diff mbox series

[v1,1/2] PCI: Disable MSI for Pericom PCIe-USB adapter

Message ID 20201105180644.42862-1-andriy.shevchenko@linux.intel.com
State Superseded
Headers show
Series [v1,1/2] PCI: Disable MSI for Pericom PCIe-USB adapter | expand

Commit Message

Andy Shevchenko Nov. 5, 2020, 6:06 p.m. UTC
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
Reported-by: alberto.vignani@fastwebnet.it
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/pci/quirks.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

Comments

Ben Dooks Nov. 5, 2020, 8:42 p.m. UTC | #1
On 05/11/2020 18:06, Andy Shevchenko wrote:
> 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

> Reported-by: alberto.vignani@fastwebnet.it

> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

> ---

>   drivers/pci/quirks.c | 16 ++++++++++++----

>   1 file changed, 12 insertions(+), 4 deletions(-)

> 

> diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c

> index f70692ac79c5..7df7ae50618c 100644

> --- a/drivers/pci/quirks.c

> +++ b/drivers/pci/quirks.c

> @@ -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;

>   }



idea: one pci_info() print of:

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

> -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)

>   {

> 



-- 
Ben Dooks				http://www.codethink.co.uk/
Senior Engineer				Codethink - Providing Genius

https://www.codethink.co.uk/privacy.html
David Woodhouse Nov. 5, 2020, 8:46 p.m. UTC | #2
On Thu, 2020-11-05 at 20:06 +0200, Andy Shevchenko wrote:
> 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...
Andy Shevchenko Nov. 6, 2020, 9:56 a.m. UTC | #3
On Thu, Nov 05, 2020 at 08:46:03PM +0000, David Woodhouse wrote:
> On Thu, 2020-11-05 at 20:06 +0200, Andy Shevchenko wrote:

> > 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!


-- 
With Best Regards,
Andy Shevchenko
Andy Shevchenko Nov. 6, 2020, 9:57 a.m. UTC | #4
On Thu, Nov 05, 2020 at 08:42:03PM +0000, Ben Dooks wrote:
> On 05/11/2020 18:06, Andy Shevchenko wrote:

> > 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.

> > +	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.

> > -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);


-- 
With Best Regards,
Andy Shevchenko
Andy Shevchenko Nov. 6, 2020, 10:11 a.m. UTC | #5
On Thu, Nov 05, 2020 at 08:06:43PM +0200, Andy Shevchenko wrote:
> 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/20201106100526.17726-1-andriy.shevchenko@linux.intel.com/

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

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

> Reported-by: alberto.vignani@fastwebnet.it

> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>


-- 
With Best Regards,
Andy Shevchenko
diff mbox series

Patch

diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index f70692ac79c5..7df7ae50618c 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -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)
 {