2021-05-27 09:17:46

by Erwan Le Ray

[permalink] [raw]
Subject: [PATCH 1/2] serial: stm32: reset dma buffers during probe

Reset Rx and Tx dma buffers during probe to avoid freeing
invalid buffer in no dma mode.

Signed-off-by: Erwan Le Ray <[email protected]>

diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c
index c2ae7b392b86..2ac3b30477a7 100644
--- a/drivers/tty/serial/stm32-usart.c
+++ b/drivers/tty/serial/stm32-usart.c
@@ -1168,6 +1168,8 @@ static struct stm32_port *stm32_usart_of_get_port(struct platform_device *pdev)
stm32_ports[id].cr1_irq = USART_CR1_RXNEIE;
stm32_ports[id].cr3_irq = 0;
stm32_ports[id].last_res = RX_BUF_L;
+ stm32_ports[id].rx_dma_buf = 0;
+ stm32_ports[id].tx_dma_buf = 0;
return &stm32_ports[id];
}

--
2.17.1


2021-05-27 09:49:48

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH 1/2] serial: stm32: reset dma buffers during probe

On Thu, May 27, 2021 at 11:15:36AM +0200, Erwan Le Ray wrote:
> Reset Rx and Tx dma buffers during probe to avoid freeing
> invalid buffer in no dma mode.
>
> Signed-off-by: Erwan Le Ray <[email protected]>
>
> diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c
> index c2ae7b392b86..2ac3b30477a7 100644
> --- a/drivers/tty/serial/stm32-usart.c
> +++ b/drivers/tty/serial/stm32-usart.c
> @@ -1168,6 +1168,8 @@ static struct stm32_port *stm32_usart_of_get_port(struct platform_device *pdev)
> stm32_ports[id].cr1_irq = USART_CR1_RXNEIE;
> stm32_ports[id].cr3_irq = 0;
> stm32_ports[id].last_res = RX_BUF_L;
> + stm32_ports[id].rx_dma_buf = 0;
> + stm32_ports[id].tx_dma_buf = 0;
> return &stm32_ports[id];
> }
>
> --
> 2.17.1
>

Is this a bugfix? if so, what commit does this fix and does it need to
be backported anywhere?

thanks,

greg k-h

2021-06-09 15:11:43

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH 1/2] serial: stm32: reset dma buffers during probe

On Thu, May 27, 2021 at 11:49:01AM +0200, Greg Kroah-Hartman wrote:
> On Thu, May 27, 2021 at 11:15:36AM +0200, Erwan Le Ray wrote:
> > Reset Rx and Tx dma buffers during probe to avoid freeing
> > invalid buffer in no dma mode.
> >
> > Signed-off-by: Erwan Le Ray <[email protected]>
> >
> > diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c
> > index c2ae7b392b86..2ac3b30477a7 100644
> > --- a/drivers/tty/serial/stm32-usart.c
> > +++ b/drivers/tty/serial/stm32-usart.c
> > @@ -1168,6 +1168,8 @@ static struct stm32_port *stm32_usart_of_get_port(struct platform_device *pdev)
> > stm32_ports[id].cr1_irq = USART_CR1_RXNEIE;
> > stm32_ports[id].cr3_irq = 0;
> > stm32_ports[id].last_res = RX_BUF_L;
> > + stm32_ports[id].rx_dma_buf = 0;
> > + stm32_ports[id].tx_dma_buf = 0;
> > return &stm32_ports[id];
> > }
> >
> > --
> > 2.17.1
> >
>
> Is this a bugfix? if so, what commit does this fix and does it need to
> be backported anywhere?

Due to lack of a response, I've dropped this from my queue. Please add
the needed information to the patch when you get the chance to resend
this.

thanks,

greg k-h

2021-06-10 08:58:11

by Erwan Le Ray

[permalink] [raw]
Subject: Re: [PATCH 1/2] serial: stm32: reset dma buffers during probe

Hi Greg,

Thanks for your question. This old patch is finally not necessary any more.
You can cancel this series, I will resend the second patch.

Best regards, Erwan.


On 5/27/21 11:49 AM, Greg Kroah-Hartman wrote:
> On Thu, May 27, 2021 at 11:15:36AM +0200, Erwan Le Ray wrote:
>> Reset Rx and Tx dma buffers during probe to avoid freeing
>> invalid buffer in no dma mode.
>>
>> Signed-off-by: Erwan Le Ray <[email protected]>
>>
>> diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c
>> index c2ae7b392b86..2ac3b30477a7 100644
>> --- a/drivers/tty/serial/stm32-usart.c
>> +++ b/drivers/tty/serial/stm32-usart.c
>> @@ -1168,6 +1168,8 @@ static struct stm32_port *stm32_usart_of_get_port(struct platform_device *pdev)
>> stm32_ports[id].cr1_irq = USART_CR1_RXNEIE;
>> stm32_ports[id].cr3_irq = 0;
>> stm32_ports[id].last_res = RX_BUF_L;
>> + stm32_ports[id].rx_dma_buf = 0;
>> + stm32_ports[id].tx_dma_buf = 0;
>> return &stm32_ports[id];
>> }
>>
>> --
>> 2.17.1
>>
>
> Is this a bugfix? if so, what commit does this fix and does it need to
> be backported anywhere?
>
> thanks,
>
> greg k-h
>