diff mbox series

usb: ehci: add pci device support for Aspeed platforms

Message ID 20220208062927.3527137-1-neal_liu@aspeedtech.com (mailing list archive)
State Superseded
Headers show
Series usb: ehci: add pci device support for Aspeed platforms | expand

Commit Message

Neal Liu Feb. 8, 2022, 6:29 a.m. UTC
Enable Aspeed quirks in commit 7f2d73788d90 ("usb: ehci:
handshake CMD_RUN instead of STS_HALT") to support Aspeed
ehci-pci device.

Signed-off-by: Neal Liu <neal_liu@aspeedtech.com>
---
 drivers/usb/host/ehci-pci.c | 6 ++++++
 include/linux/pci_ids.h     | 3 +++
 2 files changed, 9 insertions(+)

Comments

Greg KH Feb. 8, 2022, 7:37 a.m. UTC | #1
On Tue, Feb 08, 2022 at 02:29:27PM +0800, Neal Liu wrote:
> Enable Aspeed quirks in commit 7f2d73788d90 ("usb: ehci:
> handshake CMD_RUN instead of STS_HALT") to support Aspeed
> ehci-pci device.
> 
> Signed-off-by: Neal Liu <neal_liu@aspeedtech.com>
> ---
>  drivers/usb/host/ehci-pci.c | 6 ++++++
>  include/linux/pci_ids.h     | 3 +++
>  2 files changed, 9 insertions(+)
> 
> diff --git a/drivers/usb/host/ehci-pci.c b/drivers/usb/host/ehci-pci.c
> index e87cf3a00fa4..a91b25d216ae 100644
> --- a/drivers/usb/host/ehci-pci.c
> +++ b/drivers/usb/host/ehci-pci.c
> @@ -222,6 +222,12 @@ static int ehci_pci_setup(struct usb_hcd *hcd)
>  			ehci->has_synopsys_hc_bug = 1;
>  		}
>  		break;
> +	case PCI_VENDOR_ID_ASPEED:
> +		if (pdev->device == PCI_DEVICE_ID_ASPEED_EHCI) {
> +			ehci_info(ehci, "applying Aspeed HC workaround\n");
> +			ehci->is_aspeed = 1;
> +		}
> +		break;
>  	}
>  
>  	/* optional debug port, normally in the first BAR */
> diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
> index aad54c666407..410b395fe56c 100644
> --- a/include/linux/pci_ids.h
> +++ b/include/linux/pci_ids.h
> @@ -3096,4 +3096,7 @@
>  
>  #define PCI_VENDOR_ID_NCUBE		0x10ff
>  
> +#define PCI_VENDOR_ID_ASPEED		0x1a03
> +#define PCI_DEVICE_ID_ASPEED_EHCI	0x2603

Please read the top of this file, this does not need to be added here.

thanks,

greg k-h
Neal Liu Feb. 8, 2022, 8:20 a.m. UTC | #2
> -----Original Message-----
> From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Sent: Tuesday, February 8, 2022 3:38 PM
> To: Neal Liu <neal_liu@aspeedtech.com>
> Cc: Alan Stern <stern@rowland.harvard.edu>; Bjorn Helgaas
> <bhelgaas@google.com>; linux-usb@vger.kernel.org;
> linux-kernel@vger.kernel.org; linux-pci@vger.kernel.org; Tao Ren
> <rentao.bupt@gmail.com>; BMC-SW <BMC-SW@aspeedtech.com>
> Subject: Re: [PATCH] usb: ehci: add pci device support for Aspeed platforms
> 
> On Tue, Feb 08, 2022 at 02:29:27PM +0800, Neal Liu wrote:
> > Enable Aspeed quirks in commit 7f2d73788d90 ("usb: ehci:
> > handshake CMD_RUN instead of STS_HALT") to support Aspeed ehci-pci
> > device.
> >
> > Signed-off-by: Neal Liu <neal_liu@aspeedtech.com>
> > ---
> >  drivers/usb/host/ehci-pci.c | 6 ++++++
> >  include/linux/pci_ids.h     | 3 +++
> >  2 files changed, 9 insertions(+)
> >
> > diff --git a/drivers/usb/host/ehci-pci.c b/drivers/usb/host/ehci-pci.c
> > index e87cf3a00fa4..a91b25d216ae 100644
> > --- a/drivers/usb/host/ehci-pci.c
> > +++ b/drivers/usb/host/ehci-pci.c
> > @@ -222,6 +222,12 @@ static int ehci_pci_setup(struct usb_hcd *hcd)
> >  			ehci->has_synopsys_hc_bug = 1;
> >  		}
> >  		break;
> > +	case PCI_VENDOR_ID_ASPEED:
> > +		if (pdev->device == PCI_DEVICE_ID_ASPEED_EHCI) {
> > +			ehci_info(ehci, "applying Aspeed HC workaround\n");
> > +			ehci->is_aspeed = 1;
> > +		}
> > +		break;
> >  	}
> >
> >  	/* optional debug port, normally in the first BAR */ diff --git
> > a/include/linux/pci_ids.h b/include/linux/pci_ids.h index
> > aad54c666407..410b395fe56c 100644
> > --- a/include/linux/pci_ids.h
> > +++ b/include/linux/pci_ids.h
> > @@ -3096,4 +3096,7 @@
> >
> >  #define PCI_VENDOR_ID_NCUBE		0x10ff
> >
> > +#define PCI_VENDOR_ID_ASPEED		0x1a03
> > +#define PCI_DEVICE_ID_ASPEED_EHCI	0x2603
> 
> Please read the top of this file, this does not need to be added here.
> 
> thanks,
> 
> greg k-h

