Skip to content

Commit 4cb436b

Browse files
committed
Reserve driver used LUT slots in initialization
As two of the three reserved LUT slots are not populated when the device is being probed, we need to make sure that these LUT slots will not be allocated by client drivers before they are initialized during link up handshake. Reserve all three reserved LUTs by increasing nr_rsvd_luts by three when the device is being probed.
1 parent ea15ea8 commit 4cb436b

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

ntb_hw_switchtec.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,6 @@ static int switchtec_ntb_setup_crosslink(struct switchtec_ntb *sndev)
720720

721721
sndev->mmio_xlink_peer_ctrl = sndev->mmio_xlink_ctrl_win +
722722
offset;
723-
sndev->nr_rsvd_luts++;
724723
}
725724

726725
if (!sndev->mmio_xlink_dbmsg_win) {
@@ -744,7 +743,6 @@ static int switchtec_ntb_setup_crosslink(struct switchtec_ntb *sndev)
744743
return -ENOMEM;
745744

746745
sndev->mmio_peer_dbmsg = sndev->mmio_xlink_dbmsg_win + offset;
747-
sndev->nr_rsvd_luts++;
748746
}
749747

750748
crosslink_init_dbmsgs(sndev);
@@ -1515,6 +1513,7 @@ static int switchtec_ntb_init_crosslink(struct switchtec_ntb *sndev)
15151513
return -EINVAL;
15161514
}
15171515

1516+
sndev->nr_rsvd_luts += 3;
15181517
rc = crosslink_setup_mws(sndev, NT_INFO_LUT, DB_MSG_LUT, REQ_ID_LUT,
15191518
&bar_addrs[1], bar_cnt - 1);
15201519
if (rc)
@@ -1540,7 +1539,6 @@ static int switchtec_ntb_init_crosslink(struct switchtec_ntb *sndev)
15401539
}
15411540

15421541
sndev->mmio_xlink_peer_ntb = sndev->mmio_xlink_ntinfo_win + offset;
1543-
sndev->nr_rsvd_luts++;
15441542

15451543
return 0;
15461544
}

0 commit comments

Comments
 (0)