linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] serial: 8250_pci: Move Pericom IDs to pci_ids.h
@ 2020-05-08  6:53 Kai-Heng Feng
  2020-05-08  6:53 ` [PATCH 2/2] PCI: Prevent Pericom USB controller OHCI/EHCI PME# defect Kai-Heng Feng
  2020-05-08  7:38 ` [PATCH 1/2] serial: 8250_pci: Move Pericom IDs to pci_ids.h Greg Kroah-Hartman
  0 siblings, 2 replies; 4+ messages in thread
From: Kai-Heng Feng @ 2020-05-08  6:53 UTC (permalink / raw)
  To: bhelgaas
  Cc: Kai-Heng Feng, Greg Kroah-Hartman, Jiri Slaby, Je Yen Tam,
	Arnd Bergmann, Jay Dolan, Denis Efremov, Ji-Ze Hong (Peter Hong),
	Chuhong Yuan, open list:SERIAL DRIVERS, open list,
	open list:PCI SUBSYSTEM

Move the IDs to pci_ids.h so it can be used by next patch.

Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
---
 drivers/tty/serial/8250/8250_pci.c | 6 ------
 include/linux/pci_ids.h            | 6 ++++++
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/tty/serial/8250/8250_pci.c b/drivers/tty/serial/8250/8250_pci.c
index 0804469ff052..1a74d511b02a 100644
--- a/drivers/tty/serial/8250/8250_pci.c
+++ b/drivers/tty/serial/8250/8250_pci.c
@@ -1869,12 +1869,6 @@ pci_moxa_setup(struct serial_private *priv,
 #define PCIE_DEVICE_ID_WCH_CH384_4S	0x3470
 #define PCIE_DEVICE_ID_WCH_CH382_2S	0x3253
 
-#define PCI_VENDOR_ID_PERICOM			0x12D8
-#define PCI_DEVICE_ID_PERICOM_PI7C9X7951	0x7951
-#define PCI_DEVICE_ID_PERICOM_PI7C9X7952	0x7952
-#define PCI_DEVICE_ID_PERICOM_PI7C9X7954	0x7954
-#define PCI_DEVICE_ID_PERICOM_PI7C9X7958	0x7958
-
 #define PCI_VENDOR_ID_ACCESIO			0x494f
 #define PCI_DEVICE_ID_ACCESIO_PCIE_COM_2SDB	0x1051
 #define PCI_DEVICE_ID_ACCESIO_MPCIE_COM_2S	0x1053
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 1dfc4e1dcb94..9a57e6717e5c 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -1832,6 +1832,12 @@
 #define PCI_VENDOR_ID_NVIDIA_SGS	0x12d2
 #define PCI_DEVICE_ID_NVIDIA_SGS_RIVA128 0x0018
 
+#define PCI_VENDOR_ID_PERICOM			0x12D8
+#define PCI_DEVICE_ID_PERICOM_PI7C9X7951	0x7951
+#define PCI_DEVICE_ID_PERICOM_PI7C9X7952	0x7952
+#define PCI_DEVICE_ID_PERICOM_PI7C9X7954	0x7954
+#define PCI_DEVICE_ID_PERICOM_PI7C9X7958	0x7958
+
 #define PCI_SUBVENDOR_ID_CHASE_PCIFAST		0x12E0
 #define PCI_SUBDEVICE_ID_CHASE_PCIFAST4		0x0031
 #define PCI_SUBDEVICE_ID_CHASE_PCIFAST8		0x0021
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] PCI: Prevent Pericom USB controller OHCI/EHCI PME# defect
  2020-05-08  6:53 [PATCH 1/2] serial: 8250_pci: Move Pericom IDs to pci_ids.h Kai-Heng Feng
