• William Zhang's avatar
    spi: bcm63xx-hsspi: Add polling mode support · 50a6620d
    William Zhang authored
    Polling mode provides better throughput in general by avoiding the
    interrupt overhead as the maximum data size one interrupt can handle is
    only 512 bytes. So switch to polling mode as the default mode but add
    a driver sysfs option wait_mode to allow user manually changing the mode
    at run time between interrupt and polling. Also add driver banner
    message when the driver is loaded successfully.
    
    When test on a Broadcom BCM47622(ARM A7 dual core) reference board with
    WINBOND W25N01GV SPI NAND chip at 100MHz SPI clock using the MTD speed
    test suite, it shows about 15% improvement on the write and 30% on
    the read:
    ** Interrupt mode **
      mtd_speedtest: MTD device: 0    count: 16
      mtd_speedtest: MTD device size 134217728, eraseblock size 131072, page
    size 2048, count of eraseblocks 1024, pages per eraseblock 64, OOB size
    64
      mtd_test: scanning for bad eraseblocks
      mtd_test: scanned 16 eraseblocks, 0 are bad
      mtd_speedtest: testing eraseblock write speed
      mtd_speedtest: eraseblock write speed is 3072 KiB/s
      mtd_speedtest: testing eraseblock read speed
      mtd_speedtest: eraseblock read speed is 6690 KiB/s
      mtd_speedtest: testing page write speed
      mtd_speedtest: page write speed is 3066 KiB/s
      mtd_speedtest: testing page read speed
      mtd_speedtest: page read speed is 6762 KiB/s
      mtd_speedtest: testing 2 page write speed
      mtd_speedtest: 2 page write speed is 3071 KiB/s
      mtd_speedtest: testing 2 page read speed
      mtd_speedtest: 2 page read speed is 6772 KiB/s
    ** Polling mode **
      mtd_speedtest: MTD device: 0    count: 16
      mtd_speedtest: MTD device size 134217728, eraseblock size 131072, page
    size 2048, count of eraseblocks 1024, pages per eraseblock 64, OOB size
    64
      mtd_test: scanning for bad eraseblocks
      mtd_test: scanned 16 eraseblocks, 0 are bad
      mtd_speedtest: testing eraseblock write speed
      mtd_speedtest: eraseblock write speed is 3542 KiB/s
      mtd_speedtest: testing eraseblock read speed
      mtd_speedtest: eraseblock read speed is 8825 KiB/s
      mtd_speedtest: testing page write speed
      mtd_speedtest: page write speed is 3563 KiB/s
      mtd_speedtest: testing page read speed
      mtd_speedtest: page read speed is 8787 KiB/s
      mtd_speedtest: testing 2 page write speed
      mtd_speedtest: 2 page write speed is 3572 KiB/s
      mtd_speedtest: testing 2 page read speed
      mtd_speedtest: 2 page read speed is 8806 KiB/s
    Signed-off-by: default avatarWilliam Zhang <william.zhang@broadcom.com>
    
    Link: https://lore.kernel.org/r/20230207065826.285013-8-william.zhang@broadcom.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
    50a6620d
spi-bcm63xx-hsspi.c 16.4 KB