464-spi-ath79-fix-fast-flash-read.patch 831 B

1234567891011121314151617181920212223242526272829303132333435
  1. --- a/drivers/mtd/devices/m25p80.c
  2. +++ b/drivers/mtd/devices/m25p80.c
  3. @@ -137,6 +137,9 @@ static int m25p80_read(struct spi_nor *n
  4. flash->command[0] = nor->read_opcode;
  5. m25p_addr2cmd(nor, from, flash->command);
  6. + if (dummy == 1)
  7. + t[0].dummy = true;
  8. +
  9. t[0].type = SPI_TRANSFER_FLASH_READ_CMD;
  10. t[0].tx_buf = flash->command;
  11. t[0].len = m25p_cmdsz(nor) + dummy;
  12. --- a/drivers/spi/spi-ath79.c
  13. +++ b/drivers/spi/spi-ath79.c
  14. @@ -260,6 +260,10 @@ static int ath79_spi_do_read_flash_cmd(s
  15. sp->read_addr = 0;
  16. len = t->len - 1;
  17. +
  18. + if (t->dummy)
  19. + len -= 1;
  20. +
  21. p = t->tx_buf;
  22. while (len--) {
  23. --- a/include/linux/spi/spi.h
  24. +++ b/include/linux/spi/spi.h
  25. @@ -633,6 +633,7 @@ struct spi_transfer {
  26. u16 delay_usecs;
  27. u32 speed_hz;
  28. enum spi_transfer_type type;
  29. + bool dummy;
  30. struct list_head transfer_list;
  31. };