linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] ata: pata_arasan_cf: Use dma_request_chan() instead dma_request_slave_channel()
@ 2020-01-13 14:27 ` Peter Ujfalusi
  2020-01-14  4:30   ` Viresh Kumar
                     ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Peter Ujfalusi @ 2020-01-13 14:27 UTC (permalink / raw)
  To: vireshk, b.zolnierkie, axboe; +Cc: vkoul, linux-ide, linux-kernel

dma_request_slave_channel() is a wrapper on top of dma_request_chan()
eating up the error code.

The dma_request_chan() is the standard API to request slave channel,
clients should be moved away from the legacy API to allow us to retire
them.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
Hi,

Changes since v1:
- Fixed type in subject
- Removed reference to deferred probing in commit message

Regards,
Peter

 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 391dff0f25a2..e9cf31f38450 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) {
-- 
Peter

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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] ata: pata_arasan_cf: Use dma_request_chan() instead dma_request_slave_channel()
  2020-01-13 14:27 ` [PATCH v2] ata: pata_arasan_cf: Use dma_request_chan() instead dma_request_slave_channel() Peter Ujfalusi
@ 2020-01-14  4:30   ` Viresh Kumar
  2020-01-15 13:04   ` Bartlomiej Zolnierkiewicz
  2020-01-30  4:10   ` Jens Axboe
  2 siblings, 0 replies; 4+ messages in thread
From: Viresh Kumar @ 2020-01-14  4:30 UTC (permalink / raw)
  To: Peter Ujfalusi
  Cc: vireshk, b.zolnierkie, axboe, vkoul, linux-ide, linux-kernel

On 13-01-20, 16:27, Peter Ujfalusi wrote:
> dma_request_slave_channel() is a wrapper on top of dma_request_chan()
> eating up the error code.
> 
> The dma_request_chan() is the standard API to request slave channel,
> clients should be moved away from the legacy API to allow us to retire
> them.
> 
> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
> ---
> Hi,
> 
> Changes since v1:
> - Fixed type in subject
> - Removed reference to deferred probing in commit message
> 
> Regards,
> Peter
> 
>  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 391dff0f25a2..e9cf31f38450 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>

-- 
viresh

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] ata: pata_arasan_cf: Use dma_request_chan() instead dma_request_slave_channel()
  2020-01-13 14:27 ` [PATCH v2] ata: pata_arasan_cf: Use dma_request_chan() instead dma_request_slave_channel() Peter Ujfalusi
  2020-01-14  4:30   ` Viresh Kumar
@ 2020-01-15 13:04   ` Bartlomiej Zolnierkiewicz
  2020-01-30  4:10   ` Jens Axboe
  2 siblings, 0 replies; 4+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2020-01-15 13:04 UTC (permalink / raw)
  To: Peter Ujfalusi; +Cc: vireshk, axboe, vkoul, linux-ide, linux-kernel

On 1/13/20 3:27 PM, Peter Ujfalusi wrote:
> dma_request_slave_channel() is a wrapper on top of dma_request_chan()
> eating up the error code.
> 
> The dma_request_chan() is the standard API to request slave channel,
> clients should be moved away from the legacy API to allow us to retire
> them.
> 
> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>

Acked-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

> ---
> Hi,
> 
> Changes since v1:
> - Fixed type in subject
> - Removed reference to deferred probing in commit message
> 
> Regards,
> Peter
> 
>  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 391dff0f25a2..e9cf31f38450 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) {
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] ata: pata_arasan_cf: Use dma_request_chan() instead dma_request_slave_channel()
  2020-01-13 14:27 ` [PATCH v2] ata: pata_arasan_cf: Use dma_request_chan() instead dma_request_slave_channel() Peter Ujfalusi
  2020-01-14  4:30   ` Viresh Kumar
  2020-01-15 13:04   ` Bartlomiej Zolnierkiewicz
@ 2020-01-30  4:10   ` Jens Axboe
  2 siblings, 0 replies; 4+ messages in thread
From: Jens Axboe @ 2020-01-30  4:10 UTC (permalink / raw)
  To: Peter Ujfalusi, vireshk, b.zolnierkie; +Cc: vkoul, linux-ide, linux-kernel

On 1/13/20 7:27 AM, Peter Ujfalusi wrote:
> dma_request_slave_channel() is a wrapper on top of dma_request_chan()
> eating up the error code.
> 
> The dma_request_chan() is the standard API to request slave channel,
> clients should be moved away from the legacy API to allow us to retire
> them.

Applied, thanks.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-01-30  4:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20200113142721eucas1p2b925aa86ed9230da52d2f1652cf83db0@eucas1p2.samsung.com>
2020-01-13 14:27 ` [PATCH v2] ata: pata_arasan_cf: Use dma_request_chan() instead dma_request_slave_channel() Peter Ujfalusi
2020-01-14  4:30   ` Viresh Kumar
2020-01-15 13:04   ` Bartlomiej Zolnierkiewicz
2020-01-30  4:10   ` Jens Axboe

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).