Skip to contentSkip to conversation

Krait L1/L2 EDAC driver

PATCH Superseded Stephen Boyd 6 participants 24 messages Oct 29, 2013 – Oct 30, 2013

Subsystems (5)

v1 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

cover Krait L1/L2 EDAC driver

This patchset adds support for the Krait L1/L2 cache error detection hardware. The first patch fixes a generic framework bug. The next two patches lay the groundwork for this driver to be added by exporting percpu irq functions as well as adding the Krait l2 indirection register code. The next two patches add the driver and the binding and the final patch hooks it all up by adding the device tree node.

I'm not sure which tree this is supposed to go through. Ideally we could send the first 3 plus the 5th one through an edac tree. The final dts changes could go through arm-soc via davidb's tree and the Documentation patch could go through the devicetree tree.

Stephen Boyd (6):
edac: Don't try to cancel workqueue when it's never setup
genirq: export percpu irq functions for module usage
ARM: Add Krait L2 accessor functions
edac: Document Krait L1/L2 EDAC driver binding
edac: Add support for Krait CPU cache error detection
ARM: dts: msm: Add Krait edac node

 .../bindings/arm/qcom,krait-cache-erp.txt          |  16 +
 arch/arm/boot/dts/qcom-msm8974.dtsi                |   5 +
 arch/arm/common/Kconfig                            |   3 +
 arch/arm/common/Makefile                           |   1 +
 arch/arm/common/krait-l2-accessors.c               |  52 ++++
 arch/arm/include/asm/krait-l2-accessors.h          |  20 ++
 drivers/edac/Kconfig                               |   8 +
 drivers/edac/Makefile                              |   2 +
 drivers/edac/edac_device.c                         |   3 +
 drivers/edac/krait_edac.c                          | 335 +++++++++++++++++++++
 kernel/irq/manage.c                                |   2 +
 11 files changed, 447 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/arm/qcom,krait-cache-erp.txt
 create mode 100644 arch/arm/common/krait-l2-accessors.c
 create mode 100644 arch/arm/include/asm/krait-l2-accessors.h
 create mode 100644 drivers/edac/krait_edac.c
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation
#1 lore raw

PATCH 1/6 edac: Don't try to cancel workqueue when it's never setup

We only setup a workqueue for edac devices that use the polling method. We still try to cancel the workqueue if an edac_device uses the irq method though. This causes a warning from debug objects when we remove an edac device:

WARNING: CPU: 0 PID: 56 at lib/debugobjects.c:260 debug_print_object+0x98/0xc0()
ODEBUG: assert_init not available (active state 0) object type: timer_list hint: stub_timer+0x0/0x28
Modules linked in: krait_edac(-)
CPU: 0 PID: 56 Comm: rmmod Not tainted 3.12.0-rc2-00035-g15292a0 #69
[<c02179b4>] (unwind_backtrace+0x0/0x144) from [<c0213e58>] (show_stack+0x20/0x24)
[<c0213e58>] (show_stack+0x20/0x24) from [<c06f7fc4>] (dump_stack+0x74/0xb4)
[<c06f7fc4>] (dump_stack+0x74/0xb4) from [<c0223c34>] (warn_slowpath_common+0x78/0x9c)
[<c0223c34>] (warn_slowpath_common+0x78/0x9c) from [<c0223d14>] (warn_slowpath_fmt+0x40/0x48)
[<c0223d14>] (warn_slowpath_fmt+0x40/0x48) from [<c04cf078>] (debug_print_object+0x98/0xc0)
[<c04cf078>] (debug_print_object+0x98/0xc0) from [<c04cfb54>] (debug_object_assert_init+0xdc/0xec)
[<c04cfb54>] (debug_object_assert_init+0xdc/0xec) from [<c02310c4>] (del_timer+0x24/0x7c)
[<c02310c4>] (del_timer+0x24/0x7c) from [<c023fef8>] (try_to_grab_pending+0xc0/0x1b0)
[<c023fef8>] (try_to_grab_pending+0xc0/0x1b0) from [<c0240014>] (cancel_delayed_work+0x2c/0xa0)
[<c0240014>] (cancel_delayed_work+0x2c/0xa0) from [<c059fa14>] (edac_device_workq_teardown+0x1c/0x38)
[<c059fa14>] (edac_device_workq_teardown+0x1c/0x38) from [<c059fae8>] (edac_device_del_device+0xb8/0xe4)
[<c059fae8>] (edac_device_del_device+0xb8/0xe4) from [<bf000050>] (krait_edac_remove+0x50/0x70 [krait_edac])
[<bf000050>] (krait_edac_remove+0x50/0x70 [krait_edac]) from [<c0511e34>] (platform_drv_remove+0x24/0x28)
[<c0511e34>] (platform_drv_remove+0x24/0x28) from [<c050fffc>] (__device_release_driver+0x68/0xc0)
[<c050fffc>] (__device_release_driver+0x68/0xc0) from [<c0510adc>] (driver_detach+0xc4/0xc8)
[<c0510adc>] (driver_detach+0xc4/0xc8) from [<c050fd98>] (bus_remove_driver+0xac/0x114)
[<c050fd98>] (bus_remove_driver+0xac/0x114) from [<c05111d8>] (driver_unregister+0x38/0x58)
[<c05111d8>] (driver_unregister+0x38/0x58) from [<c0511fe8>] (platform_driver_unregister+0x1c/0x20)
[<c0511fe8>] (platform_driver_unregister+0x1c/0x20) from [<bf0005c4>] (krait_edac_driver_exit+0x14/0x1c [krait_edac])
[<bf0005c4>] (krait_edac_driver_exit+0x14/0x1c [krait_edac]) from [<c028b248>] (SyS_delete_module+0x178/0x2b4)
[<c028b248>] (SyS_delete_module+0x178/0x2b4) from [<c020f760>] (ret_fast_syscall+0x0/0x48)

Fix it by skipping the workqueue teardown for such devices.

---
 drivers/edac/edac_device.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/edac/edac_device.c +3 -0
