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: <1e61b277-b690-ed54-95ea-59a976773050@kontron.de>
Date:   Thu, 16 Apr 2020 12:04:03 +0000
From:   Schrempf Frieder <frieder.schrempf@...tron.de>
To:     Ashish Kumar <Ashish.Kumar@....com>,
        "broonie@...nel.org" <broonie@...nel.org>,
        "boris.brezillon@...labora.com" <boris.brezillon@...labora.com>
CC:     "linux-spi@...r.kernel.org" <linux-spi@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Kuldeep Singh <kuldeep.singh@....com>
Subject: Re: [PATCH v3] spi: spi-fsl-qspi: Reduce devm_ioremap size to 4 times
 AHB buffer size

On 16.04.20 13:43, Ashish Kumar wrote:
> Reduce devm_ioremap size to (4 * AHB_BUFER_SIZE) rather than mapping
> complete QSPI-Memmory as driver is now independent of flash size.
> Flash of any size can be accessed.
> 
> Issue was reported on platform where devm_ioremap failure is observed
> with size > 256M.
> Error log on LS1021ATWR :
>   fsl-quadspi 1550000.spi: ioremap failed for resource [mem 0x40000000-0x7fffffff]
>   fsl-quadspi 1550000.spi: Freescale QuadSPI probe failed
>   fsl-quadspi: probe of 1550000.spi failed with error -12
> 
> This change was also suggested previously:
> https://eur04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatchwork.kernel.org%2Fpatch%2F10508753%2F%2322166385&amp;data=02%7C01%7Cfrieder.schrempf%40kontron.de%7Cf2c2455908884198277708d7e1fb6146%7C8c9d3c973fd941c8a2b1646f3942daf1%7C0%7C0%7C637226342094777031&amp;sdata=QeApGgupC4RwfbSnQLIXs41o7VYKK747NCrZzn%2FRZKQ%3D&amp;reserved=0
> 
> Suggested-by: Boris Brezillon <boris.brezillon@...labora.com>
> Signed-off-by: Kuldeep Singh <kuldeep.singh@....com>
> Signed-off-by: Ashish Kumar <Ashish.kumar@....com>

Reviewed-by: Frieder Schrempf <frieder.schrempf@...tron.de>

> ---
> v3:
> Update comment
> v2:
> Add Suggested-by: Boris Brezillon <boris.brezillon@...labora.com>
> Incorrporate review comments from Frieder
>   drivers/spi/spi-fsl-qspi.c | 7 ++++---
>   1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/spi/spi-fsl-qspi.c b/drivers/spi/spi-fsl-qspi.c
> index 63c9f7e..8b95e2f 100644
> --- a/drivers/spi/spi-fsl-qspi.c
> +++ b/drivers/spi/spi-fsl-qspi.c
> @@ -859,14 +859,15 @@ static int fsl_qspi_probe(struct platform_device *pdev)
>   
>   	res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
>   					"QuadSPI-memory");
> -	q->ahb_addr = devm_ioremap_resource(dev, res);
> +	q->memmap_phy = res->start;
> +	/* Since there are 4 cs, map size required is 4 times ahb_buf_size */
> +	q->ahb_addr = devm_ioremap(dev, q->memmap_phy,
> +				   (q->devtype_data->ahb_buf_size * 4));
>   	if (IS_ERR(q->ahb_addr)) {
>   		ret = PTR_ERR(q->ahb_addr);
>   		goto err_put_ctrl;
>   	}
>   
> -	q->memmap_phy = res->start;
> -
>   	/* find the clocks */
>   	q->clk_en = devm_clk_get(dev, "qspi_en");
>   	if (IS_ERR(q->clk_en)) {
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