Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752779AbdGEKPE (ORCPT ); Wed, 5 Jul 2017 06:15:04 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:58742 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752115AbdGEKPC (ORCPT ); Wed, 5 Jul 2017 06:15:02 -0400 Subject: Re: [PATCH 3/7] serial: imx: init dma_is_{rx|tx}ing variables To: =?UTF-8?Q?Uwe_Kleine-K=c3=b6nig?= Cc: =?UTF-8?Q?Lothar_Wa=c3=9fmann?= , Greg Kroah-Hartman , Nandor Han , linux-arm-kernel@lists.infradead.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org References: <20170630120446.13994-1-romain.perier@collabora.com> <20170630120446.13994-4-romain.perier@collabora.com> <20170630141329.6144cddd@karo-electronics.de> <20170703065221.imbpbybsrd3of4ec@pengutronix.de> From: Romain Perier Message-ID: <91cc9a48-58e9-98a9-58aa-1a949b9b5552@collabora.com> Date: Wed, 5 Jul 2017 12:14:57 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: <20170703065221.imbpbybsrd3of4ec@pengutronix.de> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1453 Lines: 47 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 >>> >>> 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. > 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