devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/3] edac: xgene: Add missing SoC register bus error handling and fix CE promotes to UE
@ 2016-01-20  0:46 Loc Ho
  2016-01-20  0:46 ` [PATCH v2 1/3] Documentation: Update the APM X-Gene SoC EDAC DTS binding for missing RB Loc Ho
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Loc Ho @ 2016-01-20  0:46 UTC (permalink / raw)
  To: bp, dougthompson, mchehab, arnd
  Cc: devicetree, patches, Loc Ho, linux-arm-kernel, linux-edac

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.

v2:
* Make the register bus resource optional
* Update DT binding accordinlgy

---
Loc Ho (3):
  Documentation: Update the APM X-Gene SoC EDAC DTS binding for missing
    RB
  edac: xgene: Add missing SoC register bus error handling and fix CE
    promotes to UE
  arm64: Update the APM X-Gene EDAC node with the RB register resource

 .../devicetree/bindings/edac/apm-xgene-edac.txt    |   12 ++++
 arch/arm64/boot/dts/apm/apm-storm.dtsi             |    6 ++
 drivers/edac/xgene_edac.c                          |   70 +++++++++++++++++++-
 3 files changed, 87 insertions(+), 1 deletions(-)

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v2 1/3] Documentation: Update the APM X-Gene SoC EDAC DTS binding for missing RB
  2016-01-20  0:46 [PATCH v2 0/3] edac: xgene: Add missing SoC register bus error handling and fix CE promotes to UE Loc Ho
@ 2016-01-20  0:46 ` Loc Ho
       [not found]   ` <1453250812-15097-2-git-send-email-lho-qTEPVZfXA3Y@public.gmane.org>
  2016-01-20  0:46 ` [PATCH v2 2/3] edac: xgene: Add missing SoC register bus error handling and fix CE promotes to UE Loc Ho
  2016-01-20  0:46 ` [PATCH v2 3/3] arm64: Update the APM X-Gene EDAC node with the RB register resource Loc Ho
  2 siblings, 1 reply; 7+ messages in thread
From: Loc Ho @ 2016-01-20  0:46 UTC (permalink / raw)
  To: bp, dougthompson, mchehab, arnd
  Cc: devicetree, patches, Loc Ho, linux-arm-kernel, linux-edac

This patch updates the APM X-Gene SoC EDAC documentation binding to
reference the missing register bus for the the SoC EDAC.

Signed-off-by: Loc Ho <lho@apm.com>
---
 .../devicetree/bindings/edac/apm-xgene-edac.txt    |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/Documentation/devicetree/bindings/edac/apm-xgene-edac.txt b/Documentation/devicetree/bindings/edac/apm-xgene-edac.txt
index 78e2a31..17b29af 100644
--- a/Documentation/devicetree/bindings/edac/apm-xgene-edac.txt
+++ b/Documentation/devicetree/bindings/edac/apm-xgene-edac.txt
@@ -20,6 +20,12 @@ Required properties:
 - interrupts            : Interrupt-specifier for MCU, PMD, L3, or SoC error
 			  IRQ(s).
 
+Optional property:
+- regmap-rb		: Regmap of the register bus resource. This properity
+			  is optional only for compatibility. If the RB
+			  erorr conditions are not cleared, it will
+			  continuously generates interrupt.
+
 Required properties for memory controller subnode:
 - compatible		: Shall be "apm,xgene-edac-mc".
 - reg			: First resource shall be the memory controller unit
@@ -64,6 +70,11 @@ Example:
 		reg = <0x0 0x1054a000 0x0 0x20>;
 	};
 
+	rb: rb@7e000000 {
+		compatible = "apm,xgene-rb", "syscon";
+		reg = <0x0 0x7e000000 0x0 0x10>;
+	};
+
 	edac@78800000 {
 		compatible = "apm,xgene-edac";
 		#address-cells = <2>;
@@ -73,6 +84,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>,
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v2 2/3] edac: xgene: Add missing SoC register bus error handling and fix CE promotes to UE
  2016-01-20  0:46 [PATCH v2 0/3] edac: xgene: Add missing SoC register bus error handling and fix CE promotes to UE Loc Ho
  2016-01-20  0:46 ` [PATCH v2 1/3] Documentation: Update the APM X-Gene SoC EDAC DTS binding for missing RB Loc Ho
