Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: pcic kthread creation timing



Hi! Rafal,


From: Rafal Boni <rafal%pobox.com@localhost>
Date: Tue, 15 Jul 2008 10:48:18 -0400

> KIYOHARA Takashi wrote:
> > I saw neither wdc nor NIC at pcmcia (at pcic) attached on hpcmips.  And,
> > if the neither is attached on hpcmips, root device cannot be found. X-<

> I think at least on hpcarm, the calling sequence before the vmlocking 
> merge was something like:
> 
> pcic_attach (I forget the exact method here)
>    +----> kthread_create(create_event_thread())
>       ...
> (on new thread)       create_event_thread()
>                     +----> check for card presence
>                     +----> kthread_create(pcic_event_thread())
> 
> which was then flattened to (note, no extra thread creation):
> 
> pcic_attach (I forget the exact method here)
>    +----> create_event_thread()
>             +----> check for card presence
>             +----> kthread_create(pcic_event_thread())
> 
> The result being that the 'check for card presence'  was done before the 
> PCIC was fully set up and thus no PCMCIA / CF cards were detected at boot.
> 
> > I saw pcic_event_thread() called earlier than pcic_attach_socket_finish().
> 
> Right, exactly.
> 
> > Perhaps, pcic_attach_socket_finish() should call
> > kthread_create(pcic_event_thread()) in it if config_interrupts() is slower
> > than kthread_create().
> 
> I think you do want to use config_interrupts() instead of relying on 
> kthread creation timing... one of the side effects is that you'll be 
> guaranteed to be called before autoconfiguration finishes and you need 
> the boot device.


current pcic at isa calls:
  pcic_isa_attach()
    +- pcic_attach_sockets()
    |    +- pcic_attach_sockets()
    |         +- pcic_attach_socket()
    |         +- config_pending_incr()
    |         +- kthread_create(pcic_event_thread)
    +- config_interrupts(pcic_isa_config_interrupts)
  :
  (new thread)
    pcic_event_thread()
      +- (check for card presence)
      +- config_pending_decr()                  <-- Oops!
      +- tsleep()
  :
  pcic_isa_config_interrupts()
    +- isa_intr_establish()
    +- pcic_attach_sockets_finish()
         +- pcic_attach_socket_finish()
              +- (socket reset)
  :
  Mount the root file system.  (But not found yet!!)

  :
  :
  Maybe occur the interrupt of card detect.


I was misunderstanding it a little.  I think this problem is to have
called config_pending_decr() before establish interrupt (and reset
socket).

Then, I propose that pcic_attach_socket_finish() call kthread_create().

Thanks,
--
kiyohara


Home | Main Index | Thread Index | Old Index