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: <4D7ABA9D.8070705@codeaurora.org>
Date:	Fri, 11 Mar 2011 16:13:17 -0800
From:	Abhijeet Dharmapurikar <adharmap@...eaurora.org>
To:	Thomas Gleixner <tglx@...utronix.de>
CC:	davidb@...eaurora.org, "David S. Miller" <davem@...emloft.net>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Bryan Huntsman <bryanh@...eaurora.org>,
	Daniel Walker <dwalker@...o99.com>,
	David Collins <collinsd@...eaurora.org>,
	Grant Likely <grant.likely@...retlab.ca>,
	Greg Kroah-Hartman <gregkh@...e.de>,
	Joe Perches <joe@...ches.com>,
	Russell King <linux@....linux.org.uk>,
	Samuel Ortiz <sameo@...ux.intel.com>,
	Stepan Moskovchenko <stepanm@...eaurora.org>,
	Mark Brown <broonie@...nsource.wolfsonmicro.com>,
	Linus Walleij <linus.walleij@...rricsson.com>,
	linux-arm-kernel@...ts.infradead.org,
	linux-arm-msm@...r.kernel.org, LKML <linux-kernel@...r.kernel.org>
Subject: Re: [Qualcomm PM8921 MFD v2 2/6] mfd: pm8xxx: Add irq support

Thomas Gleixner wrote:
> So I deduce, that your HW has no way to mark the wakeup
> interrupts. Whack your HW designer on my behalf, please! :)
> 
> Patch below against:
> 
> git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip.git irq/core
> 
> It's 8 lines, but that's still at least an order of magnitude less
> than solving this with an workaround. :)
> 
> Thanks,
> 
> 	tglx
> 
> ---------->
> Subject: genirq-force-mask-on-suspend.patch
> From: Thomas Gleixner <tglx@...utronix.de>
> Date: Fri, 11 Mar 2011 21:22:14 +0100
> 
> Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
> ---
>  include/linux/irq.h |    2 ++
>  kernel/irq/pm.c     |   14 ++++++++++----
>  2 files changed, 12 insertions(+), 4 deletions(-)
> 
> Index: linux-2.6-tip/include/linux/irq.h
> ===================================================================
> --- linux-2.6-tip.orig/include/linux/irq.h
> +++ linux-2.6-tip/include/linux/irq.h
> @@ -330,10 +330,12 @@ struct irq_chip {
>   *
>   * IRQCHIP_SET_TYPE_MASKED:	Mask before calling chip.irq_set_type()
>   * IRQCHIP_EOI_IF_HANDLED:	Only issue irq_eoi() when irq was handled
> + * IRQCHIP_MASK_ON_SUSPEND:	Mask non wake irqs in the suspend path
>   */
>  enum {
>  	IRQCHIP_SET_TYPE_MASKED		= (1 <<  0),
>  	IRQCHIP_EOI_IF_HANDLED		= (1 <<  1),
> +	IRQCHIP_MASK_ON_SUSPEND		= (2 <<  1),
>  };
>  
>  /* This include will go away once we isolated irq_desc usage to core code */
> Index: linux-2.6-tip/kernel/irq/pm.c
> ===================================================================
> --- linux-2.6-tip.orig/kernel/irq/pm.c
> +++ linux-2.6-tip/kernel/irq/pm.c
> @@ -68,10 +68,16 @@ int check_wakeup_irqs(void)
>  	struct irq_desc *desc;
>  	int irq;
>  
> -	for_each_irq_desc(irq, desc)
> -		if (irqd_is_wakeup_set(&desc->irq_data) &&
> -		    (desc->istate & IRQS_PENDING))
> -			return -EBUSY;
> +	for_each_irq_desc(irq, desc) {
> +		if (irqd_is_wakeup_set(&desc->irq_data)) {
> +			if (desc->istate & IRQS_PENDING)
> +				return -EBUSY;
> +			continue;
> +		}
> +		if (desc->istate & IRQS_SUSPENDED &&
> +		    irq_desc_get_chip(desc)->flags & IRQCHIP_MASK_ON_SUSPEND)
> +			mask_irq(desc);
> +	}
>  
>  	return 0;
>  }

Awesome. This addresses the suspend/resume concerns. Thanks so much.
Reviewed-by: Abhijeet Dharmapurikar <adharmap@...eaurora.org>

To avoid compile time issues, I will add
.flags = IRQCHIP_MASK_ON_SUSPEND
in my driver at a later time (after this change is pulled in).

--
Sent by an employee of the Qualcomm Innovation Center, Inc. The Qualcomm 
Innovation Center, Inc. is a member of the Code Aurora Forum.
--
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