diff mbox series

usb: dwc3: haps: Workaround matching VID PID

Message ID 49d5ec1bcbfaef665ed166e7225ffa3b96133e1d.1549477664.git.thinhn@synopsys.com (mailing list archive)
State Mainlined
Commit 9c7ebc99b382a158fd2594adbfc204e526b16e08
Headers show
Series usb: dwc3: haps: Workaround matching VID PID | expand

Commit Message

Thinh Nguyen Feb. 6, 2019, 6:49 p.m. UTC
i.MX6QP and i.MX7D platform use a PCIe controller with the same VID and
PID as this USB controller. The system may incorrectly match this driver
to that PCIe controller. To workaround this, specifically use class type
USB with PCI device ID to prevent incorrect driver matching.

Signed-off-by: Thinh Nguyen <thinhn@synopsys.com>
---
 drivers/usb/dwc3/dwc3-haps.c | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Felipe Balbi Feb. 7, 2019, 11:16 a.m. UTC | #1
Hi,

Thinh Nguyen <thinh.nguyen@synopsys.com> writes:
> i.MX6QP and i.MX7D platform use a PCIe controller with the same VID and
> PID as this USB controller. The system may incorrectly match this driver
> to that PCIe controller. To workaround this, specifically use class type
> USB with PCI device ID to prevent incorrect driver matching.
>
> Signed-off-by: Thinh Nguyen <thinhn@synopsys.com>
> ---
>  drivers/usb/dwc3/dwc3-haps.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/drivers/usb/dwc3/dwc3-haps.c b/drivers/usb/dwc3/dwc3-haps.c
> index 02d57d98ef9b..3cecbf169452 100644
> --- a/drivers/usb/dwc3/dwc3-haps.c
> +++ b/drivers/usb/dwc3/dwc3-haps.c
> @@ -106,6 +106,15 @@ static const struct pci_device_id dwc3_haps_id_table[] = {
>  	{
>  		PCI_DEVICE(PCI_VENDOR_ID_SYNOPSYS,
>  			   PCI_DEVICE_ID_SYNOPSYS_HAPSUSB3),
> +		/*
> +		 * i.MX6QP and i.MX7D platform use a PCIe controller with the
> +		 * same VID and PID as this USB controller. The system may
> +		 * incorrectly match this driver to that PCIe controller. To
> +		 * workaround this, specifically use class type USB to prevent
> +		 * incorrect driver matching.
> +		 */
> +		.class = (PCI_CLASS_SERIAL_USB << 8),
> +		.class_mask = 0xffff00,

Just curious, how can NXP use Synopsys' vendor ID?
Thinh Nguyen Feb. 7, 2019, 8:59 p.m. UTC | #2
Hi Felipe,

Felipe Balbi wrote:
> Hi,
>
> Thinh Nguyen <thinh.nguyen@synopsys.com> writes:
>> i.MX6QP and i.MX7D platform use a PCIe controller with the same VID and
>> PID as this USB controller. The system may incorrectly match this driver
>> to that PCIe controller. To workaround this, specifically use class type
>> USB with PCI device ID to prevent incorrect driver matching.
>>
>> Signed-off-by: Thinh Nguyen <thinhn@synopsys.com>
>> ---
>>  drivers/usb/dwc3/dwc3-haps.c | 9 +++++++++
>>  1 file changed, 9 insertions(+)
>>
>> diff --git a/drivers/usb/dwc3/dwc3-haps.c b/drivers/usb/dwc3/dwc3-haps.c
>> index 02d57d98ef9b..3cecbf169452 100644
>> --- a/drivers/usb/dwc3/dwc3-haps.c
>> +++ b/drivers/usb/dwc3/dwc3-haps.c
>> @@ -106,6 +106,15 @@ static const struct pci_device_id dwc3_haps_id_table[] = {
>>  	{
>>  		PCI_DEVICE(PCI_VENDOR_ID_SYNOPSYS,
>>  			   PCI_DEVICE_ID_SYNOPSYS_HAPSUSB3),
>> +		/*
>> +		 * i.MX6QP and i.MX7D platform use a PCIe controller with the
>> +		 * same VID and PID as this USB controller. The system may
>> +		 * incorrectly match this driver to that PCIe controller. To
>> +		 * workaround this, specifically use class type USB to prevent
>> +		 * incorrect driver matching.
>> +		 */
>> +		.class = (PCI_CLASS_SERIAL_USB << 8),
>> +		.class_mask = 0xffff00,
> Just curious, how can NXP use Synopsys' vendor ID?
>

NXP cannot use Synopsys' vendor ID. This workaround is intended for the
PCIe controller on their existing SoC.

Thanks,
Thinh
diff mbox series

Patch

diff --git a/drivers/usb/dwc3/dwc3-haps.c b/drivers/usb/dwc3/dwc3-haps.c
index 02d57d98ef9b..3cecbf169452 100644
--- a/drivers/usb/dwc3/dwc3-haps.c
+++ b/drivers/usb/dwc3/dwc3-haps.c
@@ -106,6 +106,15 @@  static const struct pci_device_id dwc3_haps_id_table[] = {
 	{
 		PCI_DEVICE(PCI_VENDOR_ID_SYNOPSYS,
 			   PCI_DEVICE_ID_SYNOPSYS_HAPSUSB3),
+		/*
+		 * i.MX6QP and i.MX7D platform use a PCIe controller with the
+		 * same VID and PID as this USB controller. The system may
+		 * incorrectly match this driver to that PCIe controller. To
+		 * workaround this, specifically use class type USB to prevent
+		 * incorrect driver matching.
+		 */
+		.class = (PCI_CLASS_SERIAL_USB << 8),
+		.class_mask = 0xffff00,
 	},
 	{
 		PCI_DEVICE(PCI_VENDOR_ID_SYNOPSYS,