ichsmb(4) and msleep()
Warner Losh
imp at bsdimp.com
Wed Aug 28 13:07:58 UTC 2019
On Wed, Aug 28, 2019, 7:01 AM Yuri Pankov <yuripv at yuripv.net> wrote:
> Yuri Pankov wrote:
> > Hans Petter Selasky wrote:
> >> On 2019-08-28 11:44, Yuri Pankov wrote:
> >>> Hans Petter Selasky wrote:
> >>>> On 2019-08-28 11:07, Yuri Pankov wrote:
> >>>>> I have a "timed sleep before timers are working" panic in
> ichsmb_readb()
> >>>>> calling ichsmb_wait() which uses msleep(). That is trying to
> >>>>> jedec_dimm(4) module so it's trying to attach pretty early in boot.
> >>>>> What would be the correct replacement for msleep() here?
> >>>>>
> >>>>
> >>>> If you only need a sleep-delay, pause() is the right one. It handles
> >>>> cold-boot.
> >>>
> >>> I guess that won't work here as we need to be waked up by interrupt
> >>> handler on command completion, and pause() seems to sleep
> >>> unconditionally for the given time in 'cold' case (if I'm reading the
> >>> code correctly).
> >>
> >> If you are too early inside a SYSINIT() path, then you cannot use
> >> sleeping. You will have to use polling in a loop with a fixed DELAY()
> to
> >> know the timeout.
> >
> > Thanks for the help.
> >
> > Something like the following (it seems to work)?
>
> Here's a review with the nit you mentioned fixed, thanks!
>
> https://reviews.freebsd.org/D21452
What's the advantages of doing this instead of deferring attach until the
interrupts are running?
Warner
>
> _______________________________________________
> freebsd-hackers at freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe at freebsd.org"
>
More information about the freebsd-hackers
mailing list