Subject: Re: DVD-RAM: geometry & hangs
To: None <hubert.feyrer@informatik.fh-regensburg.de>
From: Eduardo E. Horvath <eeh@one-o.com>
List: tech-kern
Date: 11/18/1999 09:10:33
> On Wed, 17 Nov 1999, Eduardo E. Horvath wrote:
> > > sd1 at scsibus targ 4 lun 0: <MATSHITA, PD-2 LF-D100, A113> SCSI2 5/cdrom removable
> > > sd1: could not mode sense (4/5); using fictious geometry
> > > sd1: 595MB, 595 cyl, 64 head, 32 sec, 512 bytes/sect x 1218960 sectors
> > 
> > Are you sure it's a 512 bytes/sect device?  If it's not, the SCSI
> > controller could request a transfer of 1 sector (512 bytes), but the
> > drive could be trying to send 1 sector (2048 bytes).  If the driver
> > for the HBA does not handle overruns/underruns correctly it could
> > result in a hang as one side is waiting for data the other isn't
> > prepared to send or visa-versa.
> 
> No, as someone else already pointed out, it's probably 2048 bytes/sec. 
> Do se have some nice place to note that per-device fake-geometry like in
> the previous hint you gave me for recognizing the disk as sd (not cd), or
> is this the point where I have to start adding things? :>

My guess is that it's failing inside sd_scsibus_get_parms().  If it's
an optical disk the geometry is derived in a different way:


         if (sd->type == T_OPTICAL)
                return (sd_scsibus_get_optparms(sd, dp, flags));

You can try changing this to:

         if (sd->type == T_OPTICAL || sd->type == T_CDROM)
                return (sd_scsibus_get_optparms(sd, dp, flags));

Otherwise you may need to write a new sd_scsibus_get_cdparms().  A
good first pass would be to copy sd_scsibus_get_optparms() but
initialize dp->blksize to 2048 instead of 512.  Beyond that you need
technical descriptions of the device's behavior.

=========================================================================
Eduardo Horvath				eeh@one-o.com
	"I need to find a pithy new quote." -- me