lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6e798343-1880-1c58-dd8e-1bd556f6a75b@omp.ru>
Date:   Mon, 13 Nov 2023 13:17:33 +0300
From:   Sergey Shtylyov <s.shtylyov@....ru>
To:     Niklas Cassel <Niklas.Cassel@....com>,
        Christophe JAILLET <christophe.jaillet@...adoo.fr>
CC:     Damien Le Moal <dlemoal@...nel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "kernel-janitors@...r.kernel.org" <kernel-janitors@...r.kernel.org>,
        "linux-ide@...r.kernel.org" <linux-ide@...r.kernel.org>
Subject: Re: [PATCH] ata: pata_pxa: convert not to use
 dma_request_slave_channel()

On 11/13/23 11:05 AM, Niklas Cassel wrote:
[...]
>> dma_request_slave_channel() is deprecated. dma_request_chan() should
>> be used directly instead.
>>
>> Switch to the preferred function and update the error handling accordingly.
>>
>> Signed-off-by: Christophe JAILLET <christophe.jaillet@...adoo.fr>
>> ---
>>  drivers/ata/pata_pxa.c | 5 ++---
>>  1 file changed, 2 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/ata/pata_pxa.c b/drivers/ata/pata_pxa.c
>> index 5275c6464f57..0c9c9cf63d36 100644
>> --- a/drivers/ata/pata_pxa.c
>> +++ b/drivers/ata/pata_pxa.c
>> @@ -274,9 +274,8 @@ static int pxa_ata_probe(struct platform_device *pdev)
>>  	/*
>>  	 * Request the DMA channel
>>  	 */
>> -	data->dma_chan =
>> -		dma_request_slave_channel(&pdev->dev, "data");
>> -	if (!data->dma_chan)
>> +	data->dma_chan = dma_request_chan(&pdev->dev, "data");
> 
> While the previous API could only return NULL on failure, the new API can
> return an actual error.
> 
> I think we should return the actual error instead of -EBUSY.
> 
> i.e.:
> 
> if (IS_ERR(data->dma_chan))
> 	return PTR_ERR(data->dma_chan);

   Agreed. Christophe, please fix.

[...]
>> +	if (IS_ERR(data->dma_chan))
>>  		return -EBUSY;
>>  	ret = dmaengine_slave_config(data->dma_chan, &config);
>>  	if (ret < 0) {
[...]

> Kind regards,
> Niklas

MBR, Sergey

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