From: Greg KH <gregkh@linuxfoundation.org>
To: Nehal Bakulchandra Shah <Nehal-bakulchandra.Shah@amd.com>
Cc: mathias.nyman@intel.com, linux-usb@vger.kernel.org,
linux-kernel@vger.kernel.org, Sandeep.Singh@amd.com,
yuanmei@lenovo.com
Subject: Re: [PATCH] xhci: workaround for S3 issue on AMD SNPS 3.0 xHC
Date: Wed, 16 Sep 2020 10:06:11 +0200 [thread overview]
Message-ID: <20200916080611.GA486670@kroah.com> (raw)
In-Reply-To: <20200831065246.1166470-1-Nehal-bakulchandra.Shah@amd.com>
On Mon, Aug 31, 2020 at 06:52:46AM +0000, Nehal Bakulchandra Shah wrote:
> From: Nehal Bakulchandra Shah <Nehal-Bakulchandra.shah@amd.com>
>
> On some platform of AMD, S3 fails with HCE and SRE errors.To fix this,
> sparse controller enable bit has to be disabled.
>
> Signed-off-by: Nehal Bakulchandra Shah <Nehal-Bakulchandra.shah@amd.com>
> ---
> drivers/usb/host/xhci-pci.c | 12 ++++++++++++
> drivers/usb/host/xhci.h | 1 +
> 2 files changed, 13 insertions(+)
>
> diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
> index 3feaafebfe58..865a16e6c1ed 100644
> --- a/drivers/usb/host/xhci-pci.c
> +++ b/drivers/usb/host/xhci-pci.c
> @@ -160,6 +160,9 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
> (pdev->device == 0x15e0 || pdev->device == 0x15e1))
> xhci->quirks |= XHCI_SNPS_BROKEN_SUSPEND;
>
> + if (pdev->vendor == PCI_VENDOR_ID_AMD && pdev->device == 0x15e5)
> + xhci->quirks |= XHCI_DISABLE_SPARSE;
> +
> if (pdev->vendor == PCI_VENDOR_ID_AMD)
> xhci->quirks |= XHCI_TRUST_TX_LENGTH;
>
> @@ -371,6 +374,15 @@ static int xhci_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
> /* USB 2.0 roothub is stored in the PCI device now. */
> hcd = dev_get_drvdata(&dev->dev);
> xhci = hcd_to_xhci(hcd);
> +
> + if (xhci->quirks & XHCI_DISABLE_SPARSE) {
> + u32 reg;
> +
> + reg = readl(hcd->regs + 0xC12C);
> + reg &= ~BIT(17);
Odd spacing :(
Anyway, what is magic bit 17? Shouldn't that be documented somewhere?
And you forgot to handle endian issues here, right?
> + writel(reg, hcd->regs + 0xC12C);
Same for this magic address, shouldn't you document that here please?
And is this the proper place to be testing for quirks and applying them?
Why not do the above in the xhci_pci_quirks() call?
thanks,
greg k-h
next prev parent reply other threads:[~2020-09-16 8:05 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-31 6:52 Nehal Bakulchandra Shah
2020-09-16 8:06 ` Greg KH [this message]
2020-09-16 12:47 ` Mathias Nyman
[not found] ` <1163986b-075f-8d5e-13dc-7141cb25e484@amd.com>
2020-09-16 8:06 ` Greg KH
2020-09-16 12:30 ` Mathias Nyman
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=20200916080611.GA486670@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=Nehal-bakulchandra.Shah@amd.com \
--cc=Sandeep.Singh@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mathias.nyman@intel.com \
--cc=yuanmei@lenovo.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®