All of lore.kernel.org
 help / color / mirror / Atom feed
* x86, microcode: Conversion from sysdev class caused regression
@ 2012-04-11 16:38 Andreas Herrmann
  2012-04-11 17:06 ` Kay Sievers
                   ` (3 more replies)
  0 siblings, 4 replies; 24+ messages in thread
From: Andreas Herrmann @ 2012-04-11 16:38 UTC (permalink / raw)
  To: Kay Sievers; +Cc: Greg Kroah-Hartman, Petkov, Borislav, linux-kernel

Hi,

commit 8a25a2fd126c621f44f3aeaef80d51f00fc11639 (cpu: convert 'cpu'
and 'machinecheck' sysdev_class to a regular subsystem) causes a
regression in the CPU microcode loader.

Previous behaviour was that module loading failed if no appropriate
CPU was found. Now we get

 [  131.717212] WARNING: at fs/sysfs/group.c:138 mc_device_remove+0x5f/0x70 [microcode]()
 [  131.717218] Hardware name: 01972NG
 [  131.717223] sysfs group ffffffffa00013d0 not found for kobject 'cpu0'
 [  131.717228] Modules linked in: snd_hda_codec_hdmi snd_hda_codec_conexant snd_hda_intel
                btusb snd_hda_codec bluetooth thinkpad_acpi rfkill microcode(-) [last unloaded: cfg80211]
 [  131.717254] Pid: 4560, comm: modprobe Not tainted 3.4.0-rc2-00002-g258f742 #5
 [  131.717260] Call Trace:
 [  131.717277]  [<ffffffff8103113b>] ? warn_slowpath_common+0x7b/0xc0
 [  131.717287]  [<ffffffff81031235>] ? warn_slowpath_fmt+0x45/0x50
 [  131.717300]  [<ffffffff81120e74>] ? sysfs_remove_group+0x34/0x120
 [  131.717311]  [<ffffffffa00000ef>] ? mc_device_remove+0x5f/0x70 [microcode]
 [  131.717325]  [<ffffffff81331eb9>] ? subsys_interface_unregister+0x69/0xa0
 [  131.717336]  [<ffffffff81563526>] ? mutex_lock+0x16/0x40
 [  131.717346]  [<ffffffffa0000c3e>] ? microcode_exit+0x50/0x92 [microcode]
 [  131.717357]  [<ffffffff8107051d>] ? sys_delete_module+0x16d/0x260
 [  131.717369]  [<ffffffff810a0065>] ? wait_iff_congested+0x45/0x110
 [  131.717379]  [<ffffffff815656af>] ? page_fault+0x1f/0x30
 [  131.717389]  [<ffffffff81565ba2>] ? system_call_fastpath+0x16/0x1b


after loading the driver on an unsupported CPU and the subsequent
attempt to unload the driver.

The reason for the error is that subsys_interface_register() doesn't
handle the return value of sif->add_dev (and there's also no unwinding
of the interface registration). Instead subsys_interface_register
always returns 0. This is different to what we had for
sysdev_driver_register(). The latter properly handled return codes of
drv->add() functions.

See Boris' commit f4203e3032e5ae74c3e89df85a5a6d96022d0c49 (sysdev: Do
not register with sysdev when erroring on add).

I don't know whether the microcode driver is the only driver that
is affected.

What's your suggestion for a fix? Should subsys_interface_register()
be fixed or should each affected driver be adapted?


Regards,
Andreas



^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2012-05-08  4:29 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-11 16:38 x86, microcode: Conversion from sysdev class caused regression Andreas Herrmann
2012-04-11 17:06 ` Kay Sievers
2012-04-11 20:04   ` Borislav Petkov
2012-04-11 20:06 ` Greg Kroah-Hartman
2012-04-11 20:10   ` Borislav Petkov
2012-04-12 16:23     ` Borislav Petkov
2012-04-12 16:30       ` [PATCH 1/2] x86, microcode: Fix sysfs warning during module unload Borislav Petkov
2012-04-12 22:45         ` Greg Kroah-Hartman
2012-04-12 16:34       ` [PATCH 2/2] x86, microcode: Ensure that module is only loaded for Borislav Petkov
2012-04-12 22:45         ` Greg Kroah-Hartman
2012-04-16  8:42         ` Srivatsa S. Bhat
2012-04-16 13:43           ` Borislav Petkov
2012-04-17 14:11             ` Srivatsa S. Bhat
2012-04-17 14:50               ` Borislav Petkov
2012-04-17 15:53                 ` Gene Heskett
2012-04-17 16:02                   ` Kay Sievers
2012-04-17 17:30                     ` Gene Heskett
2012-04-17 18:07                       ` Borislav Petkov
2012-04-22  2:55                     ` Henrique de Moraes Holschuh
2012-04-25 23:36                       ` Kay Sievers
2012-04-17 17:35                 ` Srivatsa S. Bhat
2012-05-08  4:28           ` [tip:x86/urgent] x86/microcode: Ensure that module is only loaded on supported Intel CPUs tip-bot for Srivatsa S. Bhat
2012-04-14 18:23 ` [tip:x86/urgent] x86, microcode: Fix sysfs warning during module unload on unsupported CPUs tip-bot for Andreas Herrmann
2012-04-14 18:24 ` [tip:x86/urgent] x86, microcode: Ensure that module is only loaded on supported AMD CPUs tip-bot for Andreas Herrmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.