From: Nicolas Ferre <nicolas.ferre-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org>
To: David Mosberger <davidm-haPfTeumbwasTnJN9+BGXg@public.gmane.org>,
<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
<cyrille.pitchen-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org>
Cc: SPI SUBSYSTEM <linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Subject: Re: [PATCH] spi-atmel.c: fix DMA for bits_per_word > 8
Date: Mon, 19 Oct 2015 18:01:38 +0200 [thread overview]
Message-ID: <562513E2.4090303@atmel.com> (raw)
In-Reply-To: <CALnQHM3WxNDV3xzJwRfGRVTMYL1mo44VbBb2YawZVUzn0CzFfA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
David,
It seems that your email client is doing funny things with the source
code whitespace. Anyway, I can deal with this and re-format your patch:
no problem. For later patches I advice you to use "git format-patch"
command.
Still, see comments below...
Le 13/10/2015 00:32, David Mosberger a écrit :
> I need the patch below to make DMA work in spi-atmel.c when bits_per_word > 8.
A little bit more explanation would be good.
> --david
I would need your "Signed-off-by:" tag.
> --
> eGauge Systems LLC, http://egauge.net/, 1.877-EGAUGE1, fax 720.545.9768
>
> diff --git a/drivers/spi/spi-atmel.c b/drivers/spi/spi-atmel.c
> index 04e48e5..7bb361a 100644
> --- a/drivers/spi/spi-atmel.c
> +++ b/drivers/spi/spi-atmel.c
> @@ -711,6 +711,7 @@ static void atmel_spi_next_xfer_pio(struct
> spi_master *master,
> * Submit next transfer for DMA.
> */
> static int atmel_spi_next_xfer_dma_submit(struct spi_master *master,
> + struct spi_message *msg,
> struct spi_transfer *xfer,
> u32 *plen)
> {
> @@ -721,7 +722,7 @@ static int atmel_spi_next_xfer_dma_submit(struct
> spi_master *master,
> struct dma_async_tx_descriptor *txdesc;
> struct dma_slave_config slave_config;
> dma_cookie_t cookie;
> - u32 len = *plen;
> + u32 len = *plen, bpw;
>
> dev_vdbg(master->dev.parent, "atmel_spi_next_xfer_dma_submit\n");
>
> @@ -758,7 +759,11 @@ static int atmel_spi_next_xfer_dma_submit(struct
> spi_master *master,
>
> *plen = len;
>
> - if (atmel_spi_dma_slave_config(as, &slave_config, 8))
> + bpw = xfer->bits_per_word;
> + if (!bpw)
I assume that xfer->bits_per_word must be filled with the proper value.
So why do you need this test and de additional assignment below? Does it
come from a bad experience with the "xfer->bits_per_word" value being empty?
> + bpw = msg->spi->bits_per_word;
> +
> + if (atmel_spi_dma_slave_config(as, &slave_config, bpw))
I may have called bpw variable as "bits" like elsewhere in this driver:
it's a detail though.
> goto err_exit;
>
> /* Send both scatterlists */
> @@ -1316,8 +1321,8 @@ static int atmel_spi_one_transfer(struct
> spi_master *master,
> atmel_spi_pdc_next_xfer(master, msg, xfer);
> } else if (atmel_spi_use_dma(as, xfer)) {
> len = as->current_remaining_bytes;
> - ret = atmel_spi_next_xfer_dma_submit(master,
> - xfer, &len);
> + ret = atmel_spi_next_xfer_dma_submit(master, msg,
> + xfer, &len);
> if (ret) {
> dev_err(&spi->dev,
> "unable to use DMA, fallback to PIO\n");
Ok, the patch seems reasonable. So, can you please answer my main
question and give me the permission to add your "Signed-off-by:" tag or
re-send me a more standard patch...
Thanks a lot for your work on this driver David.
Best regards,
--
Nicolas Ferre
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
WARNING: multiple messages have this Message-ID (diff)
From: nicolas.ferre@atmel.com (Nicolas Ferre)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] spi-atmel.c: fix DMA for bits_per_word > 8
Date: Mon, 19 Oct 2015 18:01:38 +0200 [thread overview]
Message-ID: <562513E2.4090303@atmel.com> (raw)
In-Reply-To: <CALnQHM3WxNDV3xzJwRfGRVTMYL1mo44VbBb2YawZVUzn0CzFfA@mail.gmail.com>
David,
It seems that your email client is doing funny things with the source
code whitespace. Anyway, I can deal with this and re-format your patch:
no problem. For later patches I advice you to use "git format-patch"
command.
Still, see comments below...
Le 13/10/2015 00:32, David Mosberger a ?crit :
> I need the patch below to make DMA work in spi-atmel.c when bits_per_word > 8.
A little bit more explanation would be good.
> --david
I would need your "Signed-off-by:" tag.
> --
> eGauge Systems LLC, http://egauge.net/, 1.877-EGAUGE1, fax 720.545.9768
>
> diff --git a/drivers/spi/spi-atmel.c b/drivers/spi/spi-atmel.c
> index 04e48e5..7bb361a 100644
> --- a/drivers/spi/spi-atmel.c
> +++ b/drivers/spi/spi-atmel.c
> @@ -711,6 +711,7 @@ static void atmel_spi_next_xfer_pio(struct
> spi_master *master,
> * Submit next transfer for DMA.
> */
> static int atmel_spi_next_xfer_dma_submit(struct spi_master *master,
> + struct spi_message *msg,
> struct spi_transfer *xfer,
> u32 *plen)
> {
> @@ -721,7 +722,7 @@ static int atmel_spi_next_xfer_dma_submit(struct
> spi_master *master,
> struct dma_async_tx_descriptor *txdesc;
> struct dma_slave_config slave_config;
> dma_cookie_t cookie;
> - u32 len = *plen;
> + u32 len = *plen, bpw;
>
> dev_vdbg(master->dev.parent, "atmel_spi_next_xfer_dma_submit\n");
>
> @@ -758,7 +759,11 @@ static int atmel_spi_next_xfer_dma_submit(struct
> spi_master *master,
>
> *plen = len;
>
> - if (atmel_spi_dma_slave_config(as, &slave_config, 8))
> + bpw = xfer->bits_per_word;
> + if (!bpw)
I assume that xfer->bits_per_word must be filled with the proper value.
So why do you need this test and de additional assignment below? Does it
come from a bad experience with the "xfer->bits_per_word" value being empty?
> + bpw = msg->spi->bits_per_word;
> +
> + if (atmel_spi_dma_slave_config(as, &slave_config, bpw))
I may have called bpw variable as "bits" like elsewhere in this driver:
it's a detail though.
> goto err_exit;
>
> /* Send both scatterlists */
> @@ -1316,8 +1321,8 @@ static int atmel_spi_one_transfer(struct
> spi_master *master,
> atmel_spi_pdc_next_xfer(master, msg, xfer);
> } else if (atmel_spi_use_dma(as, xfer)) {
> len = as->current_remaining_bytes;
> - ret = atmel_spi_next_xfer_dma_submit(master,
> - xfer, &len);
> + ret = atmel_spi_next_xfer_dma_submit(master, msg,
> + xfer, &len);
> if (ret) {
> dev_err(&spi->dev,
> "unable to use DMA, fallback to PIO\n");
Ok, the patch seems reasonable. So, can you please answer my main
question and give me the permission to add your "Signed-off-by:" tag or
re-send me a more standard patch...
Thanks a lot for your work on this driver David.
Best regards,
--
Nicolas Ferre
next prev parent reply other threads:[~2015-10-19 16:01 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-12 22:32 [PATCH] spi-atmel.c: fix DMA for bits_per_word > 8 David Mosberger
[not found] ` <CALnQHM3WxNDV3xzJwRfGRVTMYL1mo44VbBb2YawZVUzn0CzFfA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-10-19 16:01 ` Nicolas Ferre [this message]
2015-10-19 16:01 ` Nicolas Ferre
[not found] ` <562513E2.4090303-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org>
2015-10-19 16:07 ` Mark Brown
2015-10-19 16:07 ` Mark Brown
2015-10-19 20:54 ` David Mosberger
2015-10-19 20:54 ` David Mosberger
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=562513E2.4090303@atmel.com \
--to=nicolas.ferre-aife0yeh4naavxtiumwx3w@public.gmane.org \
--cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=cyrille.pitchen-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org \
--cc=davidm-haPfTeumbwasTnJN9+BGXg@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/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.