Skip to contentSkip to conversation

Small fixes for ASMedia host controllers

PATCH Superseded Forest Crossman 4 participants 12 messages Jul 27, 2020 – Jul 29, 2020

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

cover Small fixes for ASMedia host controllers

The first patch just defines some host controller device IDs to make the code a bit easier to read (since the controller part number is not always the same as the DID) and to prepare for the next patch.

The second patch defines a new device ID for the ASM1142 and enables the XHCI_NO_64BIT_SUPPORT quirk for that device, since it has the same problem with truncating the higher bits as the ASM2142/ASM3142.

Forest Crossman (2):
usb: xhci: define IDs for various ASMedia host controllers
usb: xhci: Fix ASMedia ASM1142 DMA addressing

 drivers/usb/host/xhci-pci.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/2 usb: xhci: define IDs for various ASMedia host controllers

---
 drivers/usb/host/xhci-pci.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/usb/host/xhci-pci.c +5 -3
index 9234c82e70e4..baa5af88ca67 100644
@@ -57,7 +57,9 @@
 #define PCI_DEVICE_ID_AMD_PROMONTORYA_3			0x43ba
 #define PCI_DEVICE_ID_AMD_PROMONTORYA_2			0x43bb
 #define PCI_DEVICE_ID_AMD_PROMONTORYA_1			0x43bc
+#define PCI_DEVICE_ID_ASMEDIA_1042_XHCI			0x1042
 #define PCI_DEVICE_ID_ASMEDIA_1042A_XHCI		0x1142
+#define PCI_DEVICE_ID_ASMEDIA_2142_XHCI			0x2142
 
 static const char hcd_name[] = "xhci_hcd";
 
@@ -260,13 +262,13 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
 		xhci->quirks |= XHCI_LPM_SUPPORT;
 
 	if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA &&
-			pdev->device == 0x1042)
+		pdev->device == PCI_DEVICE_ID_ASMEDIA_1042_XHCI)
 		xhci->quirks |= XHCI_BROKEN_STREAMS;
 	if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA &&
-			pdev->device == 0x1142)
+		pdev->device == PCI_DEVICE_ID_ASMEDIA_1042A_XHCI)
 		xhci->quirks |= XHCI_TRUST_TX_LENGTH;
 	if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA &&
-			pdev->device == 0x2142)
+		pdev->device == PCI_DEVICE_ID_ASMEDIA_2142_XHCI)
 		xhci->quirks |= XHCI_NO_64BIT_SUPPORT;
 
 	if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA &&
Signature · 1 line
2.20.1
maintainer
#2 lore raw

Re: [PATCH 1/2] usb: xhci: define IDs for various ASMedia host controllers

Quoted 1 line · Forest Crossman

I can not take patches without any changelog text, sorry.

greg k-h

#3 lore raw

Re: [PATCH 1/2] usb: xhci: define IDs for various ASMedia host controllers

Quoted 5 lines · Greg KH
Quoted 1 line · Forest Crossman

I can not take patches without any changelog text, sorry.

Ah, whoops, I'm very sorry about that! Should I send a v2 of just this patch? Or would it be better to send the whole series again?

Thanks,

Forest

maintainer
#4 lore raw

Re: [PATCH 1/2] usb: xhci: define IDs for various ASMedia host controllers

Quoted 9 lines · Forest Crossman
Quoted 5 lines · Greg KH
Quoted 1 line · Forest Crossman

I can not take patches without any changelog text, sorry.

Ah, whoops, I'm very sorry about that! Should I send a v2 of just this patch? Or would it be better to send the whole series again?

Whole series is always easier to handle.

thanks,

greg k-h

#5 lore raw

PATCH 2/2 usb: xhci: Fix ASMedia ASM1142 DMA addressing

In reply to Forest Crossman

I've confirmed that the ASMedia ASM1142 has the same problem as the ASM2142/ASM3142, in that it too reports that it supports 64-bit DMA addresses when in fact it does not. As with the ASM2142/ASM3142, this can cause problems on systems where the upper bits matter, and adding the XHCI_NO_64BIT_SUPPORT quirk completely fixes the issue.

---
 drivers/usb/host/xhci-pci.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/usb/host/xhci-pci.c +3 -1
index baa5af88ca67..3feaafebfe58 100644
@@ -59,6 +59,7 @@
 #define PCI_DEVICE_ID_AMD_PROMONTORYA_1			0x43bc
 #define PCI_DEVICE_ID_ASMEDIA_1042_XHCI			0x1042
 #define PCI_DEVICE_ID_ASMEDIA_1042A_XHCI		0x1142