Are you suggesting to hard code vendor/device ID in driver instead?
Thanks

-Neal
Greg KH Feb. 8, 2022, 8:41 a.m. UTC | #3
On Tue, Feb 08, 2022 at 08:20:07AM +0000, Neal Liu wrote:
> > -----Original Message-----
> > From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > Sent: Tuesday, February 8, 2022 3:38 PM
> > To: Neal Liu <neal_liu@aspeedtech.com>
> > Cc: Alan Stern <stern@rowland.harvard.edu>; Bjorn Helgaas
> > <bhelgaas@google.com>; linux-usb@vger.kernel.org;
> > linux-kernel@vger.kernel.org; linux-pci@vger.kernel.org; Tao Ren
> > <rentao.bupt@gmail.com>; BMC-SW <BMC-SW@aspeedtech.com>
> > Subject: Re: [PATCH] usb: ehci: add pci device support for Aspeed platforms
> > 
> > On Tue, Feb 08, 2022 at 02:29:27PM +0800, Neal Liu wrote:
> > > Enable Aspeed quirks in commit 7f2d73788d90 ("usb: ehci:
> > > handshake CMD_RUN instead of STS_HALT") to support Aspeed ehci-pci
> > > device.
> > >
> > > Signed-off-by: Neal Liu <neal_liu@aspeedtech.com>
> > > ---
> > >  drivers/usb/host/ehci-pci.c | 6 ++++++
> > >  include/linux/pci_ids.h     | 3 +++
> > >  2 files changed, 9 insertions(+)
> > >
> > > diff --git a/drivers/usb/host/ehci-pci.c b/drivers/usb/host/ehci-pci.c
> > > index e87cf3a00fa4..a91b25d216ae 100644
> > > --- a/drivers/usb/host/ehci-pci.c
> > > +++ b/drivers/usb/host/ehci-pci.c
> > > @@ -222,6 +222,12 @@ static int ehci_pci_setup(struct usb_hcd *hcd)
> > >  			ehci->has_synopsys_hc_bug = 1;
> > >  		}
> > >  		break;
> > > +	case PCI_VENDOR_ID_ASPEED:
> > > +		if (pdev->device == PCI_DEVICE_ID_ASPEED_EHCI) {
> > > +			ehci_info(ehci, "applying Aspeed HC workaround\n");
> > > +			ehci->is_aspeed = 1;
> > > +		}
> > > +		break;
> > >  	}
> > >
> > >  	/* optional debug port, normally in the first BAR */ diff --git
> > > a/include/linux/pci_ids.h b/include/linux/pci_ids.h index
> > > aad54c666407..410b395fe56c 100644
> > > --- a/include/linux/pci_ids.h
> > > +++ b/include/linux/pci_ids.h
> > > @@ -3096,4 +3096,7 @@
> > >
> > >  #define PCI_VENDOR_ID_NCUBE		0x10ff
> > >
> > > +#define PCI_VENDOR_ID_ASPEED		0x1a03
> > > +#define PCI_DEVICE_ID_ASPEED_EHCI	0x2603
> > 
> > Please read the top of this file, this does not need to be added here.
> > 
> > thanks,
> > 
> > greg k-h
> 
> Are you suggesting to hard code vendor/device ID in driver instead?

Or put the define in the ehci-pci.c file like other drivers do.  Only
add to the pci_ids.h file if your define is needed in multiple drivers,
otherwise it is a merge nightmare.

thanks,

