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: <fc2b8ebb-f7f8-555e-ec36-bad2e531d194@ti.com>
Date:   Mon, 7 Oct 2019 15:20:25 +0300
From:   Roger Quadros <rogerq@...com>
To:     Pawel Laszczak <pawell@...ence.com>, <felipe.balbi@...ux.intel.com>
CC:     <gregkh@...uxfoundation.org>, <linux-usb@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>, <jbergsagel@...com>,
        <nsekhar@...com>, <nm@...com>, <sureshp@...ence.com>,
        <peter.chen@....com>, <kurahul@...ence.com>
Subject: Re: [PATCH] usb: cdns3: Fix for incorrect DMA mask.



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@...ence.com>
> Signed-off-by: Roger Quadros <rogerq@...com>
> Signed-off-by: Pawel Laszczak <pawell@...ence.com>
> Fixes: 7733f6c32e36 ("usb: cdns3: Add Cadence USB3 DRD Driver")

Tested-by: Roger Quadros <rogerq@...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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