Re: cd(4) vs bluray and cdda (dae) on ahci(4) and siis(4)

From: Juergen Lock <nox_at_jelal.kn-bremen.de>
Date: Sun, 9 Aug 2009 21:04:52 +0200
On Sun, Aug 09, 2009 at 07:20:57PM +0200, Ulrich Spörlein wrote:
> On Thu, 06.08.2009 at 20:45:10 +0200, Juergen Lock wrote:
> > Hi!
> > 
> >  So I put the problematic optical drive on a siis pcie card now because
> > I wanted to play with esata too which seems to be kinda broken on the
> > jmicron that I used before at least with _this_ esata drive (hw issue
> > most likely, has been reported by users of other OSes too) - and I
> > noticed two things:
> > 
> > 1. cd(4) (which the new ahci and siis drivers now also use) fails to do
> > any reads when a drive fails the read toc command as seems to happen
> > with bluray (data) discs at least; I was able to work around this
> > by moving the bailout: label up a few lines in scsi_cd.c:cdcheckmedia():
> > 
> > Index: sys/cam/scsi/scsi_cd.c
> > _at__at_ -2868,12 +2868,18 _at__at_
> >  	}
> >  
> >  	softc->flags |= CD_FLAG_VALID_TOC;
> > +
> > +bailout:
> >  	softc->disk->d_maxsize = DFLTPHYS;
> >  	softc->disk->d_sectorsize = softc->params.blksize;
> >  	softc->disk->d_mediasize =
> >  	    (off_t)softc->params.blksize * softc->params.disksize;
> >  
> > +/* if
> >  bailout:
> > + * is here read requests will fail when the toc cant be read although
> > + * CD_FLAG_VALID_MEDIA is set.
> > + */
> >  
> >  	/*
> >  	 * We unconditionally (re)set the blocksize each time the
> > 
> >  (I say work around because I don't know if there might be stuff
> > somewhere that depends on the old behaviour, although thats probably
> > unlikely; also acd(4) seems to behave similarly.)
> 
> T H A N K   Y O U !
> 
> Hi Juergen, this nice little patch lets my USB/Firewire attached Plextor
> drive read "pressed" DVD media, where it failed before.

Cool, I'm glad it helped. :)

>  I have mentioned
> this in the past, but due to the esoteric nature of this problem failed
> to attract enough attention.
> 
 Heh I know _that_ feeling...

> http://lists.freebsd.org/pipermail/freebsd-usb/2007-July/003730.html
> http://docs.freebsd.org/cgi/getmsg.cgi?fetch=644449+0+archive/2007/freebsd-current/20070812.freebsd-current
> 
> So this is not only related to Bluray, but plain DVD media is affected
> too (at least for some drives ...)
> 
 Yeah, good to know!

> Hopefully this can get committed some time soon...
> 
 *nod*
	Juergen
Received on Sun Aug 09 2009 - 17:11:47 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:53 UTC