diff options
author | Hauke Mehrtens <hauke@hauke-m.de> | 2017-03-12 12:30:30 +0100 |
---|---|---|
committer | Hauke Mehrtens <hauke@hauke-m.de> | 2017-03-12 15:45:50 +0100 |
commit | 9a065fcfecbf344812a92dbd9b28298da7ef2b74 (patch) | |
tree | c01ee36c2d11f00cd1f66953e100c1316bc6453e /target/linux/ipq806x/patches-4.9/0009-spi-qup-Fix-block-mode-to-work-correctly.patch | |
parent | f5d403488ed62bb7f0e0017b02890b4d72240a55 (diff) | |
download | mtk-20170518-9a065fcfecbf344812a92dbd9b28298da7ef2b74.zip mtk-20170518-9a065fcfecbf344812a92dbd9b28298da7ef2b74.tar.gz mtk-20170518-9a065fcfecbf344812a92dbd9b28298da7ef2b74.tar.bz2 |
kernel: update kernel 4.9 to 4.9.14
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Diffstat (limited to 'target/linux/ipq806x/patches-4.9/0009-spi-qup-Fix-block-mode-to-work-correctly.patch')
-rw-r--r-- | target/linux/ipq806x/patches-4.9/0009-spi-qup-Fix-block-mode-to-work-correctly.patch | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/target/linux/ipq806x/patches-4.9/0009-spi-qup-Fix-block-mode-to-work-correctly.patch b/target/linux/ipq806x/patches-4.9/0009-spi-qup-Fix-block-mode-to-work-correctly.patch index e9e22b8..2f316b1 100644 --- a/target/linux/ipq806x/patches-4.9/0009-spi-qup-Fix-block-mode-to-work-correctly.patch +++ b/target/linux/ipq806x/patches-4.9/0009-spi-qup-Fix-block-mode-to-work-correctly.patch @@ -49,11 +49,11 @@ Signed-off-by: Andy Gross <andy.gross@linaro.org> - int idx, shift, w_size; - - w_size = controller->w_size; -- -- while (controller->rx_bytes < xfer->len) { + int i, shift, num_bytes; + u32 word; +- while (controller->rx_bytes < xfer->len) { +- - state = readl_relaxed(controller->base + QUP_OPERATIONAL); - if (0 == (state & QUP_OP_IN_FIFO_NOT_EMPTY)) - break; @@ -95,20 +95,16 @@ Signed-off-by: Andy Gross <andy.gross@linaro.org> - int idx, w_size; + u32 remainder, words_per_block, num_words; + bool is_block_mode = controller->mode == QUP_IO_M_MODE_BLOCK; - -- w_size = controller->w_size; ++ + remainder = DIV_ROUND_UP(xfer->len - controller->rx_bytes, + controller->w_size); + words_per_block = controller->in_blk_sz >> 2; - -- while (controller->tx_bytes < xfer->len) { ++ + do { + /* ACK by clearing service flag */ + writel_relaxed(QUP_OP_IN_SERVICE_FLAG, + controller->base + QUP_OPERATIONAL); - -- state = readl_relaxed(controller->base + QUP_OPERATIONAL); -- if (state & QUP_OP_OUT_FIFO_FULL) ++ + if (is_block_mode) { + num_words = (remainder > words_per_block) ? + words_per_block : remainder; @@ -116,15 +112,19 @@ Signed-off-by: Andy Gross <andy.gross@linaro.org> + if (!spi_qup_is_flag_set(controller, + QUP_OP_IN_FIFO_NOT_EMPTY)) + break; -+ + +- w_size = controller->w_size; + num_words = 1; + } + + /* read up to the maximum transfer size available */ + spi_qup_read_from_fifo(controller, xfer, num_words); -+ + +- while (controller->tx_bytes < xfer->len) { + remainder -= num_words; -+ + +- state = readl_relaxed(controller->base + QUP_OPERATIONAL); +- if (state & QUP_OP_OUT_FIFO_FULL) + /* if block mode, check to see if next block is available */ + if (is_block_mode && !spi_qup_is_flag_set(controller, + QUP_OP_IN_BLOCK_READ_REQ)) |