diff mbox series

[1/2] pci: pci_ids: Move Synopsys HAPS platform device IDs

Message ID 62f746c341ea00ccadda47c3cb02eb57f2e90db2.1541209477.git.thinhn@synopsys.com (mailing list archive)
State New, archived
Headers show
Series [1/2] pci: pci_ids: Move Synopsys HAPS platform device IDs | expand

Commit Message

Thinh Nguyen Nov. 3, 2018, 1:47 a.m. UTC
Move Synopsys HAPS platform device IDs to pci_ids.h.

Signed-off-by: Thinh Nguyen <thinhn@synopsys.com>
---
 drivers/usb/dwc3/dwc3-haps.c | 4 ----
 include/linux/pci_ids.h      | 3 +++
 2 files changed, 3 insertions(+), 4 deletions(-)

Comments

Greg KH Nov. 3, 2018, 6:25 a.m. UTC | #1
On Fri, Nov 02, 2018 at 06:47:38PM -0700, Thinh Nguyen wrote:
> Move Synopsys HAPS platform device IDs to pci_ids.h.

Why?  pci_ids.h, at the top of the file, says to not add new entries to
the file.

thanks,

greg k-h
Thinh Nguyen Nov. 5, 2018, 6:46 p.m. UTC | #2
Hi Greg,

On 11/2/2018 11:26 PM, Greg KH wrote:
> On Fri, Nov 02, 2018 at 06:47:38PM -0700, Thinh Nguyen wrote:
>> Move Synopsys HAPS platform device IDs to pci_ids.h.
> Why?  pci_ids.h, at the top of the file, says to not add new entries to
> the file.

Yes, I notice. However, I want to reference these IDs in
/drivers/pci/quirks.c. It's related to this patch subject "[PATCH 2/2]
pci: quirks: Override Synopsys USB 3.x HAPS device driver".
I will CC that patch to linux-usb mailing list also. Please let me know
if this is ok. Otherwise, any suggestion?

Thanks,
Thinh
Thinh Nguyen Nov. 5, 2018, 6:49 p.m. UTC | #3
++ linux-usb
++ Greg

