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: <20141117230430.GA9716@saruman>
Date:	Mon, 17 Nov 2014 17:04:30 -0600
From:	Felipe Balbi <balbi@...com>
To:	Andrew Bresticker <abrestic@...omium.org>
CC:	Stephen Warren <swarren@...dotorg.org>,
	Thierry Reding <thierry.reding@...il.com>,
	Alexandre Courbot <gnurou@...il.com>,
	<linux-tegra@...r.kernel.org>, Rob Herring <robh+dt@...nel.org>,
	Pawel Moll <pawel.moll@....com>,
	Mark Rutland <mark.rutland@....com>,
	Ian Campbell <ijc+devicetree@...lion.org.uk>,
	Kumar Gala <galak@...eaurora.org>,
	"Russell King" <linux@....linux.org.uk>,
	Jassi Brar <jassisinghbrar@...il.com>,
	"Linus Walleij" <linus.walleij@...aro.org>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Mathias Nyman <mathias.nyman@...el.com>,
	"Grant Likely" <grant.likely@...aro.org>,
	Alan Stern <stern@...land.harvard.edu>,
	Arnd Bergmann <arnd@...db.de>, Olof Johansson <olof@...om.net>,
	"Kishon Vijay Abraham I" <kishon@...com>,
	<devicetree@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
	<linux-arm-kernel@...ts.infradead.org>, <linux-usb@...r.kernel.org>
Subject: Re: [PATCH V5 01/12] xhci: Set shared HCD's hcd_priv in
 xhci_gen_setup

On Mon, Nov 17, 2014 at 02:41:31PM -0800, Andrew Bresticker wrote:
> xhci_gen_setup() sets the hcd_priv field for the primary HCD, but not
> for the shared HCD, requiring xHCI host-controller drivers to set it
> between usb_create_shared_hcd() and usb_add_hcd().  There's no reason
> xhci_gen_setup() can't set the shared HCD's hcd_priv as well, so move
> that bit out of the host-controller drivers and into xhci_gen_setup().
> 
> Signed-off-by: Andrew Bresticker <abrestic@...omium.org>

Reviewed-by: Felipe Balbi <balbi@...com>

> ---
> New for v5.
> Peviously posted here: https://lkml.org/lkml/2014/10/30/726
> ---
>  drivers/usb/host/xhci-pci.c  | 5 -----
>  drivers/usb/host/xhci-plat.c | 5 -----
>  drivers/usb/host/xhci.c      | 6 +++---
>  3 files changed, 3 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
> index 9a69b1f..31025e4 100644
> --- a/drivers/usb/host/xhci-pci.c
> +++ b/drivers/usb/host/xhci-pci.c
> @@ -221,11 +221,6 @@ static int xhci_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
>  		goto dealloc_usb2_hcd;
>  	}
>  
> -	/* Set the xHCI pointer before xhci_pci_setup() (aka hcd_driver.reset)
> -	 * is called by usb_add_hcd().
> -	 */
> -	*((struct xhci_hcd **) xhci->shared_hcd->hcd_priv) = xhci;
> -
>  	retval = usb_add_hcd(xhci->shared_hcd, dev->irq,
>  			IRQF_SHARED);
>  	if (retval)
> diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
> index 3d78b0c..5bc33bc 100644
> --- a/drivers/usb/host/xhci-plat.c
> +++ b/drivers/usb/host/xhci-plat.c
> @@ -149,11 +149,6 @@ static int xhci_plat_probe(struct platform_device *pdev)
>  	if ((node && of_property_read_bool(node, "usb3-lpm-capable")) ||
>  			(pdata && pdata->usb3_lpm_capable))
>  		xhci->quirks |= XHCI_LPM_SUPPORT;
> -	/*
> -	 * Set the xHCI pointer before xhci_plat_setup() (aka hcd_driver.reset)
> -	 * is called by usb_add_hcd().
> -	 */
> -	*((struct xhci_hcd **) xhci->shared_hcd->hcd_priv) = xhci;
>  
>  	if (HCC_MAX_PSA(xhci->hcc_params) >= 4)
>  		xhci->shared_hcd->can_do_streams = 1;
> diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
> index 2a5d45b..ae05471 100644
> --- a/drivers/usb/host/xhci.c
> +++ b/drivers/usb/host/xhci.c
> @@ -4843,9 +4843,9 @@ int xhci_gen_setup(struct usb_hcd *hcd, xhci_get_quirks_t get_quirks)
>  		 */
>  		hcd->has_tt = 1;
>  	} else {
> -		/* xHCI private pointer was set in xhci_pci_probe for the second
> -		 * registered roothub.
> -		 */
> +		xhci = hcd_to_xhci(hcd->primary_hcd);
> +		*((struct xhci_hcd **) hcd->hcd_priv) = xhci;
> +
>  		return 0;
>  	}
>  
> -- 
> 2.1.0.rc2.206.gedb03e5
> 
> --
> 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/

-- 
balbi

Download attachment "signature.asc" of type "application/pgp-signature" (820 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