@ 2016-01-20  0:46 ` Loc Ho
  2016-01-20  0:46 ` [PATCH v2 3/3] arm64: Update the APM X-Gene EDAC node with the RB register resource Loc Ho
  2 siblings, 0 replies; 7+ messages in thread
From: Loc Ho @ 2016-01-20  0:46 UTC (permalink / raw)
  To: bp, dougthompson, mchehab, arnd
  Cc: devicetree, patches, Loc Ho, linux-arm-kernel, linux-edac

Add missing register bus error handling for APM X-Gene EDAC SoC and
fix an checking condition for CE error promotes to UE.

Signed-off-by: Loc Ho <lho@apm.com>
---
 drivers/edac/xgene_edac.c |   70 ++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 69 insertions(+), 1 deletions(-)

diff --git a/drivers/edac/xgene_edac.c b/drivers/edac/xgene_edac.c
index 41f8764..07b676b 100644
--- a/drivers/edac/xgene_edac.c
+++ b/drivers/edac/xgene_edac.c
@@ -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,51 @@ static void xgene_edac_rb_report(struct edac_device_ctl_info *edac_dev)
 	u32 err_addr_hi;
 	u32 reg;
 
+	/* If the register bus resource isn't available, just skip it */
+	if (!ctx->edac->rb_map)
+		goto rb_skip;
+
+	/*
+	 * Check RB access 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, &reg))
+		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, &reg))
+			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;
+	}
+rb_skip:
+
 	/* IOB Bridge agent transaction error interrupt */
 	reg = readl(ctx->dev_csr + IOBBATRANSERRINTSTS);
 	if (!reg)
@@ -1852,6 +1909,17 @@ static int xgene_edac_probe(struct platform_device *pdev)
 		goto out_err;
 	}
 
+	/*
+	 * NOTE: The register bus resources is optional for compatibiity
+	 * reason.
+	 */
+	edac->rb_map = syscon_regmap_lookup_by_phandle(pdev->dev.of_node,
+						       "regmap-rb");
+	if (IS_ERR(edac->rb_map)) {
+		dev_warn(edac->dev, "missing syscon regmap rb\n");
+		edac->rb_map = NULL;
+	}
+
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	edac->pcp_csr = devm_ioremap_resource(&pdev->dev, res);
 	if (IS_ERR(edac->pcp_csr)) {
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v2 3/3] arm64: Update the APM X-Gene EDAC node with the RB register resource
  2016-01-20  0:46 [PATCH v2 0/3] edac: xgene: Add missing SoC register bus error handling and fix CE promotes to UE Loc Ho
  2016-01-20  0:46 ` [PATCH v2 1/3] Documentation: Update the APM X-Gene SoC EDAC DTS binding for missing RB Loc Ho
  2016-01-20  0:46 ` [PATCH v2 2/3] edac: xgene: Add missing SoC register bus error handling and fix CE promotes to UE Loc Ho
@ 2016-01-20  0:46 ` Loc Ho
  2 siblings, 0 replies; 7+ messages in thread
From: Loc Ho @ 2016-01-20  0:46 UTC (permalink / raw)
  To: bp, dougthompson, mchehab, arnd
  Cc: devicetree, patches, Loc Ho, linux-arm-kernel, linux-edac

Add the RB register resource as requires with the updated driver.

Signed-off-by: Loc Ho <lho@apm.com>
---
 arch/arm64/boot/dts/apm/apm-storm.dtsi |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/arch/arm64/boot/dts/apm/apm-storm.dtsi b/arch/arm64/boot/dts/apm/apm-storm.dtsi
index fe30f76..3e40bd4 100644
--- a/arch/arm64/boot/dts/apm/apm-storm.dtsi
+++ b/arch/arm64/boot/dts/apm/apm-storm.dtsi
@@ -493,6 +493,11 @@
 			reg = <0x0 0x1054a000 0x0 0x20>;
 		};
 
+		rb: rb@7e000000 {
+			compatible = "apm,xgene-rb", "syscon";
+			reg = <0x0 0x7e000000 0x0 0x10>;
+		};
+
 		edac@78800000 {
 			compatible = "apm,xgene-edac";
 			#address-cells = <2>;
@@ -502,6 +507,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>,
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v2 1/3] Documentation: Update the APM X-Gene SoC EDAC DTS binding for missing RB
       [not found]   ` <1453250812-15097-2-git-send-email-lho-qTEPVZfXA3Y@public.gmane.org>