@ 2020-05-08  6:53 ` Kai-Heng Feng
  2020-05-08 21:55   ` Bjorn Helgaas
  2020-05-08  7:38 ` [PATCH 1/2] serial: 8250_pci: Move Pericom IDs to pci_ids.h Greg Kroah-Hartman
  1 sibling, 1 reply; 4+ messages in thread
From: Kai-Heng Feng @ 2020-05-08  6:53 UTC (permalink / raw)
  To: bhelgaas; +Cc: Kai-Heng Feng, open list:PCI SUBSYSTEM, open list

Both Pericom OHCI and EHCI devices support PME# from all power states:
06:00.0 USB controller [0c03]: Pericom Semiconductor PI7C9X442SL USB OHCI Controller [12d8:400e] (rev 01) (prog-if 10 [OHCI])
	Subsystem: Pericom Semiconductor PI7C9X442SL USB OHCI Controller [12d8:400e]
	Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx-
	Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
	Interrupt: pin A routed to IRQ 17
	Region 0: Memory at a5502000 (32-bit, non-prefetchable) [size=4K]
	Capabilities: [80] Power Management version 3
		Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=375mA PME(D0+,D1+,D2+,D3hot+,D3cold+)
		Status: D3 NoSoftRst+ PME-Enable+ DSel=0 DScale=0 PME-

06:00.2 USB controller [0c03]: Pericom Semiconductor PI7C9X442SL USB EHCI Controller [12d8:400f] (rev 01) (prog-if 20 [EHCI])
	Subsystem: Pericom Semiconductor PI7C9X442SL USB EHCI Controller [12d8:400f]
	Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx-
	Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
	Interrupt: pin C routed to IRQ 19
	Region 0: Memory at a5500000 (32-bit, non-prefetchable) [size=256]
	Capabilities: [80] Power Management version 3
		Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=375mA PME(D0+,D1+,D2+,D3hot+,D3cold+)
		Status: D3 NoSoftRst+ PME-Enable+ DSel=0 DScale=0 PME-

Though my original approach [1] appears to work, further testing shows
that there is a 20% chance PME# won't be asserted when USB device is
plugged.

So remove the PME support for both devices to make USB plugging works.

[1] https://lore.kernel.org/lkml/20191227092405.29588-1-kai.heng.feng@canonical.com/
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=205981

Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
---
 drivers/pci/quirks.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index ca9ed5774eb1..db2590243f0d 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -5568,6 +5568,18 @@ 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]
+ * PME# doesn't always get asserted on all power states claim to support PME#
+ */
+static void pci_fixup_no_pme(struct pci_dev *dev)
+{
+	pci_info(dev, "PME# isn't reliable, 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);
+
 static void apex_pci_fixup_class(struct pci_dev *pdev)
 {
 	pdev->class = (PCI_CLASS_SYSTEM_OTHER << 8) | pdev->class;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] serial: 8250_pci: Move Pericom IDs to pci_ids.h
  2020-05-08  6:53 [PATCH 1/2] serial: 8250_pci: Move Pericom IDs to pci_ids.h Kai-Heng Feng
  2020-05-08  6:53 ` [PATCH 2/2] PCI: Prevent Pericom USB controller OHCI/EHCI PME# defect Kai-Heng Feng
@ 2020-05-08  7:38 ` Greg Kroah-Hartman
  1 sibling, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2020-05-08  7:38 UTC (permalink / raw)
  To: Kai-Heng Feng
  Cc: bhelgaas, Jiri Slaby, Je Yen Tam, Arnd Bergmann, Jay Dolan,
	Denis Efremov, Ji-Ze Hong (Peter Hong),
	Chuhong Yuan, open list:SERIAL DRIVERS, open list,
	open list:PCI SUBSYSTEM

On Fri, May 08, 2020 at 02:53:40PM +0800, Kai-Heng Feng wrote:
> Move the IDs to pci_ids.h so it can be used by next patch.
> 
> Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
> ---
>  drivers/tty/serial/8250/8250_pci.c | 6 ------
>  include/linux/pci_ids.h            | 6 ++++++
>  2 files changed, 6 insertions(+), 6 deletions(-)

Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/2] PCI: Prevent Pericom USB controller OHCI/EHCI PME# defect
  2020-05-08  6:53 ` [PATCH 2/2] PCI: Prevent Pericom USB controller OHCI/EHCI PME# defect Kai-Heng Feng
