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

From Mathieu OTHACEHE <m.othacehe@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH] tty: add Moxa Smartio MUE serial driver
Date 2016-02-03 20:00 +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>
Organization linux.* mail to news gateway

Show all headers | 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