On Tue, Jul 02, 2013 at 02:15:46PM +0200, Javier Martinez Canillas wrote: > + Grant, Linus W and Jean-Christophe. > > On Tue, Jul 2, 2013 at 1:44 PM, Torben Hohn <torbenh@xxxxxxxxxxxxx> wrote: > > > > Hi.. > > > > I am running into Problems with a network adapter IRQ connected to an > > omap-gpio pin. > > > > omap-gpio expects gpio-request() to be called before i can use the pin. > > But this is abstracted via the DeviceTree bindings. > > > > I see 8d4c277e185c31359cf70573d8b0351fb7dd0dfe in mainline. > > This one just puts a warning into the exact place, i am dealing with. > > But i need to make this work, instead of bailing out. > > > > This has been discussed extensively on the linux-omap mailing list and > the agreement is that it has to be handled by the IRQ core. So when a > GPIO line is mapped in the IRQ domain with irq_create_of_mapping(), > the core has to take care to request the GPIO and configure it as > input. Can you give me a pointer to this discussion please ? Because i fail to understand why you just dont save the irq_type in some private data structure, and then use chip->irq_enable() or something. > > But until we have this general solution we have to do it on a per irq > chip driver basis and the less hack-ish solution is to have a custom > .map function handler that request the GPIO used as IRQ. > > There is already a patch [1] queued in Linus Walleij linux-gpio tree > [2] for-next branch that implements this for OMAP GPIO. It would be > great if you can test it and give feedback. Thanks for the pointer. The kernel i am working on is based on 3.8.x (this is before the irq_domain change to linear) First i only backported: [1] and [2] With these i see big streams like these: [ 1.554809] omap_gpio gpio.9: Could not request GPIO-256 [ 1.560394] omap_gpio gpio.9: Could not request GPIO-255 [ 1.566009] omap_gpio gpio.9: Could not request GPIO-254 [ 1.571594] omap_gpio gpio.9: Could not request GPIO-253 [ 1.577178] omap_gpio gpio.9: Could not request GPIO-252 [ 1.582794] omap_gpio gpio.9: Could not request GPIO-251 This is basically coming from irq_domain_add_legacy() which calls ops->map(domain, irq, hwirq) before the gpio chip is actually added. I fixed it by also taking [3]. However, OMAP1 is still calling irq_domain_add_legacy(). This would probably break with DeviceTree. But since omap1 doesnt use DeviceTree, this is probably a non-issue. [1] https://git.kernel.org/cgit/linux/kernel/git/linusw/linux-gpio.git/commit/?h=for-next&id=570c4bb53366157fa076922d0fc7e7adfd81cf42 [2] https://git.kernel.org/cgit/linux/kernel/git/linusw/linux-gpio.git/commit/?h=for-next&id=50fc1d067d9f4b6c99717b91c1aaaa618075f859 [3] https://git.kernel.org/cgit/linux/kernel/git/linusw/linux-gpio.git/commit/?h=for-next&id=ede4d7a5b9835510fd1f724367f68d2fa4128453 -- Mit freundlichen Grüßen Torben Hohn Linutronix GmbH Standort: Bremen Phone: +49 421 5650 2310 ; Fax.: +49 7556 919 886 mailto: torbenh@xxxxxxxxxxxxx Firmensitz / Registered Office: D-88690 Uhldingen, Auf dem Berg 3 Registergericht / Local District Court: Freiburg i. Br., HRB Nr. / Trade register no.: 700 806; Geschäftsführer / Managing Directors: Heinz Egger, Thomas Gleixner
Attachment:
signature.asc
Description: Digital signature