diff mbox

[v10,1/5] arm64: Enable EDAC on ARM64

Message ID 1431991481-25684-2-git-send-email-lho@apm.com (mailing list archive)
State New, archived
Headers show

Commit Message

Loc Ho May 18, 2015, 11:24 p.m. UTC
Add an stub atomic_scrub function and enable EDAC for arm64.

Signed-off-by: Loc Ho <lho@apm.com>
---
 arch/arm64/Kconfig            |    1 +
 arch/arm64/include/asm/edac.h |   28 ++++++++++++++++++++++++++++
 2 files changed, 29 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm64/include/asm/edac.h

Comments

Borislav Petkov May 19, 2015, 5:03 p.m. UTC | #1
On Mon, May 18, 2015 at 05:24:37PM -0600, Loc Ho wrote:
> Add an stub atomic_scrub function and enable EDAC for arm64.
> 
> Signed-off-by: Loc Ho <lho@apm.com>
> ---
>  arch/arm64/Kconfig            |    1 +
>  arch/arm64/include/asm/edac.h |   28 ++++++++++++++++++++++++++++
>  2 files changed, 29 insertions(+), 0 deletions(-)
>  create mode 100644 arch/arm64/include/asm/edac.h
> 
> diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
> index 4269dba..577078f 100644
> --- a/arch/arm64/Kconfig
> +++ b/arch/arm64/Kconfig
> @@ -22,6 +22,7 @@ config ARM64
>  	select BUILDTIME_EXTABLE_SORT
>  	select CLONE_BACKWARDS
>  	select COMMON_CLK
> +	select EDAC_SUPPORT
>  	select CPU_PM if (SUSPEND || CPU_IDLE)
>  	select DCACHE_WORD_ACCESS
>  	select GENERIC_ALLOCATOR
> diff --git a/arch/arm64/include/asm/edac.h b/arch/arm64/include/asm/edac.h
> new file mode 100644
> index 0000000..683495b
> --- /dev/null
> +++ b/arch/arm64/include/asm/edac.h
> @@ -0,0 +1,28 @@
> +/*
> + * ARM64 EDAC Header File
> + *
> + * This program is free software; you can redistribute it and/or modify it
> + * under the terms and conditions of the GNU General Public License,
> + * version 2, as published by the Free Software Foundation.
> + *
> + * This program is distributed in the hope 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.
> + *
> + * You should have received a copy of the GNU General Public License along with
> + * this program.  If not, see <http://www.gnu.org/licenses/>.
> + */
> +#ifndef __ASM_EDAC_H
> +#define __ASM_EDAC_H
> +
> +/*
> + * ECC atomic, DMA, SMP and interrupt safe scrub function.
> + */
> +static inline void atomic_scrub(void *va, u32 size)
> +{
> +	/* Stub function for now until an ARM64 HW has a way to test it. */
> +	WARN_ONCE(1, "not implemented");
> +}

So you're adding this empty function, it issues a warning for which the
user can't really do anything about and on top of that, it is not even
used in this patchset.

So please kill it from this submission.

You can add a full-fledged version later after you test it successfully
on real hw.
Loc Ho May 19, 2015, 7:57 p.m. UTC | #2
Hi,

