From: James Clark <james.clark@linaro.org>
To: Vladimir Oltean <olteanv@gmail.com>
Cc: Mark Brown <broonie@kernel.org>, Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>, Frank Li <Frank.Li@nxp.com>,
Chester Lin <chester62515@gmail.com>,
Matthias Brugger <mbrugger@suse.com>,
Ghennadi Procopciuc <ghennadi.procopciuc@oss.nxp.com>,
NXP S32 Linux Team <s32@nxp.com>, Shawn Guo <shawnguo@kernel.org>,
Sascha Hauer <s.hauer@pengutronix.de>,
Pengutronix Kernel Team <kernel@pengutronix.de>,
Fabio Estevam <festevam@gmail.com>,
larisa.grigore@nxp.com, arnd@linaro.org,
andrei.stefanescu@nxp.com, dan.carpenter@linaro.org,
linux-spi@vger.kernel.org, imx@lists.linux.dev,
linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
Xulin Sun <xulin.sun@windriver.com>
Subject: Re: [PATCH 03/14] spi: spi-fsl-dspi: restrict register range for regmap access
Date: Mon, 19 May 2025 11:25:53 +0100 [thread overview]
Message-ID: <8b7be083-cef8-4b68-af4a-2bb5b30a9b9c@linaro.org> (raw)
In-Reply-To: <20250509140622.n2tc3dd23ylyux72@skbuf>
On 09/05/2025 3:06 pm, Vladimir Oltean wrote:
> On Fri, May 09, 2025 at 12:05:50PM +0100, James Clark wrote:
>> From: Larisa Grigore <larisa.grigore@nxp.com>
>>
>> DSPI registers are NOT continuous, some registers are reserved and
>> accessing them from userspace will trigger external abort, add regmap
>> register access table to avoid below abort:
>>
>> Internal error: synchronous external abort: 96000210 1 PREEMPT SMP
>> Modules linked in: fuse dummy tun hse sch_fq_codel openvswitch nsh
>> nf_conncount nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4
>> CPU: 2 PID: 18231 Comm: read_all Not tainted 5.2.33-yocto-standard #1
>> Hardware name: Freescale S32G275 (DT)
>> pstate: 20000085 (nzCv daIf -PAN -UAO)
>> pc : regmap_mmio_read32le+0x24/0x48
>> lr : regmap_mmio_read+0x48/0x70
>> sp : ffffff801123bb70
>> x29: ffffff801123bb70 x28: ffffffc873b5c000
>> x27: ffffff8010b408f0 x26: 0000000000000001
>> x25: 000000000000013c x24: ffffff801123be40
>> x23: 00000000000003ff x22: ffffff801123bcfc
>> x21: ffffff801123bcfc x20: ffffffc873a9e500
>> x19: 0000000000000024 x18: 0000000000000020
>> x17: 0000000000000000 x16: 0000000000000000
>> x15: ffffffc876189160 x14: 0000000000000003
>> x13: ffffffc873bf73ff x12: ffffffc873bf707e
>> x11: 0000000000000000 x10: 0000000000000000
>> x9 : 0000000000000000 x8 : ffffffc83fca4e00
>> x7 : 000000000000000f x6 : ffffffc873bf7083
>> x5 : 00000000fffffff9 x4 : 0000000000000002
>> x3 : ffffff801061f058 x2 : ffffff801061ee18
>> x1 : 0000000000000024 x0 : ffffff8011490024
>
> I think you can leave the register dump out, it doesn't seem of much use.
>
Will reduce the output and add a reproducer and fixes: tag.
>> Call trace:
>> regmap_mmio_read32le+0x24/0x48
>> regmap_mmio_read+0x48/0x70
>> _regmap_bus_reg_read+0x38/0x48
>> _regmap_read+0x68/0x1b0
>> regmap_read+0x50/0x78
>> regmap_read_debugfs+0x120/0x338
>> regmap_map_read_file+0x44/0x58
>> full_proxy_read+0x68/0x98
>> __vfs_read+0x48/0x90
>> vfs_read+0xb0/0x130
>> ksys_read+0x7c/0x108
>> __arm64_sys_read+0x24/0x30
>> el0_svc_common.constprop.0+0x74/0x168
>> el0_svc_handler+0x70/0x90
>> el0_svc+0x8/0xc
>>
>> Co-developed-by: Xulin Sun <xulin.sun@windriver.com>
>> Signed-off-by: Xulin Sun <xulin.sun@windriver.com>
>> Signed-off-by: Larisa Grigore <larisa.grigore@nxp.com>
>> Signed-off-by: James Clark <james.clark@linaro.org>
>> ---
>
> Do you have a reproducer for any of the supported SoCs? On LS1028A, "cat
> /sys/kernel/debug/regmap/2120000.spi/registers" runs fine and does not
> crash.
On S32G3:
# cat /sys/kernel/debug/regmap/401d8000.spi/registers
Internal error: synchronous external abort: 0000000096000210 [#1] SMP
regmap_mmio_read32le+0x14/0x38 (P)
_regmap_bus_reg_read+0x104/0x140
_regmap_read+0x19c/0x2d0
regmap_read+0x60/0x90
regmap_read_debugfs+0x15c/0x330
...
Not sure why it wouldn't be the same on LS1028A because the register
layout is basically the same. Maybe it just ignores the read instead?
Either way I think the fix is still worthwhile to backport because we
won't be able to test every device.
next prev parent reply other threads:[~2025-05-19 10:25 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-09 11:05 [PATCH 00/14] spi: spi-fsl-dspi: DSPI support for NXP S32G platforms James Clark
2025-05-09 11:05 ` [PATCH 01/14] spi: spi-fsl-dspi: Define regmaps per device James Clark
2025-05-09 16:04 ` Vladimir Oltean
2025-05-09 11:05 ` [PATCH 02/14] spi: spi-fsl-dspi: Re-use one volatile regmap for both device types James Clark
2025-05-09 16:07 ` Vladimir Oltean
2025-05-09 11:05 ` [PATCH 03/14] spi: spi-fsl-dspi: restrict register range for regmap access James Clark
2025-05-09 14:06 ` Vladimir Oltean
2025-05-19 10:25 ` James Clark [this message]
2025-05-10 1:16 ` Mark Brown
2025-05-09 11:05 ` [PATCH 04/14] spi: spi-fsl-dspi: Add config and regmaps for S32G platforms James Clark
2025-05-09 11:05 ` [PATCH 05/14] spi: spi-fsl-dspi: Use spi_alloc_target for target James Clark
2025-05-09 11:05 ` [PATCH 06/14] spi: spi-fsl-dspi: Avoid setup_accel logic for DMA transfers James Clark
2025-05-09 11:05 ` [PATCH 07/14] spi: spi-fsl-dspi: Reset SR flags before sending a new message James Clark
2025-05-09 11:05 ` [PATCH 08/14] spi: spi-fsl-dspi: Use DMA for S32G controller in target mode James Clark
2025-05-09 11:05 ` [PATCH 09/14] spi: spi-fsl-dspi: Reinitialize DSPI regs after resuming for S32G James Clark
2025-05-09 11:05 ` [PATCH 10/14] spi: spi-fsl-dspi: Enable modified transfer protocol James Clark
2025-05-10 1:18 ` Mark Brown
2025-05-15 12:20 ` James Clark
2025-05-09 11:05 ` [PATCH 11/14] spi: spi-fsl-dspi: Halt the module after a new message transfer James Clark
2025-05-10 1:19 ` Mark Brown
2025-05-09 11:05 ` [PATCH 12/14] dt-bindings: spi: dspi: Add S32G support James Clark
2025-05-09 11:14 ` Krzysztof Kozlowski
2025-05-09 11:26 ` James Clark
2025-05-09 11:06 ` [PATCH 13/14] spi: spi-fsl-dspi: Enable support for S32G platforms James Clark
2025-05-09 11:06 ` [PATCH 14/14] arm64: dts: Add DSPI entries " James Clark
2025-05-09 11:26 ` Krzysztof Kozlowski
2025-05-09 12:54 ` Matti Vaittinen
2025-05-09 13:46 ` James Clark
2025-05-09 13:57 ` Krzysztof Kozlowski
2025-05-09 14:17 ` [PATCH 00/14] spi: spi-fsl-dspi: DSPI support for NXP " Rob Herring (Arm)
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=8b7be083-cef8-4b68-af4a-2bb5b30a9b9c@linaro.org \
--to=james.clark@linaro.org \
--cc=Frank.Li@nxp.com \
--cc=andrei.stefanescu@nxp.com \
--cc=arnd@linaro.org \
--cc=broonie@kernel.org \
--cc=chester62515@gmail.com \
--cc=conor+dt@kernel.org \
--cc=dan.carpenter@linaro.org \
--cc=devicetree@vger.kernel.org \
--cc=festevam@gmail.com \
--cc=ghennadi.procopciuc@oss.nxp.com \
--cc=imx@lists.linux.dev \
--cc=kernel@pengutronix.de \
--cc=krzk+dt@kernel.org \
--cc=larisa.grigore@nxp.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=mbrugger@suse.com \
--cc=olteanv@gmail.com \
--cc=robh@kernel.org \
--cc=s.hauer@pengutronix.de \
--cc=s32@nxp.com \
--cc=shawnguo@kernel.org \
--cc=xulin.sun@windriver.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