From owner-freebsd-current@FreeBSD.ORG Thu Aug 6 18:48:16 2009 Return-Path: Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E0BB106564A; Thu, 6 Aug 2009 18:48:16 +0000 (UTC) (envelope-from nox@jelal.kn-bremen.de) Received: from smtp.kn-bremen.de (gelbbaer.kn-bremen.de [78.46.108.116]) by mx1.freebsd.org (Postfix) with ESMTP id 20DC18FC1B; Thu, 6 Aug 2009 18:48:16 +0000 (UTC) Received: by smtp.kn-bremen.de (Postfix, from userid 10) id 3B0A11E002FF; Thu, 6 Aug 2009 20:48:15 +0200 (CEST) Received: from triton.kn-bremen.de (noident@localhost [127.0.0.1]) by triton.kn-bremen.de (8.14.3/8.14.3) with ESMTP id n76IjGB4013185; Thu, 6 Aug 2009 20:45:16 +0200 (CEST) (envelope-from nox@triton.kn-bremen.de) Received: (from nox@localhost) by triton.kn-bremen.de (8.14.3/8.14.3/Submit) id n76IjGnl013184; Thu, 6 Aug 2009 20:45:16 +0200 (CEST) (envelope-from nox) From: Juergen Lock Date: Thu, 6 Aug 2009 20:45:10 +0200 To: freebsd-current@FreeBSD.org Message-ID: <20090806184510.GA12039@triton.kn-bremen.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) Cc: mav@FreeBSD.org Subject: cd(4) vs bluray and cdda (dae) on ahci(4) and siis(4) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Aug 2009 18:48:16 -0000 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 @@ -2868,12 +2868,18 @@ } 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.) 2. cdda/dae seems to be broken entirely with ahci(4) as well as siis(4) (I remember a report about it being broken for usb optical drives too so maybe this is related?) - I tested with the audio/cdparanoia port as well as with mplayer -cdrom-device /dev/cd{0,1} cdda://... (mplayer needs to be built with the libparanoia knob on for this) - this does work with atapicam(4) without ahci/siis so it can't be cd(4)'s fault alone. On siis(4) it seems to just fail while on ahci(4) (I still have another optical drive on there, it's on the board's amd sb700) it causes the sata channel to be reset endlessly until I ^C mplayer: ahcich1: AHCI reset... ahcich1: hardware reset ... ahcich1: SATA connect time=0ms status=00000113 ahcich1: ready wait time=144ms ahcich1: AHCI reset done: devices=00000001 ahcich1: AHCI reset... ahcich1: hardware reset ... ahcich1: SATA connect time=0ms status=00000113 ahcich1: ready wait time=144ms ahcich1: AHCI reset done: devices=00000001 (Remeber if you want to reproduce this libparanoia needs permissions on the optical drive's pass(4) device node and possibly /dev/xpt0 too. And of course you need an audio cd. :) Soo, anyone have ideas/patches/things they want me to check for this? Thanx, Juergen PS: I have built quite a few more ports with ahci(4) enabled on this box now after I updated it to RELENG_8 and the ncq(?) hang hasn't reappeared yet, so _maybe_ it works now *knock-on-wood*...