summaryrefslogtreecommitdiff
path: root/drivers/ntb
diff options
context:
space:
mode:
authorJeremy Pallotta <jmpallotta@gmail.com>2021-12-23 17:23:31 -0800
committerJon Mason <jdmason@kudzu.us>2022-01-11 15:38:59 -0500
commit857e239c3ef57e6ba0ff148de96e14249a4d669b (patch)
treec35e8575060983d53240c7d81c3e993c38d8e5e6 /drivers/ntb
parent7ff351c86b6b258f387502ab2c9b9d04f82c1c3d (diff)
downloadlwn-857e239c3ef57e6ba0ff148de96e14249a4d669b.tar.gz
lwn-857e239c3ef57e6ba0ff148de96e14249a4d669b.zip
ntb_hw_switchtec: AND with the part_map for a valid tpart_vec
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>
Diffstat (limited to 'drivers/ntb')
-rw-r--r--drivers/ntb/hw/mscc/ntb_hw_switchtec.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/ntb/hw/mscc/ntb_hw_switchtec.c b/drivers/ntb/hw/mscc/ntb_hw_switchtec.c
index 36efba21db4b..8e9b97631884 100644
--- a/drivers/ntb/hw/mscc/ntb_hw_switchtec.c
+++ b/drivers/ntb/hw/mscc/ntb_hw_switchtec.c
@@ -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) {