From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vladimir Zapolskiy Subject: Re: [PATCH v6 10/15] serial: stm32-usart: Add STM32 USART Driver Date: Thu, 9 Apr 2015 16:04:39 +0300 Message-ID: <552678E7.4040107@mentor.com> References: <1428424234-28572-1-git-send-email-mcoquelin.stm32@gmail.com> <1428424234-28572-11-git-send-email-mcoquelin.stm32@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1428424234-28572-11-git-send-email-mcoquelin.stm32@gmail.com> Sender: linux-arch-owner@vger.kernel.org To: Maxime Coquelin , u.kleine-koenig@pengutronix.de, afaerber@suse.de, geert@linux-m68k.org, Rob Herring , Philipp Zabel , Linus Walleij , Arnd Bergmann , stefan@agner.ch, pmeerw@pmeerw.net, pebolle@tiscali.nl, peter@hurleysoftware.com, andy.shevchenko@gmail.com, cw00.choi@samsung.com, Russell King , Daniel Lezcano , joe@perches.com Cc: Jonathan Corbet , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Thomas Gleixner , Greg Kroah-Hartman , Jiri Slaby , Andrew Morton , "David S. Miller" , Mauro Carvalho Chehab , Antti Palosaari , Tejun Heo , Will Deacon , Nikolay Borisov , Rusty Russell , Kees Cook , Michal Marek , linux-doc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-gpio@vger.kernel.org, linux-serial@vger.kernel.orglinux-a List-Id: linux-gpio@vger.kernel.org Hi Maxime, On 07.04.2015 19:30, Maxime Coquelin wrote: > This drivers adds support to the STM32 USART controller, which is a > standard serial driver. > > Tested-by: Chanwoo Choi > Reviewed-by: Peter Hurley > Signed-off-by: Maxime Coquelin > --- > drivers/tty/serial/Kconfig | 17 + > drivers/tty/serial/Makefile | 1 + > drivers/tty/serial/stm32-usart.c | 735 +++++++++++++++++++++++++++++++++++++++ > include/uapi/linux/serial_core.h | 3 + > 4 files changed, 756 insertions(+) > create mode 100644 drivers/tty/serial/stm32-usart.c [snip] > +static void stm32_console_write(struct console *co, const char *s, unsigned cnt) > +{ > + struct uart_port *port = &stm32_ports[co->index].port; > + unsigned long flags; > + u32 old_cr1, new_cr1; > + int locked = 1; > + > + if (oops_in_progress) { > + locked = spin_trylock_irqsave(&port->lock, flags); > + } else { > + locked = 1; locked = 1 is done from the declaration. Also do you want to add "if (port->sysrq) locked = 0;" check? > + spin_lock_irqsave(&port->lock, flags); > + } > + [snip] Everything else is fine from point of view. Reviewed-by: Vladimir Zapolskiy -- With best wishes, Vladimir From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755210AbbDINFF (ORCPT ); Thu, 9 Apr 2015 09:05:05 -0400 Received: from relay1.mentorg.com ([192.94.38.131]:37252 "EHLO relay1.mentorg.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753974AbbDINFA (ORCPT ); Thu, 9 Apr 2015 09:05:00 -0400 Message-ID: <552678E7.4040107@mentor.com> Date: Thu, 9 Apr 2015 16:04:39 +0300 From: Vladimir Zapolskiy User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Icedove/31.0 MIME-Version: 1.0 To: Maxime Coquelin , , , , Rob Herring , Philipp Zabel , Linus Walleij , Arnd Bergmann , , , , , , , Russell King , Daniel Lezcano , CC: Jonathan Corbet , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Thomas Gleixner , Greg Kroah-Hartman , Jiri Slaby , Andrew Morton , "David S. Miller" , Mauro Carvalho Chehab , Antti Palosaari , Tejun Heo , Will Deacon , Nikolay Borisov , Rusty Russell , Kees Cook , Michal Marek , , , , , , , , Subject: Re: [PATCH v6 10/15] serial: stm32-usart: Add STM32 USART Driver References: <1428424234-28572-1-git-send-email-mcoquelin.stm32@gmail.com> <1428424234-28572-11-git-send-email-mcoquelin.stm32@gmail.com> In-Reply-To: <1428424234-28572-11-git-send-email-mcoquelin.stm32@gmail.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [137.202.0.76] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Maxime, On 07.04.2015 19:30, Maxime Coquelin wrote: > This drivers adds support to the STM32 USART controller, which is a > standard serial driver. > > Tested-by: Chanwoo Choi > Reviewed-by: Peter Hurley > Signed-off-by: Maxime Coquelin > --- > drivers/tty/serial/Kconfig | 17 + > drivers/tty/serial/Makefile | 1 + > drivers/tty/serial/stm32-usart.c | 735 +++++++++++++++++++++++++++++++++++++++ > include/uapi/linux/serial_core.h | 3 + > 4 files changed, 756 insertions(+) > create mode 100644 drivers/tty/serial/stm32-usart.c [snip] > +static void stm32_console_write(struct console *co, const char *s, unsigned cnt) > +{ > + struct uart_port *port = &stm32_ports[co->index].port; > + unsigned long flags; > + u32 old_cr1, new_cr1; > + int locked = 1; > + > + if (oops_in_progress) { > + locked = spin_trylock_irqsave(&port->lock, flags); > + } else { > + locked = 1; locked = 1 is done from the declaration. Also do you want to add "if (port->sysrq) locked = 0;" check? > + spin_lock_irqsave(&port->lock, flags); > + } > + [snip] Everything else is fine from point of view. Reviewed-by: Vladimir Zapolskiy -- With best wishes, Vladimir From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from relay1.mentorg.com ([192.94.38.131]:37252 "EHLO relay1.mentorg.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753974AbbDINFA (ORCPT ); Thu, 9 Apr 2015 09:05:00 -0400 Message-ID: <552678E7.4040107@mentor.com> Date: Thu, 9 Apr 2015 16:04:39 +0300 From: Vladimir Zapolskiy MIME-Version: 1.0 Subject: Re: [PATCH v6 10/15] serial: stm32-usart: Add STM32 USART Driver References: <1428424234-28572-1-git-send-email-mcoquelin.stm32@gmail.com> <1428424234-28572-11-git-send-email-mcoquelin.stm32@gmail.com> In-Reply-To: <1428424234-28572-11-git-send-email-mcoquelin.stm32@gmail.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-arch-owner@vger.kernel.org List-ID: To: Maxime Coquelin , u.kleine-koenig@pengutronix.de, afaerber@suse.de, geert@linux-m68k.org, Rob Herring , Philipp Zabel , Linus Walleij , Arnd Bergmann , stefan@agner.ch, pmeerw@pmeerw.net, pebolle@tiscali.nl, peter@hurleysoftware.com, andy.shevchenko@gmail.com, cw00.choi@samsung.com, Russell King , Daniel Lezcano , joe@perches.com Cc: Jonathan Corbet , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Thomas Gleixner , Greg Kroah-Hartman , Jiri Slaby , Andrew Morton , "David S. Miller" , Mauro Carvalho Chehab , Antti Palosaari , Tejun Heo , Will Deacon , Nikolay Borisov , Rusty Russell , Kees Cook , Michal Marek , linux-doc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-gpio@vger.kernel.org, linux-serial@vger.kernel.org, linux-arch@vger.kernel.org, linux-api@vger.kernel.org Message-ID: <20150409130439._S5fX3vt7nj_NU0MK4ZRsbTIQ3mWMDalG9gbavXTNMs@z> Hi Maxime, On 07.04.2015 19:30, Maxime Coquelin wrote: > This drivers adds support to the STM32 USART controller, which is a > standard serial driver. > > Tested-by: Chanwoo Choi > Reviewed-by: Peter Hurley > Signed-off-by: Maxime Coquelin > --- > drivers/tty/serial/Kconfig | 17 + > drivers/tty/serial/Makefile | 1 + > drivers/tty/serial/stm32-usart.c | 735 +++++++++++++++++++++++++++++++++++++++ > include/uapi/linux/serial_core.h | 3 + > 4 files changed, 756 insertions(+) > create mode 100644 drivers/tty/serial/stm32-usart.c [snip] > +static void stm32_console_write(struct console *co, const char *s, unsigned cnt) > +{ > + struct uart_port *port = &stm32_ports[co->index].port; > + unsigned long flags; > + u32 old_cr1, new_cr1; > + int locked = 1; > + > + if (oops_in_progress) { > + locked = spin_trylock_irqsave(&port->lock, flags); > + } else { > + locked = 1; locked = 1 is done from the declaration. Also do you want to add "if (port->sysrq) locked = 0;" check? > + spin_lock_irqsave(&port->lock, flags); > + } > + [snip] Everything else is fine from point of view. Reviewed-by: Vladimir Zapolskiy -- With best wishes, Vladimir From mboxrd@z Thu Jan 1 00:00:00 1970 From: vladimir_zapolskiy@mentor.com (Vladimir Zapolskiy) Date: Thu, 9 Apr 2015 16:04:39 +0300 Subject: [PATCH v6 10/15] serial: stm32-usart: Add STM32 USART Driver In-Reply-To: <1428424234-28572-11-git-send-email-mcoquelin.stm32@gmail.com> References: <1428424234-28572-1-git-send-email-mcoquelin.stm32@gmail.com> <1428424234-28572-11-git-send-email-mcoquelin.stm32@gmail.com> Message-ID: <552678E7.4040107@mentor.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Hi Maxime, On 07.04.2015 19:30, Maxime Coquelin wrote: > This drivers adds support to the STM32 USART controller, which is a > standard serial driver. > > Tested-by: Chanwoo Choi > Reviewed-by: Peter Hurley > Signed-off-by: Maxime Coquelin > --- > drivers/tty/serial/Kconfig | 17 + > drivers/tty/serial/Makefile | 1 + > drivers/tty/serial/stm32-usart.c | 735 +++++++++++++++++++++++++++++++++++++++ > include/uapi/linux/serial_core.h | 3 + > 4 files changed, 756 insertions(+) > create mode 100644 drivers/tty/serial/stm32-usart.c [snip] > +static void stm32_console_write(struct console *co, const char *s, unsigned cnt) > +{ > + struct uart_port *port = &stm32_ports[co->index].port; > + unsigned long flags; > + u32 old_cr1, new_cr1; > + int locked = 1; > + > + if (oops_in_progress) { > + locked = spin_trylock_irqsave(&port->lock, flags); > + } else { > + locked = 1; locked = 1 is done from the declaration. Also do you want to add "if (port->sysrq) locked = 0;" check? > + spin_lock_irqsave(&port->lock, flags); > + } > + [snip] Everything else is fine from point of view. Reviewed-by: Vladimir Zapolskiy -- With best wishes, Vladimir