diff mbox series

spi: bcm63xx: fix max prepend length

Message ID 20230629071453.62024-1-jonas.gorski@gmail.com
State Accepted
Commit 5158814cbb37bbb38344b3ecddc24ba2ed0365f2
Headers show
Series spi: bcm63xx: fix max prepend length | expand

Commit Message

Jonas Gorski June 29, 2023, 7:14 a.m. UTC
The command word is defined as following:

    /* Command */
    #define SPI_CMD_COMMAND_SHIFT           0
    #define SPI_CMD_DEVICE_ID_SHIFT         4
    #define SPI_CMD_PREPEND_BYTE_CNT_SHIFT  8
    #define SPI_CMD_ONE_BYTE_SHIFT          11
    #define SPI_CMD_ONE_WIRE_SHIFT          12

If the prepend byte count field starts at bit 8, and the next defined
bit is SPI_CMD_ONE_BYTE at bit 11, it can be at most 3 bits wide, and
thus the max value is 7, not 15.

Fixes: b17de076062a ("spi/bcm63xx: work around inability to keep CS up")
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
---
 drivers/spi/spi-bcm63xx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Mark Brown July 12, 2023, 10:36 a.m. UTC | #1
On Thu, 29 Jun 2023 09:14:52 +0200, Jonas Gorski wrote:
> The command word is defined as following:
> 
>     /* Command */
>     #define SPI_CMD_COMMAND_SHIFT           0
>     #define SPI_CMD_DEVICE_ID_SHIFT         4
>     #define SPI_CMD_PREPEND_BYTE_CNT_SHIFT  8
>     #define SPI_CMD_ONE_BYTE_SHIFT          11
>     #define SPI_CMD_ONE_WIRE_SHIFT          12
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[1/1] spi: bcm63xx: fix max prepend length
      commit: 5158814cbb37bbb38344b3ecddc24ba2ed0365f2

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
diff mbox series

Patch

diff --git a/drivers/spi/spi-bcm63xx.c b/drivers/spi/spi-bcm63xx.c
index 9aecb77c3d89..07b5b71b2352 100644
--- a/drivers/spi/spi-bcm63xx.c
+++ b/drivers/spi/spi-bcm63xx.c
@@ -126,7 +126,7 @@  enum bcm63xx_regs_spi {
 	SPI_MSG_DATA_SIZE,
 };
 
-#define BCM63XX_SPI_MAX_PREPEND		15
+#define BCM63XX_SPI_MAX_PREPEND		7
 
 #define BCM63XX_SPI_MAX_CS		8
 #define BCM63XX_SPI_BUS_NUM		0