[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZsdR-G9S5nYbQX4s@finisterre.sirena.org.uk>
Date: Thu, 22 Aug 2024 15:58:00 +0100
From: Mark Brown <broonie@...nel.org>
To: Jinjie Ruan <ruanjinjie@...wei.com>
Cc: mcoquelin.stm32@...il.com, alexandre.torgue@...s.st.com,
linux-spi@...r.kernel.org, linux-stm32@...md-mailman.stormreply.com,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH -next] spi: stm32-qspi: Simpify resource lookup
On Tue, Aug 20, 2024 at 08:37:07PM +0800, Jinjie Ruan wrote:
> Use the devm_platform_ioremap_resource_byname() helper instead of
> calling platform_get_resource_byname() and devm_ioremap_resource()
> separately.
This breaks boot on the Avenger96 board, it causes a NULL pointer
dereference:
[ 2.350480] Unable to handle kernel NULL pointer dereference at virtual address 00000000 when read
...
[ 2.695787] Call trace:
[ 2.695807] stm32_qspi_probe from platform_probe+0x5c/0xb0
[ 2.703914] platform_probe from really_probe+0xc8/0x2c8
[ 2.709284] really_probe from __driver_probe_device+0x88/0x19c
[ 2.715145] __driver_probe_device from driver_probe_device+0x30/0x104
https://lava.sirena.org.uk/scheduler/job/650792
> - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "qspi");
> - qspi->io_base = devm_ioremap_resource(dev, res);
> + qspi->io_base = devm_platform_ioremap_resource_byname(pdev, "qspi");
> if (IS_ERR(qspi->io_base))
> return PTR_ERR(qspi->io_base);
>
> qspi->phys_base = res->start;
>
> - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "qspi_mm");
> - qspi->mm_base = devm_ioremap_resource(dev, res);
> + qspi->mm_base = devm_platform_ioremap_resource_byname(pdev, "qspi_mm");
> if (IS_ERR(qspi->mm_base))
> return PTR_ERR(qspi->mm_base);
I can't identify any obvious error here, these look like a direct
subsitution - the implementation of devm_platform_ioremap_resource_byname()
looks to be the same as the replaced code and dev is set to &pdev->dev
but I'm seeing the above behaviour.
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists