Patchwork [2/3] PPC: Fix compilation of fsl_rio.c

login
register
mail settings
Submitter Alexander Graf
Date Aug. 31, 2010, 2:15 a.m.
Message ID <1283220922-20369-3-git-send-email-agraf@suse.de>
Download mbox | patch
Permalink /patch/63158/
State Superseded
Delegated to: Kumar Gala
Headers show

Comments

Alexander Graf - Aug. 31, 2010, 2:15 a.m.
Commit a52c8f52 introduced machine check magic for the RapidIO chip.
Unfortunately it was so magical that it used constants that aren't even
defined!

This patch bluntly comments out the broken constant's usage. This
probably means that said functionality thus doesn't work, but at
least it makes it compile for me.

CC: Alexandre Bounine <alexandre.bounine@idt.com>
CC: Thomas Moll <thomas.moll@sysgo.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
---
 arch/powerpc/sysdev/fsl_rio.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Scott Wood - Aug. 31, 2010, 6:10 p.m.
On Tue, 31 Aug 2010 04:15:21 +0200
Alexander Graf <agraf@suse.de> wrote:

> Commit a52c8f52 introduced machine check magic for the RapidIO chip.
> Unfortunately it was so magical that it used constants that aren't even
> defined!
> 
> This patch bluntly comments out the broken constant's usage. This
> probably means that said functionality thus doesn't work, but at
> least it makes it compile for me.

The MCSR_MASK is actually completely unnecessary -- it doesn't change
the result of testing bits that are within the mask.

Multiple patches have been posted for this already, including:
http://patchwork.ozlabs.org/patch/56135/

Someone just needs to apply it. :-)

-Scott
Kumar Gala - Aug. 31, 2010, 6:55 p.m.
On Aug 31, 2010, at 1:10 PM, Scott Wood wrote:

> On Tue, 31 Aug 2010 04:15:21 +0200
> Alexander Graf <agraf@suse.de> wrote:
> 
>> Commit a52c8f52 introduced machine check magic for the RapidIO chip.
>> Unfortunately it was so magical that it used constants that aren't even
>> defined!
>> 
>> This patch bluntly comments out the broken constant's usage. This
>> probably means that said functionality thus doesn't work, but at
>> least it makes it compile for me.
> 
> The MCSR_MASK is actually completely unnecessary -- it doesn't change
> the result of testing bits that are within the mask.
> 
> Multiple patches have been posted for this already, including:
> http://patchwork.ozlabs.org/patch/56135/
> 
> Someone just needs to apply it. :-)

I've got a different version as I don't want to override the mcheck handler.

- k

Patch

diff --git a/arch/powerpc/sysdev/fsl_rio.c b/arch/powerpc/sysdev/fsl_rio.c
index 6425abe..dba2969 100644
--- a/arch/powerpc/sysdev/fsl_rio.c
+++ b/arch/powerpc/sysdev/fsl_rio.c
@@ -245,7 +245,7 @@  static int (*saved_mcheck_exception)(struct pt_regs *regs);
 static int fsl_rio_mcheck_exception(struct pt_regs *regs)
 {
 	const struct exception_table_entry *entry = NULL;
-	unsigned long reason = (mfspr(SPRN_MCSR) & MCSR_MASK);
+	unsigned long reason = (mfspr(SPRN_MCSR) /* & MCSR_MASK */);
 
 	if (reason & MCSR_BUS_RBERR) {
 		reason = in_be32((u32 *)(rio_regs_win + RIO_LTLEDCSR));