+#define PCI_DEVICE_ID_ASMEDIA_1142_XHCI			0x1242
 #define PCI_DEVICE_ID_ASMEDIA_2142_XHCI			0x2142
 
 static const char hcd_name[] = "xhci_hcd";
@@ -268,7 +269,8 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
 		pdev->device == PCI_DEVICE_ID_ASMEDIA_1042A_XHCI)
 		xhci->quirks |= XHCI_TRUST_TX_LENGTH;
 	if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA &&
-		pdev->device == PCI_DEVICE_ID_ASMEDIA_2142_XHCI)
+	    (pdev->device == PCI_DEVICE_ID_ASMEDIA_1142_XHCI ||
+	     pdev->device == PCI_DEVICE_ID_ASMEDIA_2142_XHCI))
 		xhci->quirks |= XHCI_NO_64BIT_SUPPORT;
 
 	if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA &&
Signature · 1 line
2.20.1
#6 lore raw

v2 cover Small fixes for ASMedia host controllers

In reply to Forest Crossman

The first patch just defines some host controller device IDs to make the code a bit easier to read (since the controller part number is not always the same as the DID) and to prepare for the next patch.

The second patch defines a new device ID for the ASM1142 and enables the XHCI_NO_64BIT_SUPPORT quirk for that device, since it has the same problem with truncating the higher bits as the ASM2142/ASM3142.

Changes since v1:
- Added changelog text to the first patch.

Forest Crossman (2):
usb: xhci: define IDs for various ASMedia host controllers
usb: xhci: Fix ASMedia ASM1142 DMA addressing

 drivers/usb/host/xhci-pci.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
Signature · 1 line
2.20.1
#7 lore raw

PATCH v2 1/2 usb: xhci: define IDs for various ASMedia host controllers

Not all ASMedia host controllers have a device ID that matches its part number. #define some of these IDs to make it clearer at a glance which chips require what quirks.

---
 drivers/usb/host/xhci-pci.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/usb/host/xhci-pci.c +5 -3
index 9234c82e70e4..baa5af88ca67 100644
@@ -57,7 +57,9 @@
 #define PCI_DEVICE_ID_AMD_PROMONTORYA_3			0x43ba
 #define PCI_DEVICE_ID_AMD_PROMONTORYA_2			0x43bb
 #define PCI_DEVICE_ID_AMD_PROMONTORYA_1			0x43bc
+#define PCI_DEVICE_ID_ASMEDIA_1042_XHCI			0x1042
 #define PCI_DEVICE_ID_ASMEDIA_1042A_XHCI		0x1142
+#define PCI_DEVICE_ID_ASMEDIA_2142_XHCI			0x2142
 
 static const char hcd_name[] = "xhci_hcd";
 
@@ -260,13 +262,13 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
 		xhci->quirks |= XHCI_LPM_SUPPORT;
 
 	if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA &&
-			pdev->device == 0x1042)
+		pdev->device == PCI_DEVICE_ID_ASMEDIA_1042_XHCI)
 		xhci->quirks |= XHCI_BROKEN_STREAMS;
 	if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA &&
-			pdev->device == 0x1142)
+		pdev->device == PCI_DEVICE_ID_ASMEDIA_1042A_XHCI)
 		xhci->quirks |= XHCI_TRUST_TX_LENGTH;
 	if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA &&
-			pdev->device == 0x2142)
+		pdev->device == PCI_DEVICE_ID_ASMEDIA_2142_XHCI)
 		xhci->quirks |= XHCI_NO_64BIT_SUPPORT;
 
 	if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA &&
Signature · 1 line
2.20.1
#8 lore raw

Re: [PATCH v2 1/2] usb: xhci: define IDs for various ASMedia host controllers

Hello!

Quoted 13 lines · Forest Crossman

Not all ASMedia host controllers have a device ID that matches its part number. #define some of these IDs to make it clearer at a glance which chips require what quirks.

---
 drivers/usb/host/xhci-pci.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/usb/host/xhci-pci.c +0 -0
index 9234c82e70e4..baa5af88ca67 100644

[...]

drivers/usb/host/xhci-pci.c static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci) · line 265

Quoted 6 lines
drivers/usb/host/xhci-pci.c +1 -1
@@ -260,13 +262,13 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
 		xhci->quirks |= XHCI_LPM_SUPPORT;
 
 	if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA &&
