linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Cao Minh Hiep <cm-hiep@jinso.co.jp>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>,
	Mark Brown <broonie@kernel.org>,
	linux-spi <linux-spi@vger.kernel.org>,
	Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
	Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>,
	Ryusuke Sakato <ryusuke.sakato.bx@renesas.com>,
	Linux-sh list <linux-sh@vger.kernel.org>
Subject: Re: [PATCH v3 1/1] spi: Using Trigger number to transmit/receive data
Date: Mon, 20 Apr 2015 16:04:42 +0900	[thread overview]
Message-ID: <5534A50A.8000109@jinso.co.jp> (raw)
In-Reply-To: <CAMuHMdWcfij=gFwT9c5wT1+mBT7Q-Fc5_qzqSjLk4RvOEsUGgA@mail.gmail.com>

Hi Geert-san
I am sorry for late replying.

On 2015年04月08日 03:51, Geert Uytterhoeven wrote:
> Hi Hiep-san,
>
> On Thu, Oct 23, 2014 at 5:14 AM, Cao Minh Hiep <cm-hiep@jinso.co.jp> wrote:
>> From: Hiep Cao Minh <cm-hiep@jinso.co.jp>
>>
>> In order to transmit and receive data when have 32 bytes of data that
>> ready has prepared on Transmit/Receive Buffer to transmit or receive.
>> Instead transmits/receives a byte data using Transmit/Receive Buffer
>> Data Triggering Number will improve the speed of transfer data.
> Please accept my apologies for these late review comments.
> I had completely forgotten about your patch, until I noticed Mark had
> applied it.
  No problems. Thanks,
>> --- a/drivers/spi/spi-rspi.c
>> +++ b/drivers/spi/spi-rspi.c
>> @@ -614,19 +667,29 @@ static bool rspi_can_dma(struct spi_master *master, struct spi_device *spi,
>>          return __rspi_can_dma(rspi, xfer);
>>   }
>>
>> -static int rspi_common_transfer(struct rspi_data *rspi,
>> -                               struct spi_transfer *xfer)
>> +static int rspi_dma_check_then_transfer(struct rspi_data *rspi,
>> +                                        struct spi_transfer *xfer)
>>   {
>> -       int ret;
>> -
>>          if (rspi->master->can_dma && __rspi_can_dma(rspi, xfer)) {
>>                  /* rx_buf can be NULL on RSPI on SH in TX-only Mode */
>> -               ret = rspi_dma_transfer(rspi, &xfer->tx_sg,
>> +               int ret = rspi_dma_transfer(rspi, &xfer->tx_sg,
>>                                          xfer->rx_buf ? &xfer->rx_sg : NULL);
>>                  if (ret != -EAGAIN)
>> -                       return ret;
>> +                       return 0;
> Shouldn't you propagate "ret" here, instead of returning zero?
> Else you will turn a failure into a success below (see "here").
Thanks, I will keep the "ret" here.
>>          }
>>
>> +       return -EAGAIN;
>> +}
>> +
>> +static int rspi_common_transfer(struct rspi_data *rspi,
>> +                               struct spi_transfer *xfer)
>> +{
>> +       int ret;
>> +
>> +       ret = rspi_dma_check_then_transfer(rspi, xfer);
>> +       if (ret != -EAGAIN)
>> +               return ret;
> ... here.
>
>> +
>>          ret = rspi_pio_transfer(rspi, xfer->tx_buf, xfer->rx_buf, xfer->len);
>>          if (ret < 0)
>>                  return ret;
>> @@ -666,12 +729,59 @@ static int rspi_rz_transfer_one(struct spi_master *master,
>>          return rspi_common_transfer(rspi, xfer);
>>   }
>>
>> +static int qspi_trigger_transfer_out_int(struct rspi_data *rspi, const u8 *tx,
> I guess this should be called "qspi_trigger_transfer_out_in" (without "t")?
>
thanks, I will re-do that.

>> +                                       u8 *rx, unsigned int len)
>>   static int qspi_transfer_out_in(struct rspi_data *rspi,
>>                                  struct spi_transfer *xfer)
>>   {
>> +       int ret;
>> +
>>          qspi_receive_init(rspi);
>>
>> -       return rspi_common_transfer(rspi, xfer);
>> +       ret = rspi_dma_check_then_transfer(rspi, xfer);
>> +       if (ret != -EAGAIN)
>> +               return ret;
>> +
>> +       ret = qspi_trigger_transfer_out_int(rspi, xfer->tx_buf,
>> +                                           xfer->rx_buf, xfer->len);
>> +       if (ret < 0)
>> +               return ret;
>> +
>> +       return 0;
> You could just write
>
>        return qspi_trigger_transfer_out_int(rspi, xfer->tx_buf,
>                                             xfer->rx_buf, xfer->len);
ok. Thanks,

I will update your comments in other patch, then sending them to you and 
Mark-san.

Best Regards,
Hiep.



      reply	other threads:[~2015-04-20  7:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-23  3:14 [PATCH v3 0/1] spi: Using Trigger number to transmit/receive data Cao Minh Hiep
     [not found] ` <1414034053-14750-1-git-send-email-cm-hiep-HEF513clHfp3+QwDJ9on6Q@public.gmane.org>
2014-10-23  3:14   ` [PATCH v3 1/1] " Cao Minh Hiep
     [not found]     ` <1414034053-14750-2-git-send-email-cm-hiep-HEF513clHfp3+QwDJ9on6Q@public.gmane.org>
2015-03-30  4:30       ` Mark Brown
2015-03-31  5:24         ` Cao Minh Hiep
2015-04-07 18:51       ` Geert Uytterhoeven
2015-04-20  7:04         ` Cao Minh Hiep [this message]

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=5534A50A.8000109@jinso.co.jp \
    --to=cm-hiep@jinso.co.jp \
    --cc=broonie@kernel.org \
    --cc=geert+renesas@glider.be \
    --cc=geert@linux-m68k.org \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=linux-sh@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=ryusuke.sakato.bx@renesas.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).