index 211021d..203561b 100644
@@ -437,6 +437,9 @@ void edac_device_workq_teardown(struct edac_device_ctl_info *edac_dev)
 {
 	int status;
 
+	if (!edac_dev->edac_check)
+		return;
+
 	status = cancel_delayed_work(&edac_dev->work);
 	if (status == 0) {
 		/* workq instance might be running, wait for it */
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation
#4 lore raw

PATCH 2/6 genirq: export percpu irq functions for module usage

In reply to Stephen Boyd

In the near future we're going to use these percpu irq functions in the Krait CPU EDAC driver. Export them so that the EDAC driver can be compiled as a module.

Cc Thomas Gleixner <[email protected]>
---
 kernel/irq/manage.c | 2 ++
 1 file changed, 2 insertions(+)
kernel/irq/manage.c +2 -0
index 514bcfd..c6009d1 100644
@@ -1623,6 +1623,7 @@ void free_percpu_irq(unsigned int irq, void __percpu *dev_id)
 	kfree(__free_percpu_irq(irq, dev_id));
 	chip_bus_sync_unlock(desc);
 }
+EXPORT_SYMBOL_GPL(free_percpu_irq);
 
 /**
  *	setup_percpu_irq - setup a per-cpu interrupt
@@ -1693,3 +1694,4 @@ int request_percpu_irq(unsigned int irq, irq_handler_t handler,
 
 	return retval;
 }
+EXPORT_SYMBOL_GPL(request_percpu_irq);
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation
#6 lore raw

PATCH 3/6 ARM: Add Krait L2 accessor functions

In reply to Stephen Boyd

Qualcomm's Krait CPUs have a handful of L2 cache controller registers that live behind a cp15 based indirection register. First you program the indirection register (l2cpselr) to point the L2 'window' register (l2cpdr) at what you want to read/write. Then you read/write the 'window' register to do what you want. The l2cpselr register is not banked per-cpu so we must lock around accesses to it to prevent other CPUs from re-pointing l2cpdr underneath us.

---
 arch/arm/common/Kconfig                   |  3 ++
 arch/arm/common/Makefile                  |  1 +
 arch/arm/common/krait-l2-accessors.c      | 52 +++++++++++++++++++++++++++++++
 arch/arm/include/asm/krait-l2-accessors.h | 20 ++++++++++++
 4 files changed, 76 insertions(+)
 create mode 100644 arch/arm/common/krait-l2-accessors.c
 create mode 100644 arch/arm/include/asm/krait-l2-accessors.h
arch/arm/common/Kconfig +3 -0
index c3a4e9c..9da52dc 100644
@@ -9,6 +9,9 @@ config DMABOUNCE
 	bool
 	select ZONE_DMA
 
+config KRAIT_L2_ACCESSORS
+	bool
+
 config SHARP_LOCOMO
 	bool
 
arch/arm/common/Makefile +1 -0
index 8c60f47..606131a 100644
@@ -8,6 +8,7 @@ obj-$(CONFIG_ICST)		+= icst.o
 obj-$(CONFIG_SA1111)		+= sa1111.o
 obj-$(CONFIG_PCI_HOST_VIA82C505) += via82c505.o
 obj-$(CONFIG_DMABOUNCE)		+= dmabounce.o
+obj-$(CONFIG_KRAIT_L2_ACCESSORS) += krait-l2-accessors.o
 obj-$(CONFIG_SHARP_LOCOMO)	+= locomo.o
 obj-$(CONFIG_SHARP_PARAM)	+= sharpsl_param.o
 obj-$(CONFIG_SHARP_SCOOP)	+= scoop.o
arch/arm/common/krait-l2-accessors.c new file +52 -0

52 lines not on this page · raw message

arch/arm/include/asm/krait-l2-accessors.h new file +20 -0
new file mode 100644
index 0000000..d5305c4
@@ -0,0 +1,20 @@
+/*
+ * Copyright (c) 2011-2013, The Linux Foundation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 and
+ * only version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef __ASMARM_KRAIT_L2_ACCESSORS_H
+#define __ASMARM_KRAIT_L2_ACCESSORS_H
+
+extern void set_l2_indirect_reg(u32 addr, u32 val);
+extern u32 get_l2_indirect_reg(u32 addr);
+
+#endif
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation
#11 lore raw

PATCH 4/6 edac: Document Krait L1/L2 EDAC driver binding

In reply to Stephen Boyd

The Krait L1/L2 error reporting device is made up of two interrupts, one per-CPU interrupt for the L1 caches and one interrupt for the L2 cache.

---
 .../devicetree/bindings/arm/qcom,krait-cache-erp.txt     | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/arm/qcom,krait-cache-erp.txt
Documentation/devicetree/bindings/arm/qcom,krait-cache-erp.txt new file +16 -0
new file mode 100644
index 0000000..01fe8a8
@@ -0,0 +1,16 @@
+* Qualcomm Krait L1 / L2 cache error reporting
+
+Required properties:
+- compatible: Should be "qcom,krait-cache-erp"
+- interrupts: Should contain the L1/CPU error interrupt number and
+  then the L2 cache error interrupt number
+
+Optional properties:
+- interrupt-names: Should contain the interrupt names "l1_irq" and
+  "l2_irq"
+
+Example:
+	edac {
+		compatible = "qcom,krait-cache-erp";
+		interrupts = <1 9 0xf04>, <0 2 0x4>;
+	};
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation
#21 lore raw

PATCH 5/6 edac: Add support for Krait CPU cache error detection

In reply to Stephen Boyd

Add support for the Krait CPU cache error detection. This is a simplified version of the code originally written by Stepan Moskovchenko[1] ported to the EDAC device framework.

[1] https://www.codeaurora.org/cgit/quic/la/kernel/msm/tree/arch/arm/mach-msm/cache_erp.c?h=msm-3.4

Cc Stepan Moskovchenko <[email protected]>
---
 drivers/edac/Kconfig      |   8 ++
 drivers/edac/Makefile     |   2 +
 drivers/edac/krait_edac.c | 336 ++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 346 insertions(+)
 create mode 100644 drivers/edac/krait_edac.c
drivers/edac/Kconfig +8 -0
index 878f090..68f612d 100644
@@ -368,4 +368,12 @@ config EDAC_OCTEON_PCI
 	  Support for error detection and correction on the
 	  Cavium Octeon family of SOCs.
 
+config EDAC_KRAIT_CACHE
+	tristate "Krait L1/L2 Cache"
+	depends on EDAC_MM_EDAC && ARCH_MSM
+	select KRAIT_L2_ACCESSORS
+	help
+	  Support for error detection and correction on the
+	  Krait L1/L2 cache controller.
+
 endif # EDAC
drivers/edac/Makefile +2 -0
index 4154ed6..b6ea505 100644
@@ -64,3 +64,5 @@ obj-$(CONFIG_EDAC_OCTEON_PC)		+= octeon_edac-pc.o
 obj-$(CONFIG_EDAC_OCTEON_L2C)		+= octeon_edac-l2c.o
 obj-$(CONFIG_EDAC_OCTEON_LMC)		+= octeon_edac-lmc.o
 obj-$(CONFIG_EDAC_OCTEON_PCI)		+= octeon_edac-pci.o
+
+obj-$(CONFIG_EDAC_KRAIT_CACHE)		+= krait_edac.o
drivers/edac/krait_edac.c new file +336 -0

336 lines not on this page · raw message

Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation
#23 lore raw

PATCH 6/6 ARM: dts: msm: Add Krait edac node

In reply to Stephen Boyd

---

This is based on the dts updates I sent two weeks ago to add mmio architected timesr to qcom-msm8974.dtsi.

 arch/arm/boot/dts/qcom-msm8974.dtsi | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm/boot/dts/qcom-msm8974.dtsi +5 -0
index 152879d..7b15eb7 100644
@@ -32,6 +32,11 @@
 			clock-frequency = <19200000>;
 		};
 
+		edac {
+			compatible = "qcom,krait-cache-erp";
+			interrupts = <1 9 0xf04>, <0 2 0>;
+		};
+
 		timer at f9020000 {
 			#address-cells = <1>;
 			#size-cells = <1>;
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation
#7 lore raw

Re: [PATCH 3/6] ARM: Add Krait L2 accessor functions

In reply to Stephen Boyd
Quoted 19 lines · Stephen Boyd

Qualcomm's Krait CPUs have a handful of L2 cache controller registers that live behind a cp15 based indirection register. First you program the indirection register (l2cpselr) to point the L2 'window' register (l2cpdr) at what you want to read/write. Then you read/write the 'window' register to do what you want. The l2cpselr register is not banked per-cpu so we must lock around accesses to it to prevent other CPUs from re-pointing l2cpdr underneath us.

---
 arch/arm/common/Kconfig                   |  3 ++
 arch/arm/common/Makefile                  |  1 +
 arch/arm/common/krait-l2-accessors.c      | 52 +++++++++++++++++++++++++++++++
 arch/arm/include/asm/krait-l2-accessors.h | 20 ++++++++++++
 4 files changed, 76 insertions(+)
 create mode 100644 arch/arm/common/krait-l2-accessors.c
 create mode 100644 arch/arm/include/asm/krait-l2-accessors.h

[...]

Quoted 4 lines
arch/arm/common/krait-l2-accessors.c new file +4 -0
+void set_l2_indirect_reg(u32 addr, u32 val)
+{
+	unsigned long flags;
+

arch/arm/common/krait-l2-accessors.c line 35

Quoted 10 lines
arch/arm/common/krait-l2-accessors.c new file +10 -0
+	raw_spin_lock_irqsave(&krait_l2_lock, flags);
+
+	asm volatile ("mcr p15, 3, %0, c15, c0, 6" : : "r" (addr));
+	isb();
+	asm volatile ("mcr p15, 3, %0, c15, c0, 7" : : "r" (val));
+	isb();
+
+	raw_spin_unlock_irqrestore(&krait_l2_lock, flags);
+}
+EXPORT_SYMBOL(set_l2_indirect_reg);

It might be worth commmenting inline as to what register each of these is accessing. Inevitably the commit message will become harder to find and associate with the code over time.

Similarly for get_l2_indirect_reg.

Thanks,
Mark.

#8 lore raw

Re: [PATCH 3/6] ARM: Add Krait L2 accessor functions

Quoted 40 lines · Mark Rutland
Quoted 19 lines · Stephen Boyd

Qualcomm's Krait CPUs have a handful of L2 cache controller registers that live behind a cp15 based indirection register. First you program the indirection register (l2cpselr) to point the L2 'window' register (l2cpdr) at what you want to read/write. Then you read/write the 'window' register to do what you want. The l2cpselr register is not banked per-cpu so we must lock around accesses to it to prevent other CPUs from re-pointing l2cpdr underneath us.

---
 arch/arm/common/Kconfig                   |  3 ++
 arch/arm/common/Makefile                  |  1 +
 arch/arm/common/krait-l2-accessors.c      | 52 +++++++++++++++++++++++++++++++
 arch/arm/include/asm/krait-l2-accessors.h | 20 ++++++++++++
 4 files changed, 76 insertions(+)
 create mode 100644 arch/arm/common/krait-l2-accessors.c
 create mode 100644 arch/arm/include/asm/krait-l2-accessors.h

[...]

Quoted 4 lines
arch/arm/common/krait-l2-accessors.c new file +4 -0
+void set_l2_indirect_reg(u32 addr, u32 val)
+{
+	unsigned long flags;
+

arch/arm/common/krait-l2-accessors.c line 35

Quoted 10 lines
arch/arm/common/krait-l2-accessors.c new file +10 -0
+	raw_spin_lock_irqsave(&krait_l2_lock, flags);
+
+	asm volatile ("mcr p15, 3, %0, c15, c0, 6" : : "r" (addr));
+	isb();
+	asm volatile ("mcr p15, 3, %0, c15, c0, 7" : : "r" (val));
+	isb();
+
+	raw_spin_unlock_irqrestore(&krait_l2_lock, flags);
+}
+EXPORT_SYMBOL(set_l2_indirect_reg);

It might be worth commmenting inline as to what register each of these is accessing. Inevitably the commit message will become harder to find and associate with the code over time.

Quoted 1 line

Similarly for get_l2_indirect_reg.

Do you mean with the "@" syntax in the assembly? The 80-character limit is out to get me.

Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation
#22 lore raw

Re: [PATCH 5/6] edac: Add support for Krait CPU cache error detection

In reply to Stephen Boyd
Quoted 14 lines · Stephen Boyd

Add support for the Krait CPU cache error detection. This is a simplified version of the code originally written by Stepan Moskovchenko[1] ported to the EDAC device framework.

[1] https://www.codeaurora.org/cgit/quic/la/kernel/msm/tree/arch/arm/mach-msm/cache_erp.c?h=msm-3.4

Cc Stepan Moskovchenko <[email protected]>
---
 drivers/edac/Kconfig      |   8 ++
 drivers/edac/Makefile     |   2 +
 drivers/edac/krait_edac.c | 336 ++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 346 insertions(+)
 create mode 100644 drivers/edac/krait_edac.c

[...]

Quoted 6 lines
drivers/edac/krait_edac.c new file +6 -0
+static int krait_edac_probe(struct platform_device *pdev)
+{
+       struct device *dev = &pdev->dev;
+       struct edac_device_ctl_info *edev;
+       struct krait_edac *p;
+       int l1_irq, l2_irq;

drivers/edac/krait_edac.c line 245

Quoted 10 lines
drivers/edac/krait_edac.c new file +10 -0
+       int ret;
+       int cpu;
+
+       l1_irq = platform_get_irq(pdev, 0);
+       if (l1_irq < 0)
+               return l1_irq;
+
+       l2_irq = platform_get_irq(pdev, 1);
+       if (l2_irq < 0)
+               return l2_irq;

As you have optional interrupt-names, I would prefer that you attempted to request interrupts by name if interrupt-names is present. Otherwise interrupt-names brings no value.

Thanks,
Mark.

#9 lore raw

Re: [PATCH 3/6] ARM: Add Krait L2 accessor functions

In reply to Stephen Boyd
Quoted 41 lines · Stephen Boyd
Quoted 40 lines · Mark Rutland
Quoted 19 lines · Stephen Boyd

Qualcomm's Krait CPUs have a handful of L2 cache controller registers that live behind a cp15 based indirection register. First you program the indirection register (l2cpselr) to point the L2 'window' register (l2cpdr) at what you want to read/write. Then you read/write the 'window' register to do what you want. The l2cpselr register is not banked per-cpu so we must lock around accesses to it to prevent other CPUs from re-pointing l2cpdr underneath us.

---
 arch/arm/common/Kconfig                   |  3 ++
 arch/arm/common/Makefile                  |  1 +
 arch/arm/common/krait-l2-accessors.c      | 52 +++++++++++++++++++++++++++++++
 arch/arm/include/asm/krait-l2-accessors.h | 20 ++++++++++++
 4 files changed, 76 insertions(+)
 create mode 100644 arch/arm/common/krait-l2-accessors.c
 create mode 100644 arch/arm/include/asm/krait-l2-accessors.h

[...]

Quoted 4 lines
arch/arm/common/krait-l2-accessors.c new file +4 -0
+void set_l2_indirect_reg(u32 addr, u32 val)
+{
+	unsigned long flags;
+

arch/arm/common/krait-l2-accessors.c line 35

Quoted 10 lines
arch/arm/common/krait-l2-accessors.c new file +10 -0
+	raw_spin_lock_irqsave(&krait_l2_lock, flags);
+
+	asm volatile ("mcr p15, 3, %0, c15, c0, 6" : : "r" (addr));
+	isb();
+	asm volatile ("mcr p15, 3, %0, c15, c0, 7" : : "r" (val));
+	isb();
+
+	raw_spin_unlock_irqrestore(&krait_l2_lock, flags);
+}
+EXPORT_SYMBOL(set_l2_indirect_reg);

It might be worth commmenting inline as to what register each of these is accessing. Inevitably the commit message will become harder to find and associate with the code over time.

Quoted 4 lines
Quoted 1 line

Similarly for get_l2_indirect_reg.

Do you mean with the "@" syntax in the assembly? The 80-character limit is out to get me.

I probably didn't mean inline :)

How about a block comment above the first asm block like:

/*
* Select the L2 window by poking l2cpselr, then write to the window via
* l2cpdr.
*/

Thanks,
Mark.

Acked-by on v1 4/6
#12 lore raw

Re: [PATCH 4/6] edac: Document Krait L1/L2 EDAC driver binding

In reply to Stephen Boyd
Quoted 17 lines · Stephen Boyd

The Krait L1/L2 error reporting device is made up of two interrupts, one per-CPU interrupt for the L1 caches and one interrupt for the L2 cache.

---
 .../devicetree/bindings/arm/qcom,krait-cache-erp.txt     | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/arm/qcom,krait-cache-erp.txt
Documentation/devicetree/bindings/arm/qcom,krait-cache-erp.txt new file +0 -0
new file mode 100644
index 0000000..01fe8a8

Documentation/devicetree/bindings/arm/qcom,krait-cache-erp.txt line 10

Quoted 10 lines
Documentation/devicetree/bindings/arm/qcom,krait-cache-erp.txt new file +10 -0
@@ -0,0 +1,16 @@
+* Qualcomm Krait L1 / L2 cache error reporting
+
+Required properties:
+- compatible: Should be "qcom,krait-cache-erp"
+- interrupts: Should contain the L1/CPU error interrupt number and
+  then the L2 cache error interrupt number
+
+Optional properties:
+- interrupt-names: Should contain the interrupt names "l1_irq" and
+  "l2_irq"

As with my comment on the parsing code, I'd prefer that if interrupt-names was present it defined the order of interrupts. Otherwise it's redundant and of no value.

Otherwise, the binding looks fine to me:

Quoted 15 lines
Documentation/devicetree/bindings/arm/qcom,krait-cache-erp.txt new file +6 -0
+
+Example:
+	edac {
+		compatible = "qcom,krait-cache-erp";
+		interrupts = <1 9 0xf04>, <0 2 0x4>;
+	};
Signature · 7 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#10 lore raw

Re: [PATCH 3/6] ARM: Add Krait L2 accessor functions

In reply to Mark Rutland
Quoted 11 lines · Mark Rutland
Quoted 9 lines · Stephen Boyd
Quoted 5 lines · Mark Rutland

It might be worth commmenting inline as to what register each of these is accessing. Inevitably the commit message will become harder to find and associate with the code over time.

Similarly for get_l2_indirect_reg.

Do you mean with the "@" syntax in the assembly? The 80-character limit is out to get me.

Quoted 9 lines

I probably didn't mean inline :)

How about a block comment above the first asm block like:

/*
* Select the L2 window by poking l2cpselr, then write to the window via
* l2cpdr.
*/

Ok sure.

Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation
#13 lore raw

Re: [PATCH 4/6] edac: Document Krait L1/L2 EDAC driver binding

In reply to Mark Rutland
Quoted 10 lines · Mark Rutland

Documentation/devicetree/bindings/arm/qcom,krait-cache-erp.txt line 10

Quoted 4 lines · Stephen Boyd
Documentation/devicetree/bindings/arm/qcom,krait-cache-erp.txt new file +4 -0
+
+Optional properties:
+- interrupt-names: Should contain the interrupt names "l1_irq" and
+  "l2_irq"

As with my comment on the parsing code, I'd prefer that if interrupt-names was present it defined the order of interrupts. Otherwise it's redundant and of no value.

Quoted 3 lines

Otherwise, the binding looks fine to me:

How about I just drop the interrupt-names property? It isn't adding much and is a holdover from the vendor kernel.

Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation
#15 lore raw

Re: [PATCH 4/6] edac: Document Krait L1/L2 EDAC driver binding

In reply to Stephen Boyd
Quoted 23 lines · Stephen Boyd

The Krait L1/L2 error reporting device is made up of two interrupts, one per-CPU interrupt for the L1 caches and one interrupt for the L2 cache.

---
.../devicetree/bindings/arm/qcom,krait-cache-erp.txt | 16 ++++++++++++++++

1 file changed, 16 insertions(+)

create mode 100644 Documentation/devicetree/bindings/arm/qcom,krait-cache-erp.txt

Documentation/devicetree/bindings/arm/qcom,krait-cache-erp.txt new file +6 -0
new file mode 100644
index 0000000..01fe8a8
@@ -0,0 +1,16 @@
+* Qualcomm Krait L1 / L2 cache error reporting
+
+Required properties:
+- compatible: Should be "qcom,krait-cache-erp"
+- interrupts: Should contain the L1/CPU error interrupt number and
+  then the L2 cache error interrupt number

Documentation/devicetree/bindings/arm/qcom,krait-cache-erp.txt line 16

Quoted 10 lines
Documentation/devicetree/bindings/arm/qcom,krait-cache-erp.txt new file +10 -0
+
+Optional properties:
+- interrupt-names: Should contain the interrupt names "l1_irq" and
+  "l2_irq"
+
+Example:
+	edac {
+		compatible = "qcom,krait-cache-erp";
+		interrupts = <1 9 0xf04>, <0 2 0x4>;
+	};

Why wouldn't we have these as part of cache nodes in the dts? (which begs the question why we don't have cache nodes?)

