Skip to contentSkip to conversation

ntb: intel: Fix using link status DB's

PATCH In review Nikita Shubin 2 participants 2 messages Jun 6, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ntb: intel: Fix using link status DB's

Make sure we are not using DB's which were remapped for link status.

Fixes f6e51c354b60 ("ntb: intel: split out the gen3 code")

---
Hello Dave, sending a patch as planned.

Thank you for looking into this!

---
 drivers/ntb/hw/intel/ntb_hw_gen3.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/ntb/hw/intel/ntb_hw_gen3.c +3 -0
index ffcfc3e02c35..a5aa96a31f4a 100644
@@ -215,6 +215,9 @@ static int gen3_init_ntb(struct intel_ntb_dev *ndev)
 	}
 
 	ndev->db_valid_mask = BIT_ULL(ndev->db_count) - 1;
+	/* Make sure we are not using DB's used for link status */
+	if (ndev->hwerr_flags & NTB_HWERR_MSIX_VECTOR32_BAD)
+		ndev->db_valid_mask &= ~ndev->db_link_mask;
 
 	ndev->reg->db_iowrite(ndev->db_valid_mask,
 			      ndev->self_mmio +

---
base-commit: 2df0193e62cf887f373995fb8a91068562784adc
change-id: 20240606-ntb_intel_db_fix-036299fabc48

Best regards,

Signature · 1 line
Nikita Shubin <[email protected]>
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · On 6/6/24 1:15 AM, Nikita Shubin via B4 Relay wrote:

From: Nikita Shubin <[email protected]>

Make sure we are not using DB's which were remapped for link status.

Fixes f6e51c354b60 ("ntb: intel: split out the gen3 code")

Thank you for the patch.

Quoted 30 lines

---
Hello Dave, sending a patch as planned.

Thank you for looking into this!

---
 drivers/ntb/hw/intel/ntb_hw_gen3.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/ntb/hw/intel/ntb_hw_gen3.c +3 -1
index ffcfc3e02c35..a5aa96a31f4a 100644
@@ -215,6 +215,9 @@ static int gen3_init_ntb(struct intel_ntb_dev *ndev)
 	}
 
 	ndev->db_valid_mask = BIT_ULL(ndev->db_count) - 1;
+	/* Make sure we are not using DB's used for link status */
+	if (ndev->hwerr_flags & NTB_HWERR_MSIX_VECTOR32_BAD)
+		ndev->db_valid_mask &= ~ndev->db_link_mask;
 
 	ndev->reg->db_iowrite(ndev->db_valid_mask,
 			      ndev->self_mmio +
 
---

base-commit: 2df0193e62cf887f373995fb8a91068562784adc
change-id: 20240606-ntb_intel_db_fix-036299fabc48

Best regards,