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] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 2 Sep 2011 08:24:38 -0700
From:	Stephen Warren <swarren@...dia.com>
To:	Thomas Gleixner <tglx@...utronix.de>
CC:	Mark Brown <broonie@...nsource.wolfsonmicro.com>,
	Liam Girdwood <lrg@...com>, Chris Ball <cjb@...top.org>,
	"ccross@...roid.com" <ccross@...roid.com>,
	"olof@...om.net" <olof@...om.net>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"linux-arm-kernel@...ts.infradead.org" 
	<linux-arm-kernel@...ts.infradead.org>,
	"alsa-devel@...a-project.org" <alsa-devel@...a-project.org>,
	"linux-mmc@...r.kernel.org" <linux-mmc@...r.kernel.org>,
	"linux-tegra@...r.kernel.org" <linux-tegra@...r.kernel.org>
Subject: RE: [PATCH 1/3] irq: If an IRQ is a GPIO, request and configure it

Thomas Gleixner wrote at Friday, September 02, 2011 2:37 AM:
> On Thu, 4 Aug 2011, Stephen Warren wrote:
> 
> > Many IRQs are associated with GPIO pins. When the pin is used as an IRQ,
> > it can't be used as anything else; it should be requested. Enhance the
> > core interrupt code to call gpio_request() and gpio_direction_input() for
> > any IRQ that is also a GPIO. This prevents duplication of these calls in
> > each driver that uses an IRQ.
> 
> This is very much the wrong approach. If you think it through then the
> irq setup code might end up with tons of other subsystem specific
> setup thingies, e.g. PCI .....
> 
> The right thing to do is to add a irq_configure() function pointer to
> the irq chip and provide a common function for gpios in gpiolib, which
> is then used by the particular GPIO irq chip implementation.

Sorry, could you expand on this some more.

The whole point of these patches is that it's impossible to convert from
IRQ number to GPIO number.

Some drivers use just an IRQ, and don't care if it's a GPIO. They work
fine currently.

Some drivers use just a GPIO; that's not relevant to these patches.

Some drivers use something that's both an IRQ and a GPIO. Historically,
this has worked by passing the IRQ to the driver, and then the driver
calling irq_to_gpio() to get the GPIO ID. Since irq_to_gpio() is being
removed, this is no longer possible. The whole point of the removal was
that it's not possible in general to convert from IRQ to GPIO, so I'm not
sure exactly what you're proposing irq_configure() or gpiolib do to
centralize this?

Thanks for any insight.

-- 
nvpublic

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