-			pdev->device == 0x1042)
+		pdev->device == PCI_DEVICE_ID_ASMEDIA_1042_XHCI)

You shouldn't have un-indented it, blends with the branch below. The 80-column line length limit is history now. :-)

drivers/usb/host/xhci-pci.c static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci) · line 274

Quoted 11 lines
drivers/usb/host/xhci-pci.c +2 -2
 		xhci->quirks |= XHCI_BROKEN_STREAMS;
 	if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA &&
-			pdev->device == 0x1142)
+		pdev->device == PCI_DEVICE_ID_ASMEDIA_1042A_XHCI)
 		xhci->quirks |= XHCI_TRUST_TX_LENGTH;
 	if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA &&
-			pdev->device == 0x2142)
+		pdev->device == PCI_DEVICE_ID_ASMEDIA_2142_XHCI)
 		xhci->quirks |= XHCI_NO_64BIT_SUPPORT;
 
 	if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA &&

MBR, Sergei

#9 lore raw

PATCH v2 2/2 usb: xhci: Fix ASMedia ASM1142 DMA addressing

In reply to Forest Crossman

I've confirmed that the ASMedia ASM1142 has the same problem as the ASM2142/ASM3142, in that it too reports that it supports 64-bit DMA addresses when in fact it does not. As with the ASM2142/ASM3142, this can cause problems on systems where the upper bits matter, and adding the XHCI_NO_64BIT_SUPPORT quirk completely fixes the issue.

---
 drivers/usb/host/xhci-pci.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/usb/host/xhci-pci.c +3 -1
index baa5af88ca67..3feaafebfe58 100644
@@ -59,6 +59,7 @@
 #define PCI_DEVICE_ID_AMD_PROMONTORYA_1			0x43bc
 #define PCI_DEVICE_ID_ASMEDIA_1042_XHCI			0x1042
 #define PCI_DEVICE_ID_ASMEDIA_1042A_XHCI		0x1142
+#define PCI_DEVICE_ID_ASMEDIA_1142_XHCI			0x1242
 #define PCI_DEVICE_ID_ASMEDIA_2142_XHCI			0x2142
 
 static const char hcd_name[] = "xhci_hcd";
@@ -268,7 +269,8 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
 		pdev->device == PCI_DEVICE_ID_ASMEDIA_1042A_XHCI)
 		xhci->quirks |= XHCI_TRUST_TX_LENGTH;
 	if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA &&
-		pdev->device == PCI_DEVICE_ID_ASMEDIA_2142_XHCI)
+	    (pdev->device == PCI_DEVICE_ID_ASMEDIA_1142_XHCI ||
+	     pdev->device == PCI_DEVICE_ID_ASMEDIA_2142_XHCI))
 		xhci->quirks |= XHCI_NO_64BIT_SUPPORT;
 
 	if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA &&
Signature · 1 line
2.20.1
maintainer
#10 lore raw
In reply to Forest Crossman
Quoted 13 lines · Forest Crossman

The first patch just defines some host controller device IDs to make the code a bit easier to read (since the controller part number is not always the same as the DID) and to prepare for the next patch.

The second patch defines a new device ID for the ASM1142 and enables the XHCI_NO_64BIT_SUPPORT quirk for that device, since it has the same problem with truncating the higher bits as the ASM2142/ASM3142.

Changes since v1:
- Added changelog text to the first patch.

Quoted 6 lines

Forest Crossman (2):
usb: xhci: define IDs for various ASMedia host controllers
usb: xhci: Fix ASMedia ASM1142 DMA addressing

 drivers/usb/host/xhci-pci.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

Mathias, any objection for me just taking these now?

thanks,

greg k-h

Acked-by
#11 lore raw
Quoted 14 lines · Greg KH
Quoted 13 lines · Forest Crossman

The first patch just defines some host controller device IDs to make the code a bit easier to read (since the controller part number is not always the same as the DID) and to prepare for the next patch.

The second patch defines a new device ID for the ASM1142 and enables the XHCI_NO_64BIT_SUPPORT quirk for that device, since it has the same problem with truncating the higher bits as the ASM2142/ASM3142.

Changes since v1:
- Added changelog text to the first patch.

Quoted 9 lines
Quoted 6 lines

Forest Crossman (2):
usb: xhci: define IDs for various ASMedia host controllers
usb: xhci: Fix ASMedia ASM1142 DMA addressing

 drivers/usb/host/xhci-pci.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

Mathias, any objection for me just taking these now?

No objection

Note that I'll be away most of this and the the next week so response will be slow.

Thanks
-Mathias