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

From: Mathieu OTHACEHE
Date: Wed Feb 03 2016 - 13:50:21 EST


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