All of lore.kernel.org
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Nguyen An Hoan <na-hoan@jinso.co.jp>
Cc: Linux-Renesas <linux-renesas-soc@vger.kernel.org>,
	"Mark Brown" <broonie@kernel.org>,
	"Geert Uytterhoeven" <geert+renesas@glider.be>,
	"Magnus Damm" <magnus.damm@gmail.com>,
	linux-spi <linux-spi@vger.kernel.org>,
	"Kuninori Morimoto" <kuninori.morimoto.gx@renesas.com>,
	"Yoshihiro Shimoda" <yoshihiro.shimoda.uh@renesas.com>,
	稲吉 <h-inayoshi@jinso.co.jp>, Dung:人ソ <nv-dung@jinso.co.jp>,
	カオ・ヴァン・ドン <cv-dong@jinso.co.jp>
Subject: Re: [PATCH 2/2] spi: sh-msiof: Use DMA if possible
Date: Fri, 11 Jan 2019 10:09:10 +0100	[thread overview]
Message-ID: <CAMuHMdUAk004J-06o43yHei10tWCkyztsWUXUyCj36cPwT9D0w@mail.gmail.com> (raw)
In-Reply-To: <1547197109-637-2-git-send-email-na-hoan@jinso.co.jp>

Hi Hoan-san,

On Fri, Jan 11, 2019 at 9:59 AM Nguyen An Hoan <na-hoan@jinso.co.jp> wrote:
> From: Hoan Nguyen An <na-hoan@jinso.co.jp>
>
> 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@jinso.co.jp>

Thanks for your patch, that's a great idea!

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
with a small suggestion below.

> --- 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 (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

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

  reply	other threads:[~2019-01-11  9:09 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-11  8:58 [PATCH 1/2] spi: sh-msiof: fix *info pointer in request_dma() Nguyen An Hoan
2019-01-11  8:58 ` [PATCH 2/2] spi: sh-msiof: Use DMA if possible Nguyen An Hoan
2019-01-11  9:09   ` Geert Uytterhoeven [this message]
2019-01-11  9:27     ` Hoan
2019-01-11 10:05       ` Geert Uytterhoeven
2019-01-18  8:19         ` Hoan
2019-01-11  9:01 ` [PATCH 1/2] spi: sh-msiof: fix *info pointer in request_dma() Geert Uytterhoeven
2019-01-11 10:15 ` Sergei Shtylyov
2019-01-11 13:26 ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAMuHMdUAk004J-06o43yHei10tWCkyztsWUXUyCj36cPwT9D0w@mail.gmail.com \
    --to=geert@linux-m68k.org \
    --cc=broonie@kernel.org \
    --cc=cv-dong@jinso.co.jp \
    --cc=geert+renesas@glider.be \
    --cc=h-inayoshi@jinso.co.jp \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=magnus.damm@gmail.com \
    --cc=na-hoan@jinso.co.jp \
    --cc=nv-dung@jinso.co.jp \
    --cc=yoshihiro.shimoda.uh@renesas.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.