All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Thinh Nguyen <thinh.nguyen@synopsys.com>
Cc: linux-pci@vger.kernel.org, linux-usb@vger.kernel.org,
	John Youn <john.youn@synopsys.com>
Subject: Re: [PATCH v2 2/2] PCI: Override Synopsys USB 3.x HAPS device class
Date: Mon, 17 Dec 2018 16:29:40 -0600	[thread overview]
Message-ID: <20181217222940.GE28981@google.com> (raw)
In-Reply-To: <8994fd7d7ee2bf5c1b32ce5bca25be4beb4405b5.1544478969.git.thinhn@synopsys.com>

On Mon, Dec 10, 2018 at 02:08:01PM -0800, 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. Change these devices' class code to
> PCI_CLASS_SERIAL_USB_DEVICE to prevent the xhci-pci driver from claiming
> them.
> 
> Signed-off-by: Thinh Nguyen <thinhn@synopsys.com>

I applied both of these to pci/misc for v4.21, thanks!

> ---
> Change in v2:
> - Revise title to fit PCI patches' convention
> - Override pci class instead of driver
> 
>  drivers/pci/quirks.c | 26 ++++++++++++++++++++++++++
>  1 file changed, 26 insertions(+)
> 
> diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
> index 4700d24e5d55..c84f81c42a1f 100644
> --- a/drivers/pci/quirks.c
> +++ b/drivers/pci/quirks.c
> @@ -618,6 +618,32 @@ 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. Change these devices' class code to
> + * PCI_CLASS_SERIAL_USB_DEVICE to prevent the xhci-pci driver from claiming
> + * them.
> + */
> +static void quirk_synopsys_haps(struct pci_dev *pdev)
> +{
> +	u32 class = pdev->class;
> +
> +	switch (pdev->device) {
> +	case PCI_DEVICE_ID_SYNOPSYS_HAPSUSB3:
> +	case PCI_DEVICE_ID_SYNOPSYS_HAPSUSB3_AXI:
> +	case PCI_DEVICE_ID_SYNOPSYS_HAPSUSB31:
> +		pdev->class = PCI_CLASS_SERIAL_USB_DEVICE;
> +		pci_info(pdev, "PCI class overridden (%#08x -> %#08x) so dwc3 driver can claim this instead of xhci\n",
> +			 class, pdev->class);
> +		break;
> +	default:
> +		return;

I dropped this "default: return;" because it's superfluous.

> +	}
> +}
> +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SYNOPSYS, PCI_ANY_ID,
> +			 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
> -- 
> 2.11.0
> 

WARNING: multiple messages have this Message-ID (diff)
From: Bjorn Helgaas <helgaas@kernel.org>
To: Thinh Nguyen <thinh.nguyen@synopsys.com>
Cc: linux-pci@vger.kernel.org, linux-usb@vger.kernel.org,
	John Youn <john.youn@synopsys.com>
Subject: [v2,2/2] PCI: Override Synopsys USB 3.x HAPS device class
Date: Mon, 17 Dec 2018 16:29:40 -0600	[thread overview]
Message-ID: <20181217222940.GE28981@google.com> (raw)

On Mon, Dec 10, 2018 at 02:08:01PM -0800, 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. Change these devices' class code to
> PCI_CLASS_SERIAL_USB_DEVICE to prevent the xhci-pci driver from claiming
> them.
> 
> Signed-off-by: Thinh Nguyen <thinhn@synopsys.com>

I applied both of these to pci/misc for v4.21, thanks!

> ---
> Change in v2:
> - Revise title to fit PCI patches' convention
> - Override pci class instead of driver
> 
>  drivers/pci/quirks.c | 26 ++++++++++++++++++++++++++
>  1 file changed, 26 insertions(+)
> 
> diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
> index 4700d24e5d55..c84f81c42a1f 100644
> --- a/drivers/pci/quirks.c
> +++ b/drivers/pci/quirks.c
> @@ -618,6 +618,32 @@ 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. Change these devices' class code to
> + * PCI_CLASS_SERIAL_USB_DEVICE to prevent the xhci-pci driver from claiming
> + * them.
> + */
> +static void quirk_synopsys_haps(struct pci_dev *pdev)
> +{
> +	u32 class = pdev->class;
> +
> +	switch (pdev->device) {
> +	case PCI_DEVICE_ID_SYNOPSYS_HAPSUSB3:
> +	case PCI_DEVICE_ID_SYNOPSYS_HAPSUSB3_AXI:
> +	case PCI_DEVICE_ID_SYNOPSYS_HAPSUSB31:
> +		pdev->class = PCI_CLASS_SERIAL_USB_DEVICE;
> +		pci_info(pdev, "PCI class overridden (%#08x -> %#08x) so dwc3 driver can claim this instead of xhci\n",
> +			 class, pdev->class);
> +		break;
> +	default:
> +		return;

I dropped this "default: return;" because it's superfluous.

> +	}
> +}
> +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SYNOPSYS, PCI_ANY_ID,
> +			 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
> -- 
> 2.11.0
>

  reply	other threads:[~2018-12-17 22:29 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-10 22:07 [PATCH v2 1/2] PCI: Move Synopsys HAPS platform device IDs Thinh Nguyen
2018-12-10 22:07 ` [v2,1/2] " Thinh Nguyen
2018-12-10 22:08 ` [PATCH v2 2/2] PCI: Override Synopsys USB 3.x HAPS device class Thinh Nguyen
2018-12-10 22:08   ` [v2,2/2] " Thinh Nguyen
2018-12-17 22:29   ` Bjorn Helgaas [this message]
2018-12-17 22:29     ` Bjorn Helgaas
2019-02-04 22:42   ` [PATCH v2 2/2] " Trent Piepho
2019-02-04 22:42     ` [v2,2/2] " Trent Piepho
2019-02-04 23:18     ` [PATCH v2 2/2] " Thinh Nguyen
2019-02-04 23:18       ` [v2,2/2] " Thinh Nguyen
2019-02-04 23:50       ` [PATCH v2 2/2] " Trent Piepho
2019-02-04 23:50         ` [v2,2/2] " Trent Piepho

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181217222940.GE28981@google.com \
    --to=helgaas@kernel.org \
    --cc=john.youn@synopsys.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=thinh.nguyen@synopsys.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.