Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1681432

Re: [PATCH 3/7] serial: imx: init dma_is_{rx|tx}ing variables

From Romain Perier <romain.perier@collabora.com>
Newsgroups linux.kernel
Subject Re: [PATCH 3/7] serial: imx: init dma_is_{rx|tx}ing variables
Date 2017-07-05 12:20 +0200
Message-ID <tZPzA-4Wj-29@gated-at.bofh.it> (permalink)
References <tY2Ui-5iT-17@gated-at.bofh.it> <tY2Ui-5iT-33@gated-at.bofh.it> <tY33Y-5nU-21@gated-at.bofh.it> <tZ3uV-5SC-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hello,


Le 03/07/2017 à 08:52, Uwe Kleine-König a écrit :
> On Fri, Jun 30, 2017 at 02:13:29PM +0200, Lothar Waßmann wrote:
>> Hi,
>>
>> On Fri, 30 Jun 2017 14:04:42 +0200 Romain Perier wrote:
>>> From: Nandor Han <nandor.han@ge.com>
>>>
>>> Initialize both dma_is_{rx|tx}ing variables when DMA is enabled to avoid
>>> checking uninitialized variables if port shutdown is requested before
>>> DMA channels get a chance to start.
>>>
>>> Signed-off-by: Nandor Han <nandor.han@ge.com>
>>> Signed-off-by: Romain Perier <romain.perier@collabora.com>
>>> ---
>>>  drivers/tty/serial/imx.c | 3 +++
>>>  1 file changed, 3 insertions(+)
>>>
>>> diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
>>> index 188063d..81fb413 100644
>>> --- a/drivers/tty/serial/imx.c
>>> +++ b/drivers/tty/serial/imx.c
>>> @@ -1225,6 +1225,9 @@ static void imx_enable_dma(struct imx_port *sport)
>>>  
>>>  	imx_setup_ufcr(sport, TXTL_DMA, RXTL_DMA);
>>>  
>>> +	sport->dma_is_rxing = 0;
>>> +	sport->dma_is_txing = 0;
>>> +
>>>  	sport->dma_is_enabled = 1;
>>>  }
>>>  
>> sport is devm_kzalloc()ed, so the variables are initialized to 0 anyway.
> I'd agree to Lothar's statement. Did you find this issue by inspection,
> or does it fix a compiler warning? Do you think there is an actual
> problem?
>
> Best regards
> Uwe
>
What does happen if the UART port is shutdown and then re-enabled ? I
don't think that kzalloc will work in this case

Regards,
Romain

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: [PATCH 3/7] serial: imx: init dma_is_{rx|tx}ing variables Romain Perier <romain.perier@collabora.com> - 2017-07-05 12:20 +0200
  Re: [PATCH 3/7] serial: imx: init dma_is_{rx|tx}ing variables Uwe Kleine-König          <u.kleine-koenig@pengutronix.de> - 2017-07-05 14:00 +0200

csiph-web