Re: [PATCH] trivial fix for 2.6.11 raid6 compilation on ppc w/ Altivec

From: Olof Johansson
Date: Thu Mar 03 2005 - 18:07:20 EST


On Fri, Mar 04, 2005 at 09:30:22AM +1100, Paul Mackerras wrote:
> > I nominate this as a candidate for linux-2.6.11 release branch. :)
>
> No. Unfortunately if you fix ppc64 here you will break ppc, and vice
> versa. Yes, we are going to reconcile the cur_cpu_spec definitions
> between ppc and ppc64. :)

The proper fix is to get the cpu_has_feature patch merged up from -mm,
but that's 99% cleanup and 1% bugfix. So here's a more appropriate fix
for the 2.6.11 patch stream. This goes on top of the one that just got
merged there.


-Olof


---


Here's a patch that will work for both PPC and PPC64. The proper way to
fix this in mainline is to merge -mm's cpu_has_feature patch, but for
the stable 2.6.11-series, this much less intrusive (i.e. just the pure
bugfix, not the cleanup part).

Signed-off-by: Olof Johansson <olof@xxxxxxxxxxxxxx>


Index: linux-2.5/drivers/md/raid6altivec.uc
===================================================================
--- linux-2.5.orig/drivers/md/raid6altivec.uc 2005-03-03 16:46:47.000000000 -0600
+++ linux-2.5/drivers/md/raid6altivec.uc 2005-03-03 16:48:03.000000000 -0600
@@ -108,7 +108,11 @@ int raid6_have_altivec(void);
int raid6_have_altivec(void)
{
/* This assumes either all CPUs have Altivec or none does */
+#ifdef CONFIG_PPC64
+ return cur_cpu_spec->cpu_features & CPU_FTR_ALTIVEC;
+#else
return cur_cpu_spec[0]->cpu_features & CPU_FTR_ALTIVEC;
+#endif
}
#endif

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/