edac: xgene: Add missing SoC register bus error handling and fix CE promotes to UE
Subsystems (4)
cover edac: xgene: Add missing SoC register bus error handling and fix CE promotes to UE
Add missing register bus error handling for SoC and fix an checking condition for CE error promotes to UE. DT binding and documentation are also updated.
---
Loc Ho (3):
Documentation: Update the APM X-Gene SoC EDAC DTS binding with fix to
the RB
edac: xgene: Add missing SoC register bus error handling and fix CE
promotes to UE
arm64: Update the APM X-Gene EDAC node to the RB register resource
.../devicetree/bindings/edac/apm-xgene-edac.txt | 7 ++ arch/arm64/boot/dts/apm/apm-storm.dtsi | 6 ++ drivers/edac/xgene_edac.c | 62 +++++++++++++++++++- 3 files changed, 74 insertions(+), 1 deletions(-)
PATCH 1/3 Documentation: Update the APM X-Gene SoC EDAC DTS binding for missing RB
This patch updates the APM X-Gene SoC EDAC documentation binding to reference the missing register bus for the the SoC EDAC.
--- .../devicetree/bindings/edac/apm-xgene-edac.txt | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-)
Documentation/devicetree/bindings/edac/apm-xgene-edac.txt +7 -0
@@ -16,6 +16,7 @@ Required properties: - regmap-mcba : Regmap of the MCB-A (memory bridge) resource. - regmap-mcbb : Regmap of the MCB-B (memory bridge) resource. - regmap-efuse : Regmap of the PMD efuse resource. +- regmap-rb : Regmap of the register bus resource. - reg : First resource shall be the CPU bus (PCP) resource. - interrupts : Interrupt-specifier for MCU, PMD, L3, or SoC error IRQ(s).
@@ -64,6 +65,11 @@ Example: reg = <0x0 0x1054a000 0x0 0x20>; }; + rb: rb at 7e000000 { + compatible = "apm,xgene-rb", "syscon"; + reg = <0x0 0x7e000000 0x0 0x10>; + }; + edac at 78800000 { compatible = "apm,xgene-edac"; #address-cells = <2>;
@@ -73,6 +79,7 @@ Example: regmap-mcba = <&mcba>; regmap-mcbb = <&mcbb>; regmap-efuse = <&efuse>; + regmap-rb = <&rb>; reg = <0x0 0x78800000 0x0 0x100>; interrupts = <0x0 0x20 0x4>, <0x0 0x21 0x4>,
Signature · 1 line
1.7.1
PATCH 1/3 Documentation: Update the APM X-Gene SoC EDAC DTS binding for missing RB
Quoted 12 lines · On Tuesday 12 January 2016 16:04:58 Loc Ho wrote:
Documentation/devicetree/bindings/edac/apm-xgene-edac.txt +1
-0@@ -16,6 +16,7 @@ Required properties: - regmap-mcba : Regmap of the MCB-A (memory bridge) resource. - regmap-mcbb : Regmap of the MCB-B (memory bridge) resource. - regmap-efuse : Regmap of the PMD efuse resource. +- regmap-rb : Regmap of the register bus resource. - reg : First resource shall be the CPU bus (PCP) resource. - interrupts : Interrupt-specifier for MCU, PMD, L3, or SoC error IRQ(s).@@ -64,6 +65,11 @@ Example: reg = <0x0 0x1054a000 0x0 0x20>;
Documentation/devicetree/bindings/edac/apm-xgene-edac.txt Example: · line 75
Quoted 10 lines
Documentation/devicetree/bindings/edac/apm-xgene-edac.txt +5
-0}; + rb: rb at 7e000000 { + compatible = "apm,xgene-rb", "syscon"; + reg = <0x0 0x7e000000 0x0 0x10>; + }; + edac at 78800000 { compatible = "apm,xgene-edac";
When you add a property, please list that as "optional", not "required", to ensure that the old dtb files still conform to the binding.
In the driver, make sure it is not a fatal error when the property is missing and the driver can keep working without it.
Arnd
PATCH 1/3 Documentation: Update the APM X-Gene SoC EDAC DTS binding for missing RB
Hi Arnd,
Quoted 26 lines
Quoted 12 lines
Documentation/devicetree/bindings/edac/apm-xgene-edac.txt +1
-0@@ -16,6 +16,7 @@ Required properties: - regmap-mcba : Regmap of the MCB-A (memory bridge) resource. - regmap-mcbb : Regmap of the MCB-B (memory bridge) resource. - regmap-efuse : Regmap of the PMD efuse resource. +- regmap-rb : Regmap of the register bus resource. - reg : First resource shall be the CPU bus (PCP) resource. - interrupts : Interrupt-specifier for MCU, PMD, L3, or SoC error IRQ(s).@@ -64,6 +65,11 @@ Example: reg = <0x0 0x1054a000 0x0 0x20>;Documentation/devicetree/bindings/edac/apm-xgene-edac.txt Example: · line 75
Quoted 10 lines
Documentation/devicetree/bindings/edac/apm-xgene-edac.txt +5
-0}; + rb: rb at 7e000000 { + compatible = "apm,xgene-rb", "syscon"; + reg = <0x0 0x7e000000 0x0 0x10>; + }; + edac at 78800000 { compatible = "apm,xgene-edac";When you add a property, please list that as "optional", not "required", to ensure that the old dtb files still conform to the binding.
Quoted 4 lines
In the driver, make sure it is not a fatal error when the property is missing and the driver can keep working without it.
From my view, this is required. Otherwise, the error condition will
NOT be cleared correctly and will get constant interrupt. Though, for compatibility, we can make it optional but system will be unusable should such error occurred. Though, it would be rare or with bad FW. I will fix in the next version by making it optional such as it will still probe correctly with older DT binding.
-Loc
PATCH 2/3 edac: xgene: Add missing SoC register bus error handling and fix CE promotes to UE
In reply to Loc HoAdd missing register bus error handling for APM X-Gene EDAC SoC and fix an checking condition for CE error promotes to UE.
--- drivers/edac/xgene_edac.c | 62 ++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 61 insertions(+), 1 deletions(-)
drivers/edac/xgene_edac.c +61 -1
@@ -61,6 +61,7 @@ struct xgene_edac {struct regmap *mcba_map;struct regmap *mcbb_map;struct regmap *efuse_map; +struct regmap *rb_map;void __iomem *pcp_csr;spinlock_t lock;struct dentry *dfs;
@@ -1057,7 +1058,7 @@ static bool xgene_edac_l3_promote_to_uc_err(u32 l3cesr, u32 l3celr)case 0x041 :return true; } - }else if (L3C_ELR_ERRSYN (l3celr) ==9 ) + }else if (L3C_ELR_ERRWAY (l3celr) ==9 )return true;return false;
@@ -1353,6 +1354,17 @@ static int xgene_edac_l3_remove(struct xgene_edac_dev_ctx *l3)#define GLBL_MDED_ERRH 0x0848#define GLBL_MDED_ERRHMASK 0x084c +/* IO Bus Registers */ +#define RBCSR 0x0000 +#define STICKYERR_MASK BIT(0) +#define RBEIR 0x0008 +#define AGENT_OFFLINE_ERR_MASK BIT(30) +#define UNIMPL_RBPAGE_ERR_MASK BIT(29) +#define WORD_ALIGNED_ERR_MASK BIT(28) +#define PAGE_ACCESS_ERR_MASK BIT(27) +#define WRITE_ACCESS_MASK BIT(26) +#define RBERRADDR_RD (src) ((src) & 0x03FFFFFF) +static const char *const soc_mem_err_v1[] = {"10GbE0" ,"10GbE1" ,
@@ -1470,6 +1482,46 @@ static void xgene_edac_rb_report(struct edac_device_ctl_info *edac_dev)u32 err_addr_hi;u32 reg; +/* +* Check RB acess errors +* 1. Out of range +* 2. Un-implemented page +* 3. Un-aligned access +* 4. Offline slave IP +*/ +if (regmap_read (ctx->edac->rb_map,RBCSR , ®)) +return ; +if (reg &STICKYERR_MASK ) { +bool write; +u32 address; + +dev_err (edac_dev->dev,"IOB bus access error(s)\n" ); +if (regmap_read (ctx->edac->rb_map,RBEIR , ®)) +return ; + write = reg &WRITE_ACCESS_MASK ?1 :0 ; + address =RBERRADDR_RD (reg); +if (reg &AGENT_OFFLINE_ERR_MASK ) +dev_err (edac_dev->dev, +"IOB bus %s access to offline agent error\n" , + write ?"write" :"read" ); +if (reg &UNIMPL_RBPAGE_ERR_MASK ) +dev_err (edac_dev->dev, +"IOB bus %s access to unimplemented page error\n" , + write ?"write" :"read" ); +if (reg &WORD_ALIGNED_ERR_MASK ) +dev_err (edac_dev->dev, +"IOB bus %s word aligned access error\n" , + write ?"write" :"read" ); +if (reg &PAGE_ACCESS_ERR_MASK ) +dev_err (edac_dev->dev, +"IOB bus %s to page out of range access error\n" , + write ?"write" :"read" ); +if (regmap_write (ctx->edac->rb_map,RBEIR ,0 )) +return ; +if (regmap_write (ctx->edac->rb_map,RBCSR ,0 )) +return ; + } +/* IOB Bridge agent transaction error interrupt */ reg =readl (ctx->dev_csr +IOBBATRANSERRINTSTS );if (!reg)
@@ -1852,6 +1904,14 @@ static int xgene_edac_probe(struct platform_device *pdev) goto out_err; } + edac->rb_map =syscon_regmap_lookup_by_phandle (pdev->dev.of_node, +"regmap-rb" ); +if (IS_ERR (edac->rb_map)) { +dev_err (edac->dev,"unable to get syscon regmap rb\n" ); + rc =PTR_ERR (edac->rb_map); + goto out_err; + } + res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); edac->pcp_csr =devm_ioremap_resource (&pdev->dev, res);if (IS_ERR (edac->pcp_csr)) {
Signature · 1 line
1.7.1
PATCH 3/3 arm64: Update the APM X-Gene EDAC node with the RB register resource
In reply to Loc HoAdd the RB register resource as requires with the updated driver.
--- arch/arm64/boot/dts/apm/apm-storm.dtsi | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-)
arch/arm64/boot/dts/apm/apm-storm.dtsi +6 -0
@@ -444,6 +444,11 @@ reg = <0x0 0x1054a000 0x0 0x20>; }; + rb: rb at 7e000000 { + compatible = "apm,xgene-rb", "syscon"; + reg = <0x0 0x7e000000 0x0 0x10>; + }; + edac at 78800000 { compatible = "apm,xgene-edac"; #address-cells = <2>;
@@ -453,6 +458,7 @@ regmap-mcba = <&mcba>; regmap-mcbb = <&mcbb>; regmap-efuse = <&efuse>; + regmap-rb = <&rb>; reg = <0x0 0x78800000 0x0 0x100>; interrupts = <0x0 0x20 0x4>, <0x0 0x21 0x4>,
Signature · 1 line
1.7.1