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, 22 Apr 2014 14:27:20 +0200
From:	Linus Walleij <linus.walleij@...aro.org>
To:	Tim Kryger <tim.kryger@...aro.org>
Cc:	Markus Mayer <markus.mayer@...aro.org>,
	Alexandre Courbot <gnurou@...il.com>,
	Broadcom Kernel Feedback List 
	<bcm-kernel-feedback-list@...adcom.com>,
	Linux GPIO Mailing List <linux-gpio@...r.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH] gpio: bcm-kona: Add irq_set_wake method

On Fri, Apr 11, 2014 at 2:00 AM, Tim Kryger <tim.kryger@...aro.org> wrote:

> If a consumer of a GPIO-based IRQ identifies itself as wanting to
> have the capability to wake up the system through that interrupt,
> update the flags to keep that interrupt enabled in suspend.
>
> Signed-off-by: Tim Kryger <tim.kryger@...aro.org>
(...)
> +#ifdef CONFIG_SUSPEND
> +static int bcm_kona_gpio_irq_set_wake(struct irq_data *d, unsigned int on)
> +{
> +
> +       struct irq_desc *desc = container_of(d, struct irq_desc, irq_data);
> +
> +       if (on)
> +               desc->action->flags |= IRQF_NO_SUSPEND;
> +       else
> +               desc->action->flags &= ~IRQF_NO_SUSPEND;
> +
> +       return 0;
> +}
> +#else
> +#define bcm_kona_gpio_irq_set_wake NULL
> +#endif

Tglx: is this generally speaking the right thing to do for a cascaded
irqchip? (It looks a bit odd but makes some sense.)

>  static void bcm_kona_gpio_irq_mask(struct irq_data *d)
>  {
>         struct bcm_kona_gpio *kona_gpio;
> @@ -494,6 +512,7 @@ static struct irq_chip bcm_gpio_irq_chip = {
>         .irq_set_type = bcm_kona_gpio_irq_set_type,
>         .irq_request_resources = bcm_kona_gpio_irq_reqres,
>         .irq_release_resources = bcm_kona_gpio_irq_relres,
> +       .irq_set_wake = bcm_kona_gpio_irq_set_wake,
>  };

So I have introduced the generic GPIO irqchip helpers in order to avoid
fixing exactly this type of bug in 200 different places.

Can you take this action:

(A) Convert the BCM kona driver to use the genric GPIO irqchip
helpers e.g. in the manner of this patch:
http://marc.info/?l=linux-gpio&m=139696011031186&w=2

(B) Make exactly this bug fix in the gpiolib irqchip helpers,
by partching drivers/gpio/gpiolib.c instead?

That way we solve the problem for *several* chips in one go.

Yours,
Linus Walleij
--
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