greg k-h
Neal Liu Feb. 8, 2022, 8:53 a.m. UTC | #4
> -----Original Message-----
> From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Sent: Tuesday, February 8, 2022 4:42 PM
> To: Neal Liu <neal_liu@aspeedtech.com>
> Cc: Alan Stern <stern@rowland.harvard.edu>; Bjorn Helgaas
> <bhelgaas@google.com>; linux-usb@vger.kernel.org;
> linux-kernel@vger.kernel.org; linux-pci@vger.kernel.org; Tao Ren
> <rentao.bupt@gmail.com>; BMC-SW <BMC-SW@aspeedtech.com>
> Subject: Re: [PATCH] usb: ehci: add pci device support for Aspeed platforms
> 
> On Tue, Feb 08, 2022 at 08:20:07AM +0000, Neal Liu wrote:
> > > -----Original Message-----
> > > From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > > Sent: Tuesday, February 8, 2022 3:38 PM
> > > To: Neal Liu <neal_liu@aspeedtech.com>
> > > Cc: Alan Stern <stern@rowland.harvard.edu>; Bjorn Helgaas
> > > <bhelgaas@google.com>; linux-usb@vger.kernel.org;
> > > linux-kernel@vger.kernel.org; linux-pci@vger.kernel.org; Tao Ren
> > > <rentao.bupt@gmail.com>; BMC-SW <BMC-SW@aspeedtech.com>
> > > Subject: Re: [PATCH] usb: ehci: add pci device support for Aspeed
> > > platforms
> > >
> > > On Tue, Feb 08, 2022 at 02:29:27PM +0800, Neal Liu wrote:
> > > > Enable Aspeed quirks in commit 7f2d73788d90 ("usb: ehci:
> > > > handshake CMD_RUN instead of STS_HALT") to support Aspeed ehci-pci
> > > > device.
> > > >
> > > > Signed-off-by: Neal Liu <neal_liu@aspeedtech.com>
> > > > ---
> > > >  drivers/usb/host/ehci-pci.c | 6 ++++++
> > > >  include/linux/pci_ids.h     | 3 +++
> > > >  2 files changed, 9 insertions(+)
> > > >
> > > > diff --git a/drivers/usb/host/ehci-pci.c
> > > > b/drivers/usb/host/ehci-pci.c index e87cf3a00fa4..a91b25d216ae
> > > > 100644
> > > > --- a/drivers/usb/host/ehci-pci.c
> > > > +++ b/drivers/usb/host/ehci-pci.c
> > > > @@ -222,6 +222,12 @@ static int ehci_pci_setup(struct usb_hcd *hcd)
> > > >  			ehci->has_synopsys_hc_bug = 1;
> > > >  		}
> > > >  		break;
> > > > +	case PCI_VENDOR_ID_ASPEED:
> > > > +		if (pdev->device == PCI_DEVICE_ID_ASPEED_EHCI) {
> > > > +			ehci_info(ehci, "applying Aspeed HC workaround\n");
> > > > +			ehci->is_aspeed = 1;
> > > > +		}
> > > > +		break;
> > > >  	}
> > > >
> > > >  	/* optional debug port, normally in the first BAR */ diff --git
> > > > a/include/linux/pci_ids.h b/include/linux/pci_ids.h index
> > > > aad54c666407..410b395fe56c 100644
> > > > --- a/include/linux/pci_ids.h
> > > > +++ b/include/linux/pci_ids.h
> > > > @@ -3096,4 +3096,7 @@
> > > >
> > > >  #define PCI_VENDOR_ID_NCUBE		0x10ff
> > > >
> > > > +#define PCI_VENDOR_ID_ASPEED		0x1a03
> > > > +#define PCI_DEVICE_ID_ASPEED_EHCI	0x2603
> > >
> > > Please read the top of this file, this does not need to be added here.
> > >
> > > thanks,
> > >
> > > greg k-h
> >
> > Are you suggesting to hard code vendor/device ID in driver instead?
> 
> Or put the define in the ehci-pci.c file like other drivers do.  Only add to the
> pci_ids.h file if your define is needed in multiple drivers, otherwise it is a
> merge nightmare.
> 
> thanks,
> 
> greg k-h

Okay, I'll revise it. Thanks for your suggestion.

-Neal
diff mbox series

Patch

diff --git a/drivers/usb/host/ehci-pci.c b/drivers/usb/host/ehci-pci.c
index e87cf3a00fa4..a91b25d216ae 100644
--- a/drivers/usb/host/ehci-pci.c
+++ b/drivers/usb/host/ehci-pci.c
@@ -222,6 +222,12 @@  static int ehci_pci_setup(struct usb_hcd *hcd)
 			ehci->has_synopsys_hc_bug = 1;
 		}
 		break;
+	case PCI_VENDOR_ID_ASPEED:
+		if (pdev->device == PCI_DEVICE_ID_ASPEED_EHCI) {
+			ehci_info(ehci, "applying Aspeed HC workaround\n");
+			ehci->is_aspeed = 1;
+		}
+		break;
 	}
 
 	/* optional debug port, normally in the first BAR */
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index aad54c666407..410b395fe56c 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -3096,4 +3096,7 @@ 
 
 #define PCI_VENDOR_ID_NCUBE		0x10ff
 
+#define PCI_VENDOR_ID_ASPEED		0x1a03
+#define PCI_DEVICE_ID_ASPEED_EHCI	0x2603
+
 #endif /* _LINUX_PCI_IDS_H */