Message ID | 20090421.021631.00852238.davem@davemloft.net |
---|---|
State | Accepted |
Delegated to: | David Miller |
Headers | show |
From: David Miller <davem@davemloft.net> Date: Tue, 21 Apr 2009 02:16:31 -0700 (PDT) > From: Meelis Roos <mroos@linux.ee> > Date: Sun, 19 Apr 2009 12:16:21 +0300 (EEST) > >>> Ok, following through on this... Here is how I would like to >>> fix this bug. >>> >>> sparc: Fix bus type probing for ESP and LE devices. >>> >>> If there is a dummy "espdma" or "ledma" parent device above ESP scsi >>> or LE ethernet device nodes, we have to match the bus as SBUS. >> >> Unfortunately it does not work, onboard ESP is still not detected on my >> Ultra 1. > > Silly bug in that patch, I forgot to substitude "np" with "dp" in > the name tests that got moved into the loop. > > Please try this patch instead. > > Thanks! Meelis, have you have an opportunity to test this updated version of the fix yet? Thanks. -- To unsubscribe from this list: send the line "unsubscribe sparclinux" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
> Meelis, have you have an opportunity to test this updated > version of the fix yet? It was still compiling 2 hour ago, will see in an hour or two.
> Meelis, have you have an opportunity to test this updated > version of the fix yet? The compile had finished, I installed and testbooted it. It works, thank you! Tested against yesterdays git.
From: Meelis Roos <mroos@linux.ee> Date: Wed, 22 Apr 2009 13:37:11 +0300 (EEST) >> Meelis, have you have an opportunity to test this updated >> version of the fix yet? > > The compile had finished, I installed and testbooted it. It works, thank > you! Tested against yesterdays git. Thanks a lot for all of your help. I'll push this fix to Linus and -stable. -- To unsubscribe from this list: send the line "unsubscribe sparclinux" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/arch/sparc/kernel/of_device_32.c b/arch/sparc/kernel/of_device_32.c index 0a83bd7..c8f14c1 100644 --- a/arch/sparc/kernel/of_device_32.c +++ b/arch/sparc/kernel/of_device_32.c @@ -246,8 +246,25 @@ static unsigned long of_bus_pci_get_flags(const u32 *addr, unsigned long flags) static int of_bus_sbus_match(struct device_node *np) { - return !strcmp(np->name, "sbus") || - !strcmp(np->name, "sbi"); + struct device_node *dp = np; + + while (dp) { + if (!strcmp(dp->name, "sbus") || + !strcmp(dp->name, "sbi")) + return 1; + + /* Have a look at use_1to1_mapping(). We're trying + * to match SBUS if that's the top-level bus and we + * don't have some intervening real bus that provides + * ranges based translations. + */ + if (of_find_property(dp, "ranges", NULL) != NULL) + break; + + dp = dp->parent; + } + + return 0; } static void of_bus_sbus_count_cells(struct device_node *child, diff --git a/arch/sparc/kernel/of_device_64.c b/arch/sparc/kernel/of_device_64.c index 27381f1..5ac287a 100644 --- a/arch/sparc/kernel/of_device_64.c +++ b/arch/sparc/kernel/of_device_64.c @@ -300,8 +300,25 @@ static unsigned long of_bus_pci_get_flags(const u32 *addr, unsigned long flags) static int of_bus_sbus_match(struct device_node *np) { - return !strcmp(np->name, "sbus") || - !strcmp(np->name, "sbi"); + struct device_node *dp = np; + + while (dp) { + if (!strcmp(dp->name, "sbus") || + !strcmp(dp->name, "sbi")) + return 1; + + /* Have a look at use_1to1_mapping(). We're trying + * to match SBUS if that's the top-level bus and we + * don't have some intervening real bus that provides + * ranges based translations. + */ + if (of_find_property(dp, "ranges", NULL) != NULL) + break; + + dp = dp->parent; + } + + return 0; } static void of_bus_sbus_count_cells(struct device_node *child,