Skip to content

Commit

Permalink
ntb_hw_switchtec: AND with the part_map for a valid tpart_vec
Browse files Browse the repository at this point in the history
Some firmware versions return 1 in the target partition vector for
undefined partitions. AND with the part_map to give a valid tpart_vec.

Signed-off-by: Jeremy Pallotta <jmpallotta@gmail.com>
Signed-off-by: Kelvin Cao <kelvin.cao@microchip.com>
Signed-off-by: Jon Mason <jdmason@kudzu.us>
  • Loading branch information
Jeremy Pallotta authored and Jon Mason committed Jan 11, 2022
1 parent 7ff351c commit 857e239
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/ntb/hw/mscc/ntb_hw_switchtec.c
Original file line number Diff line number Diff line change
Expand Up @@ -858,6 +858,7 @@ static int switchtec_ntb_init_sndev(struct switchtec_ntb *sndev)
tpart_vec |= ioread32(&sndev->mmio_ntb->ntp_info[self].target_part_low);

part_map = ioread64(&sndev->mmio_ntb->ep_map);
tpart_vec &= part_map;
part_map &= ~(1 << sndev->self_partition);

if (!tpart_vec) {
Expand Down

0 comments on commit 857e239

Please sign in to comment.