ichsmb(4) and msleep()
Yuri Pankov
yuripv at yuripv.net
Thu Aug 29 03:28:29 UTC 2019
Conrad Meyer wrote:
> On Wed, Aug 28, 2019 at 6:35 AM Yuri Pankov <yuripv at yuripv.net> wrote:
>>
>> Warner Losh wrote:
>>> What's the advantages of doing this instead of deferring attach until the
>>> interrupts are running?
>>
>> None that I can think of, just going with what was suggested and seeing
>> other drivers doing the same. Could you please name a driver that
>> defers attach until !cold?
>
> I think pretty much all drivers attach when interrupts are enabled
> (not the same as !cold)? At least x86 enables interrupts on BSP at
> SI_SUB_INTR, and DRIVER_MODULE drivers *load* at SI_SUB_DRIVERS, and
> the INTR one is ordered before the other. My skim read is that
> drivers do not actually attach until SI_SUB_CONFIGURE.
>
> I think the panic / test in sleepq_set_timeout_sbt is maybe overly
> strong? !cold indicates the entire autoconfigure process has
> concluded. But interrupts are available long before that. Seems like
> hardclock is started at ~SI_SUB_CLOCKS? Which is admittedly after
> DRIVERS, but still long before !cold. I'm not sure what set of
> interrupt/timer functionality is needed for sleepq, but likely that
> condition can be relaxed.
>
> If it cannot be relaxed enough for your driver, you could expand your
> DRIVER_MODULE() into the expanded macro, replacing SI_SUB_DRIVERS with
> a later stage.
Yes, thank you. I guess it's already sorted out with Ian's help, please
see the review:
https://reviews.freebsd.org/D21452
More information about the freebsd-hackers
mailing list