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]
Date:	Tue, 23 Jul 2013 00:04:06 +0300
From:	Felipe Balbi <balbi@...com>
To:	Illia Smyrnov <x0194613@...com>
CC:	<balbi@...com>, Illia Smyrnov <illia.smyrnov@...ballogic.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 2/2] Input: omap-keypad: Cleanup - remove unnecessary IRQ
 enabling/disabling

Hi,

On Mon, Jul 22, 2013 at 08:25:05PM +0300, Illia Smyrnov wrote:
> >please don't remove this code. It'll be good to have this around when we
> >move the driver to threaded IRQs without IRQF_ONESHOT. In fact, it would
> >be very simple to implement such a change, wanna take it up ?
> >
> >It should be doable in few patches:
> >
> >1) switch over to request_threaded_irq()
> >
> >	just blind move to a thread, without hardirq handler, so
> >	IRQF_ONESHOT is mandatory.
> >
> >2) add hardirq handler
> >
> >	read IRQSTATUS to check if our device has generated IRQs
> >	returning IRQ_WAKE_THREAD if true
> >
> >3) move 'IRQ masking logic' to hardirq handler, before returning
> >IRQ_WAKE_THREAD
> >
> >	this will let you remove IRQF_ONESHOT
> >
> >4) finally remove IRQF_ONESHOT
> >
> >	this makes sure that IRQs aren't kept disabled until we have
> >	time to iterate over the entire keypad matrix. Only the keypad
> >	IRQ will be masked.
> >
> 
> Ok, but why we need to remove IRQF_ONESHOT flag for omap keypad driver?

well, we might want to use this HW with the RT patchset. In that case,
we want to run with IRQs disabled for as short time as possible.

> The keypad IRQ isn't shared IRQ and in our case hardirq handler will
> always return IRQ_WAKE_THREAD like default

not entirely true, you still want to check if *this* HW generated to
interrupt in case you get spurious IRQs and whatnot.

> irq_default_primary_handler do. With IRQF_ONESHOT flag IRQ line will
> be masked until the threaded
> handler finished, but there is only keypad on this line.
> 
> I tested two versions:
> the first one - just threaded IRQs with IRQF_ONESHOT and without
> specific hardirq handler.
> the second version - threaded IRQs without IRQF_ONESHOT as you described.
> Both versions was successfully tested on Blaze's keypad.

you can't simply remove IRQF_ONESHOT, you need to mask this interrupt at
the keypad level, basically you clear IRQ_ENABLE_SET (or write to
IRQ_CLEAR or whatever it's called).

Remember that the hardirq handler runs with IRQs disabled and what you
need to guarantee is that once you go over your hardirq, you mask
keypad's IRQs only.

Currently, the RT patchset forces all IRQs to run as threads, but that's
less than optimal.

-- 
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