@ 2016-01-20 16:46     ` Rob Herring
  2016-01-20 18:35     ` Borislav Petkov
  1 sibling, 0 replies; 7+ messages in thread
From: Rob Herring @ 2016-01-20 16:46 UTC (permalink / raw)
  To: Loc Ho
  Cc: bp-Gina5bIWoIWzQB+pC5nmwQ, dougthompson-aS9lmoZGLiVWk0Htik3J/w,
	mchehab-JPH+aEBZ4P+UEJcrhfAQsw, arnd-r2nGTMty4D4,
	linux-edac-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	patches-qTEPVZfXA3Y

On Tue, Jan 19, 2016 at 05:46:50PM -0700, Loc Ho wrote:
> This patch updates the APM X-Gene SoC EDAC documentation binding to
> reference the missing register bus for the the SoC EDAC.
> 
> Signed-off-by: Loc Ho <lho-qTEPVZfXA3Y@public.gmane.org>
> ---
>  .../devicetree/bindings/edac/apm-xgene-edac.txt    |   12 ++++++++++++
>  1 files changed, 12 insertions(+), 0 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/edac/apm-xgene-edac.txt b/Documentation/devicetree/bindings/edac/apm-xgene-edac.txt
> index 78e2a31..17b29af 100644
> --- a/Documentation/devicetree/bindings/edac/apm-xgene-edac.txt
> +++ b/Documentation/devicetree/bindings/edac/apm-xgene-edac.txt
> @@ -20,6 +20,12 @@ Required properties:
>  - interrupts            : Interrupt-specifier for MCU, PMD, L3, or SoC error
>  			  IRQ(s).
>  
> +Optional property:
> +- regmap-rb		: Regmap of the register bus resource. This properity

s/properity/property/

> +			  is optional only for compatibility. If the RB
> +			  erorr conditions are not cleared, it will
> +			  continuously generates interrupt.

s/generates/generate/

Given this is pretty much required. I think I would move this back to 
required in the documentation, but keep the driver to allow it to be 
missing.

Rob
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2 1/3] Documentation: Update the APM X-Gene SoC EDAC DTS binding for missing RB
       [not found]   ` <1453250812-15097-2-git-send-email-lho-qTEPVZfXA3Y@public.gmane.org>
  2016-01-20 16:46     ` Rob Herring
@ 2016-01-20 18:35     ` Borislav Petkov
       [not found]       ` <20160120183543.GK23186-fF5Pk5pvG8Y@public.gmane.org>
  1 sibling, 1 reply; 7+ messages in thread
From: Borislav Petkov @ 2016-01-20 18:35 UTC (permalink / raw)
  To: Loc Ho
  Cc: dougthompson-aS9lmoZGLiVWk0Htik3J/w,
	mchehab-JPH+aEBZ4P+UEJcrhfAQsw, arnd-r2nGTMty4D4,
	linux-edac-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	patches-qTEPVZfXA3Y

On Tue, Jan 19, 2016 at 05:46:50PM -0700, Loc Ho wrote:
>  This patch updates the APM X-Gene SoC EDAC documentation binding to
>  reference the missing register bus for the the SoC EDAC.
>  
>  Signed-off-by: Loc Ho <lho-qTEPVZfXA3Y@public.gmane.org>
>  ---
>   .../devicetree/bindings/edac/apm-xgene-edac.txt    |   12 ++++++++++++
>   1 files changed, 12 insertions(+), 0 deletions(-)
>  
>  diff --git a/Documentation/devicetree/bindings/edac/apm-xgene-edac.txt b/Documentation/devicetree/bindings/edac/apm-xgene-edac.txt
>  index 78e2a31..17b29af 100644
>  --- a/Documentation/devicetree/bindings/edac/apm-xgene-edac.txt
>  +++ b/Documentation/devicetree/bindings/edac/apm-xgene-edac.txt
>  @@ -20,6 +20,12 @@ Required properties:
>   - interrupts            : Interrupt-specifier for MCU, PMD, L3, or SoC error
>   			  IRQ(s).
>   
>  +Optional property:
>  +- regmap-rb		: Regmap of the register bus resource. This properity
>  +			  is optional only for compatibility. If the RB
>  +			  erorr conditions are not cleared, it will

