On Sat, 14 Oct 2000, Torben Mathiasen wrote:

> On Sat, Oct 14 2000, David S. Miller wrote:
> >    Date: Sat, 14 Oct 2000 11:43:09 +0200
> >    From: Torben Mathiasen <[EMAIL PROTECTED]>
> > 
> >    David, why is tpnt->proc_name NULL on sparc for devices not
> >    existing?  Every driver has this as part of their tpnt struct, so
> >    it doesn't matter if the underlying device really exists.
> > 
> > In the mentioned case it would be NULL on all architectures, not just
> > Sparc ;-) (it happens on ix86 too, ix86 is different only because it
> > does not trap kernel NULL pointer derefences during bootup for some
> > odd reason)
> > 
> > Here is what happens:
> > 
> > scsi_register_host()
> >     tpnt->present = tpnt->detect(tpnt);
> >     /* tpnt->present is zero since no such adapters were found */
> > 
> > If no hosts are detected the driver is under no obligation to
> > initialize the tpnt->proc_name field.  For example,
> > sym53c8xx.c:sym53c8xx_detect() does not if PCI is not present and this
> > is the specific case hit on my SBUS-only workstation :-)
> > 
> > Subsequently scsi_unregister_host() is called for this TPNT and
> > this is where the NULL pointer is hit.
> >
> 
> Ahh, the drivers I looked at all had proc_name as part of their:
> 
> define IN2000 {
>       bla:    bla,
>       proc_name: IN2000,
> 
> }
> 
> structure. I see your point now.
> 
> Are there any reason why sym53c8xx and others initialize proc_name only
> if an adapter was actually found (or in the sym case, if a pcibus was
> found)?

The [sym|ncr]53c8xx drivers do initialize the proc fs stuff (proc_name for
recent kernels) in the Scsi_Host_Template if PCI is present and user wants
the controllers to be registered in the proc FS. On the other hand, the
`proc_name' field appeared in some 2.3.X kernel version (sym53c8xx says
Linux-2.3.27). In previous kernel versions, SCSI drivers had to make
`proc_dir' field point to a `proc_dir' structure that allowed proc/FSing
the controller to be optionnable.

We have to decide if we want proc/FSing SCSI controllers (event when none
will be attached or BUS does not even exist) to be optionnal or not.
- If it is optionnal, then proc_name=NULL should be interpreted as
  proc/FSing option disabled.
- Otherwise, the proc_name field should be required to be not NULL.

  Gérard.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/

Reply via email to