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]
Message-ID: <CACRpkdaMwmMYUff+_PUCQrACEu6x-2uQbvFF_t1hTmTmFeODDg@mail.gmail.com>
Date:	Mon, 4 May 2015 15:16:50 +0200
From:	Linus Walleij <linus.walleij@...aro.org>
To:	Kamlakant Patel <kamlakant.patel@...adcom.com>
Cc:	"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
	Steve Glendinning <steve.glendinning@...well.net>,
	"David S . Miller" <davem@...emloft.net>
Subject: Re: [PATCH] net/smsc911x: fix irq resource allocation failure

On Mon, May 4, 2015 at 11:09 AM,  <kamlakant.patel@...adcom.com> wrote:

> From: Kamlakant Patel <kamlakant.patel@...adcom.com>
>
> When smsc911x uses GPIO as the interrupt controller, and if both are
> loaded as modules, we get following error:
>
> "smsc911x: Could not allocate irq resource"
>
> This issue is because of smsc911x using platform_get_resource to get
> device tree based irq resource.
>
> commit "9ec36ca (of/irq: do irq resolution in platform_get_irq)" and
> commit "7085a7 (drivers: platform: parse IRQ flags from resources)" add
> support in platform_get_irq to resolve irq and irq_flags respectively
> for both modern device tree and legacy static platform data platforms.
>
> Modify smsc911x driver to use platform_get_irq to pick up irq resource
> correctly and use irq_get_trigger_type to get the IRQ trigger flags.
>
> Signed-off-by: Kamlakant Patel <kamlakant.patel@...adcom.com>

Basically identical to commit d52fdbb735c36a209f36a628d40ca9185b349ba7
"smc91x: retrieve IRQ and trigger flags in a modern way" for
the SMC91x driver, which was reverted but should now be unreverted
as the patch to driver core was merged :P


> -       irq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
> -       if (!irq_res) {
> +       irq = platform_get_irq(pdev, 0);
> +       if (irq <= 0) {
>                 pr_warn("Could not allocate irq resource\n");

Correct.

> -       dev->irq = irq_res->start;
> -       irq_flags = irq_res->flags & IRQF_TRIGGER_MASK;
> +       dev->irq = irq;
> +       irq_flags = irq_get_trigger_type(irq);

This slightly alters semantics, since any other flags apart from trigger
flags will also be retrieved. maybe you should still add

irq_flags &= IRQF_TRIGGER_MASK;

after this line?

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