Re: [PATCH] topology: Provide CPU topology in sysfs in !SMP configurations

From: Geert Uytterhoeven
Date: Tue Jan 03 2012 - 10:54:49 EST


On Thu, Nov 24, 2011 at 08:04, Ben Hutchings <ben@xxxxxxxxxxxxxxx> wrote:
> We should provide topology information to userland even if it's not
> very interesting. ÂThe current code appears to work properly for !SMP
> (tested on i386).
>
> Reference: http://bugs.debian.org/649216
> Reported-by: Marcus Osdoba <marcus.osdoba@xxxxxxxxxxxxxx>
> Signed-off-by: Ben Hutchings <ben@xxxxxxxxxxxxxxx>
> ---
> Âdrivers/base/Makefile | Â Â4 ++--
> Â1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/base/Makefile b/drivers/base/Makefile
> index 99a375a..1334d89 100644
> --- a/drivers/base/Makefile
> +++ b/drivers/base/Makefile
> @@ -3,7 +3,8 @@
> Âobj-y         Â:= core.o sys.o bus.o dd.o syscore.o \
> Â Â Â Â Â Â Â Â Â Â Â Â Â driver.o class.o platform.o \
> Â Â Â Â Â Â Â Â Â Â Â Â Â cpu.o firmware.o init.o map.o devres.o \
> - Â Â Â Â Â Â Â Â Â Â Â Â Âattribute_container.o transport_class.o
> + Â Â Â Â Â Â Â Â Â Â Â Â Âattribute_container.o transport_class.o \
> + Â Â Â Â Â Â Â Â Â Â Â Â Âtopology.o
> Âobj-$(CONFIG_DEVTMPFS) += devtmpfs.o
> Âobj-y         Â+= power/
> Âobj-$(CONFIG_HAS_DMA) Â+= dma-mapping.o
> @@ -12,7 +13,6 @@ obj-$(CONFIG_ISA) Â Â += isa.o
> Âobj-$(CONFIG_FW_LOADER) Â Â Â Â+= firmware_class.o
> Âobj-$(CONFIG_NUMA) Â Â += node.o
> Âobj-$(CONFIG_MEMORY_HOTPLUG_SPARSE) += memory.o
> -obj-$(CONFIG_SMP) Â Â Â+= topology.o
> Âifeq ($(CONFIG_SYSFS),y)
> Âobj-$(CONFIG_MODULES) Â+= module.o
> Âendif

Taking this to linux-arch with a follow up from Ben due to crashes
reported on the
debian-m68k mailing list:

> > My guess is that on m68k get_cpu_sysdev(0) returns NULL and thus
> > topology_add_dev() passes an invalid pointer into sysfs_create_group().
> > So either m68k (and maybe some other architectures with no SMP support)
> > need to be fixed or the CPU topology code needs to allow for this.
>
> None of these architectures appears to call register_cpu():
>
> c6x frv h8300 m68k microblaze openrisc score um xtensa
>
> and therefore they will all panic at boot following this change (commit
> ccbc60d3e19a1b6ae66ca0d89b3da02dde62088b). So either I can try to fix
> them or else it must be reverted for now.

The commit mentioned above is in linux-next (and in Debian's 3.2-rc7).

Gr{oetje,eeting}s,

            Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
             Â Â -- Linus Torvalds
--
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/