public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mathieu OTHACEHE <m.othacehe@gmail.com>
To: One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk>
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
Date: Wed, 3 Feb 2016 19:50:08 +0100	[thread overview]
Message-ID: <20160203185008.GA16942@gmail.com> (raw)
In-Reply-To: <20160201211345.3f5c6b72@lxorguk.ukuu.org.uk>

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

  reply	other threads:[~2016-02-03 18:50 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-01 20:34 [PATCH] tty: add Moxa Smartio MUE serial driver Mathieu OTHACEHE
2016-02-01 20:59 ` Greg KH
2016-02-01 21:13 ` One Thousand Gnomes
2016-02-03 18:50   ` Mathieu OTHACEHE [this message]
2016-02-07  8:32 ` kbuild test robot
2016-02-08 16:18 ` Andy Shevchenko
2016-02-09 12:10   ` Mathieu OTHACEHE
2016-02-10  6:32     ` Andy Shevchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160203185008.GA16942@gmail.com \
    --to=m.othacehe@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=gnomes@lxorguk.ukuu.org.uk \
    --cc=gregkh@linuxfoundation.org \
    --cc=joe@perches.com \
    --cc=jslaby@suse.com \
    --cc=kvalo@codeaurora.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab@osg.samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox