lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAODwPW8XMESHi=_ovcTRcyxv6zS6fMuTmSW2qrE-fbQvtHks=g@mail.gmail.com>
Date:	Tue, 10 Dec 2013 10:25:31 -0800
From:	Julius Werner <jwerner@...omium.org>
To:	Vivek Gautam <gautam.vivek@...sung.com>
Cc:	"linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
	"linux-samsung-soc@...r.kernel.org" 
	<linux-samsung-soc@...r.kernel.org>, linux-omap@...r.kernel.org,
	LKML <linux-kernel@...r.kernel.org>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Felipe Balbi <balbi@...com>,
	Sarah Sharp <sarah.a.sharp@...ux.intel.com>,
	Kukjin Kim <kgene.kim@...sung.com>, kishon <kishon@...com>,
	Jingoo Han <jg1.han@...sung.com>,
	Julius Werner <jwerner@...omium.org>
Subject: Re: [PATCH RFC 2/4] xhci: Add quirk for DWC3-Exynos controller

On Tue, Dec 10, 2013 at 2:55 AM, Vivek Gautam <gautam.vivek@...sung.com> wrote:
> The DWC3-exynos eXtensible host controller on Exynos5420 SoC
> is quirky in a way that the PHY needs to be tuned to get it
> working at SuperSpeed.
> By default this PHY works as High-speed phy and therefore
> detects even Super-speed devices as high-speed ones.
> So, the PHY needs to be tuned after controller has been reset.
>
> Adding a xHCI quirk for this purpose.
>
> Signed-off-by: Vivek Gautam <gautam.vivek@...sung.com>
> ---
>  drivers/usb/host/xhci-plat.c |   19 +++++++++++++++++++
>  drivers/usb/host/xhci.h      |    1 +
>  2 files changed, 20 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
> index d9c169f..395c9e9 100644
> --- a/drivers/usb/host/xhci-plat.c
> +++ b/drivers/usb/host/xhci-plat.c
> @@ -21,6 +21,25 @@
>
>  static void xhci_plat_quirks(struct device *dev, struct xhci_hcd *xhci)
>  {
> +       struct device *parent_dev;
> +       struct device *vendor_parent_dev;
> +
> +       parent_dev = dev->parent;
> +       vendor_parent_dev = parent_dev->parent;

Is this guaranteed to exist for all current and future xhci-plat
controllers or should you maybe check one or both for NULL?

> +
> +       /*
> +        * The DWC3-exynos host controller on Exynos5420 SoC is quirky
> +        * in a way that the PHY needs to be tuned to get it working
> +        * at SuperSpeed. By default this PHY works as High-speed phy
> +        * and so detects even Super-speed devices as high-speed ones.
> +        * Therefor the PHY needs to be tuned after controller
> +        * has been reset, since a controller reset actually forces the
> +        * PHY to fall back to its default state wherein it works as
> +        * High-Speed PHY only.
> +        */
> +       if (!strstr(dev_name(vendor_parent_dev), "exynos"))
> +               xhci->quirks |= XHCI_DWC3_EXYNOS;
> +
>         /*
>          * As of now platform drivers don't provide MSI support so we ensure
>          * here that the generic code does not try to make a pci_dev from our
> diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
> index 7807f62..f69af8c 100644
> --- a/drivers/usb/host/xhci.h
> +++ b/drivers/usb/host/xhci.h
> @@ -1560,6 +1560,7 @@ struct xhci_hcd {
>  #define XHCI_PLAT              (1 << 16)
>  #define XHCI_SLOW_SUSPEND      (1 << 17)
>  #define XHCI_SPURIOUS_WAKEUP   (1 << 18)
> +#define XHCI_DWC3_EXYNOS       (1 << 19)

I think in general it's better to name quirks after what they do
rather than a specific device, that way you might be able to reuse
them. How about XHCI_TUNE_AFTER_RESET? (Or you could leave out the
quirk completely and just differentiate by whether the PHY implements
the tune() method or not.)

>         unsigned int            num_active_eps;
>         unsigned int            limit_active_eps;
>         /* There are two roothubs to keep track of bus suspend info for */
> --
> 1.7.6.5
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