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


Groups > linux.kernel > #1325855

Re: [PATCH] tty: add Moxa Smartio MUE serial driver

Path csiph.com!aioe.org!bofh.it!news.nic.it!robomod
From Mathieu OTHACEHE <m.othacehe@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH] tty: add Moxa Smartio MUE serial driver
Date Wed, 03 Feb 2016 20:00:02 +0100
Message-ID <qYaOK-5HS-9@gated-at.bofh.it> (permalink)
References <qXtqp-8iB-1@gated-at.bofh.it> <qXu38-mK-19@gated-at.bofh.it>
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=cOPdoXvYUQr6azQe6eMOxj18hPdnermfsmyQiLcmtvg=; b=yiL82VkTEo5G63pS+QV4BPbWsFmRvFgtoJR+YhBp9gTScWVHjhmyXb74oBsnC+KlH/ sigC0kf9PkKpCP8uYp1h0uV3M0YPuTn9Fs2SqZZ2WeJfA5fU94xxs74J7iw/GcAdM8sz Uek/mIWZsP6QQSuBUg+vaZPfmsaSKi87r/sOM7D4guik6temy1hFvok13g0z83VuSe8n +EGqe33HBXucXbRm4GXNoAfSXZ31LN6lIFA7k0KUEp0QT0gzhOQRLd56U7jrTJUHxR+u pCtdmZ1oWz/uBlkmcB4tWHl/YIFn4bQICPj9VkdVzHkITcI8BnRoubwISezmgO+XGIBW uabQ==
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=cOPdoXvYUQr6azQe6eMOxj18hPdnermfsmyQiLcmtvg=; b=fglxhyDA3lIzGCwR90xbGMngedpteJ7ptnbrOa+BaOMGp41V/JQVf3PRgz+gGpySwu eGrOPpe/bMTXYjbQENYmDzkzWuyWOgmi+9Ky7a71shccUvHctyWIvd49k3iSQYxF9oTm osax2KP++iWaG1uE/axW8/EgEysdvMtcIBfhTQVbJ76T0aQKlSIYxBZbflt6kQytfepg DAzj8EU08CdjRRiX6jxnTbF0jOh9CuIJO8eZHb+Qk8aGWe9mQfaB/6+S3iszY6glzkUl whBwti72PP8/ZgtJb7QOD7xGaobi7EO/+2cEudlxEnbQaCbxQ67nU5S42qBB22xA7uts IJ8w==
X-Gm-Message-State AG10YOSq9CSc0qqEpTHzoPlN82P9ctkLoWI0QWJGHQOGtmp53kJcg6srzL0kiGzz7BdbPA==
X-Received by 10.28.215.136 with SMTP id o130mr25419579wmg.33.1454525412449; Wed, 03 Feb 2016 10:50:12 -0800 (PST)
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Disposition inline
User-Agent Mutt/1.5.24 (2015-08-30)
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 23
Organization linux.* mail to news gateway
X-Original-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
X-Original-Date Wed, 3 Feb 2016 19:50:08 +0100
X-Original-Message-ID <20160203185008.GA16942@gmail.com>
X-Original-References <1454358859-5534-1-git-send-email-m.othacehe@gmail.com> <20160201211345.3f5c6b72@lxorguk.ukuu.org.uk>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1325855

Show key headers only | View raw


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

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


Thread

Re: [PATCH] tty: add Moxa Smartio MUE serial driver One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk> - 2016-02-01 22:20 +0100
  Re: [PATCH] tty: add Moxa Smartio MUE serial driver Mathieu OTHACEHE <m.othacehe@gmail.com> - 2016-02-03 20:00 +0100

csiph-web