On Tue, May 19, 2015 at 10:03 AM, Borislav Petkov <bp@alien8.de> wrote:
> On Mon, May 18, 2015 at 05:24:37PM -0600, Loc Ho wrote:
>> Add an stub atomic_scrub function and enable EDAC for arm64.
>>
>> Signed-off-by: Loc Ho <lho@apm.com>
>> ---
>>  arch/arm64/Kconfig            |    1 +
>>  arch/arm64/include/asm/edac.h |   28 ++++++++++++++++++++++++++++
>>  2 files changed, 29 insertions(+), 0 deletions(-)
>>  create mode 100644 arch/arm64/include/asm/edac.h
>>
>> diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
>> index 4269dba..577078f 100644
>> --- a/arch/arm64/Kconfig
>> +++ b/arch/arm64/Kconfig
>> @@ -22,6 +22,7 @@ config ARM64
>>       select BUILDTIME_EXTABLE_SORT
>>       select CLONE_BACKWARDS
>>       select COMMON_CLK
>> +     select EDAC_SUPPORT
>>       select CPU_PM if (SUSPEND || CPU_IDLE)
>>       select DCACHE_WORD_ACCESS
>>       select GENERIC_ALLOCATOR
>> diff --git a/arch/arm64/include/asm/edac.h b/arch/arm64/include/asm/edac.h
>> new file mode 100644
>> index 0000000..683495b
>> --- /dev/null
>> +++ b/arch/arm64/include/asm/edac.h
>> @@ -0,0 +1,28 @@
>> +/*
>> + * ARM64 EDAC Header File
>> + *
>> + * This program is free software; you can redistribute it and/or modify it
>> + * under the terms and conditions of the GNU General Public License,
>> + * version 2, as published by the Free Software Foundation.
>> + *
>> + * This program is distributed in the hope 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.
>> + *
>> + * You should have received a copy of the GNU General Public License along with
>> + * this program.  If not, see <http://www.gnu.org/licenses/>.
>> + */
>> +#ifndef __ASM_EDAC_H
>> +#define __ASM_EDAC_H
>> +
>> +/*
>> + * ECC atomic, DMA, SMP and interrupt safe scrub function.
>> + */
>> +static inline void atomic_scrub(void *va, u32 size)
>> +{
>> +     /* Stub function for now until an ARM64 HW has a way to test it. */
>> +     WARN_ONCE(1, "not implemented");
>> +}
>
> So you're adding this empty function, it issues a warning for which the
> user can't really do anything about and on top of that, it is not even
> used in this patchset.
>
> So please kill it from this submission.

This was discussed here
http://lists.infradead.org/pipermail/linux-arm-kernel/2015-March/326986.html.
Without this, it will have compiler error as this function is called
by.function edac_mc_scrub_block in file drivers/edac/edac_mc.c.

>
> You can add a full-fledged version later after you test it successfully
> on real hw.

Our platform don't use it as it has HW scrub support.

-Loc
Borislav Petkov May 19, 2015, 8:33 p.m. UTC | #3
On Tue, May 19, 2015 at 12:57:32PM -0700, Loc Ho wrote:
> This was discussed here
> http://lists.infradead.org/pipermail/linux-arm-kernel/2015-March/326986.html.
> Without this, it will have compiler error as this function is called
> by.function edac_mc_scrub_block in file drivers/edac/edac_mc.c.

Argh, that's just silly. We should have a __weak atomic_scrub() in the
edac core which arches can override but not have to supply a dummy just
because...

I'll try to hack up something later.
Borislav Petkov May 21, 2015, 6:07 p.m. UTC | #4
Adding more arch people.

On Tue, May 19, 2015 at 10:33:36PM +0200, Borislav Petkov wrote:
> On Tue, May 19, 2015 at 12:57:32PM -0700, Loc Ho wrote:
> > This was discussed here
> > http://lists.infradead.org/pipermail/linux-arm-kernel/2015-March/326986.html.
> > Without this, it will have compiler error as this function is called
> > by.function edac_mc_scrub_block in file drivers/edac/edac_mc.c.
> 
> Argh, that's just silly. We should have a __weak atomic_scrub() in the
> edac core which arches can override but not have to supply a dummy just
> because...
> 
> I'll try to hack up something later.

Phew, so this wasn't easy but I think I have it. And it is nicer now.
Patch as a reply to this message.
diff mbox

Patch

diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 4269dba..577078f 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -22,6 +22,7 @@  config ARM64
 	select BUILDTIME_EXTABLE_SORT
 	select CLONE_BACKWARDS
 	select COMMON_CLK
+	select EDAC_SUPPORT
 	select CPU_PM if (SUSPEND || CPU_IDLE)
 	select DCACHE_WORD_ACCESS
 	select GENERIC_ALLOCATOR
diff --git a/arch/arm64/include/asm/edac.h b/arch/arm64/include/asm/edac.h
new file mode 100644
index 0000000..683495b
--- /dev/null
+++ b/arch/arm64/include/asm/edac.h
@@ -0,0 +1,28 @@ 
+/*
+ * ARM64 EDAC Header File
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope 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.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+#ifndef __ASM_EDAC_H
+#define __ASM_EDAC_H
+
+/*
+ * ECC atomic, DMA, SMP and interrupt safe scrub function.
+ */
+static inline void atomic_scrub(void *va, u32 size)
+{
+	/* Stub function for now until an ARM64 HW has a way to test it. */
+	WARN_ONCE(1, "not implemented");
+}
+
+#endif