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] [day] [month] [year] [list]
Message-ID: <b15934cf-2a89-259d-c785-c3f6f090ecd7@ti.com>
Date:   Thu, 3 Nov 2016 12:49:00 -0500
From:   Grygorii Strashko <grygorii.strashko@...com>
To:     Sriram Dash <sriram.dash@....com>, <linux-kernel@...r.kernel.org>,
        <linux-usb@...r.kernel.org>
CC:     <mathias.nyman@...el.com>, <gregkh@...uxfoundation.org>,
        <suresh.gupta@....com>, <felipe.balbi@...ux.intel.com>,
        <stern@...land.harvard.edu>, <pku.leo@...il.com>,
        Arnd Bergmann <arnd@...db.de>,
        Sinjan Kumar <sinjank@...eaurora.org>,
        David Fisher <david.fisher1@...opsys.com>,
        Catalin Marinas <catalin.marinas@....com>,
        "Thang Q. Nguyen" <tqnguyen@....com>,
        Yoshihiro Shimoda <yoshihiro.shimoda.uh@...esas.com>,
        Stephen Boyd <sboyd@...eaurora.org>,
        Bjorn Andersson <bjorn.andersson@...aro.org>,
        Ming Lei <tom.leiming@...il.com>, Jon Masters <jcm@...hat.com>,
        Dann Frazier <dann.frazier@...onical.com>,
        Peter Chen <peter.chen@....com>
Subject: Re: [PATCH v2 1/6] usb: separate out sysdev pointer from usb_bus



On 11/02/2016 12:38 AM, Sriram Dash wrote:
> From: Arnd Bergmann <arnd@...db.de>
> 
> For xhci-hcd platform device, all the DMA parameters are not
> configured properly, notably dma ops for dwc3 devices.
> 
> The idea here is that you pass in the parent of_node along with
> the child device pointer, so it would behave exactly like the
> parent already does. The difference is that it also handles all
> the other attributes besides the mask.
> 
> sysdev will represent the physical device, as seen from firmware
> or bus.Splitting the usb_bus->controller field into the
> Linux-internal device (used for the sysfs hierarchy, for printks
> and for power management) and a new pointer (used for DMA,
> DT enumeration and phy lookup) probably covers all that we really
> need.
> 
> Signed-off-by: Arnd Bergmann <arnd@...db.de>
> Signed-off-by: Sriram Dash <sriram.dash@....com>
> Cc: Felipe Balbi <felipe.balbi@...ux.intel.com>
> Cc: Grygorii Strashko <grygorii.strashko@...com>
> Cc: Sinjan Kumar <sinjank@...eaurora.org>
> Cc: David Fisher <david.fisher1@...opsys.com>
> Cc: Catalin Marinas <catalin.marinas@....com>
> Cc: "Thang Q. Nguyen" <tqnguyen@....com>
> Cc: Yoshihiro Shimoda <yoshihiro.shimoda.uh@...esas.com>
> Cc: Stephen Boyd <sboyd@...eaurora.org>
> Cc: Bjorn Andersson <bjorn.andersson@...aro.org>
> Cc: Ming Lei <tom.leiming@...il.com>
> Cc: Jon Masters <jcm@...hat.com>
> Cc: Dann Frazier <dann.frazier@...onical.com>
> Cc: Peter Chen <peter.chen@....com>
> Cc: Leo Li <pku.leo@...il.com>
> ---
> Changes in v2:
>   - Split the patch wrt driver
> 
>  drivers/usb/core/buffer.c | 12 ++++++------
>  drivers/usb/core/hcd.c    | 48 ++++++++++++++++++++++++++++-------------------
>  drivers/usb/core/usb.c    | 18 +++++++++---------
>  include/linux/usb.h       |  1 +
>  include/linux/usb/hcd.h   |  3 +++
>  5 files changed, 48 insertions(+), 34 deletions(-)
> 
> diff --git a/drivers/usb/core/buffer.c b/drivers/usb/core/buffer.c
> index 98e39f9..1e41ef7 100644
> --- a/drivers/usb/core/buffer.c
> +++ b/drivers/usb/core/buffer.c
> @@ -63,7 +63,7 @@ int hcd_buffer_create(struct usb_hcd *hcd)
>  	int		i, size;
>  
>  	if (!IS_ENABLED(CONFIG_HAS_DMA) ||
> -	    (!hcd->self.controller->dma_mask &&
> +	    (!hcd->self.sysdev->dma_mask &&

I think code shouldn't access DMA props directly, so may be
is_device_dma_capable() is right API to use here (and other places).

>  	     !(hcd->driver->flags & HCD_LOCAL_MEM)))
>  		return 0;
>  
> @@ -72,7 +72,7 @@ int hcd_buffer_create(struct usb_hcd *hcd)
>  		if (!size)
>  			continue;
>  		snprintf(name, sizeof(name), "buffer-%d", size);
> -		hcd->pool[i] = dma_pool_create(name, hcd->self.controller,
> +		hcd->pool[i] = dma_pool_create(name, hcd->self.sysdev,
>  				size, size, 0);
>  		if (!hcd->pool[i]) {
>  			hcd_buffer_destroy(hcd);
> @@ -127,7 +127,7 @@ void *hcd_buffer_alloc(
>  

-- 
regards,
-grygorii

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