On 11/2/2018 6:47 PM, Thinh Nguyen wrote:
> Synopsys USB 3.x host HAPS platform has a class code of
> PCI_CLASS_SERIAL_USB_XHCI, and xhci driver can claim it. However, these
> devices should use dwc3-haps driver. Set driver_override to dwc3-haps
> for these platforms.
>
> Signed-off-by: Thinh Nguyen <thinhn@synopsys.com>
> ---
>  drivers/pci/quirks.c | 21 +++++++++++++++++++++
>  1 file changed, 21 insertions(+)
>
> diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
> index 6bc27b7fd452..5f7c3ade7749 100644
> --- a/drivers/pci/quirks.c
> +++ b/drivers/pci/quirks.c
> @@ -618,6 +618,27 @@ static void quirk_amd_nl_class(struct pci_dev *pdev)
>  DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_NL_USB,
>  		quirk_amd_nl_class);
>  
> +/*
> + * Synopsys USB 3.x host HAPS platform has a class code of
> + * PCI_CLASS_SERIAL_USB_XHCI, and xhci driver can claim it. However, these
> + * devices should use dwc3-haps driver. Set driver_override to dwc3-haps for
> + * these platforms.
> + */
> +static void quirk_synopsys_haps(struct pci_dev *pdev)
> +{
> +	/* Use dwc3-haps driver instead of xhci-pci */
> +	pdev->driver_override = "dwc3-haps";
> +}
> +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_SYNOPSYS,
> +			PCI_DEVICE_ID_SYNOPSYS_HAPSUSB3,
> +			quirk_synopsys_haps);
> +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_SYNOPSYS,
> +			PCI_DEVICE_ID_SYNOPSYS_HAPSUSB3_AXI,
> +			quirk_synopsys_haps);
> +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_SYNOPSYS,
> +			PCI_DEVICE_ID_SYNOPSYS_HAPSUSB31,
> +			quirk_synopsys_haps);
> +
>  /*
>   * Let's make the southbridge information explicit instead of having to
>   * worry about people probing the ACPI areas, for example.. (Yes, it
Greg KH Nov. 5, 2018, 6:56 p.m. UTC | #4
On Mon, Nov 05, 2018 at 06:46:26PM +0000, Thinh Nguyen wrote:
> Hi Greg,
> 
> On 11/2/2018 11:26 PM, Greg KH wrote:
> > On Fri, Nov 02, 2018 at 06:47:38PM -0700, Thinh Nguyen wrote:
> >> Move Synopsys HAPS platform device IDs to pci_ids.h.
> > Why?  pci_ids.h, at the top of the file, says to not add new entries to
> > the file.
> 
> Yes, I notice. However, I want to reference these IDs in
> /drivers/pci/quirks.c. It's related to this patch subject "[PATCH 2/2]
> pci: quirks: Override Synopsys USB 3.x HAPS device driver".
> I will CC that patch to linux-usb mailing list also. Please let me know
> if this is ok. Otherwise, any suggestion?

Ah, ok, that is fine, as I never saw patch 2/2, I didn't know that :)
Felipe Balbi Nov. 6, 2018, 8:43 a.m. UTC | #5
Thinh Nguyen <thinh.nguyen@synopsys.com> writes:

> ++ linux-usb
> ++ Greg
>
> On 11/2/2018 6:47 PM, Thinh Nguyen wrote:
>> Synopsys USB 3.x host HAPS platform has a class code of
>> PCI_CLASS_SERIAL_USB_XHCI, and xhci driver can claim it. However, these
>> devices should use dwc3-haps driver. Set driver_override to dwc3-haps
>> for these platforms.
>>
>> Signed-off-by: Thinh Nguyen <thinhn@synopsys.com>

FWIW:

Acked-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Thinh Nguyen Dec. 8, 2018, 2:49 a.m. UTC | #6
Hi Bjorn,

On 11/6/2018 12:44 AM, Felipe Balbi wrote:
> Thinh Nguyen <thinh.nguyen@synopsys.com> writes:
>
>> ++ linux-usb
>> ++ Greg
>>
>> On 11/2/2018 6:47 PM, Thinh Nguyen wrote:
>>> Synopsys USB 3.x host HAPS platform has a class code of
>>> PCI_CLASS_SERIAL_USB_XHCI, and xhci driver can claim it. However, these
>>> devices should use dwc3-haps driver. Set driver_override to dwc3-haps
>>> for these platforms.
>>>
>>> Signed-off-by: Thinh Nguyen <thinhn@synopsys.com>
> FWIW:
>
> Acked-by: Felipe Balbi <felipe.balbi@linux.intel.com>
>

Please let me know if you're ok with these 2 patches.  (This and patch
subject "[PATCH 1/2] pci: pci_ids: Move Synopsys HAPS platform device IDs")

Thanks,
Thinh
Bjorn Helgaas Dec. 10, 2018, 6:49 p.m. UTC | #7
On Fri, Nov 02, 2018 at 06:47:38PM -0700, Thinh Nguyen wrote:
> Move Synopsys HAPS platform device IDs to pci_ids.h.
> 
> Signed-off-by: Thinh Nguyen <thinhn@synopsys.com>

1) Run "git log --oneline include/linux/pci_ids.h" and follow the
style convention for patch subject.

2) Explain in the changelog why we're moving this to pci_ids.h.  Note
the comment at the top of pci_ids.h.  I think the move is fine because
you're using the definition in two places, so just mention that in the
changelog.

Thanks!

> ---
>  drivers/usb/dwc3/dwc3-haps.c | 4 ----
>  include/linux/pci_ids.h      | 3 +++
>  2 files changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/usb/dwc3/dwc3-haps.c b/drivers/usb/dwc3/dwc3-haps.c
> index c9cc33881bef..02d57d98ef9b 100644
> --- a/drivers/usb/dwc3/dwc3-haps.c
> +++ b/drivers/usb/dwc3/dwc3-haps.c
> @@ -15,10 +15,6 @@
>  #include <linux/platform_device.h>
>  #include <linux/property.h>
>  
> -#define PCI_DEVICE_ID_SYNOPSYS_HAPSUSB3		0xabcd
> -#define PCI_DEVICE_ID_SYNOPSYS_HAPSUSB3_AXI	0xabce
> -#define PCI_DEVICE_ID_SYNOPSYS_HAPSUSB31	0xabcf
> -
>  /**
>   * struct dwc3_haps - Driver private structure
>   * @dwc3: child dwc3 platform_device
> diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
> index d157983b84cf..c48550aa67e3 100644
> --- a/include/linux/pci_ids.h
> +++ b/include/linux/pci_ids.h
> @@ -2354,6 +2354,9 @@
>  #define PCI_DEVICE_ID_CENATEK_IDE	0x0001
>  
>  #define PCI_VENDOR_ID_SYNOPSYS		0x16c3
> +#define PCI_DEVICE_ID_SYNOPSYS_HAPSUSB3		0xabcd
> +#define PCI_DEVICE_ID_SYNOPSYS_HAPSUSB3_AXI	0xabce
> +#define PCI_DEVICE_ID_SYNOPSYS_HAPSUSB31	0xabcf
>  
>  #define PCI_VENDOR_ID_VITESSE		0x1725
>  #define PCI_DEVICE_ID_VITESSE_VSC7174	0x7174
> -- 
> 2.11.0
>
Bjorn Helgaas Dec. 10, 2018, 6:54 p.m. UTC | #8
On Sat, Dec 08, 2018 at 02:49:09AM +0000, Thinh Nguyen wrote:
> Hi Bjorn,
> 
> On 11/6/2018 12:44 AM, Felipe Balbi wrote:
> > Thinh Nguyen <thinh.nguyen@synopsys.com> writes:
> >
> >> ++ linux-usb
> >> ++ Greg
> >>
> >> On 11/2/2018 6:47 PM, Thinh Nguyen wrote:
> >>> Synopsys USB 3.x host HAPS platform has a class code of
> >>> PCI_CLASS_SERIAL_USB_XHCI, and xhci driver can claim it. However, these
> >>> devices should use dwc3-haps driver. Set driver_override to dwc3-haps
> >>> for these platforms.
> >>>
> >>> Signed-off-by: Thinh Nguyen <thinhn@synopsys.com>
> > FWIW:
> >
> > Acked-by: Felipe Balbi <felipe.balbi@linux.intel.com>
> >
> 
> Please let me know if you're ok with these 2 patches.  (This and patch
> subject "[PATCH 1/2] pci: pci_ids: Move Synopsys HAPS platform device IDs")

1) Run "git log --oneline drivers/pci/quirks.c" ...

2) quirk_amd_nl_class() and quirk_netmos() do something similar in a
different way.  quirk_amd_nl_class() in particular seems to be doing
exactly the same thing.  I think since they're doing the same thing, they
should do it the same way.  Would the quirk_amd_nl_class() solution work
for you?

Bjorn
Thinh Nguyen Dec. 10, 2018, 9:49 p.m. UTC | #9
Hi Bjorn,

On 12/10/2018 10:49 AM, Bjorn Helgaas wrote:
> On Fri, Nov 02, 2018 at 06:47:38PM -0700, Thinh Nguyen wrote:
>> Move Synopsys HAPS platform device IDs to pci_ids.h.
>>
>> Signed-off-by: Thinh Nguyen <thinhn@synopsys.com>
> 1) Run "git log --oneline include/linux/pci_ids.h" and follow the
> style convention for patch subject.
>
> 2) Explain in the changelog why we're moving this to pci_ids.h.  Note
> the comment at the top of pci_ids.h.  I think the move is fine because
> you're using the definition in two places, so just mention that in the
> changelog.
>
> Thanks!

Thanks for the review! I'll fix it.

Thinh
Thinh Nguyen Dec. 10, 2018, 9:51 p.m. UTC | #10
Hi Bjorn,

On 12/10/2018 10:54 AM, Bjorn Helgaas wrote:
> On Sat, Dec 08, 2018 at 02:49:09AM +0000, Thinh Nguyen wrote:
>> Hi Bjorn,
>>
>> On 11/6/2018 12:44 AM, Felipe Balbi wrote:
>>> Thinh Nguyen <thinh.nguyen@synopsys.com> writes:
>>>
>>>> ++ linux-usb
>>>> ++ Greg
>>>>
>>>> On 11/2/2018 6:47 PM, Thinh Nguyen wrote:
>>>>> Synopsys USB 3.x host HAPS platform has a class code of
>>>>> PCI_CLASS_SERIAL_USB_XHCI, and xhci driver can claim it. However, these
>>>>> devices should use dwc3-haps driver. Set driver_override to dwc3-haps
>>>>> for these platforms.
>>>>>
>>>>> Signed-off-by: Thinh Nguyen <thinhn@synopsys.com>
>>> FWIW:
>>>
>>> Acked-by: Felipe Balbi <felipe.balbi@linux.intel.com>
>>>
>> Please let me know if you're ok with these 2 patches.  (This and patch
>> subject "[PATCH 1/2] pci: pci_ids: Move Synopsys HAPS platform device IDs")
> 1) Run "git log --oneline drivers/pci/quirks.c" ...
>
> 2) quirk_amd_nl_class() and quirk_netmos() do something similar in a
> different way.  quirk_amd_nl_class() in particular seems to be doing
> exactly the same thing.  I think since they're doing the same thing, they
> should do it the same way.  Would the quirk_amd_nl_class() solution work
> for you?
>
> Bjorn
>

Yes. Also, the way Netmos handling multiple devices is cleaner. I'll
incorporate the their solutions.

Thanks,
Thinh
diff mbox series

Patch

diff --git a/drivers/usb/dwc3/dwc3-haps.c b/drivers/usb/dwc3/dwc3-haps.c
index c9cc33881bef..02d57d98ef9b 100644
--- a/drivers/usb/dwc3/dwc3-haps.c
+++ b/drivers/usb/dwc3/dwc3-haps.c
@@ -15,10 +15,6 @@ 
 #include <linux/platform_device.h>
 #include <linux/property.h>
 
-#define PCI_DEVICE_ID_SYNOPSYS_HAPSUSB3		0xabcd
-#define PCI_DEVICE_ID_SYNOPSYS_HAPSUSB3_AXI	0xabce
-#define PCI_DEVICE_ID_SYNOPSYS_HAPSUSB31	0xabcf
-
 /**
  * struct dwc3_haps - Driver private structure
  * @dwc3: child dwc3 platform_device
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index d157983b84cf..c48550aa67e3 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -2354,6 +2354,9 @@ 
 #define PCI_DEVICE_ID_CENATEK_IDE	0x0001
 
 #define PCI_VENDOR_ID_SYNOPSYS		0x16c3
+#define PCI_DEVICE_ID_SYNOPSYS_HAPSUSB3		0xabcd
+#define PCI_DEVICE_ID_SYNOPSYS_HAPSUSB3_AXI	0xabce
+#define PCI_DEVICE_ID_SYNOPSYS_HAPSUSB31	0xabcf
 
 #define PCI_VENDOR_ID_VITESSE		0x1725
 #define PCI_DEVICE_ID_VITESSE_VSC7174	0x7174