Skip to contentSkip to conversation

PCI: Disable MSI for Pericom PCIe-USB adapter

PATCH Superseded Andy Shevchenko 3 participants 7 messages Nov 5, 2020 – Nov 6, 2020

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 PCI: Disable MSI for Pericom PCIe-USB adapter

Pericom PCIe-USB adapter ambiguously advertises MSI, but documentation says "The MSI Function is not implemented on this device." in the chapters 7.3.27, 7.3.29-7.3.31.

Fixes 306c54d0edb6 ("usb: hcd: Try MSI interrupts on PCI devices")

Datasheet: https://www.diodes.com/assets/Datasheets/PI7C9X440SL.pdf

---
 drivers/pci/quirks.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)
drivers/pci/quirks.c +12 -4
index f70692ac79c5..7df7ae50618c 100644
@@ -5567,17 +5567,25 @@ static void pci_fixup_no_d0_pme(struct pci_dev *dev)
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ASMEDIA, 0x2142, pci_fixup_no_d0_pme);
 
 /*
- * Device [12d8:0x400e] and [12d8:0x400f]
+ * Device 12d8:0x400e [OHCI] and 12d8:0x400f [EHCI]
+ *
  * These devices advertise PME# support in all power states but don't
  * reliably assert it.
+ *
+ * These devices ambiguously advertise MSI, but documentation (PI7C9X440SL.pdf)
+ * says "The MSI Function is not implemented on this device." in the chapters
+ * 7.3.27, 7.3.29-7.3.31.
  */
-static void pci_fixup_no_pme(struct pci_dev *dev)
+static void pci_fixup_no_msi_no_pme(struct pci_dev *dev)
 {
+	pci_info(dev, "The MSI Function is not implemented on this device, disabling it\n");
+	dev->no_msi = 1;
+
 	pci_info(dev, "PME# is unreliable, disabling it\n");
 	dev->pme_support = 0;
 }
-DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_PERICOM, 0x400e, pci_fixup_no_pme);
-DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_PERICOM, 0x400f, pci_fixup_no_pme);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_PERICOM, 0x400e, pci_fixup_no_msi_no_pme);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_PERICOM, 0x400f, pci_fixup_no_msi_no_pme);
 
 static void apex_pci_fixup_class(struct pci_dev *pdev)
 {
Signature · 1 line
2.28.0
#1 lore raw

PATCH 2/2 PCI: Use predefined Pericom vendor ID

Pericom has predefined vendor ID, use it instead of hard coded value.

---
 drivers/pci/quirks.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/pci/quirks.c +3 -3
index 7df7ae50618c..6fd5ce08d027 100644
@@ -2356,9 +2356,9 @@ static void quirk_enable_clear_retrain_link(struct pci_dev *dev)
 	dev->clear_retrain_link = 1;
 	pci_info(dev, "Enable PCIe Retrain Link quirk\n");
 }
-DECLARE_PCI_FIXUP_HEADER(0x12d8, 0xe110, quirk_enable_clear_retrain_link);
-DECLARE_PCI_FIXUP_HEADER(0x12d8, 0xe111, quirk_enable_clear_retrain_link);
-DECLARE_PCI_FIXUP_HEADER(0x12d8, 0xe130, quirk_enable_clear_retrain_link);
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_PERICOM, 0xe110, quirk_enable_clear_retrain_link);
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_PERICOM, 0xe111, quirk_enable_clear_retrain_link);
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_PERICOM, 0xe130, quirk_enable_clear_retrain_link);
 
 static void fixup_rev1_53c810(struct pci_dev *dev)
 {
Signature · 1 line
2.28.0
#2 lore raw
In reply to Andy Shevchenko
Quoted 29 lines · Andy Shevchenko

Pericom PCIe-USB adapter ambiguously advertises MSI, but documentation says "The MSI Function is not implemented on this device." in the chapters 7.3.27, 7.3.29-7.3.31.

Fixes 306c54d0edb6 ("usb: hcd: Try MSI interrupts on PCI devices")

Datasheet: https://www.diodes.com/assets/Datasheets/PI7C9X440SL.pdf

---
  drivers/pci/quirks.c | 16 ++++++++++++----
  1 file changed, 12 insertions(+), 4 deletions(-)
drivers/pci/quirks.c +6 -1
index f70692ac79c5..7df7ae50618c 100644
@@ -5567,17 +5567,25 @@ static void pci_fixup_no_d0_pme(struct pci_dev *dev)
  DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ASMEDIA, 0x2142, pci_fixup_no_d0_pme);
 
  /*
- * Device [12d8:0x400e] and [12d8:0x400f]
+ * Device 12d8:0x400e [OHCI] and 12d8:0x400f [EHCI]
+ *
   * These devices advertise PME# support in all power states but don't
   * reliably assert it.
+ *
+ * These devices ambiguously advertise MSI, but documentation (PI7C9X440SL.pdf)
+ * says "The MSI Function is not implemented on this device." in the chapters
+ * 7.3.27, 7.3.29-7.3.31.

drivers/pci/quirks.c static void pci_fixup_no_d0_pme(struct pci_dev *dev) · line 5586

Quoted 10 lines
drivers/pci/quirks.c +4 -1
   */
