Dear Geert-san
Thank you very much for your comments!
On 2019/01/11 18:09, Geert Uytterhoeven wrote:
Hi Hoan-san,
On Fri, Jan 11, 2019 at 9:59 AM Nguyen An Hoan <na-hoan@xxxxxxxxxxx> wrote:
From: Hoan Nguyen An <na-hoan@xxxxxxxxxxx>
Currently, this driver only supports feature for DMA 32-bits.
In this case, only if the data length is divisible by 4 to use
DMA, otherwise PIO will be used. This patch will suggest use
the DMA 32-bits with 4bytes of words, then the remaining data
will be transmitted by PIO mode.
Signed-off-by: Hoan Nguyen An <na-hoan@xxxxxxxxxxx>
Thanks for your patch, that's a great idea!
Reviewed-by: Geert Uytterhoeven <geert+renesas@xxxxxxxxx>
with a small suggestion below.
Currently, I only test the transmit-receive spi with AT25C eeprom,
because the maximum length of data I test with eeprom is only 18 bytes,
so with this patch, there will be times when clock timing time and pulse
of data transmission (I Observed by sigrock logic analyzer) will not be
beautiful compared to PIO mode.
I worry if other devices using this driver also limit the maximum length
of transmission/reception to 18bytes.
But I still want to patch up to ask for your opinion.
--- a/drivers/spi/spi-sh-msiof.c
+++ b/drivers/spi/spi-sh-msiof.c
@@ -937,17 +937,13 @@ static int sh_msiof_transfer_one(struct spi_master *master,
unsigned int l = 0;
if (tx_buf)
- l = min(len, p->tx_fifo_size * 4);
+ l = min(len - len % 4, p->tx_fifo_size * 4);
I think this would be easier to read when written as:
l = min(round_down(len, 4), p->tx_fifo_size * 4);
If you do not have any problems with the above,
I will update as you want here.
Thank you for your helps!
Hoan.
if (rx_buf)
- l = min(len, p->rx_fifo_size * 4);
+ l = min(len - len % 4, p->rx_fifo_size * 4);
Likewise,
Gr{oetje,eeting}s,
Geert