s/erorr/error/

Please integrate a spellchecker into your patch creation workflow.

Thanks.

-- 
Regards/Gruss,
    Boris.

ECO tip #101: Trim your mails when you reply.
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2 1/3] Documentation: Update the APM X-Gene SoC EDAC DTS binding for missing RB
       [not found]       ` <20160120183543.GK23186-fF5Pk5pvG8Y@public.gmane.org>
@ 2016-01-20 23:14         ` Loc Ho
  0 siblings, 0 replies; 7+ messages in thread
From: Loc Ho @ 2016-01-20 23:14 UTC (permalink / raw)
  To: Borislav Petkov
  Cc: Doug Thompson, Mauro Carvalho Chehab, Arnd Bergmann, linux-edac,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	patches-qTEPVZfXA3Y@public.gmane.org

Hi,

On Wed, Jan 20, 2016 at 10:35 AM, Borislav Petkov <bp-Gina5bIWoIWzQB+pC5nmwQ@public.gmane.org> wrote:
> On Tue, Jan 19, 2016 at 05:46:50PM -0700, Loc Ho wrote:
>>  This patch updates the APM X-Gene SoC EDAC documentation binding to
>>  reference the missing register bus for the the SoC EDAC.
>>
>>  Signed-off-by: Loc Ho <lho-qTEPVZfXA3Y@public.gmane.org>
>>  ---
>>   .../devicetree/bindings/edac/apm-xgene-edac.txt    |   12 ++++++++++++
>>   1 files changed, 12 insertions(+), 0 deletions(-)
>>
>>  diff --git a/Documentation/devicetree/bindings/edac/apm-xgene-edac.txt b/Documentation/devicetree/bindings/edac/apm-xgene-edac.txt
>>  index 78e2a31..17b29af 100644
>>  --- a/Documentation/devicetree/bindings/edac/apm-xgene-edac.txt
>>  +++ b/Documentation/devicetree/bindings/edac/apm-xgene-edac.txt
>>  @@ -20,6 +20,12 @@ Required properties:
>>   - interrupts            : Interrupt-specifier for MCU, PMD, L3, or SoC error
>>                         IRQ(s).
>>
>>  +Optional property:
>>  +- regmap-rb         : Regmap of the register bus resource. This properity
>>  +                      is optional only for compatibility. If the RB
>>  +                      erorr conditions are not cleared, it will
>
> s/erorr/error/
>
> Please integrate a spellchecker into your patch creation workflow.

I will integrate aspell into the patch creation workflow and shoot for
an update version sometime this Friday.

-Loc
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-01-20 23:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-20  0:46 [PATCH v2 0/3] edac: xgene: Add missing SoC register bus error handling and fix CE promotes to UE Loc Ho
2016-01-20  0:46 ` [PATCH v2 1/3] Documentation: Update the APM X-Gene SoC EDAC DTS binding for missing RB Loc Ho
     [not found]   ` <1453250812-15097-2-git-send-email-lho-qTEPVZfXA3Y@public.gmane.org>
2016-01-20 16:46     ` Rob Herring
2016-01-20 18:35     ` Borislav Petkov
     [not found]       ` <20160120183543.GK23186-fF5Pk5pvG8Y@public.gmane.org>
2016-01-20 23:14         ` Loc Ho
2016-01-20  0:46 ` [PATCH v2 2/3] edac: xgene: Add missing SoC register bus error handling and fix CE promotes to UE Loc Ho
2016-01-20  0:46 ` [PATCH v2 3/3] arm64: Update the APM X-Gene EDAC node with the RB register resource Loc Ho

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).