[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160203185008.GA16942@gmail.com>
Date: Wed, 3 Feb 2016 19:50:08 +0100
From: Mathieu OTHACEHE <m.othacehe@...il.com>
To: One Thousand Gnomes <gnomes@...rguk.ukuu.org.uk>
Cc: gregkh@...uxfoundation.org, jslaby@...e.com,
akpm@...ux-foundation.org, davem@...emloft.net,
mchehab@....samsung.com, kvalo@...eaurora.org, joe@...ches.com,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] tty: add Moxa Smartio MUE serial driver
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
Powered by blists - more mailing lists