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] [day] [month] [year] [list]
Message-ID: <c29e4d22-78b4-4265-b459-7cee38149084@wanadoo.fr>
Date:   Mon, 20 Nov 2023 22:19:25 +0100
From:   Christophe JAILLET <christophe.jaillet@...adoo.fr>
To:     claudiu beznea <claudiu.beznea@...on.dev>,
        Jiri Slaby <jirislaby@...nel.org>,
        Richard Genoud <richard.genoud@...il.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Nicolas Ferre <nicolas.ferre@...rochip.com>,
        Alexandre Belloni <alexandre.belloni@...tlin.com>
Cc:     linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org,
        linux-serial@...r.kernel.org, linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH v2] serial: atmel: convert not to use
 dma_request_slave_channel()

Le 20/11/2023 à 08:12, claudiu beznea a écrit :
> 
> 
> On 20.11.2023 09:04, Jiri Slaby wrote:
>> On 20. 11. 23, 7:14, claudiu beznea wrote:
>>> Hi, Christophe,
>>>
>>> On 19.11.2023 17:55, Christophe JAILLET 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>
>>>> ---
>>>> v2: Also update atmel_prepare_rx_dma()
>>>> ---
>>>>    drivers/tty/serial/atmel_serial.c | 16 ++++++++++++----
>>>>    1 file changed, 12 insertions(+), 4 deletions(-)
>>>>
>>>> diff --git a/drivers/tty/serial/atmel_serial.c
>>>> b/drivers/tty/serial/atmel_serial.c
>>>> index 1946fafc3f3e..6aeb4648843b 100644
>>>> --- a/drivers/tty/serial/atmel_serial.c
>>>> +++ b/drivers/tty/serial/atmel_serial.c
>>>> @@ -1013,14 +1013,18 @@ static int atmel_prepare_tx_dma(struct uart_port
>>>> *port)
>>>>        struct device *mfd_dev = port->dev->parent;
>>>>        dma_cap_mask_t        mask;
>>>>        struct dma_slave_config config;
>>>> +    struct dma_chan *chan;
>>>
>>> There is no need for this.
>>
>> How'd you avoid crash in here then:
>>          if (atmel_port->chan_tx)
>>                  atmel_release_tx_dma(port);
>> ?
> 
> I wanted to say that instead of adding the chan variable the
> atmel_port->chan_tx would be used instead.

You mean something like:

-	atmel_port->chan_tx = dma_request_slave_channel(mfd_dev, "tx");
-	if (atmel_port->chan_tx == NULL)
+	atmel_port->chan_tx = dma_request_chan(mfd_dev, "tx");
+	if (IS_ERR(atmel_port->chan_tx)) {
+		atmel_port->chan_tx = NULL;

?

Mostly a mater of taste. I can send a v3 with that if it is the 
preferred style.

CJ

> 
>>
>> thanks,
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