27 Jul, 2015
9 commits
-
This is a preparatory patch for moving irq_data struct members.
Signed-off-by: Jiang Liu
Cc: Steven Miao
Cc: adi-buildroot-devel@lists.sourceforge.net
Link: http://lkml.kernel.org/r/20150713125611.652550580@linutronix.de
Signed-off-by: Thomas Gleixner -
This is a preparatory patch for moving irq_data struct members.
Signed-off-by: Jiang Liu
Cc: Matt Turner
Link: http://lkml.kernel.org/r/20150713075508.821878421@linutronix.de
Signed-off-by: Thomas Gleixner -
Our irq-bcm7120-l2 interrupt controller driver utilizes the same handler
function for the different parent interrupts it services: UPG_MAIN, UPG_BSC for
instance.The problem is that function reads the IRQSTAT register which can combine
interrupt causes for different parent interrupts, such that we can end-up in
the following situation:- CPU takes an interrupt
- bcm7120_l2_intc_irq_handle() reads IRQSTAT
- generic_handle_irq() is invoked
- there are still pending interrupts flagged in IRQSTAT from a different parent
- handle_bad_irq() is invoked for these since they come from a different irq_desc/irqIn order to fix this, make sure that we always mask IRQSTAT with the
appropriate bits that correspond go the parent interrupt source this is coming
from. To simplify things, associate an unique structure per parent interrupt
handler to avoid multiplying the number of lookups.Fixes: a5042de2688d ("irqchip: bcm7120-l2: Add Broadcom BCM7120-style Level 2 interrupt controller")
Signed-off-by: Florian Fainelli
Cc: linux-mips@linux-mips.org
Cc: cernekee@gmail.com
Cc: jason@lakedaemon.net
Cc: bcm-kernel-feedback-list@broadcom.com
Cc: gregory.0xf0@gmail.com
Cc: computersforpeace@gmail.com
Link: http://lkml.kernel.org/r/1437691941-3100-1-git-send-email-f.fainelli@gmail.com
Signed-off-by: Thomas Gleixner -
Make use of the new irq_chip_generic suspend/resume callbacks.
This is required because if there are no installed child IRQs for this
chip, the irq_chip::irq_{suspend,resume} functions will not be called.
However, we still need to save/restore the forwarding mask, to enable
the top-level GIC interrupt; otherwise, we lose UART output after S3
resume.In addition to refactoring the callbacks, we have to self-initialize the
mask cache, since the genirq core also doesn't initialize this until the
first child IRQ is installed.The original problem report is described in extra detail here:
http://lkml.kernel.org/g/20150619224123.GL4917@ld-irv-0074Signed-off-by: Brian Norris
Tested-by: Florian Fainelli
Cc: Gregory Fong
Cc: bcm-kernel-feedback-list@broadcom.com
Cc: linux-mips@linux-mips.org
Cc: Kevin Cernekee
Cc: Jason Cooper
Link: http://lkml.kernel.org/r/1437607300-40858-2-git-send-email-computersforpeace@gmail.com
Signed-off-by: Thomas Gleixner -
Some (admittedly odd) irqchips perform functions that are not directly
related to any of their child IRQ lines, and therefore need to perform
some tasks during suspend/resume regardless of whether there are
any "installed" interrupts for the irqchip. However, the current
generic-chip framework does not call the chip's irq_{suspend,resume}
when there are no interrupts installed (this makes sense, because there
are no irq_data objects for such a call to be made).More specifically, irq-bcm7120-l2 configures both a forwarding mask
(which affects other top-level GIC IRQs) and a second-level interrupt
mask (for managing its own child interrupts). The former must be
saved/restored on suspend/resume, even when there's nothing to do for
the latter.This patch adds a new set of suspend/resume hooks to irq_chip_generic,
to help represent *chip* suspend/resume, rather than IRQ suspend/resume.
These callbacks will always be called for an IRQ chip (regardless of the
installed interrupts) and are based on the per-chip irq_chip_generic
struct, rather than the per-IRQ irq_data struct.The original problem report is described in extra detail here:
http://lkml.kernel.org/g/20150619224123.GL4917@ld-irv-0074Signed-off-by: Brian Norris
Tested-by: Florian Fainelli
Cc: Gregory Fong
Cc: bcm-kernel-feedback-list@broadcom.com
Cc: linux-mips@linux-mips.org
Cc: Kevin Cernekee
Cc: Jason Cooper
Link: http://lkml.kernel.org/r/1437607300-40858-1-git-send-email-computersforpeace@gmail.com
Signed-off-by: Thomas Gleixner -
Init data marked const should be annotated with __initconst for
correctness and not __initdata. And for those already __initconst,
they should be qualified as const at the compiler level too.
This also fixes LTO builds that otherwise fail with section mismatch
errors.Signed-off-by: Nicolas Pitre
Cc: Jason Cooper
Link: http://lkml.kernel.org/r/alpine.LFD.2.20.1507241511551.1806@knanqh.ubzr
Signed-off-by: Thomas Gleixner -
Export these functions to be able to build the Qualcomm family A PMIC
gpio and mpp drivers as modules.[ tglx: Made them GPL exports ]
Signed-off-by: Bjorn Andersson
Reviewed-by: Mark Brown
Cc: Marc Zyngier
Cc:
Cc:
Cc: Srinivas Kandagatla
Cc: Linus Walleij
Link: http://lkml.kernel.org/r/1437594184-22966-1-git-send-email-bjorn.andersson@sonymobile.com
Signed-off-by: Thomas Gleixner -
Now that the GIC chip implementation enables IRQCHIP_SKIP_SET_WAKE and
IRQCHIP_MASK_ON_SUSPEND by default, the platforms requiring them need
not override the irqchip flags as before.This patch removes all the users of gic_set_irqchip_flags and the
function itself.Signed-off-by: Sudeep Holla
Acked-by: Linus Walleij
Cc: Marc Zyngier
Cc: Simon Horman
Cc: Jason Cooper
Cc: Michal Simek
Cc: Magnus Damm
Cc: Gregory CLEMENT
Cc: Geert Uytterhoeven
Cc: Lorenzo Pieralisi
Cc: linux-arm-kernel@lists.infradead.org
Link: http://lkml.kernel.org/r/1436971109-20189-2-git-send-email-sudeep.holla@arm.com
Signed-off-by: Thomas Gleixner -
The GIC controller doesn't provides any facility to configure the wakeup
sources. For the same reason, GIC chip implementation can't provide
irq_set_wake functionality, but that results in the irqchip core
preventing the systems from entering sleep states like "suspend to RAM".The GICv1/v2 controllers support wakeup events. They signal these wakeup
events even when CPU interface is disabled which means the wakeup
outputs are always enabled with the required logic in always-on domain.
An implementation can powerdown the GIC completely, but then the wake-up
must be relayed to some control logic within the power controller that
acts as wake-up interrupt controller.Setting the IRQCHIP_SKIP_SET_WAKE flags will ensure that the interrupts
from GIC can work as wakeup interrupts and resume from suspend-to-{idle,
ram}. The wakeup interrupt sources need to use enable_irq_wake() and the
irqchip core will then set the IRQD_WAKEUP_STATE flag.Also it's always safer to mask all the non wakeup interrupts are masked
at the chip level when suspending. The irqchip infrastructure can handle
masking of those interrupts at the chip level. The chip implementation
just have to indicate that with IRQCHIP_MASK_ON_SUSPEND.This patch enables IRQCHIP_SKIP_SET_WAKE and IRQCHIP_MASK_ON_SUSPEND so
that the irqchip core allows and handles the power managemant wake up
modes.Signed-off-by: Sudeep Holla
Cc: Marc Zyngier
Cc: Simon Horman
Cc: Jason Cooper
Cc: Michal Simek
Cc: Linus Walleij
Cc: Magnus Damm
Cc: Gregory CLEMENT
Cc: Geert Uytterhoeven
Cc: Lorenzo Pieralisi
Cc: linux-arm-kernel@lists.infradead.org
Link: http://lkml.kernel.org/r/1436971109-20189-1-git-send-email-sudeep.holla@arm.com
Signed-off-by: Thomas Gleixner
26 Jul, 2015
3 commits
-
Use irq_desc_get_xxx() to avoid redundant lookup of irq_desc while we
already have a pointer to corresponding irq_desc.Signed-off-by: Jiang Liu
Acked-by: Hans-Christian Egtvedt
Cc: Haavard Skinnemoen
Link: http://lkml.kernel.org/r/20150713100606.527106283@linutronix.de
Signed-off-by: Thomas Gleixner -
Use irq_set_handler_locked() as it avoids a redundant lookup of the
irq descriptor.Search and replacement was done with coccinelle.
Signed-off-by: Thomas Gleixner
Acked-by: Hans-Christian Egtvedt
Cc: Haavard Skinnemoen
Cc: Jiang Liu
Cc: Julia Lawall
Link: http://lkml.kernel.org/r/20150713100606.448031045@linutronix.de
Signed-off-by: Thomas Gleixner -
Chained irq handlers usually set up handler data as well. We now have
a function to set both under irq_desc->lock. Replace the two calls
with one.Search and conversion was done with coccinelle.
Reported-by: Russell King
Signed-off-by: Thomas Gleixner
Acked-by: Hans-Christian Egtvedt
Cc: Haavard Skinnemoen
Cc: Jiang Liu
Cc: Julia Lawall
Link: http://lkml.kernel.org/r/20150713100606.351640193@linutronix.de
Signed-off-by: Thomas Gleixner
23 Jul, 2015
14 commits
-
Move alloc_msi_entry() from PCI MSI code into generic MSI code, so it
can be reused by other generic MSI drivers. Also introduce
free_msi_entry() for completeness.Suggested-by: Stuart Yoder .
Signed-off-by: Jiang Liu
Reviewed-by: Marc Zyngier
Reviewed-by: Yijing Wang
Acked-by: Bjorn Helgaas
Cc: Tony Luck
Cc: linux-arm-kernel@lists.infradead.org
Cc: Grant Likely
Cc: Borislav Petkov
Cc: Alexander Gordeev
Link: http://lkml.kernel.org/r/1436428847-8886-13-git-send-email-jiang.liu@linux.intel.com
Signed-off-by: Thomas Gleixner -
Reorganize struct msi_desc so it could be reused by other MSI
drivers. We have the following layout now:struct msi_desc {
/* Shared device/bus independent data */
...
union {
/* PCI specific data */
struct {
...
};
};
};We need to have anonymous union and a anonymous structure for the PCI
fields, otherwise we would have to change all instances using these
fields.For non PCI devices we will enforce a proper namespace and a non
anonymous structure.[ tglx: Added proper comments to the structure and massaged changelog ]
Signed-off-by: Jiang Liu
Reviewed-by: Yijing Wang
Reviewed-by: Marc Zyngier
Cc: Tony Luck
Cc: linux-arm-kernel@lists.infradead.org
Cc: Bjorn Helgaas
Cc: Grant Likely
Cc: Stuart Yoder
Cc: Borislav Petkov
Cc: Alexander Gordeev
Link: http://lkml.kernel.org/r/1436428847-8886-12-git-send-email-jiang.liu@linux.intel.com
Signed-off-by: Thomas Gleixner -
Store 'struct device *' instead of 'struct pci_dev *' in struct msi_desc,
so struct msi_desc can be reused by non PCI based MSI drivers.Signed-off-by: Jiang Liu
Reviewed-by: Yijing Wang
Reviewed-by: Marc Zyngier
Cc: Tony Luck
Cc: linux-arm-kernel@lists.infradead.org
Cc: Bjorn Helgaas
Cc: Grant Likely
Cc: Stuart Yoder
Cc: Borislav Petkov
Cc: Alexander Gordeev
Link: http://lkml.kernel.org/r/1436428847-8886-11-git-send-email-jiang.liu@linux.intel.com
Signed-off-by: Thomas Gleixner -
Move msi_list from struct pci_dev into struct device, so we can
support non-PCI-device based generic MSI interrupts.msi_list is now conditional under CONFIG_GENERIC_MSI_IRQ, which is
selected from CONFIG_PCI_MSI, so no functional change for PCI MSI
users.Signed-off-by: Jiang Liu
Reviewed-by: Yijing Wang
Acked-by: Bjorn Helgaas
Cc: Tony Luck
Cc: linux-arm-kernel@lists.infradead.org
Cc: Grant Likely
Cc: Marc Zyngier
Cc: Stuart Yoder
Cc: Borislav Petkov
Cc: Greg Kroah-Hartman
Cc: Joe Perches
Cc: Dmitry Torokhov
Cc: Paul Gortmaker
Cc: Luis R. Rodriguez
Cc: Rafael J. Wysocki
Cc: Joerg Roedel
Cc: Alexander Gordeev
Link: http://lkml.kernel.org/r/1436428847-8886-10-git-send-email-jiang.liu@linux.intel.com
Signed-off-by: Thomas Gleixner -
Use helper functions to access fields in struct msi_desc, so we could
easily refine msi_desc later.Signed-off-by: Jiang Liu
Reviewed-by: Yijing Wang
Cc: Tony Luck
Cc: linux-arm-kernel@lists.infradead.org
Cc: Bjorn Helgaas
Cc: Grant Likely
Cc: Marc Zyngier
Cc: Stuart Yoder
Cc: Borislav Petkov
Cc: Murali Karicheri
Cc: Jingoo Han
Cc: Pratyush Anand
Cc: Michal Simek
Cc: Soeren Brinkmann
Cc: Srikanth Thokala
Cc: Rob Herring
Link: http://lkml.kernel.org/r/1436428847-8886-9-git-send-email-jiang.liu@linux.intel.com
Signed-off-by: Thomas Gleixner -
Use helper functions to access fields in struct msi_desc, so we could
easily refine struct msi_desc later.Signed-off-by: Jiang Liu
Acked-by: David S. Miller
Cc: Tony Luck
Cc: linux-arm-kernel@lists.infradead.org
Cc: Bjorn Helgaas
Cc: Grant Likely
Cc: Marc Zyngier
Cc: Stuart Yoder
Cc: Yijing Wang
Cc: Borislav Petkov
Cc: Eric Snowberg
Link: http://lkml.kernel.org/r/1436428847-8886-8-git-send-email-jiang.liu@linux.intel.com
Signed-off-by: Thomas Gleixner -
Use accessor for_each_pci_msi_entry() to access MSI device list, so we
could easily move msi_list from struct pci_dev into struct device
later.Signed-off-by: Jiang Liu
Reviewed-by: Yijing Wang
Acked-by: Bjorn Helgaas
Acked-by: Konrad Rzeszutek Wilk
Cc: Tony Luck
Cc: linux-arm-kernel@lists.infradead.org
Cc: xen-devel@lists.xenproject.org
Cc: Grant Likely
Cc: Marc Zyngier
Cc: Stuart Yoder
Cc: Borislav Petkov
Cc: Boris Ostrovsky
Cc: David Vrabel
Link: http://lkml.kernel.org/r/1436428847-8886-7-git-send-email-jiang.liu@linux.intel.com
Signed-off-by: Thomas Gleixner -
Use accessor for_each_pci_msi_entry() to access MSI device list, so we
could easily move msi_list from struct pci_dev into struct device
later.Signed-off-by: Jiang Liu
Acked-by: Konrad Rzeszutek Wilk
Cc: Tony Luck
Cc: linux-arm-kernel@lists.infradead.org
Cc: xen-devel@lists.xenproject.org
Cc: Bjorn Helgaas
Cc: Grant Likely
Cc: Marc Zyngier
Cc: Stuart Yoder
Cc: Yijing Wang
Cc: Borislav Petkov
Link: http://lkml.kernel.org/r/1436428847-8886-6-git-send-email-jiang.liu@linux.intel.com
Signed-off-by: Thomas Gleixner -
Use accessor for_each_pci_msi_entry() to access MSI device list, so we could
easily move msi_list from struct pci_dev into struct device later.Signed-off-by: Jiang Liu
Acked-by: Sebastian Ott
Cc: Tony Luck
Cc: linux-arm-kernel@lists.infradead.org
Cc: Bjorn Helgaas
Cc: Grant Likely
Cc: Marc Zyngier
Cc: Stuart Yoder
Cc: Yijing Wang
Cc: Borislav Petkov
Cc: Gerald Schaefer
Cc: Martin Schwidefsky
Cc: Heiko Carstens
Cc: linux390@de.ibm.com
Link: http://lkml.kernel.org/r/1436428847-8886-5-git-send-email-jiang.liu@linux.intel.com
Signed-off-by: Thomas Gleixner -
Use accessor for_each_pci_msi_entry() to access MSI device list, so we
could easily move msi_list from struct pci_dev into struct device
later.Signed-off-by: Jiang Liu
Cc: Tony Luck
Cc: linux-arm-kernel@lists.infradead.org
Cc: linuxppc-dev@lists.ozlabs.org
Cc: Bjorn Helgaas
Cc: Grant Likely
Cc: Marc Zyngier
Cc: Stuart Yoder
Cc: Yijing Wang
Cc: Borislav Petkov
Cc: Arnd Bergmann
Cc: Benjamin Herrenschmidt
Cc: Paul Mackerras
Cc: Michael Ellerman
Cc: Olof Johansson
Cc: Gavin Shan
Cc: Alexey Kardashevskiy
Cc: David Gibson
Cc: Daniel Axtens
Cc: Wei Yang
Cc: Nishanth Aravamudan
Cc: Alexander Gordeev
Cc: Scott Wood
Cc: Laurentiu Tudor
Cc: Tudor Laurentiu
Cc: Hongtao Jia
Link: http://lkml.kernel.org/r/1436428847-8886-4-git-send-email-jiang.liu@linux.intel.com
Signed-off-by: Thomas Gleixner -
Use accessor for_each_pci_msi_entry() to access MSI device list, so we
could easily move msi_list from struct pci_dev into struct device
later.Signed-off-by: Jiang Liu
Cc: Tony Luck
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-mips@linux-mips.org
Cc: Bjorn Helgaas
Cc: Grant Likely
Cc: Marc Zyngier
Cc: Stuart Yoder
Cc: Yijing Wang
Cc: Borislav Petkov
Cc: Ralf Baechle
Link: http://lkml.kernel.org/r/1436428847-8886-3-git-send-email-jiang.liu@linux.intel.com
Signed-off-by: Thomas Gleixner -
Add helper function msi_desc_to_pci_sysdata() to retrieve sysdata from
an MSI descriptor. To avoid pulling include/linux/pci.h into
include/linux/msi.h, msi_desc_to_pci_sysdata() is implemented as a normal
function instead of an inline function.Signed-off-by: Jiang Liu
Reviewed-by: Yijing Wang
Acked-by: Bjorn Helgaas
Cc: Tony Luck
Cc: linux-arm-kernel@lists.infradead.org
Cc: Grant Likely
Cc: Marc Zyngier
Cc: Stuart Yoder
Cc: Borislav Petkov
Cc: Alexander Gordeev
Link: http://lkml.kernel.org/r/1436428847-8886-2-git-send-email-jiang.liu@linux.intel.com
Signed-off-by: Thomas Gleixner -
Update the last pr_warning callsite in drivers/irqchip.
Signed-off-by: Wang Long
Cc:
Cc:
Cc:
Cc:
Cc:
Cc:
Link: http://lkml.kernel.org/r/1437466261-147373-1-git-send-email-long.wanglong@huawei.com
Signed-off-by: Thomas Gleixner -
As it turns out the current IRQ number will *always* be available from
SIR register which renders the reads of PENDING registers as plain
unnecessary overhead.In order to catch any situation where SIR reads as zero, we're adding
a WARN() to turn it into a very verbose error and users actually
report it.With this patch average running time of omap_intc_handle_irq() reduced
from about 28.5us to 19.8us as measured by the kernel function
profiler.Tested with BeagleBoneBlack Rev A5C.
Tested-by: Tony Lindgren
Signed-off-by: Felipe Balbi
Cc: Linux ARM Kernel Mailing List
Link: http://lkml.kernel.org/r/20150720204910.GH5394@saruman.tx.rr.com
Signed-off-by: Thomas Gleixner
20 Jul, 2015
3 commits
-
Instead of locally caching the virq as domain_irq simply rely on the
IRQ domain code and irq_find_mapping(). This reduces the delta
between the IRQC driver and the generic chip implementation.Signed-off-by: Magnus Damm
Cc: jason@lakedaemon.net
Cc: geert+renesas@glider.be
Cc: horms@verge.net.au
Cc: Magnus Damm
Link: http://lkml.kernel.org/r/20150720100635.2552.20906.sendpatchset@little-apple
Signed-off-by: Thomas Gleixner -
Use linear IRQ domain instead of irq_domain_add_simple() that also
handles non-DT cases. This reduces the delta between the IRQC code and
the generic chip implementation.Signed-off-by: Magnus Damm
Cc: jason@lakedaemon.net
Cc: geert+renesas@glider.be
Cc: horms@verge.net.au
Cc: Magnus Damm
Link: http://lkml.kernel.org/r/20150720100625.2552.63939.sendpatchset@little-apple
Signed-off-by: Thomas Gleixner -
IRQF_VALID is not needed on ARM anymore, so get rid of it.
Signed-off-by: Magnus Damm
Cc: jason@lakedaemon.net
Cc: geert+renesas@glider.be
Cc: horms@verge.net.au
Cc: Magnus Damm
Link: http://lkml.kernel.org/r/20150720100614.2552.86867.sendpatchset@little-apple
Signed-off-by: Thomas Gleixner
17 Jul, 2015
11 commits
-
Signed-off-by: Thomas Gleixner
-
Chained irq handlers usually set up handler data as well. We now have
a function to set both under irq_desc->lock. Replace the two calls
with one.Search and conversion was done with coccinelle.
Reported-by: Russell King
Signed-off-by: Thomas Gleixner
Cc: Julia Lawall
Cc: Murali Karicheri
Cc: Bjorn Helgaas
Cc: linux-pci@vger.kernel.org
Cc: Jiang Liu -
Use irq_data_get_msi_desc() to avoid redundant lookup of irq_data while we
already have a pointer to corresponding irq_data.Signed-off-by: Jiang Liu
Cc: Bjorn Helgaas
Cc: Murali Karicheri
Cc: linux-pci@vger.kernel.org
Signed-off-by: Thomas Gleixner -
Use irq_data access helper to access irq_data->msi_desc, so we can
move msi_desc from struct irq_data into struct irq_common_data later.Signed-off-by: Jiang Liu
Cc: Bjorn Helgaas
Cc: Tony Luck
Cc: Fenghua Yu
Cc: Benjamin Herrenschmidt
Cc: Paul Mackerras
Cc: Michael Ellerman
Cc: Chris Metcalf
Signed-off-by: Thomas Gleixner -
Rename irq_data_get_msi() as irq_data_get_msi_desc() to keep consistency
with other irq_data access helpers.Signed-off-by: Jiang Liu
Acked-by: Bjorn Helgaas
Cc: Jason Cooper
Signed-off-by: Thomas Gleixner -
The irq argument of most interrupt flow handlers is unused or merily
used instead of a local variable. The handlers which need the irq
argument can retrieve the irq number from the irq descriptor.Search and update was done with coccinelle and the invaluable help of
Julia Lawall.Signed-off-by: Thomas Gleixner
Cc: Julia Lawall -
The irq argument of most interrupt flow handlers is unused or merily
used instead of a local variable. The handlers which need the irq
argument can retrieve the irq number from the irq descriptor.Search and update was done with coccinelle and the invaluable help of
Julia Lawall.Signed-off-by: Thomas Gleixner
Cc: Julia Lawall -
The irq argument of most interrupt flow handlers is unused or merily
used instead of a local variable. The handlers which need the irq
argument can retrieve the irq number from the irq descriptor.Search and update was done with coccinelle and the invaluable help of
Julia Lawall.Signed-off-by: Thomas Gleixner
Cc: Julia Lawall -
The irq argument of most interrupt flow handlers is unused or merily
used instead of a local variable. The handlers which need the irq
argument can retrieve the irq number from the irq descriptor.Search and update was done with coccinelle and the invaluable help of
Julia Lawall.Signed-off-by: Thomas Gleixner
Cc: Julia Lawall -
The irq argument of most interrupt flow handlers is unused or merily
used instead of a local variable. The handlers which need the irq
argument can retrieve the irq number from the irq descriptor.Search and update was done with coccinelle and the invaluable help of
Julia Lawall.Signed-off-by: Thomas Gleixner
Cc: Julia Lawall -
The irq argument of most interrupt flow handlers is unused or merily
used instead of a local variable. The handlers which need the irq
argument can retrieve the irq number from the irq descriptor.Search and update was done with coccinelle and the invaluable help of
Julia Lawall.Signed-off-by: Thomas Gleixner
Cc: Julia Lawall