Re: [PATCH 1/8] Add driver auto probing for x86 features v2

From: Thomas Renninger
Date: Fri Dec 23 2011 - 08:16:10 EST


Hi,

for info:

On Tuesday, December 20, 2011 12:46:27 AM Andi Kleen wrote:
> From: Andi Kleen <ak@xxxxxxxxxxxxxxx>
>
> Old patchkit, resurrect due to popular demand.
...
> + n = snprintf(buf, size, "x86cpu:vendor:%04x:family:%04x:model:%04x:feature:",
this must be uppercase hex values (%04X)
...
> + if (boot_cpu_has(i)) {
> + n = snprintf(buf, size, ",%04x", i);
same here.
Looks like a string compare is happening and in
scripts/mod/file2alias.c
sizeof(field) == 2 ? "%04X"
is used and the modalias added to the driver and showing up
in /lib/modules/*/modales.alias is uppercase.

...
> + }
> + *buf++ = ',';
> + *buf++ = '\n';
this must be:
+ *buf++ = '\0';
otherwise one can hit:
WARNING: at lib/kobject_uevent.c:362 add_uevent_var+0xf2/0x100()
add_uevent_var: buffer size too small
Hm, then /sys/devices/system/cpu/modalias has not a newline.
Using kzalloc in arch_cpu_uevent() should be the nicest way
to address this.

Now things work much better, hope that's all.
I just send out a new patchset (with cpuid vs cpu kobject broken out
in a separate patch for better backporting).

Thomas
--
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/