From owner-freebsd-stable@FreeBSD.ORG Wed Feb 11 22:16:13 2009 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2DADD106564A for ; Wed, 11 Feb 2009 22:16:13 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id DFF828FC08 for ; Wed, 11 Feb 2009 22:16:12 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (pool-98-109-39-197.nwrknj.fios.verizon.net [98.109.39.197]) by cyrus.watson.org (Postfix) with ESMTPSA id 72F5846B5C; Wed, 11 Feb 2009 17:16:12 -0500 (EST) Received: from localhost (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.14.3/8.14.3) with ESMTP id n1BMFpwm028247; Wed, 11 Feb 2009 17:16:06 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: freebsd-stable@freebsd.org Date: Wed, 11 Feb 2009 16:02:06 -0500 User-Agent: KMail/1.9.7 References: <20080917150433.GA3585@lpthe.jussieu.fr> <200809171713.39694.jhb@freebsd.org> <20080918075306.GA30709@lpthe.jussieu.fr> In-Reply-To: <20080918075306.GA30709@lpthe.jussieu.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200902111602.06646.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Wed, 11 Feb 2009 17:16:06 -0500 (EST) X-Virus-Scanned: ClamAV 0.94.2/8980/Wed Feb 11 11:40:45 2009 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: Michel Talon Subject: Re: floppy disk controller broken X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Feb 2009 22:16:13 -0000 On Thursday 18 September 2008 3:53:06 am Michel Talon wrote: > On Wed, Sep 17, 2008 at 05:13:39PM -0400, John Baldwin wrote: > > On Wednesday 17 September 2008 11:04:33 am Michel Talon wrote: > > > Hello, > > > > > > when testing FreeBSD-7.1-BETA i discovered that the floppy disk > > > controller doesn't work correctly. Trying to format a floppy (perhaps > > > with bad blocks) i get: > > > Processing fdformat: ioctl(FD_FORM): Device not configured > > > instead of the normal E letter. I then checked the same problem is > > > present on FreeBSD-6.3 and it has been reported by Beech Rintoul (*) in > > > 2006! Of course the floppy disk driver is particularly messy, but > > > this is not pretty. > > > > > > (*) i386/103862: Error with fdformat > > > > It looks like the ioctl to format a track used to never report failures from > > the controller. The newer driver does. What I've done with fdformat is to > > make it just ignore the errors in userland instead. Try this: > > > > Index: fdformat.c > > =================================================================== > > --- fdformat.c (revision 183112) > > +++ fdformat.c (working copy) > > @@ -75,8 +75,7 @@ > > f.fd_formb_secno(i) = il[i+1]; > > f.fd_formb_secsize(i) = secsize; > > } > > - if(ioctl(fd, FD_FORM, (caddr_t)&f) < 0) > > - err(EX_OSERR, "ioctl(FD_FORM)"); > > + (void)ioctl(fd, FD_FORM, (caddr_t)&f); > > } > > > > static int > > > > > > -- > > John Baldwin > > This doesn't work any more. This time i get > niobe# fdformat fd0 > Format 1440K floppy `/dev/fd0'? (y/n): y > Processing EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE done. > > where only the first E takes some time to be printed, and all subsequent > ones are printed instantaneously, that is all other formatting is not > tried. In principle the formatting process must try each of the > "sectors" in turn, and can come up with a series of V and F. > > Moreover, trying to write to the floppy: > niobe# dd if=/dev/zero of=/dev/fd0 conv=noerror > dd: /dev/fd0: Input/output error > 5+0 records in > 4+0 records out > 2048 bytes transferred in 4.054404 secs (505 bytes/sec) > > I don't expect such result. Traditionnally writing works, while reading > may fail. Here reading fails with incoherent messages: > dd: /dev/fd0: Device not configured > 3+0 records in > 3+0 records out > 1536 bytes transferred in 2.595216 secs (592 bytes/sec) > repeated a large number of times. But nothing in dmesg, contrary to the > tradition which showed the defective sectors. > > In conclusion i am under the impression that the in kernel driver is > severely botched. Of course nobody uses floppies any more, but this is > quite ugly. There are actually changes to the floppy driver in HEAD that I think address this. I don't recall if they were MFC'd to 7. -- John Baldwin