Message ID | 20190318141301.14750-1-svens@stackframe.org (mailing list archive) |
---|---|
State | Superseded, archived |
Headers | show |
Series | parisc: fix iosapic address compare | expand |
On 2019-03-18 10:13 a.m., Sven Schnelle wrote:
> Using F_EXTEND doesn't work here as it casts hpa to long,
Actually, it casts to unsigned long.
Dave
Hi Sven, * Sven Schnelle <svens@stackframe.org>: > i just updated my C3750 to latest git, and got the kernel oops below. It looks > like the change to using F_EXTEND breaks using 32 bit kernels on at least my > C3750. Not sure whether we should revert the F_EXTEND change, or just cast > the other side of the compare to long. The patch below does this. Thanks for testing! I think, as suggested by you, revertig parts of my patch makes most sense. I've committed the patch below to my for-next tree. Can you check if it works for you? Helge -------------------- From dae50289effc106df023796eb25d602244e73ac1 Mon Sep 17 00:00:00 2001 From: Helge Deller <deller@gmx.de> Date: Mon, 18 Mar 2019 22:56:15 +0100 Subject: [PATCH] Revert: parisc: Use F_EXTEND() macro in iosapic code Revert parts of commit 97d7e2e3fd8a ("parisc: Use F_EXTEND() macro in iosapic code"). It breaks booting the 32-bit kernel. Reported-by: Sven Schnelle <svens@stackframe.org> Fixes: 97d7e2e3fd8a ("parisc: Use F_EXTEND() macro in iosapic code") Signed-off-by: Helge Deller <deller@gmx.de> diff --git a/drivers/parisc/iosapic.c b/drivers/parisc/iosapic.c index 1be571c20062..6bad04cbb1d3 100644 --- a/drivers/parisc/iosapic.c +++ b/drivers/parisc/iosapic.c @@ -157,8 +157,12 @@ #define DBG_IRT(x...) #endif +#ifdef CONFIG_64BIT +#define COMPARE_IRTE_ADDR(irte, hpa) ((irte)->dest_iosapic_addr == (hpa)) +#else #define COMPARE_IRTE_ADDR(irte, hpa) \ - ((irte)->dest_iosapic_addr == F_EXTEND(hpa)) + ((irte)->dest_iosapic_addr == ((hpa) | 0xffffffff00000000ULL)) +#endif #define IOSAPIC_REG_SELECT 0x00 #define IOSAPIC_REG_WINDOW 0x10
Hi Helge, On Mon, Mar 18, 2019 at 11:03:06PM +0100, Helge Deller wrote: > Hi Sven, > > * Sven Schnelle <svens@stackframe.org>: > > i just updated my C3750 to latest git, and got the kernel oops below. It looks > > like the change to using F_EXTEND breaks using 32 bit kernels on at least my > > C3750. Not sure whether we should revert the F_EXTEND change, or just cast > > the other side of the compare to long. The patch below does this. > > Thanks for testing! > I think, as suggested by you, revertig parts of my patch makes most sense. > I've committed the patch below to my for-next tree. > Can you check if it works for you? Yes, works for me. The good thing about this Bug is that i was forced to read the NS87560 driver source and have an idea now why it's called SuckyIO :) Tested-by: Sven Schnelle <svens@stackframe.org> Regards Sven
diff --git a/drivers/parisc/iosapic.c b/drivers/parisc/iosapic.c index 1be571c20062..1b0c3139d971 100644 --- a/drivers/parisc/iosapic.c +++ b/drivers/parisc/iosapic.c @@ -158,7 +158,7 @@ #endif #define COMPARE_IRTE_ADDR(irte, hpa) \ - ((irte)->dest_iosapic_addr == F_EXTEND(hpa)) + ((long)(irte)->dest_iosapic_addr == F_EXTEND(hpa)) #define IOSAPIC_REG_SELECT 0x00 #define IOSAPIC_REG_WINDOW 0x10