-static void pci_fixup_no_pme(struct pci_dev *dev)
+static void pci_fixup_no_msi_no_pme(struct pci_dev *dev)
  {
+	pci_info(dev, "The MSI Function is not implemented on this device, disabling it\n");
+	dev->no_msi = 1;
+
  	pci_info(dev, "PME# is unreliable, disabling it\n");
  	dev->pme_support = 0;
  }

idea: one pci_info() print of:

pci_info(dev, "PME# is unreliable, MSI not implemented, disabling both\n");

Quoted 8 lines
drivers/pci/quirks.c +2 -2
-DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_PERICOM, 0x400e, pci_fixup_no_pme);
-DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_PERICOM, 0x400f, pci_fixup_no_pme);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_PERICOM, 0x400e, pci_fixup_no_msi_no_pme);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_PERICOM, 0x400f, pci_fixup_no_msi_no_pme);
 
  static void apex_pci_fixup_class(struct pci_dev *pdev)
  {
Signature · 4 lines
Ben Dooks				http://www.codethink.co.uk/
Senior Engineer				Codethink - Providing Genius

https://www.codethink.co.uk/privacy.html
#3 lore raw
Quoted 4 lines · Ben Dooks
Quoted 3 lines · Andy Shevchenko

Pericom PCIe-USB adapter ambiguously advertises MSI, but documentation says "The MSI Function is not implemented on this device." in the chapters 7.3.27, 7.3.29-7.3.31.

Thanks for review.

Quoted 9 lines

drivers/pci/quirks.c static void pci_fixup_no_d0_pme(struct pci_dev *dev) · line 5585

Quoted 5 lines
drivers/pci/quirks.c +3 -0
+	pci_info(dev, "The MSI Function is not implemented on this device, disabling it\n");
+	dev->no_msi = 1;
+
  	pci_info(dev, "PME# is unreliable, disabling it\n");
  	dev->pme_support = 0;

idea: one pci_info() print of:

pci_info(dev, "PME# is unreliable, MSI not implemented, disabling both\n");

I am not in favour of it. Perhaps I can do #ifdef CONFIG_PCI_MSI for those two.

Quoted 4 lines
Quoted 4 lines
drivers/pci/quirks.c +2 -2
-DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_PERICOM, 0x400e, pci_fixup_no_pme);
-DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_PERICOM, 0x400f, pci_fixup_no_pme);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_PERICOM, 0x400e, pci_fixup_no_msi_no_pme);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_PERICOM, 0x400f, pci_fixup_no_msi_no_pme);
Signature · 2 lines
With Best Regards,
Andy Shevchenko
#4 lore raw
In reply to Andy Shevchenko
Quoted 3 lines · Andy Shevchenko

Pericom PCIe-USB adapter ambiguously advertises MSI, but documentation says "The MSI Function is not implemented on this device." in the chapters 7.3.27, 7.3.29-7.3.31.

I don't think it can be ambiguous, surely? Either it does advertise it, or it doesn't. It doesn't just give you subtle hints that it *might* support MSI, but it isn't sure...

#5 lore raw
Quoted 8 lines · David Woodhouse
Quoted 3 lines · Andy Shevchenko

Pericom PCIe-USB adapter ambiguously advertises MSI, but documentation says "The MSI Function is not implemented on this device." in the chapters 7.3.27, 7.3.29-7.3.31.

I don't think it can be ambiguous, surely? Either it does advertise it, or it doesn't. It doesn't just give you subtle hints that it *might* support MSI, but it isn't sure...

I will drop the word from commit message, thanks!

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#6 lore raw
In reply to Andy Shevchenko
Quoted 3 lines · Andy Shevchenko

Pericom PCIe-USB adapter ambiguously advertises MSI, but documentation says "The MSI Function is not implemented on this device." in the chapters 7.3.27, 7.3.29-7.3.31.

I have sent v2 [1].

[1]: https://lore.kernel.org/linux-usb/[email protected]/

Quoted 4 lines
Fixes 306c54d0edb6 ("usb: hcd: Try MSI interrupts on PCI devices")

Datasheet: https://www.diodes.com/assets/Datasheets/PI7C9X440SL.pdf

Signature · 2 lines
With Best Regards,
Andy Shevchenko