Date: Tue, 24 Aug 2004 09:58:19 +0200 From: =?ISO-8859-1?Q?S=F8ren_Schmidt?= <sos@DeepCore.dk> To: Brian Rogers <burpmaster@truffula.net> Cc: freebsd-current@freebsd.org Subject: Re: ATAPI_RESET hang fix Message-ID: <412AF51B.8010801@DeepCore.dk> In-Reply-To: <412AD147.7050502@truffula.net> References: <412AD147.7050502@truffula.net>
next in thread | previous in thread | raw e-mail | index | archive | help
Brian Rogers wrote: > I was getting the hang on start after the "ATAPI_RESET time =3D x"=20 > message. I stuck in a diagnostic printf before the ATAPI_RESET, and=20 > that actually fixed the hang. So I replaced it with a DELAY(50), and=20 > that also avoids the hang. >=20 > I guess some ATAPI devices don't like being reset right after being=20 > queried. (Or there is a bug with handling that in FreeBSD) Patch is=20 > attached. Hmm, you could be on to something, but instead of using a fixed delay=20 I'd rather (re)introduce the wait for ready before selecting the device=20 in ata_command. Could you please try the following patch and let me know = if that fixes the problem as well ? -S=F8ren Index: ata-lowlevel.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/sys/dev/ata/ata-lowlevel.c,v retrieving revision 1.44 diff -u -r1.44 ata-lowlevel.c --- ata-lowlevel.c 16 Aug 2004 09:32:35 -0000 1.44 +++ ata-lowlevel.c 24 Aug 2004 07:21:12 -0000 @@ -721,6 +721,12 @@ rman_get_start(atadev->channel->r_io[ATA_DATA].res), command, (intmax_t)lba, count, feature); + /* ready to select device ? */ + if (ata_wait(atadev, 0) < 0) { + ata_prtdev(atadev, "timeout waiting for ready command=3D%02x\n", = command); + return -1; + } + /* select device */ ATA_IDX_OUTB(atadev->channel, ATA_DRIVE, ATA_D_IBM | atadev->unit);=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?412AF51B.8010801>