diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2022-01-11 16:09:36 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2022-01-11 16:09:36 -0800 |
commit | 3e3a138a46906641d95599040f2470a60740c399 (patch) | |
tree | 5cf012cdb1193406bb797391c9e4e5e5bb8e558c /drivers | |
parent | c1eb8f6cff3442b0b7eff5b801c9745ea9abcb14 (diff) | |
parent | b0343ab330ae4d6c8d4210de5c16da704c2d4743 (diff) | |
download | lwn-3e3a138a46906641d95599040f2470a60740c399.tar.gz lwn-3e3a138a46906641d95599040f2470a60740c399.zip |
Merge tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm
Pull ARM updates from Russell King:
- amba bus irq rework
- add kfence support
- support for Cortex M33 and M55 CPUs
- kbuild updates for decompressor
- let core code manage thread_info::cpu
- avoid unpredictable NOP encoding in decompressor
- reduce information printed in calltraces
* tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm:
ARM: reduce the information printed in call traces
ARM: 9168/1: Add support for Cortex-M55 processor
ARM: 9167/1: Add support for Cortex-M33 processor
ARM: 9166/1: Support KFENCE for ARM
ARM: 9165/1: mm: Provide is_write_fault()
ARM: 9164/1: mm: Provide set_memory_valid()
ARM: 9163/1: amba: Move of_amba_device_decode_irq() into amba_probe()
ARM: 9162/1: amba: Kill sysfs attribute file of irq
ARM: 9161/1: mm: mark private VM_FAULT_X defines as vm_fault_t
ARM: 9159/1: decompressor: Avoid UNPREDICTABLE NOP encoding
ARM: 9158/1: leave it to core code to manage thread_info::cpu
ARM: 9154/1: decompressor: do not copy source files while building
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/amba/bus.c | 71 |
1 files changed, 28 insertions, 43 deletions
diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c index 720aa6cdd402..e1a5eca3ae3c 100644 --- a/drivers/amba/bus.c +++ b/drivers/amba/bus.c @@ -21,8 +21,6 @@ #include <linux/reset.h> #include <linux/of_irq.h> -#include <asm/irq.h> - #define to_amba_driver(d) container_of(d, struct amba_driver, drv) /* called on periphid match and class 0x9 coresight device. */ @@ -136,8 +134,6 @@ static ssize_t name##_show(struct device *_dev, \ static DEVICE_ATTR_RO(name) amba_attr_func(id, "%08x\n", dev->periphid); -amba_attr_func(irq0, "%u\n", dev->irq[0]); -amba_attr_func(irq1, "%u\n", dev->irq[1]); amba_attr_func(resource, "\t%016llx\t%016llx\t%016lx\n", (unsigned long long)dev->res.start, (unsigned long long)dev->res.end, dev->res.flags); @@ -175,6 +171,28 @@ static int amba_uevent(struct device *dev, struct kobj_uevent_env *env) return retval; } +static int of_amba_device_decode_irq(struct amba_device *dev) +{ + struct device_node *node = dev->dev.of_node; + int i, irq = 0; + + if (IS_ENABLED(CONFIG_OF_IRQ) && node) { + /* Decode the IRQs and address ranges */ + for (i = 0; i < AMBA_NR_IRQS; i++) { + irq = of_irq_get(node, i); + if (irq < 0) { + if (irq == -EPROBE_DEFER) + return irq; + irq = 0; + } + + dev->irq[i] = irq; + } + } + + return 0; +} + /* * These are the device model conversion veneers; they convert the * device model structures to our more specific structures. @@ -187,6 +205,10 @@ static int amba_probe(struct device *dev) int ret; do { + ret = of_amba_device_decode_irq(pcdev); + if (ret) + break; + ret = of_clk_set_defaults(dev->of_node, false); if (ret < 0) break; @@ -372,38 +394,12 @@ static void amba_device_release(struct device *dev) kfree(d); } -static int of_amba_device_decode_irq(struct amba_device *dev) -{ - struct device_node *node = dev->dev.of_node; - int i, irq = 0; - - if (IS_ENABLED(CONFIG_OF_IRQ) && node) { - /* Decode the IRQs and address ranges */ - for (i = 0; i < AMBA_NR_IRQS; i++) { - irq = of_irq_get(node, i); - if (irq < 0) { - if (irq == -EPROBE_DEFER) - return irq; - irq = 0; - } - - dev->irq[i] = irq; - } - } - - return 0; -} - static int amba_device_try_add(struct amba_device *dev, struct resource *parent) { u32 size; void __iomem *tmp; int i, ret; - ret = of_amba_device_decode_irq(dev); - if (ret) - goto err_out; - ret = request_resource(parent, &dev->res); if (ret) goto err_out; @@ -488,20 +484,9 @@ static int amba_device_try_add(struct amba_device *dev, struct resource *parent) skip_probe: ret = device_add(&dev->dev); - if (ret) - goto err_release; - - if (dev->irq[0]) - ret = device_create_file(&dev->dev, &dev_attr_irq0); - if (ret == 0 && dev->irq[1]) - ret = device_create_file(&dev->dev, &dev_attr_irq1); - if (ret == 0) - return ret; - - device_unregister(&dev->dev); - err_release: - release_resource(&dev->res); + if (ret) + release_resource(&dev->res); err_out: return ret; |