• Qipan Li's avatar
    spi: sirf: fix the issue while transferring more than 256 words · 237ce466
    Qipan Li authored
    currently, spi irq handler only does rx processing and fetching data from rx
    fifo when "FRM_END" irq happens. FRM_END indicates one transfer completes. if
    rx size is less than 256, it works well.
    but the problem is that spi rx fifo size is only 256 bytes, then if data size
    of one frame is more than 256, before FRM_END comes, rx fifo will be filled with
    RXFIFO_OFLOW overflow interrupt, it will make us lose some data due to fifo
    overflow.
    Explicitly we need do fetch work from device rx fifo in irq handler not only in
    "FRM_END" irq but also in "THD_REACH" irq. THD_REACH means rx fifo has come to
    its threshold and will come to overflow if we don't take data from it in time.
    
    In this patch, we fix this issue. we take data from rx fifo when either FRM_END
    or RX_THD_REACH irq comes, we put data into tx fifo when either TX_FIFO_EMPTY
    or TX_THD_REACH irq comes.
    Signed-off-by: default avatarQipan Li <Qipan.Li@csr.com>
    Signed-off-by: default avatarZhiwu Song <Zhiwu.Song@csr.com>
    Signed-off-by: default avatarBarry Song <Baohua.Song@csr.com>
    Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
    237ce466
spi-sirf.c 17.9 KB