@ 2020-05-08 21:55   ` Bjorn Helgaas
  0 siblings, 0 replies; 4+ messages in thread
From: Bjorn Helgaas @ 2020-05-08 21:55 UTC (permalink / raw)
  To: Kai-Heng Feng; +Cc: bhelgaas, open list:PCI SUBSYSTEM, open list

On Fri, May 08, 2020 at 02:53:41PM +0800, Kai-Heng Feng wrote:
> Both Pericom OHCI and EHCI devices support PME# from all power states:
> 06:00.0 USB controller [0c03]: Pericom Semiconductor PI7C9X442SL USB OHCI Controller [12d8:400e] (rev 01) (prog-if 10 [OHCI])
> 	Subsystem: Pericom Semiconductor PI7C9X442SL USB OHCI Controller [12d8:400e]
> 	Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx-
> 	Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
> 	Interrupt: pin A routed to IRQ 17
> 	Region 0: Memory at a5502000 (32-bit, non-prefetchable) [size=4K]
> 	Capabilities: [80] Power Management version 3
> 		Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=375mA PME(D0+,D1+,D2+,D3hot+,D3cold+)
> 		Status: D3 NoSoftRst+ PME-Enable+ DSel=0 DScale=0 PME-
> 
> 06:00.2 USB controller [0c03]: Pericom Semiconductor PI7C9X442SL USB EHCI Controller [12d8:400f] (rev 01) (prog-if 20 [EHCI])
> 	Subsystem: Pericom Semiconductor PI7C9X442SL USB EHCI Controller [12d8:400f]
> 	Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx-
> 	Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
> 	Interrupt: pin C routed to IRQ 19
> 	Region 0: Memory at a5500000 (32-bit, non-prefetchable) [size=256]
> 	Capabilities: [80] Power Management version 3
> 		Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=375mA PME(D0+,D1+,D2+,D3hot+,D3cold+)
> 		Status: D3 NoSoftRst+ PME-Enable+ DSel=0 DScale=0 PME-
> 
> Though my original approach [1] appears to work, further testing shows
> that there is a 20% chance PME# won't be asserted when USB device is
> plugged.
> 
> So remove the PME support for both devices to make USB plugging works.
> 
> [1] https://lore.kernel.org/lkml/20191227092405.29588-1-kai.heng.feng@canonical.com/
> Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=205981
> 
> Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>

Applied both with Greg's ack to pci/pm for v5.8, thanks!

I added stable tags to both; let me know if you don't want that.

> ---
>  drivers/pci/quirks.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
> index ca9ed5774eb1..db2590243f0d 100644
> --- a/drivers/pci/quirks.c
> +++ b/drivers/pci/quirks.c
> @@ -5568,6 +5568,18 @@ 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]
> + * PME# doesn't always get asserted on all power states claim to support PME#
> + */
> +static void pci_fixup_no_pme(struct pci_dev *dev)
> +{
> +	pci_info(dev, "PME# isn't reliable, 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);
> +
>  static void apex_pci_fixup_class(struct pci_dev *pdev)
>  {
>  	pdev->class = (PCI_CLASS_SYSTEM_OTHER << 8) | pdev->class;
> -- 
> 2.17.1
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-05-08 21:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-08  6:53 [PATCH 1/2] serial: 8250_pci: Move Pericom IDs to pci_ids.h Kai-Heng Feng
2020-05-08  6:53 ` [PATCH 2/2] PCI: Prevent Pericom USB controller OHCI/EHCI PME# defect Kai-Heng Feng
2020-05-08 21:55   ` Bjorn Helgaas
2020-05-08  7:38 ` [PATCH 1/2] serial: 8250_pci: Move Pericom IDs to pci_ids.h Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).