From owner-freebsd-stable Thu Mar 21 20:24:39 2002 Delivered-To: freebsd-stable@freebsd.org Received: from ebb.errno.com (ebb.errno.com [66.127.85.87]) by hub.freebsd.org (Postfix) with ESMTP id 9162237B41A for ; Thu, 21 Mar 2002 20:24:28 -0800 (PST) Received: from melange (melange.errno.com [66.127.85.82]) (authenticated bits=0) by ebb.errno.com (8.12.1/8.12.1) with ESMTP id g2M4ORNN003739 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO); Thu, 21 Mar 2002 20:24:28 -0800 (PST)?g (envelope-from sam@errno.com)œ Message-ID: <3f4201c1d159$7e73fe30$52557f42@errno.com> From: "Sam Leffler" To: "Jon Larssen" , References: Subject: Re: Is ATA partially broken in -STABLE? Date: Thu, 21 Mar 2002 20:24:43 -0800 Organization: Errno Consulting MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_3F3F_01C1D116.6FBDF410" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700 Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG This is a multi-part message in MIME format. ------=_NextPart_000_3F3F_01C1D116.6FBDF410 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 7bit This is a regression introduced in rev 1.50.2.30. The asleep+await calls that closed two races in the driver were removed. Soren is aware of it. Attached is a patch that fixes it for me. Sam ----- Original Message ----- From: "Jon Larssen" To: Sent: Thursday, March 21, 2002 7:36 PM Subject: Is ATA partially broken in -STABLE? > Hi, > > I have just cvsup'd my -STABLE system running under VMware 3 > Workstation under Windows 2000. After making world and a > GENERIC kernel I can't boot into my system. These are the > messages I get: > > ata0-master: timeout waiting for interrupt > ata0-master: ATA identify failed > ata1-master: timeout waiting for interrupt > ata1-master: ATAPI identify failed > Mounting root from ufs:/dev/ad0s1a > no such device 'ad' > setrootbyname failed > > and then of course will of course ask me to manually supply > the boot filesystem. What's is strange is that I kept an old > kernel that _does_ boot and finds ad. > > Is ATA support semi-broken or I am the one broken? :^) > > Best regards, > Jon. > > _________________________________________________________________ > Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp. > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-stable" in the body of the message > > ------=_NextPart_000_3F3F_01C1D116.6FBDF410 Content-Type: application/octet-stream; name="ata-patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="ata-patch" Index: ata-all.c=0A= =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=0A= RCS file: /home/ncvs/src/sys/dev/ata/ata-all.c,v=0A= retrieving revision 1.50.2.30=0A= diff -u -r1.50.2.30 ata-all.c=0A= --- ata-all.c 2002/03/18 08:37:33 1.50.2.30=0A= +++ ata-all.c 2002/03/22 04:23:26=0A= @@ -1039,13 +1039,14 @@=0A= =0A= case ATA_WAIT_INTR:=0A= atadev->channel->active |=3D ATA_WAIT_INTR;=0A= + asleep((caddr_t)atadev->channel, PRIBIO, "atacmd", 10 * hz);=0A= ATA_OUTB(atadev->channel->r_io, ATA_CMD, command);=0A= =0A= /* enable interrupt */=0A= if (atadev->channel->flags & ATA_QUEUED)=0A= ATA_OUTB(atadev->channel->r_altio, ATA_ALTSTAT, ATA_A_4BIT);=0A= =0A= - if (tsleep((caddr_t)atadev->channel, PRIBIO, "atacmd", 10 * hz)) {=0A= + if (await(PRIBIO, 10 * hz)) {=0A= ata_prtdev(atadev, "timeout waiting for interrupt\n");=0A= atadev->channel->active &=3D ~ATA_WAIT_INTR;=0A= error =3D -1;=0A= Index: atapi-all.c=0A= =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=0A= RCS file: /home/ncvs/src/sys/dev/ata/atapi-all.c,v=0A= retrieving revision 1.46.2.12=0A= diff -u -r1.46.2.12 atapi-all.c=0A= --- atapi-all.c 2002/03/18 08:37:33 1.46.2.12=0A= +++ atapi-all.c 2002/03/22 04:23:27=0A= @@ -202,28 +202,41 @@=0A= ata_prtdev(atadev, "queueing %s ", atapi_cmd2str(request->ccb[0]));=0A= atapi_dump("ccb =3D ", &request->ccb[0], sizeof(request->ccb));=0A= #endif=0A= - /* append onto controller queue and try to start controller */=0A= - s =3D splbio();=0A= - if (flags & ATPR_F_AT_HEAD)=0A= - TAILQ_INSERT_HEAD(&atadev->channel->atapi_queue, request, chain);=0A= - else=0A= - TAILQ_INSERT_TAIL(&atadev->channel->atapi_queue, request, chain);=0A= - splx(s);=0A= - ata_start(atadev->channel);=0A= -=0A= - /* if callback used, then just return, gets called from interrupt = context */=0A= - if (callback)=0A= + if (callback) {=0A= + /*=0A= + * If callback used, then just return,=0A= + * gets called from interrupt context.=0A= + */=0A= + s =3D splbio();=0A= + /* append onto controller queue and try to start controller */=0A= + if (flags & ATPR_F_AT_HEAD)=0A= + TAILQ_INSERT_HEAD(&atadev->channel->atapi_queue, request, chain);=0A= + else=0A= + TAILQ_INSERT_TAIL(&atadev->channel->atapi_queue, request, chain);=0A= + ata_start(atadev->channel);=0A= + splx(s);=0A= return 0;=0A= + } else {=0A= + s =3D splbio();=0A= + asleep((caddr_t)request, PRIBIO, "atprq", 0);=0A= + /* append onto controller queue and try to start controller */=0A= + if (flags & ATPR_F_AT_HEAD)=0A= + TAILQ_INSERT_HEAD(&atadev->channel->atapi_queue, request, chain);=0A= + else=0A= + TAILQ_INSERT_TAIL(&atadev->channel->atapi_queue, request, chain);=0A= + ata_start(atadev->channel);=0A= + /* wait for request to complete */=0A= + await(PRIBIO, 0);=0A= + splx(s);=0A= =0A= - /* wait for request to complete */=0A= - tsleep((caddr_t)request, PRIBIO, "atprq", 0);=0A= - error =3D request->error;=0A= - if (error)=0A= - bcopy(&request->sense, atadev->result, sizeof(struct atapi_reqsense));=0A= - if (request->dmatab)=0A= - free(request->dmatab, M_DEVBUF);=0A= - free(request, M_ATAPI);=0A= - return error;=0A= + error =3D request->error;=0A= + if (error)=0A= + bcopy(&request->sense, atadev->result, sizeof(struct = atapi_reqsense));=0A= + if (request->dmatab)=0A= + free(request->dmatab, M_DEVBUF);=0A= + free(request, M_ATAPI);=0A= + return error;=0A= + }=0A= }=0A= =0A= void=0A= ------=_NextPart_000_3F3F_01C1D116.6FBDF410-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message