lkml.org 
[lkml]   [2020]   [Jan]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH V2 2/2] drivers: input: keyboard
On Wed, Jan 08, 2020 at 01:26:09PM +0200, Andy Shevchenko wrote:
> On Wed, Jan 08, 2020 at 04:46:02PM +0800, Yingjoe Chen wrote:
> > On Wed, 2020-01-08 at 14:29 +0800, fengping yu wrote:
>
> > > + tasklet_init(&keypad->tasklet, kpd_keymap_handler,
> > > + (unsigned long)keypad);
> > > +
> > > + writew((u16)(keypad->key_debounce & KPD_DEBOUNCE_MASK),
> > > + keypad->base + KP_DEBOUNCE);
> >
> > You use a 13 bits mask and set it directly to KP_DEBOUNCE register. Are
> > you sure the debounce unit is ms?
> >
> > > +
> > > + /* register IRQ */
> > > + err = request_irq(keypad->irqnr, kpd_irq_handler, IRQF_TRIGGER_NONE,
> > > + KPD_NAME, keypad);
> >
> > please consider using devm_request_irq, otherwise you have to free it in
> > _remove function.
>
> No, you may not use devm_*_irq() when tasklets are in use. There is a nasty
> race condition.
>
> Actually the rule of thumb is to NOT use devm_*_irq() unless you exactly know
> what you are doing.
>
> P.S. Why simple not to switch to threaded IRQ handler and drop tasklet? In such
> case devm_*_irq() is fine.

Actually, we are simply reading iomem data and forward it to input
subsystem, there is no need to use threaded interrupt nor the tasklet.

Thanks.

--
Dmitry

\
 
 \ /
  Last update: 2020-01-10 02:21    [W:0.075 / U:2.140 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site