linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Roger Quadros <rogerq@ti.com>
To: Pawel Laszczak <pawell@cadence.com>, <felipe.balbi@linux.intel.com>
Cc: <gregkh@linuxfoundation.org>, <linux-usb@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <jbergsagel@ti.com>,
	<nsekhar@ti.com>, <nm@ti.com>, <sureshp@cadence.com>,
	<peter.chen@nxp.com>, <kurahul@cadence.com>
Subject: Re: [PATCH] usb: cdns3: Fix for incorrect DMA mask.
Date: Mon, 7 Oct 2019 15:20:25 +0300	[thread overview]
Message-ID: <fc2b8ebb-f7f8-555e-ec36-bad2e531d194@ti.com> (raw)
In-Reply-To: <1570449803-15299-1-git-send-email-pawell@cadence.com>



On 07/10/2019 15:03, Pawel Laszczak wrote:
> This patch restores the correct DMA mask after switching back to device
> mode.
> The issue occurred because Device part of controller use 32 bits DMA and
> Host side use 64 bits DMA. During loading XHCI driver the DMA mask
> used by driver is overwritten by XHCI driver so it must be restored
> to 32 bits.
> 
> Reported-by: Pawel Laszczak <pawell@cadence.com>
> Signed-off-by: Roger Quadros <rogerq@ti.com>
> Signed-off-by: Pawel Laszczak <pawell@cadence.com>
> Fixes: 7733f6c32e36 ("usb: cdns3: Add Cadence USB3 DRD Driver")

Tested-by: Roger Quadros <rogerq@ti.com>

> ---
>   drivers/usb/cdns3/gadget.c | 7 +++++++
>   1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/usb/cdns3/gadget.c b/drivers/usb/cdns3/gadget.c
> index 157536753b8c..2ca280f4c054 100644
> --- a/drivers/usb/cdns3/gadget.c
> +++ b/drivers/usb/cdns3/gadget.c
> @@ -2663,6 +2663,13 @@ static int __cdns3_gadget_init(struct cdns3 *cdns)
>   {
>   	int ret = 0;
>   
> +	/* Ensure 32-bit DMA Mask in case we switched back from Host mode */
> +	ret = dma_set_mask_and_coherent(cdns->dev, DMA_BIT_MASK(32));
> +	if (ret) {
> +		dev_err(cdns->dev, "Failed to set dma mask: %d\n", ret);
> +		return ret;
> +	}
> +
>   	cdns3_drd_switch_gadget(cdns, 1);
>   	pm_runtime_get_sync(cdns->dev);
>   
> 

-- 
cheers,
-roger

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

  reply	other threads:[~2019-10-07 12:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-07 12:03 [PATCH] usb: cdns3: Fix for incorrect DMA mask Pawel Laszczak
2019-10-07 12:20 ` Roger Quadros [this message]
2019-10-08  8:03 ` Peter Chen

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=fc2b8ebb-f7f8-555e-ec36-bad2e531d194@ti.com \
    --to=rogerq@ti.com \
    --cc=felipe.balbi@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jbergsagel@ti.com \
    --cc=kurahul@cadence.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=nm@ti.com \
    --cc=nsekhar@ti.com \
    --cc=pawell@cadence.com \
    --cc=peter.chen@nxp.com \
    --cc=sureshp@cadence.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;
as well as URLs for NNTP newsgroup(s).