- k

Signature · 2 lines
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
Acked-by on v1 2/6
#5 lore raw

Re: [PATCH 2/6] genirq: export percpu irq functions for module usage

In reply to Stephen Boyd
Quoted 6 lines · Stephen Boyd

In the near future we're going to use these percpu irq functions in the Krait CPU EDAC driver. Export them so that the EDAC driver can be compiled as a module.

Cc Thomas Gleixner <[email protected]>

Please take it through the tree which will take the EDAC patches.

Thanks,

tglx

Quoted 26 lines
---
 kernel/irq/manage.c | 2 ++
 1 file changed, 2 insertions(+)
kernel/irq/manage.c +2 -0
index 514bcfd..c6009d1 100644
@@ -1623,6 +1623,7 @@ void free_percpu_irq(unsigned int irq, void __percpu *dev_id)
 	kfree(__free_percpu_irq(irq, dev_id));
 	chip_bus_sync_unlock(desc);
 }
+EXPORT_SYMBOL_GPL(free_percpu_irq);
 
 /**
  *	setup_percpu_irq - setup a per-cpu interrupt
@@ -1693,3 +1694,4 @@ int request_percpu_irq(unsigned int irq, irq_handler_t handler,
 
 	return retval;
 }
+EXPORT_SYMBOL_GPL(request_percpu_irq);
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation
#16 lore raw

Re: [PATCH 4/6] edac: Document Krait L1/L2 EDAC driver binding

In reply to Kumar Gala
Quoted 28 lines · Kumar Gala
Quoted 26 lines · Stephen Boyd

The Krait L1/L2 error reporting device is made up of two interrupts, one per-CPU interrupt for the L1 caches and one interrupt for the L2 cache.

---
.../devicetree/bindings/arm/qcom,krait-cache-erp.txt | 16 ++++++++++++++++

1 file changed, 16 insertions(+)

create mode 100644 Documentation/devicetree/bindings/arm/qcom,krait-cache-erp.txt

Documentation/devicetree/bindings/arm/qcom,krait-cache-erp.txt new file +9 -0
new file mode 100644
index 0000000..01fe8a8
@@ -0,0 +1,16 @@
+* Qualcomm Krait L1 / L2 cache error reporting
+
+Required properties:
+- compatible: Should be "qcom,krait-cache-erp"
+- interrupts: Should contain the L1/CPU error interrupt number and
+  then the L2 cache error interrupt number
+
+Optional properties:
+- interrupt-names: Should contain the interrupt names "l1_irq" and
Quoted 9 lines

Documentation/devicetree/bindings/arm/qcom,krait-cache-erp.txt line 16

Quoted 7 lines
Documentation/devicetree/bindings/arm/qcom,krait-cache-erp.txt new file +7 -0
+  "l2_irq"
+
+Example:
+	edac {
+		compatible = "qcom,krait-cache-erp";
+		interrupts = <1 9 0xf04>, <0 2 0x4>;
+	};

Why wouldn't we have these as part of cache nodes in the dts? (which begs the question why we don't have cache nodes?)

I can certainly add cache nodes and cpu nodes and then put the interrupts in those nodes. I was thinking along those same lines when I ported this driver but figured it would be good to get something out there. The only question I have is how am I supposed to hook that up into the linux device model? Will the edac driver bind to the device created for the cpus node and the cache node? I guess it will have to be a driver that binds to two devices.

One could argue that we should put the cp15 based architected timers in the cpus node also but so far nobody has done that and I think there was some reasoning behind that, Mark?

Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation
#17 lore raw

Re: [PATCH 4/6] edac: Document Krait L1/L2 EDAC driver binding

Quoted 29 lines · Stephen Boyd
Quoted 28 lines · Kumar Gala
Quoted 26 lines · Stephen Boyd

The Krait L1/L2 error reporting device is made up of two interrupts, one per-CPU interrupt for the L1 caches and one interrupt for the L2 cache.

---
.../devicetree/bindings/arm/qcom,krait-cache-erp.txt | 16 ++++++++++++++++

1 file changed, 16 insertions(+)

create mode 100644 Documentation/devicetree/bindings/arm/qcom,krait-cache-erp.txt

Documentation/devicetree/bindings/arm/qcom,krait-cache-erp.txt new file +9 -0
new file mode 100644
index 0000000..01fe8a8
@@ -0,0 +1,16 @@
+* Qualcomm Krait L1 / L2 cache error reporting
+
+Required properties:
+- compatible: Should be "qcom,krait-cache-erp"
+- interrupts: Should contain the L1/CPU error interrupt number and
+  then the L2 cache error interrupt number
+
+Optional properties:
+- interrupt-names: Should contain the interrupt names "l1_irq" and
Quoted 8 lines
Quoted 8 lines

Documentation/devicetree/bindings/arm/qcom,krait-cache-erp.txt line 16

Quoted 7 lines
Documentation/devicetree/bindings/arm/qcom,krait-cache-erp.txt new file +7 -0
+  "l2_irq"
+
+Example:
+    edac {
+            compatible = "qcom,krait-cache-erp";
+            interrupts = <1 9 0xf04>, <0 2 0x4>;
+    };

Why wouldn't we have these as part of cache nodes in the dts? (which begs the question why we don't have cache nodes?)

In particular, naming the node edac seems like a suboptimal choice, since that's a very linux-specific name for the error reporting framework.

Quoted 7 lines

I can certainly add cache nodes and cpu nodes and then put the interrupts in those nodes. I was thinking along those same lines when I ported this driver but figured it would be good to get something out there. The only question I have is how am I supposed to hook that up into the linux device model? Will the edac driver bind to the device created for the cpus node and the cache node? I guess it will have to be a driver that binds to two devices.

Or it could bind to one device and look up the info for the other from the devicetree without relying on the driver core to instantiate devices.

-Olof

maintainer Acked-by on v1 1/6
#2 lore raw

Re: [PATCH 1/6] edac: Don't try to cancel workqueue when it's never setup

In reply to Stephen Boyd
Quoted 31 lines · Stephen Boyd

We only setup a workqueue for edac devices that use the polling method. We still try to cancel the workqueue if an edac_device uses the irq method though. This causes a warning from debug objects when we remove an edac device:

WARNING: CPU: 0 PID: 56 at lib/debugobjects.c:260 debug_print_object+0x98/0xc0()
ODEBUG: assert_init not available (active state 0) object type: timer_list hint: stub_timer+0x0/0x28
Modules linked in: krait_edac(-)
CPU: 0 PID: 56 Comm: rmmod Not tainted 3.12.0-rc2-00035-g15292a0 #69
[<c02179b4>] (unwind_backtrace+0x0/0x144) from [<c0213e58>] (show_stack+0x20/0x24)
[<c0213e58>] (show_stack+0x20/0x24) from [<c06f7fc4>] (dump_stack+0x74/0xb4)
[<c06f7fc4>] (dump_stack+0x74/0xb4) from [<c0223c34>] (warn_slowpath_common+0x78/0x9c)
[<c0223c34>] (warn_slowpath_common+0x78/0x9c) from [<c0223d14>] (warn_slowpath_fmt+0x40/0x48)
[<c0223d14>] (warn_slowpath_fmt+0x40/0x48) from [<c04cf078>] (debug_print_object+0x98/0xc0)
[<c04cf078>] (debug_print_object+0x98/0xc0) from [<c04cfb54>] (debug_object_assert_init+0xdc/0xec)
[<c04cfb54>] (debug_object_assert_init+0xdc/0xec) from [<c02310c4>] (del_timer+0x24/0x7c)
[<c02310c4>] (del_timer+0x24/0x7c) from [<c023fef8>] (try_to_grab_pending+0xc0/0x1b0)
[<c023fef8>] (try_to_grab_pending+0xc0/0x1b0) from [<c0240014>] (cancel_delayed_work+0x2c/0xa0)
[<c0240014>] (cancel_delayed_work+0x2c/0xa0) from [<c059fa14>] (edac_device_workq_teardown+0x1c/0x38)
[<c059fa14>] (edac_device_workq_teardown+0x1c/0x38) from [<c059fae8>] (edac_device_del_device+0xb8/0xe4)
[<c059fae8>] (edac_device_del_device+0xb8/0xe4) from [<bf000050>] (krait_edac_remove+0x50/0x70 [krait_edac])
[<bf000050>] (krait_edac_remove+0x50/0x70 [krait_edac]) from [<c0511e34>] (platform_drv_remove+0x24/0x28)
[<c0511e34>] (platform_drv_remove+0x24/0x28) from [<c050fffc>] (__device_release_driver+0x68/0xc0)
[<c050fffc>] (__device_release_driver+0x68/0xc0) from [<c0510adc>] (driver_detach+0xc4/0xc8)
[<c0510adc>] (driver_detach+0xc4/0xc8) from [<c050fd98>] (bus_remove_driver+0xac/0x114)
[<c050fd98>] (bus_remove_driver+0xac/0x114) from [<c05111d8>] (driver_unregister+0x38/0x58)
[<c05111d8>] (driver_unregister+0x38/0x58) from [<c0511fe8>] (platform_driver_unregister+0x1c/0x20)
[<c0511fe8>] (platform_driver_unregister+0x1c/0x20) from [<bf0005c4>] (krait_edac_driver_exit+0x14/0x1c [krait_edac])
[<bf0005c4>] (krait_edac_driver_exit+0x14/0x1c [krait_edac]) from [<c028b248>] (SyS_delete_module+0x178/0x2b4)
[<c028b248>] (SyS_delete_module+0x178/0x2b4) from [<c020f760>] (ret_fast_syscall+0x0/0x48)
Quoted 3 lines

Fix it by skipping the workqueue teardown for such devices.

Btw, you might want to remove the hex numbers in the trace above and leave only the call stack to make it more readable.

Signature · 5 lines
Regards/Gruss,
    Boris.

Sent from a fat crate under my desk. Formatting is fine.
--
#3 lore raw

Re: [PATCH 1/6] edac: Don't try to cancel workqueue when it's never setup

Quoted 32 lines · Borislav Petkov
Quoted 31 lines · Stephen Boyd

We only setup a workqueue for edac devices that use the polling method. We still try to cancel the workqueue if an edac_device uses the irq method though. This causes a warning from debug objects when we remove an edac device:

WARNING: CPU: 0 PID: 56 at lib/debugobjects.c:260 debug_print_object+0x98/0xc0()
ODEBUG: assert_init not available (active state 0) object type: timer_list hint: stub_timer+0x0/0x28
Modules linked in: krait_edac(-)
CPU: 0 PID: 56 Comm: rmmod Not tainted 3.12.0-rc2-00035-g15292a0 #69
[<c02179b4>] (unwind_backtrace+0x0/0x144) from [<c0213e58>] (show_stack+0x20/0x24)
[<c0213e58>] (show_stack+0x20/0x24) from [<c06f7fc4>] (dump_stack+0x74/0xb4)
[<c06f7fc4>] (dump_stack+0x74/0xb4) from [<c0223c34>] (warn_slowpath_common+0x78/0x9c)
[<c0223c34>] (warn_slowpath_common+0x78/0x9c) from [<c0223d14>] (warn_slowpath_fmt+0x40/0x48)
[<c0223d14>] (warn_slowpath_fmt+0x40/0x48) from [<c04cf078>] (debug_print_object+0x98/0xc0)
[<c04cf078>] (debug_print_object+0x98/0xc0) from [<c04cfb54>] (debug_object_assert_init+0xdc/0xec)
[<c04cfb54>] (debug_object_assert_init+0xdc/0xec) from [<c02310c4>] (del_timer+0x24/0x7c)
[<c02310c4>] (del_timer+0x24/0x7c) from [<c023fef8>] (try_to_grab_pending+0xc0/0x1b0)
[<c023fef8>] (try_to_grab_pending+0xc0/0x1b0) from [<c0240014>] (cancel_delayed_work+0x2c/0xa0)
[<c0240014>] (cancel_delayed_work+0x2c/0xa0) from [<c059fa14>] (edac_device_workq_teardown+0x1c/0x38)
[<c059fa14>] (edac_device_workq_teardown+0x1c/0x38) from [<c059fae8>] (edac_device_del_device+0xb8/0xe4)
[<c059fae8>] (edac_device_del_device+0xb8/0xe4) from [<bf000050>] (krait_edac_remove+0x50/0x70 [krait_edac])
[<bf000050>] (krait_edac_remove+0x50/0x70 [krait_edac]) from [<c0511e34>] (platform_drv_remove+0x24/0x28)
[<c0511e34>] (platform_drv_remove+0x24/0x28) from [<c050fffc>] (__device_release_driver+0x68/0xc0)
[<c050fffc>] (__device_release_driver+0x68/0xc0) from [<c0510adc>] (driver_detach+0xc4/0xc8)
[<c0510adc>] (driver_detach+0xc4/0xc8) from [<c050fd98>] (bus_remove_driver+0xac/0x114)
[<c050fd98>] (bus_remove_driver+0xac/0x114) from [<c05111d8>] (driver_unregister+0x38/0x58)
[<c05111d8>] (driver_unregister+0x38/0x58) from [<c0511fe8>] (platform_driver_unregister+0x1c/0x20)
[<c0511fe8>] (platform_driver_unregister+0x1c/0x20) from [<bf0005c4>] (krait_edac_driver_exit+0x14/0x1c [krait_edac])
[<bf0005c4>] (krait_edac_driver_exit+0x14/0x1c [krait_edac]) from [<c028b248>] (SyS_delete_module+0x178/0x2b4)
[<c028b248>] (SyS_delete_module+0x178/0x2b4) from [<c020f760>] (ret_fast_syscall+0x0/0x48)
Quoted 8 lines
Quoted 3 lines

Fix it by skipping the workqueue teardown for such devices.

Btw, you might want to remove the hex numbers in the trace above and leave only the call stack to make it more readable.

Thanks. I'll do that in the next round.

Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation
#18 lore raw

Re: [PATCH 4/6] edac: Document Krait L1/L2 EDAC driver binding

In reply to Stephen Boyd
Quoted 47 lines · Stephen Boyd
Quoted 28 lines · Kumar Gala
Quoted 26 lines · Stephen Boyd

The Krait L1/L2 error reporting device is made up of two interrupts, one per-CPU interrupt for the L1 caches and one interrupt for the L2 cache.

---
.../devicetree/bindings/arm/qcom,krait-cache-erp.txt | 16 ++++++++++++++++

1 file changed, 16 insertions(+)

create mode 100644 Documentation/devicetree/bindings/arm/qcom,krait-cache-erp.txt

Documentation/devicetree/bindings/arm/qcom,krait-cache-erp.txt new file +9 -0
new file mode 100644
index 0000000..01fe8a8
@@ -0,0 +1,16 @@
+* Qualcomm Krait L1 / L2 cache error reporting
+
+Required properties:
+- compatible: Should be "qcom,krait-cache-erp"
+- interrupts: Should contain the L1/CPU error interrupt number and
+  then the L2 cache error interrupt number
+
+Optional properties:
+- interrupt-names: Should contain the interrupt names "l1_irq" and
Quoted 9 lines

Documentation/devicetree/bindings/arm/qcom,krait-cache-erp.txt line 16

Quoted 7 lines
Documentation/devicetree/bindings/arm/qcom,krait-cache-erp.txt new file +7 -0
+  "l2_irq"
+
+Example:
+	edac {
+		compatible = "qcom,krait-cache-erp";
+		interrupts = <1 9 0xf04>, <0 2 0x4>;
+	};

Why wouldn't we have these as part of cache nodes in the dts? (which begs the question why we don't have cache nodes?)

I can certainly add cache nodes and cpu nodes and then put the interrupts in those nodes. I was thinking along those same lines when I ported this driver but figured it would be good to get something out there. The only question I have is how am I supposed to hook that up into the linux device model? Will the edac driver bind to the device created for the cpus node and the cache node? I guess it will have to be a driver that binds to two devices.

Quoted 4 lines

One could argue that we should put the cp15 based architected timers in the cpus node also but so far nobody has done that and I think there was some reasoning behind that, Mark?

Ok I've come up with this:

	cpus {
		#address-cells = <1>;
		#size-cells = <0>;
		compatible = "qcom,krait";
		interrupts = <1 9 0xf04>;

		cpu at 0 {
			reg = <0>;
			next-level-cache = <&L2>;
		};

		cpu at 1 {
			reg = <1>;
			next-level-cache = <&L2>;
		};

		cpu at 2 {
			reg = <2>;
			next-level-cache = <&L2>;
		};

		cpu at 3 {
			reg = <3>;
			next-level-cache = <&L2>;
		};

		L2: l2-cache {
			compatible = "qcom,krait-l2", "cache";
			cache-level = <2>;
			interrupts = <0 2 0x4>;
		};
	};

But now I don't know where to document this. Should I make a krait-edac.txt file and document it there? The problem is now we're documenting more than the error interrupts.

Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation
#14 lore raw

Re: [PATCH 4/6] edac: Document Krait L1/L2 EDAC driver binding

In reply to Stephen Boyd
Quoted 11 lines · Stephen Boyd
Quoted 10 lines · Mark Rutland

Documentation/devicetree/bindings/arm/qcom,krait-cache-erp.txt line 10

Quoted 4 lines · Stephen Boyd
Documentation/devicetree/bindings/arm/qcom,krait-cache-erp.txt new file +4 -0
+
+Optional properties:
+- interrupt-names: Should contain the interrupt names "l1_irq" and
+  "l2_irq"

As with my comment on the parsing code, I'd prefer that if interrupt-names was present it defined the order of interrupts. Otherwise it's redundant and of no value.

Quoted 6 lines
Quoted 3 lines

Otherwise, the binding looks fine to me:

How about I just drop the interrupt-names property? It isn't adding much and is a holdover from the vendor kernel.

That's also fine given that this is a very specific binding.

Mark.

#19 lore raw

Re: [PATCH 4/6] edac: Document Krait L1/L2 EDAC driver binding

In reply to Stephen Boyd
Quoted 47 lines · Stephen Boyd
Quoted 28 lines · Kumar Gala
Quoted 26 lines · Stephen Boyd

The Krait L1/L2 error reporting device is made up of two interrupts, one per-CPU interrupt for the L1 caches and one interrupt for the L2 cache.

---
.../devicetree/bindings/arm/qcom,krait-cache-erp.txt | 16 ++++++++++++++++

1 file changed, 16 insertions(+)

create mode 100644 Documentation/devicetree/bindings/arm/qcom,krait-cache-erp.txt

Documentation/devicetree/bindings/arm/qcom,krait-cache-erp.txt new file +9 -0
new file mode 100644
index 0000000..01fe8a8
@@ -0,0 +1,16 @@
+* Qualcomm Krait L1 / L2 cache error reporting
+
+Required properties:
+- compatible: Should be "qcom,krait-cache-erp"
+- interrupts: Should contain the L1/CPU error interrupt number and
+  then the L2 cache error interrupt number
+
+Optional properties:
+- interrupt-names: Should contain the interrupt names "l1_irq" and
Quoted 9 lines

Documentation/devicetree/bindings/arm/qcom,krait-cache-erp.txt line 16

Quoted 7 lines
Documentation/devicetree/bindings/arm/qcom,krait-cache-erp.txt new file +7 -0
+  "l2_irq"
+
+Example:
+	edac {
+		compatible = "qcom,krait-cache-erp";
+		interrupts = <1 9 0xf04>, <0 2 0x4>;
+	};

Why wouldn't we have these as part of cache nodes in the dts? (which begs the question why we don't have cache nodes?)

I can certainly add cache nodes and cpu nodes and then put the interrupts in those nodes. I was thinking along those same lines when I ported this driver but figured it would be good to get something out there. The only question I have is how am I supposed to hook that up into the linux device model? Will the edac driver bind to the device created for the cpus node and the cache node? I guess it will have to be a driver that binds to two devices.

Quoted 3 lines

One could argue that we should put the cp15 based architected timers in the cpus node also but so far nobody has done that and I think there was some reasoning behind that, Mark?

The architected timer binding was created at a time I wasn't involved in kernel development, and I'm not aware of any particular reasoning. I've heard that there was a decision to not duplicate banked resources, which would explain not having the timer under /cpus/cpu at N, but doesn't imply that having it under /cpus is bad.

Do we have precedent for putting any devices other than CPUs in /cpus?

Thanks,
Mark.

#20 lore raw

Re: [PATCH 4/6] edac: Document Krait L1/L2 EDAC driver binding

Quoted 52 lines · Mark Rutland
Quoted 47 lines · Stephen Boyd
Quoted 28 lines · Kumar Gala
Quoted 26 lines · Stephen Boyd

The Krait L1/L2 error reporting device is made up of two interrupts, one per-CPU interrupt for the L1 caches and one interrupt for the L2 cache.

---
.../devicetree/bindings/arm/qcom,krait-cache-erp.txt | 16 ++++++++++++++++

1 file changed, 16 insertions(+)

create mode 100644 Documentation/devicetree/bindings/arm/qcom,krait-cache-erp.txt

Documentation/devicetree/bindings/arm/qcom,krait-cache-erp.txt new file +9 -0
new file mode 100644
index 0000000..01fe8a8
@@ -0,0 +1,16 @@
+* Qualcomm Krait L1 / L2 cache error reporting
+
+Required properties:
+- compatible: Should be "qcom,krait-cache-erp"
+- interrupts: Should contain the L1/CPU error interrupt number and
+  then the L2 cache error interrupt number
+
+Optional properties:
+- interrupt-names: Should contain the interrupt names "l1_irq" and
Quoted 9 lines

Documentation/devicetree/bindings/arm/qcom,krait-cache-erp.txt line 16

Quoted 7 lines
Documentation/devicetree/bindings/arm/qcom,krait-cache-erp.txt new file +7 -0
+  "l2_irq"
+
+Example:
+	edac {
+		compatible = "qcom,krait-cache-erp";
+		interrupts = <1 9 0xf04>, <0 2 0x4>;
+	};

Why wouldn't we have these as part of cache nodes in the dts? (which begs the question why we don't have cache nodes?)

I can certainly add cache nodes and cpu nodes and then put the interrupts in those nodes. I was thinking along those same lines when I ported this driver but figured it would be good to get something out there. The only question I have is how am I supposed to hook that up into the linux device model? Will the edac driver bind to the device created for the cpus node and the cache node? I guess it will have to be a driver that binds to two devices.

Quoted 3 lines

One could argue that we should put the cp15 based architected timers in the cpus node also but so far nobody has done that and I think there was some reasoning behind that, Mark?

Quoted 7 lines

The architected timer binding was created at a time I wasn't involved in kernel development, and I'm not aware of any particular reasoning. I've heard that there was a decision to not duplicate banked resources, which would explain not having the timer under /cpus/cpu at N, but doesn't imply that having it under /cpus is bad.

Do we have precedent for putting any devices other than CPUs in /cpus?

On PPC we had core cache's (depending on topology) that would be there, and thus why I raised the suggestion.

- k

Signature · 2 lines
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation