linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Ujfalusi <peter.ujfalusi@ti.com>
To: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Cc: Viresh Kumar <viresh.kumar@linaro.org>, <vireshk@kernel.org>,
	<axboe@kernel.dk>, <vkoul@kernel.org>,
	<linux-ide@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] ata: pata_arasam_cf: Use dma_request_chan() instead dma_request_slave_channel()
Date: Mon, 13 Jan 2020 16:33:01 +0200	[thread overview]
Message-ID: <7cb96956-806e-4120-692c-dfd0afd49738@ti.com> (raw)
In-Reply-To: <b171c3c0-d924-e2e6-0c4d-196c7e6c2325@samsung.com>



On 13/01/2020 13.31, Bartlomiej Zolnierkiewicz wrote:
> 
> On 12/17/19 12:19 PM, Viresh Kumar wrote:
>> On 17-12-19, 12:50, Peter Ujfalusi wrote:
>>> dma_request_slave_channel() is a wrapper on top of dma_request_chan()
>>> eating up the error code.
>>>
>>> By using dma_request_chan() directly the driver can support deferred
>>> probing against DMA.
> 
> It doesn't seem to be the case as DMA channel is requested at the start
> of the data transfer (which happens after the driver has been successfully
> probed).

True, I have updated the commit message to remove the reference to
deferred probing.
If the DMA is requested upfront (at probe time, device open time?) the
driver would save quite a bit of time by not allocating and freeing the
DMA resources repeatedly for each transfer, thus most likely giving a
boost to throughput...

> PS there is a typo in the patch summary (it should "pata_arasan_cf").

Ah, fixed this as well in v2.

Thanks for catching them,
- Péter

> 
> Best regards,
> --
> Bartlomiej Zolnierkiewicz
> Samsung R&D Institute Poland
> Samsung Electronics
> 
>>> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
>>> ---
>>>  drivers/ata/pata_arasan_cf.c | 6 ++++--
>>>  1 file changed, 4 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/ata/pata_arasan_cf.c b/drivers/ata/pata_arasan_cf.c
>>> index 135173c8d138..69b555d83f68 100644
>>> --- a/drivers/ata/pata_arasan_cf.c
>>> +++ b/drivers/ata/pata_arasan_cf.c
>>> @@ -526,9 +526,10 @@ static void data_xfer(struct work_struct *work)
>>>  
>>>  	/* request dma channels */
>>>  	/* dma_request_channel may sleep, so calling from process context */
>>> -	acdev->dma_chan = dma_request_slave_channel(acdev->host->dev, "data");
>>> -	if (!acdev->dma_chan) {
>>> +	acdev->dma_chan = dma_request_chan(acdev->host->dev, "data");
>>> +	if (IS_ERR(acdev->dma_chan)) {
>>>  		dev_err(acdev->host->dev, "Unable to get dma_chan\n");
>>> +		acdev->dma_chan = NULL;
>>>  		goto chan_request_fail;
>>>  	}
>>>  
>>> @@ -539,6 +540,7 @@ static void data_xfer(struct work_struct *work)
>>>  	}
>>>  
>>>  	dma_release_channel(acdev->dma_chan);
>>> +	acdev->dma_chan = NULL;
>>>  
>>>  	/* data xferred successfully */
>>>  	if (!ret) {
>>
>> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
>>
> 

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

      reply	other threads:[~2020-01-13 14:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-17 10:50 [PATCH] ata: pata_arasam_cf: Use dma_request_chan() instead dma_request_slave_channel() Peter Ujfalusi
2019-12-17 11:19 ` Viresh Kumar
2020-01-13 11:31   ` Bartlomiej Zolnierkiewicz
2020-01-13 14:33     ` Peter Ujfalusi [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=7cb96956-806e-4120-692c-dfd0afd49738@ti.com \
    --to=peter.ujfalusi@ti.com \
    --cc=axboe@kernel.dk \
    --cc=b.zolnierkie@samsung.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viresh.kumar@linaro.org \
    --cc=vireshk@kernel.org \
    --cc=vkoul@kernel.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 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).