spi/bcm63xx: don't substract prepend length from total length
Subsystems (2)
PATCH 1/2 spi/bcm63xx: don't substract prepend length from total length
The spi command must include the full message length including any prepended writes, else transfers larger than 256 bytes will be incomplete.
--- drivers/spi/spi-bcm63xx.c | 2 -- 1 file changed, 2 deletions(-)
drivers/spi/spi-bcm63xx.c +0 -2
@@ -169,8 +169,6 @@ static int bcm63xx_txrx_bufs(struct spi_device *spi, struct spi_transfer *first, transfer_list); } - len -= prepend_len; -init_completion (&bs->done);/* Fill in the Message control register */
Signature · 5 lines
1.8.4.rc3 -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 1385912662-8261-1-git-send-email-jogo-p3rKhJxN3npAfugRpC6u6w@public.gmane.org
PATCH 2/2 spi/bcm63xx: don't reject reads >= 256 bytes
The rx_tail register is only 8 bit wide, so it will wrap around after 256 read bytes. This makes it rather meaningless, so drop any usage of it to not treat reads over 256 as failed.
--- drivers/spi/spi-bcm63xx.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-)
drivers/spi/spi-bcm63xx.c +1 -7
@@ -203,13 +203,7 @@ static int bcm63xx_txrx_bufs(struct spi_device *spi, struct spi_transfer *first,if (!timeout)return -ETIMEDOUT ; -/* read out all data */ - rx_tail =bcm_spi_readb (bs,SPI_RX_TAIL ); - -if (do_rx && rx_tail != len) -return -EIO ; - -if (!rx_tail) +if (!do_rx)return 0 ; len =0 ;
Signature · 5 lines
1.8.4.rc3 -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 1385912662-8261-2-git-send-email-jogo-p3rKhJxN3npAfugRpC6u6w@public.gmane.org
Florian Fainelli
Acked-byRe: [PATCH 2/2] spi/bcm63xx: don't reject reads >= 256 bytes
2013/12/1 Jonas Gorski <[email protected]>:
Quoted 5 lines
The
rx_tailregister is only 8 bit wide, so it will wrap around after 256 read bytes. This makes it rather meaningless, so drop any usage of it to not treat reads over 256 as failed.Signed-off-by Jonas Gorski <[email protected]>
Looks good:
Quoted 25 lines
--- drivers/spi/spi-bcm63xx.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-)drivers/spi/spi-bcm63xx.c +1
-8@@ -203,13 +203,7 @@ static int bcm63xx_txrx_bufs(struct spi_device *spi, struct spi_transfer *first,if (!timeout)return -ETIMEDOUT ; -/* read out all data */ - rx_tail =bcm_spi_readb (bs,SPI_RX_TAIL ); - -if (do_rx && rx_tail != len) -return -EIO ; - -if (!rx_tail) +if (!do_rx)return 0 ; len =0 ; --1.8.4.rc3
Signature · 5 lines
Florian -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Florian Fainelli
Acked-by2013/12/1 Jonas Gorski <[email protected]>:
Quoted 5 lines
The spi command must include the full message length including any prepended writes, else transfers larger than 256 bytes will be incomplete.
Signed-off-by Jonas Gorski <[email protected]>
Looks good:
Quoted 19 lines
--- drivers/spi/spi-bcm63xx.c | 2 -- 1 file changed, 2 deletions(-)drivers/spi/spi-bcm63xx.c +0
-3@@ -169,8 +169,6 @@ static int bcm63xx_txrx_bufs(struct spi_device *spi, struct spi_transfer *first, transfer_list); } - len -= prepend_len; -init_completion (&bs->done);/* Fill in the Message control register */ --1.8.4.rc3
Signature · 5 lines
Florian -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html