#
d23b2516 |
| 29-Jun-2015 |
Jeremy Linton <lintonrjeremy@gmail.com> |
of/irq: Fix pSeries boot failure
of_irq_parse_raw() needs to return the correct interrupt controller node when an interrupt-map property doesn't exist.
It allows of_irq_parse_raw() to return the no
of/irq: Fix pSeries boot failure
of_irq_parse_raw() needs to return the correct interrupt controller node when an interrupt-map property doesn't exist.
It allows of_irq_parse_raw() to return the node pointer of the interrupt controller, rather than the parent bus. This allows ics_rtas_host_match() to detect that the controller is a legacy 8259 and avoid using xics. This avoids an RTAS assertion/crash during early kernel bootstrapping.
Signed-off-by: Jeremy Linton <lintonrjeremy@gmail.com> Reviewed-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Grant Likely <grant.likely@linaro.org>
show more ...
|
#
d7c14605 |
| 17-Mar-2015 |
Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> |
of/irq: Fix of_irq_parse_one() returned error codes
The error code paths that require cleanup use a goto to jump to the cleanup code and return an error code. However, the error code variable res, w
of/irq: Fix of_irq_parse_one() returned error codes
The error code paths that require cleanup use a goto to jump to the cleanup code and return an error code. However, the error code variable res, which is initialized to -EINVAL when declared, is then overwritten with the return value of of_parse_phandle_with_args(), and reused as the return code from of_irq_parse_one(). This leads to an undetermined error being returned instead of the expected -EINVAL value. Fix it.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Cc: stable@vger.kernel.org # 3.13+ Signed-off-by: Rob Herring <robh@kernel.org>
show more ...
|
#
9eb08fb3 |
| 30-Oct-2014 |
Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> |
of/irq: Export of_irq_get()
The function will be used by the I2C core which can be compiled as a module.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Rob He
of/irq: Export of_irq_get()
The function will be used by the I2C core which can be compiled as a module.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Rob Herring <robh@kernel.org> Acked-by: Grant Likely <grant.likely@linaro.org> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
show more ...
|
#
a9ecdc0f |
| 06-Aug-2014 |
Florian Fainelli <f.fainelli@gmail.com> |
of/irq: Fix lookup to use 'interrupts-extended' property first
In case the Device Tree blob passed by the boot agent supplies both an 'interrupts-extended' and an 'interrupts' property in order to a
of/irq: Fix lookup to use 'interrupts-extended' property first
In case the Device Tree blob passed by the boot agent supplies both an 'interrupts-extended' and an 'interrupts' property in order to allow for older kernels to be usable, prefer the new-style 'interrupts-extended' property which conveys a lot more information.
This allows us to have bootloaders willingly maintaining backwards compatibility with older kernels without entirely deprecating the 'interrupts' property.
Update the bindings documentation to describe a situation where both the 'interrupts-extended' and the 'interrupts' property are present, and which one takes precedence over the other.
Cc: stable@vger.kernel.org # 3.13+ Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Grant Likely <grant.likely@linaro.org>
show more ...
|
#
ad69674e |
| 20-May-2014 |
Grygorii Strashko <grygorii.strashko@ti.com> |
of/irq: do irq resolution in platform_get_irq_byname()
The commit 9ec36cafe43bf835f8f29273597a5b0cbc8267ef "of/irq: do irq resolution in platform_get_irq" from Rob Herring - moves resolving of the i
of/irq: do irq resolution in platform_get_irq_byname()
The commit 9ec36cafe43bf835f8f29273597a5b0cbc8267ef "of/irq: do irq resolution in platform_get_irq" from Rob Herring - moves resolving of the interrupt resources in platform_get_irq(). But this solution isn't complete because platform_get_irq_byname() need to be modified the same way.
Hence, fix it by adding interrupt resolution code at the platform_get_irq_byname() function too.
Cc: Russell King <linux@arm.linux.org.uk> Cc: Rob Herring <robh@kernel.org> Cc: Tony Lindgren <tony@atomide.com> Cc: Grant Likely <grant.likely@linaro.org> Cc: Thierry Reding <thierry.reding@gmail.com>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com> Signed-off-by: Grant Likely <grant.likely@linaro.org>
show more ...
|
#
9ec36caf |
| 23-Apr-2014 |
Rob Herring <robh@kernel.org> |
of/irq: do irq resolution in platform_get_irq
Currently we get the following kind of errors if we try to use interrupt phandles to irqchips that have not yet initialized:
irq: no irq domain found f
of/irq: do irq resolution in platform_get_irq
Currently we get the following kind of errors if we try to use interrupt phandles to irqchips that have not yet initialized:
irq: no irq domain found for /ocp/pinmux@48002030 ! ------------[ cut here ]------------ WARNING: CPU: 0 PID: 1 at drivers/of/platform.c:171 of_device_alloc+0x144/0x184() Modules linked in: CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.12.0-00038-g42a9708 #1012 (show_stack+0x14/0x1c) (dump_stack+0x6c/0xa0) (warn_slowpath_common+0x64/0x84) (warn_slowpath_null+0x1c/0x24) (of_device_alloc+0x144/0x184) (of_platform_device_create_pdata+0x44/0x9c) (of_platform_bus_create+0xd0/0x170) (of_platform_bus_create+0x12c/0x170) (of_platform_populate+0x60/0x98)
This is because we're wrongly trying to populate resources that are not yet available. It's perfectly valid to create irqchips dynamically, so let's fix up the issue by resolving the interrupt resources when platform_get_irq is called.
And then we also need to accept the fact that some irqdomains do not exist that early on, and only get initialized later on. So we can make the current WARN_ON into just into a pr_debug().
We still attempt to populate irq resources when we create the devices. This allows current drivers which don't use platform_get_irq to continue to function. Once all drivers are fixed, this code can be removed.
Suggested-by: Russell King <linux@arm.linux.org.uk> Signed-off-by: Rob Herring <robh@kernel.org> Signed-off-by: Tony Lindgren <tony@atomide.com> Tested-by: Tony Lindgren <tony@atomide.com> Cc: stable@vger.kernel.org # v3.10+ Signed-off-by: Grant Likely <grant.likely@linaro.org>
show more ...
|
#
ae107d06 |
| 22-Apr-2014 |
Geert Uytterhoeven <geert+renesas@glider.be> |
dt: Fix binding typos in clock-names and interrupt-names
s/interrupts-names/interrupt-names/g s/clocks-names/clock-names/g
Some of the binding files and device tree files get this wrong and the ker
dt: Fix binding typos in clock-names and interrupt-names
s/interrupts-names/interrupt-names/g s/clocks-names/clock-names/g
Some of the binding files and device tree files get this wrong and the kernel won't be able to pick it up. Fix them up now so that they don't get widely used.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Acked-by : Patrice Chotard <patrice.chotard@st.com> Signed-off-by: Grant Likely <grant.likely@linaro.org>
show more ...
|
#
2f53a713 |
| 17-Dec-2013 |
Cédric Le Goater <clg@fr.ibm.com> |
of/irq: Fix device_node refcount in of_irq_parse_raw()
Commit 2361613206e6, "of/irq: Refactor interrupt-map parsing" changed the refcount on the device_node causing an error in of_node_put():
ERROR
of/irq: Fix device_node refcount in of_irq_parse_raw()
Commit 2361613206e6, "of/irq: Refactor interrupt-map parsing" changed the refcount on the device_node causing an error in of_node_put():
ERROR: Bad of_node_put() on /pci@800000020000000 CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.13.0-rc3-dirty #2 Call Trace: [c00000003e403500] [c0000000000144fc] .show_stack+0x7c/0x1f0 (unreliable) [c00000003e4035d0] [c00000000070f250] .dump_stack+0x88/0xb4 [c00000003e403650] [c0000000005e8768] .of_node_release+0xd8/0xf0 [c00000003e4036e0] [c0000000005eeafc] .of_irq_parse_one+0x10c/0x280 [c00000003e4037a0] [c0000000005efd4c] .of_irq_parse_pci+0x3c/0x1d0 [c00000003e403840] [c000000000038240] .pcibios_setup_device+0xa0/0x2e0 [c00000003e403910] [c0000000000398f0] .pcibios_setup_bus_devices+0x60/0xd0 [c00000003e403990] [c00000000003b3a4] .__of_scan_bus+0x1a4/0x2b0 [c00000003e403a80] [c00000000003a62c] .pcibios_scan_phb+0x30c/0x410 [c00000003e403b60] [c0000000009fe430] .pcibios_init+0x7c/0xd4
This patch adjusts the refcount in the walk of the interrupt tree. When a match is found, there is no need to increase the refcount on 'out_irq->np' as 'newpar' is already holding a ref. The refcount balance between 'ipar' and 'newpar' is maintained in the skiplevel: goto label.
This patch also removes the usage of the device_node variable 'old' which seems useless after the latest changes.
Signed-off-by: Cédric Le Goater <clg@fr.ibm.com> Signed-off-by: Rob Herring <robh@kernel.org>
show more ...
|
#
1ca56e7d |
| 28-Nov-2013 |
Peter Crosthwaite <peter.crosthwaite@xilinx.com> |
of: irq: Ignore disabled intc's when searching map
When searching the interrupt map, if a matched parent is disabled, just ignore it and move on with the search.
This allows for specifying connecti
of: irq: Ignore disabled intc's when searching map
When searching the interrupt map, if a matched parent is disabled, just ignore it and move on with the search.
This allows for specifying connection of a single device IRQ to multiple interrupt controllers via the interrupt map schema. This change allows for selection of the active interrupt controller via the already existing status = "disabled" mechanism.
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Acked-by: Michal Simek <michal.simek@xilinx.com> Signed-off-by: Rob Herring <rob.herring@calxeda.com>
show more ...
|
#
bf49be02 |
| 28-Nov-2013 |
Peter Crosthwaite <peter.crosthwaite@xilinx.com> |
of: irq: Ignore disabled interrupt controllers
When searching the system for interrupt controllers, skip over any that are explicitly disabled.
This makes interrupt controllers consistent with regu
of: irq: Ignore disabled interrupt controllers
When searching the system for interrupt controllers, skip over any that are explicitly disabled.
This makes interrupt controllers consistent with regular devices, which can be marked as do-not-probe via the status = "disabled" dts property.
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Acked-by: Michal Simek <michal.simek@xilinx.com> Signed-off-by: Rob Herring <rob.herring@calxeda.com>
show more ...
|
#
74dac2ed |
| 05-Nov-2013 |
Tomasz Figa <t.figa@samsung.com> |
of: irq: Fix interrupt-map entry matching
This patch fixes interrupt-map entry matching code to properly match all specifier cells with interrupt map entries.
Signed-off-by: Tomasz Figa <t.figa@sam
of: irq: Fix interrupt-map entry matching
This patch fixes interrupt-map entry matching code to properly match all specifier cells with interrupt map entries.
Signed-off-by: Tomasz Figa <t.figa@samsung.com> Tested-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Rob Herring <rob.herring@calxeda.com>
show more ...
|
#
355e62f5 |
| 02-Nov-2013 |
Grant Likely <grant.likely@linaro.org> |
of/irq: Fix potential buffer overflow
Commit 2361613206e6, "of/irq: Refactor interrupt-map parsing" introduced a potential buffer overflow bug because it doesn't do sufficient range checking on the
of/irq: Fix potential buffer overflow
Commit 2361613206e6, "of/irq: Refactor interrupt-map parsing" introduced a potential buffer overflow bug because it doesn't do sufficient range checking on the input data. This patch adds the appropriate checking and buffer size adjustments. If the bounds are out of range then warn loudly. MAX_PHANDLE_ARGS should be sufficient. If it is not then the value can be increased.
Signed-off-by: Grant Likely <grant.likely@linaro.org> Cc: Rob Herring <rob.herring@calxeda.com>
show more ...
|
#
78119fd1 |
| 01-Nov-2013 |
Grant Likely <grant.likely@linaro.org> |
of/irq: Fix bug in interrupt parsing refactor.
Commit 2361613206e6, "of/irq: Refactor interrupt-map parsing" introduced a bug. The irq parsing will fail for some nodes that don't have a reg property
of/irq: Fix bug in interrupt parsing refactor.
Commit 2361613206e6, "of/irq: Refactor interrupt-map parsing" introduced a bug. The irq parsing will fail for some nodes that don't have a reg property. It is fixed by deferring the check for reg until it is actually needed. Also adjust the testcase data to catch the bug.
Signed-off-by: Grant Likely <grant.likely@linaro.org> Tested-by: Stephen Warren <swarren@nvidia.com> Tested-by: Ming Lei <tom.leiming@gmail.com> Tested-by: Stephen Warren <swarren@nvidia.com> Cc: Rob Herring <rob.herring@calxeda.com>
show more ...
|
#
79d97015 |
| 19-Sep-2013 |
Grant Likely <grant.likely@linaro.org> |
of/irq: create interrupts-extended property
The standard interrupts property in device tree can only handle interrupts coming from a single interrupt parent. If a device is wired to multiple interru
of/irq: create interrupts-extended property
The standard interrupts property in device tree can only handle interrupts coming from a single interrupt parent. If a device is wired to multiple interrupt controllers, then it needs to be attached to a node with an interrupt-map property to demux the interrupt specifiers which is confusing. It would be a lot easier if there was a form of the interrupts property that allows for a separate interrupt phandle for each interrupt specifier.
This patch does exactly that by creating a new interrupts-extended property which reuses the phandle+arguments pattern used by GPIOs and other core bindings.
Signed-off-by: Grant Likely <grant.likely@linaro.org> Acked-by: Tony Lindgren <tony@atomide.com> Acked-by: Kumar Gala <galak@codeaurora.org> [grant.likely: removed versatile platform hunks into separate patch] Cc: Rob Herring <rob.herring@calxeda.com>
show more ...
|
#
3da52787 |
| 18-Sep-2013 |
Thierry Reding <thierry.reding@gmail.com> |
of/irq: Rework of_irq_count()
The of_irq_to_resource() helper that is used to implement of_irq_count() tries to resolve interrupts and in fact creates a mapping for resolved interrupts. That's prett
of/irq: Rework of_irq_count()
The of_irq_to_resource() helper that is used to implement of_irq_count() tries to resolve interrupts and in fact creates a mapping for resolved interrupts. That's pretty heavy lifting for something that claims to just return the number of interrupts requested by a given device node.
Instead, use the more lightweight of_irq_map_one(), which, despite the name, doesn't create an actual mapping. Perhaps a better name would be of_irq_translate_one().
Signed-off-by: Thierry Reding <treding@nvidia.com> Acked-by: Rob Herring <rob.herring@calxeda.com> [grant.likely: fixup s/of_irq_map_one/of_irq_parse_one/] Signed-off-by: Grant Likely <grant.likely@linaro.org>
show more ...
|
#
624cfca5 |
| 11-Oct-2013 |
Grant Likely <grant.likely@linaro.org> |
of: Add helper for printing an of_phandle_args structure
It is sometimes useful for debug to get the contents of an of_phandle_args structure out into the kernel log.
Signed-off-by: Grant Likely <g
of: Add helper for printing an of_phandle_args structure
It is sometimes useful for debug to get the contents of an of_phandle_args structure out into the kernel log.
Signed-off-by: Grant Likely <grant.likely@linaro.org>
show more ...
|
#
23616132 |
| 15-Sep-2013 |
Grant Likely <grant.likely@linaro.org> |
of/irq: Refactor interrupt-map parsing
All the users of of_irq_parse_raw pass in a raw interrupt specifier from the device tree and expect it to be returned (possibly modified) in an of_phandle_args
of/irq: Refactor interrupt-map parsing
All the users of of_irq_parse_raw pass in a raw interrupt specifier from the device tree and expect it to be returned (possibly modified) in an of_phandle_args structure. However, the primary function of of_irq_parse_raw() is to check for translations due to the presence of one or more interrupt-map properties. The actual placing of the data into an of_phandle_args structure is trivial. If it is refactored to accept an of_phandle_args structure directly, then it becomes possible to consume of_phandle_args from other sources. This is important for an upcoming patch that allows a device to be connected to more than one interrupt parent. It also simplifies the code a bit.
The biggest complication with this patch is that the old version works on the interrupt specifiers in __be32 form, but the of_phandle_args structure is intended to carry it in the cpu-native version. A bit of churn was required to make this work. In the end it results in tighter code, so the churn is worth it.
Signed-off-by: Grant Likely <grant.likely@linaro.org> Acked-by: Tony Lindgren <tony@atomide.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
show more ...
|
#
e6d30ab1 |
| 15-Sep-2013 |
Grant Likely <grant.likely@linaro.org> |
of/irq: simplify args to irq_create_of_mapping
All the callers of irq_create_of_mapping() pass the contents of a struct of_phandle_args structure to the function. Since all the callers already have
of/irq: simplify args to irq_create_of_mapping
All the callers of irq_create_of_mapping() pass the contents of a struct of_phandle_args structure to the function. Since all the callers already have an of_phandle_args pointer, why not pass it directly to irq_create_of_mapping()?
Signed-off-by: Grant Likely <grant.likely@linaro.org> Acked-by: Michal Simek <monstr@monstr.eu> Acked-by: Tony Lindgren <tony@atomide.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Russell King <linux@arm.linux.org.uk> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
show more ...
|
#
530210c7 |
| 15-Sep-2013 |
Grant Likely <grant.likely@linaro.org> |
of/irq: Replace of_irq with of_phandle_args
struct of_irq and struct of_phandle_args are exactly the same structure. This patch makes the kernel use of_phandle_args everywhere. This in itself isn't
of/irq: Replace of_irq with of_phandle_args
struct of_irq and struct of_phandle_args are exactly the same structure. This patch makes the kernel use of_phandle_args everywhere. This in itself isn't a big deal, but it makes some follow-on patches simpler.
Signed-off-by: Grant Likely <grant.likely@linaro.org> Acked-by: Michal Simek <monstr@monstr.eu> Acked-by: Tony Lindgren <tony@atomide.com> Cc: Russell King <linux@arm.linux.org.uk> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
show more ...
|
#
0c02c800 |
| 19-Sep-2013 |
Grant Likely <grant.likely@linaro.org> |
of/irq: Rename of_irq_map_* functions to of_irq_parse_*
The OF irq handling code has been overloading the term 'map' to refer to both parsing the data in the device tree and mapping it to the intern
of/irq: Rename of_irq_map_* functions to of_irq_parse_*
The OF irq handling code has been overloading the term 'map' to refer to both parsing the data in the device tree and mapping it to the internal linux irq system. This is probably because the device tree does have the concept of an 'interrupt-map' function for translating interrupt references from one node to another, but 'map' is still confusing when the primary purpose of some of the functions are to parse the DT data.
This patch renames all the of_irq_map_* functions to of_irq_parse_* which makes it clear that there is a difference between the parsing phase and the mapping phase. Kernel code can make use of just the parsing or just the mapping support as needed by the subsystem.
The patch was generated mechanically with a handful of sed commands.
Signed-off-by: Grant Likely <grant.likely@linaro.org> Acked-by: Michal Simek <monstr@monstr.eu> Acked-by: Tony Lindgren <tony@atomide.com> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
show more ...
|
#
4a43d686 |
| 28-Sep-2013 |
Tomasz Figa <tomasz.figa@gmail.com> |
of/irq: Pass trigger type in IRQ resource flags
Some drivers might rely on availability of trigger flags in IRQ resource, for example to configure the hardware for particular interrupt type. However
of/irq: Pass trigger type in IRQ resource flags
Some drivers might rely on availability of trigger flags in IRQ resource, for example to configure the hardware for particular interrupt type. However current code creating IRQ resources from data in device tree does not configure trigger flags in resulting resources.
This patch tries to solve the problem, based on the fact that irq_of_parse_and_map() configures the trigger based on DT interrupt specifier and IRQD_TRIGGER_* flags are consistent with IORESOURCE_IRQ_*, and we can get correct trigger flags by calling irqd_get_trigger_type() after mapping the interrupt.
Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com> [grant.likely: Merged the two assignments to r->flags] Signed-off-by: Grant Likely <grant.likely@linaro.org>
show more ...
|
#
8804827b |
| 19-Sep-2013 |
Grant Likely <grant.likely@linaro.org> |
of: Fix dereferencing node name in debug output to be safe
Several locations in the of_address and of_irq code dereference the full_name parameter from a device_node pointer without checking if the
of: Fix dereferencing node name in debug output to be safe
Several locations in the of_address and of_irq code dereference the full_name parameter from a device_node pointer without checking if the pointer is valid. This patch switches to use of_node_full_name() which always checks the pointer.
Signed-off-by: Grant Likely <grant.likely@linaro.org>
show more ...
|
#
d84ff46a |
| 30-Aug-2013 |
Yijing Wang <wangyijing@huawei.com> |
irq/of: Fix comment typo for irq_of_parse_and_map
Fix trivial comment typo for irq_of_parse_and_map().
Signed-off-by: Yijing Wang <wangyijing@huawei.com> Signed-off-by: Grant Likely <grant.likely@l
irq/of: Fix comment typo for irq_of_parse_and_map
Fix trivial comment typo for irq_of_parse_and_map().
Signed-off-by: Yijing Wang <wangyijing@huawei.com> Signed-off-by: Grant Likely <grant.likely@linaro.org>
show more ...
|
#
cf9e2368 |
| 18-Jul-2013 |
Sebastian Andrzej Siewior <bigeasy@linutronix.de> |
of/irq: init struct resource to 0 in of_irq_to_resource()
It almost does not matter because most users use only the ->start member of the struct. However if this struct is passed to a platform devic
of/irq: init struct resource to 0 in of_irq_to_resource()
It almost does not matter because most users use only the ->start member of the struct. However if this struct is passed to a platform device which is then added via platform_device_add() then the ->parent member is also used.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Grant Likely <grant.likely@linaro.org>
show more ...
|
#
c0cdfaa0 |
| 23-Jun-2013 |
Axel Lin <axel.lin@ingics.com> |
of/irq: Avoid calling list_first_entry() for empty list
list_first_entry() expects the list is not empty, we need to check if list is empty before calling list_first_entry(). Thus use list_first_ent
of/irq: Avoid calling list_first_entry() for empty list
list_first_entry() expects the list is not empty, we need to check if list is empty before calling list_first_entry(). Thus use list_first_entry_or_null() instead of list_first_entry().
Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Grant Likely <grant.likely@linaro.org>
show more ...
|