public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Grygorii Strashko <grygorii.strashko@ti.com>
To: Sriram Dash <sriram.dash@nxp.com>, <linux-kernel@vger.kernel.org>,
	<linux-usb@vger.kernel.org>
Cc: <mathias.nyman@intel.com>, <gregkh@linuxfoundation.org>,
	<suresh.gupta@nxp.com>, <felipe.balbi@linux.intel.com>,
	<stern@rowland.harvard.edu>, <pku.leo@gmail.com>,
	Arnd Bergmann <arnd@arndb.de>,
	Sinjan Kumar <sinjank@codeaurora.org>,
	David Fisher <david.fisher1@synopsys.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	"Thang Q. Nguyen" <tqnguyen@apm.com>,
	Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>,
	Stephen Boyd <sboyd@codeaurora.org>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	Ming Lei <tom.leiming@gmail.com>, Jon Masters <jcm@redhat.com>,
	Dann Frazier <dann.frazier@canonical.com>,
	Peter Chen <peter.chen@nxp.com>
Subject: Re: [PATCH v2 1/6] usb: separate out sysdev pointer from usb_bus
Date: Thu, 3 Nov 2016 12:49:00 -0500	[thread overview]
Message-ID: <b15934cf-2a89-259d-c785-c3f6f090ecd7@ti.com> (raw)
In-Reply-To: <1478065093-6923-2-git-send-email-sriram.dash@nxp.com>



On 11/02/2016 12:38 AM, Sriram Dash wrote:
> From: Arnd Bergmann <arnd@arndb.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@arndb.de>
> Signed-off-by: Sriram Dash <sriram.dash@nxp.com>
> Cc: Felipe Balbi <felipe.balbi@linux.intel.com>
> Cc: Grygorii Strashko <grygorii.strashko@ti.com>
> Cc: Sinjan Kumar <sinjank@codeaurora.org>
> Cc: David Fisher <david.fisher1@synopsys.com>
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: "Thang Q. Nguyen" <tqnguyen@apm.com>
> Cc: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
> Cc: Stephen Boyd <sboyd@codeaurora.org>
> Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
> Cc: Ming Lei <tom.leiming@gmail.com>
> Cc: Jon Masters <jcm@redhat.com>
> Cc: Dann Frazier <dann.frazier@canonical.com>
> Cc: Peter Chen <peter.chen@nxp.com>
> Cc: Leo Li <pku.leo@gmail.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

  reply	other threads:[~2016-11-03 17:49 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-02  5:38 [PATCH v2 0/6] inherit dma configuration from parent dev Sriram Dash
2016-11-02  5:38 ` [PATCH v2 1/6] usb: separate out sysdev pointer from usb_bus Sriram Dash
2016-11-03 17:49   ` Grygorii Strashko [this message]
2016-11-02  5:38 ` [PATCH v2 2/6] usb: chipidea: use bus->sysdev for DMA configuration Sriram Dash
2016-11-02  6:03   ` Peter Chen
2016-11-02  5:38 ` [PATCH v2 3/6] usb: ehci: fsl: " Sriram Dash
2016-11-02  8:53   ` kbuild test robot
2016-11-02  9:26   ` Sriram Dash
2016-11-02  5:38 ` [PATCH v2 4/6] usb: xhci: " Sriram Dash
2016-11-02  5:38 ` [PATCH v2 5/6] usb: dwc3: " Sriram Dash
2016-11-02  5:38 ` [PATCH v2 6/6] usb: dwc3: Do not set dma coherent mask Sriram Dash

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=b15934cf-2a89-259d-c785-c3f6f090ecd7@ti.com \
    --to=grygorii.strashko@ti.com \
    --cc=arnd@arndb.de \
    --cc=bjorn.andersson@linaro.org \
    --cc=catalin.marinas@arm.com \
    --cc=dann.frazier@canonical.com \
    --cc=david.fisher1@synopsys.com \
    --cc=felipe.balbi@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jcm@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mathias.nyman@intel.com \
    --cc=peter.chen@nxp.com \
    --cc=pku.leo@gmail.com \
    --cc=sboyd@codeaurora.org \
    --cc=sinjank@codeaurora.org \
    --cc=sriram.dash@nxp.com \
    --cc=stern@rowland.harvard.edu \
    --cc=suresh.gupta@nxp.com \
    --cc=tom.leiming@gmail.com \
    --cc=tqnguyen@apm.com \
    --cc=yoshihiro.shimoda.uh@renesas.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