* [PATCH] spi-rockchip: Fix register out of bounds access
@ 2025-03-21 12:57 Luis de Arquer
2025-03-26 16:21 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Luis de Arquer @ 2025-03-21 12:57 UTC (permalink / raw)
To: linux-spi, linux-rockchip
Cc: broonie, heiko, linux-arm-kernel, Robin Murphy, luis.dearquer
From: Luis de Arquer <luis.dearquer@inertim.com>
Do not write native chip select stuff for GPIO chip selects.
GPIOs can be numbered much higher than native CS.
Also, it makes no sense.
Signed-off-by: Luis de Arquer <luis.dearquer@inertim.com>
---
drivers/spi/spi-rockchip.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/spi/spi-rockchip.c b/drivers/spi/spi-rockchip.c
index 1bc012fce..1a6381de6 100644
--- a/drivers/spi/spi-rockchip.c
+++ b/drivers/spi/spi-rockchip.c
@@ -547,7 +547,7 @@ static int rockchip_spi_config(struct rockchip_spi *rs,
cr0 |= (spi->mode & 0x3U) << CR0_SCPH_OFFSET;
if (spi->mode & SPI_LSB_FIRST)
cr0 |= CR0_FBM_LSB << CR0_FBM_OFFSET;
- if (spi->mode & SPI_CS_HIGH)
+ if ((spi->mode & SPI_CS_HIGH) && !(spi_get_csgpiod(spi, 0)))
cr0 |= BIT(spi_get_chipselect(spi, 0)) << CR0_SOI_OFFSET;
if (xfer->rx_buf && xfer->tx_buf)
--
2.43.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] spi-rockchip: Fix register out of bounds access
2025-03-21 12:57 [PATCH] spi-rockchip: Fix register out of bounds access Luis de Arquer
@ 2025-03-26 16:21 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2025-03-26 16:21 UTC (permalink / raw)
To: linux-spi, linux-rockchip, Luis de Arquer
Cc: heiko, linux-arm-kernel, Robin Murphy, luis.dearquer
On Fri, 21 Mar 2025 13:57:53 +0100, Luis de Arquer wrote:
> Do not write native chip select stuff for GPIO chip selects.
> GPIOs can be numbered much higher than native CS.
> Also, it makes no sense.
>
>
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next
Thanks!
[1/1] spi-rockchip: Fix register out of bounds access
commit: 7a874e8b54ea21094f7fd2d428b164394c6cb316
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-03-26 16:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-21 12:57 [PATCH] spi-rockchip: Fix register out of bounds access Luis de Arquer
2025-03-26 16:21 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox