From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966202AbcBCSuR (ORCPT ); Wed, 3 Feb 2016 13:50:17 -0500 Received: from mail-wm0-f53.google.com ([74.125.82.53]:35319 "EHLO mail-wm0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933787AbcBCSuN (ORCPT ); Wed, 3 Feb 2016 13:50:13 -0500 Date: Wed, 3 Feb 2016 19:50:08 +0100 From: Mathieu OTHACEHE To: One Thousand Gnomes Cc: gregkh@linuxfoundation.org, jslaby@suse.com, akpm@linux-foundation.org, davem@davemloft.net, mchehab@osg.samsung.com, kvalo@codeaurora.org, joe@perches.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] tty: add Moxa Smartio MUE serial driver Message-ID: <20160203185008.GA16942@gmail.com> References: <1454358859-5534-1-git-send-email-m.othacehe@gmail.com> <20160201211345.3f5c6b72@lxorguk.ukuu.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160201211345.3f5c6b72@lxorguk.ukuu.org.uk> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Thank you for your comments. I'll come up with v2 soon but, I have a question about this point : > > + /* clear Rx/Tx FIFO's */ > > + for (i = 0; i < reset_cnt; i++) { > > + iowrite8((UART_FCR_CLEAR_RCVR | UART_FCR_CLEAR_XMIT), > > + info->ioaddr + UART_FCR); > > + msleep(sleep_interval); > > No can do - you have a spinlock held while you are tring to sleep. I'm > not btw clear that you actually need the lock. The tty_port layer ensures > activate/shutdown don't cross or get duplicated. The only protection you > might need is versus interrupts, and in that case you could free the IRQ > up and claim it in activate/shutdown. So is it possible to replace spin_lock_irqsave/restore by local_irq_save/restore in activate/shutdown to protect versus interrupts ? And is it allowed to call msleep while holding local_irq_save ? Thank you, Mathieu