lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20130723173227.GA9636@radagast>
Date:	Tue, 23 Jul 2013 20:32:27 +0300
From:	Felipe Balbi <balbi@...com>
To:	Felipe Balbi <balbi@...com>
CC:	Illia Smyrnov <illia.smyrnov@...com>,
	Dmitry Torokhov <dmitry.torokhov@...il.com>,
	<linux-input@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
	<linux-omap@...r.kernel.org>
Subject: Re: [PATCH v2 2/3] Input: omap-keypad: Convert to threaded IRQ

Hi,

On Tue, Jul 23, 2013 at 08:25:01PM +0300, Felipe Balbi wrote:
> > Convert to use threaded IRQ.
> > 
> > Cc: Felipe Balbi <balbi@...com>
> > Signed-off-by: Illia Smyrnov <illia.smyrnov@...com>
> > ---
> >  drivers/input/keyboard/omap4-keypad.c |   29 ++++++++++++++++++++---------
> >  1 files changed, 20 insertions(+), 9 deletions(-)
> > 
> > diff --git a/drivers/input/keyboard/omap4-keypad.c b/drivers/input/keyboard/omap4-keypad.c
> > index c727548..b876a0d 100644
> > --- a/drivers/input/keyboard/omap4-keypad.c
> > +++ b/drivers/input/keyboard/omap4-keypad.c
> > @@ -112,8 +112,22 @@ static void kbd_write_irqreg(struct omap4_keypad *keypad_data,
> >  }
> >  
> >  
> > -/* Interrupt handler */
> > -static irqreturn_t omap4_keypad_interrupt(int irq, void *dev_id)
> > +/* Interrupt handlers */
> > +static irqreturn_t omap4_keypad_irq_handler(int irq, void *dev_id)
> > +{
> > +	struct omap4_keypad *keypad_data = dev_id;
> > +
> > +	if (kbd_read_irqreg(keypad_data, OMAP4_KBD_IRQSTATUS)) {
> > +		/* Disable interrupts */
> > +		kbd_write_irqreg(keypad_data, OMAP4_KBD_IRQENABLE,
> > +				 OMAP4_VAL_IRQDISABLE);
> > +		return IRQ_WAKE_THREAD;
> > +	}
> > +
> > +	return IRQ_NONE;
> > +}
> > +
> > +static irqreturn_t omap4_keypad_irq_thread_fn(int irq, void *dev_id)
> >  {
> >  	struct omap4_keypad *keypad_data = dev_id;
> >  	struct input_dev *input_dev = keypad_data->input;
> > @@ -121,10 +135,6 @@ static irqreturn_t omap4_keypad_interrupt(int irq, void *dev_id)
> >  	unsigned int col, row, code, changed;
> >  	u32 *new_state = (u32 *) key_state;
> >  
> > -	/* Disable interrupts */
> > -	kbd_write_irqreg(keypad_data, OMAP4_KBD_IRQENABLE,
> > -			 OMAP4_VAL_IRQDISABLE);
> 
> looking a lot better, but I wonder if you should add a mutex to this
> threaded handler, but I guess there's no way this will never race since

s/never/ever

-- 
balbi

Download attachment "signature.asc" of type "application/pgp-signature" (837 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