Re: [ RFC, PATCH - 1/2, v2 ] x86-microcode: refactor microcodeoutput messages

From: Andreas Herrmann
Date: Thu Nov 12 2009 - 10:20:41 EST


On Thu, Nov 12, 2009 at 01:06:36PM +0100, Dmitry Adamushko wrote:
> 2009/11/12 Dmitry Adamushko <dmitry.adamushko@xxxxxxxxx>:
> > 2009/11/12 Ingo Molnar <mingo@xxxxxxx>:
> >>
> >> -tip testing found the following bug - there's a _long_ boot delay of
> >> 58.6 seconds if the CPU family is not supported:
> >>
> >> [ 1.421761] calling microcode_init+0x0/0x137 @ 1
> >> [ 1.426532] platform microcode: firmware: requesting amd-ucode/microcode_amd.bin
> >> [ 61.433126] microcode: failed to load file amd-ucode/microcode_amd.bin
> >> [ 61.439682] microcode: CPU0: AMD CPU family 0xf not supported
> >> [ 61.445441] microcode: CPU1: AMD CPU family 0xf not supported
> >> [ 61.451273] Microcode Update Driver: v2.00 <tigran@xxxxxxxxxxxxxxxxxxxx>, Peter Oruba
> >> [ 61.459116] initcall microcode_init+0x0/0x137 returned 0 after 58625622 usecs
> >>
> >> Where does this delay come from?
> >
> > My guess is that it's comming from
> >
> > static int loading_timeout = 60; /* In seconds */
> >
> > drivers/base/firmware_class.c
> >
> > given that you seem to have MICROCODE build in kernel, so this patch
> > http://git.kernel.org/?p=linux/kernel/git/x86/linux-2.6-tip.git;a=commit;h=d1c84f79a6ba992dc01e312c44a21496303874d6
> >
> > will result in sending a request for a firmware image to user-space
> > (unless that firmware image is also built-in into the kernel) and
> > user-space has not started yet.
>
> btw., it doesn't make sense for request_firmware() to even try this if
> the system_state != SYSTEM_RUNNING and current == 'init' (it'd perhaps
> make some sense if it's been done in a context of another task -- like
> in case of a parallel boot).

> And perhaps it just makes sense for microcode to use request_firmware_nowait().

That would be asynchronous.

I think I should ensure that microcode_amd.c is compiled into
microcode.o if and only if its built as module. microcode_amd.c
supports only the firmware interface.

Thus I suggest to add below.

Regards,
Andreas

----