Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755854AbbGUVXu (ORCPT ); Tue, 21 Jul 2015 17:23:50 -0400 Received: from www.linutronix.de ([62.245.132.108]:35215 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752203AbbGUVXt (ORCPT ); Tue, 21 Jul 2015 17:23:49 -0400 Date: Tue, 21 Jul 2015 23:23:33 +0200 (CEST) From: Thomas Gleixner To: Florian Fainelli cc: Brian Norris , Gregory Fong , bcm-kernel-feedback-list@broadcom.com, linux-kernel@vger.kernel.org, linux-mips@linux-mips.org, Kevin Cernekee , Jason Cooper Subject: Re: [PATCH 1/2] genirq: add chip_{suspend,resume} PM support to irq_chip In-Reply-To: <55AE8E5D.8020700@gmail.com> Message-ID: References: <20150619224123.GL4917@ld-irv-0074> <1434756403-379-1-git-send-email-computersforpeace@gmail.com> <55AE8E5D.8020700@gmail.com> User-Agent: Alpine 2.11 (DEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3528 Lines: 78 On Tue, 21 Jul 2015, Florian Fainelli wrote: > On 20/06/15 07:11, Thomas Gleixner wrote: > > On Fri, 19 Jun 2015, Brian Norris wrote: > >> This patch adds a second set of suspend/resume hooks to irq_chip, this > >> time to represent *chip* suspend/resume, rather than IRQ suspend/resume. > >> These callbacks will always be called for an irqchip and are based on > >> the per-chip irq_chip_generic struct, rather than the per-IRQ irq_data > >> struct. > > > > There is no per-chip irq_chip_generic struct. It's only there if the > > irq chip has been instantiated as a generic chip. > > > >> /** > >> * struct irq_chip - hardware interrupt chip descriptor > >> * > >> @@ -317,6 +319,12 @@ static inline irq_hw_number_t irqd_to_hwirq(struct irq_data *d) > >> * @irq_suspend: function called from core code on suspend once per chip > >> * @irq_resume: function called from core code on resume once per chip > >> * @irq_pm_shutdown: function called from core code on shutdown once per chip > >> + * @chip_suspend: function called from core code on suspend once per > >> + * chip; for handling chip details even when no interrupts > >> + * are in use > >> + * @chip_resume: function called from core code on resume once per chip; > >> + * for handling chip details even when no interrupts are > >> + * in use > >> * @irq_calc_mask: Optional function to set irq_data.mask for special cases > >> * @irq_print_chip: optional to print special chip info in show_interrupts > >> * @irq_request_resources: optional to request resources before calling > >> @@ -357,6 +365,8 @@ struct irq_chip { > >> void (*irq_suspend)(struct irq_data *data); > >> void (*irq_resume)(struct irq_data *data); > >> void (*irq_pm_shutdown)(struct irq_data *data); > >> + void (*chip_suspend)(struct irq_chip_generic *gc); > >> + void (*chip_resume)(struct irq_chip_generic *gc); > > > > I really don't want to set a precedent for random (*foo)(*bar) > > callbacks. > > > >> + > >> + if (ct->chip.chip_suspend) > >> + ct->chip.chip_suspend(gc); > > > > So wouldn't it be the more intuitive solution to make this a callback > > in the struct gc itself? > > Brian can correct me, but his approach is more generic, if there is > another irqchip driver needing a similar infrastructure, this would be > already there, and directly usable. No it's not directly usable. It's only usable with irq_chip_generic incarnations. > Maybe all we need to is to change the chip_suspend/resume arguments > to pass a reference to irq_chip instead? I just read back on the problem report which was mentioned in the changelog: "It's not a problem with patch 7, exactly, it's a problem with the irqchip driver which handles the UART interrupt mask (irq-bcm7120-l2.c). The problem is that with a trimmed down device tree (such as the one found at arch/arm/boot/dts/bcm7445-bcm97445svmb.dtb), none of the child interrupts of the 'irq0_intc' node are described -- we don't have device tree nodes for them yet -- but we still require saving and restoring the forwarding mask (see 'brcm,int-fwd-mask') in order for the UART interrupts to continue operating." So you are trying to work around a flaw in the device tree by adding random callbacks to the core kernel? Thanks, tglx -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/