Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752361AbdF3MN7 convert rfc822-to-8bit (ORCPT ); Fri, 30 Jun 2017 08:13:59 -0400 Received: from smtprelay02.ispgateway.de ([80.67.31.40]:26193 "EHLO smtprelay02.ispgateway.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751690AbdF3MNg (ORCPT ); Fri, 30 Jun 2017 08:13:36 -0400 Date: Fri, 30 Jun 2017 14:13:29 +0200 From: Lothar =?UTF-8?B?V2HDn21hbm4=?= To: Romain Perier Cc: Greg Kroah-Hartman , Nandor Han , linux-arm-kernel@lists.infradead.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/7] serial: imx: init dma_is_{rx|tx}ing variables Message-ID: <20170630141329.6144cddd@karo-electronics.de> In-Reply-To: <20170630120446.13994-4-romain.perier@collabora.com> References: <20170630120446.13994-1-romain.perier@collabora.com> <20170630120446.13994-4-romain.perier@collabora.com> Organization: Ka-Ro electronics GmbH MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT X-Df-Sender: bHdAa2Fyby1lbGVjdHJvbmljcy5kZQ== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 968 Lines: 33 Hi, On Fri, 30 Jun 2017 14:04:42 +0200 Romain Perier wrote: > From: Nandor Han > > 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 > Signed-off-by: Romain Perier > --- > 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. Lothar Waßmann