Received: from list by lists.gnu.org with archive (Exim 4.71) id 1USml1-0000Qj-Vg for mharc-grub-devel@gnu.org; Thu, 18 Apr 2013 07:12:03 -0400 Received: from eggs.gnu.org ([208.118.235.92]:40225) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1USmkx-0000OO-3N for grub-devel@gnu.org; Thu, 18 Apr 2013 07:12:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1USmkt-00033k-Ml for grub-devel@gnu.org; Thu, 18 Apr 2013 07:11:59 -0400 Received: from mail.gw90.de ([188.40.100.199]:46023) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1USmkt-00032z-DA for grub-devel@gnu.org; Thu, 18 Apr 2013 07:11:55 -0400 Received: from e178079194.adsl.alicedsl.de ([85.178.79.194] helo=[192.168.2.49]) by mail.gw90.de with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from ) id 1USmkn-0008DB-KB for grub-devel@gnu.org; Thu, 18 Apr 2013 11:11:50 +0000 Message-ID: <1366283507.11819.40.camel@mattotaupa> Subject: Re: SATA disk on cntroller in AHCI mode not found: `disk/ahci.c:225: couldn't start CR` From: Paul Menzel To: grub-devel@gnu.org Date: Thu, 18 Apr 2013 13:11:47 +0200 In-Reply-To: <1365159295.20168.36.camel@mattotaupa> References: <1365159295.20168.36.camel@mattotaupa> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-ujF00s3nl0elJF+MSYhw" X-Mailer: Evolution 3.4.4-3 Mime-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 188.40.100.199 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Apr 2013 11:12:02 -0000 --=-ujF00s3nl0elJF+MSYhw Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Dear GRUB folks, here is an update on the issue I only reported to #grub on . Am Freitag, den 05.04.2013, 12:54 +0200 schrieb Paul Menzel: > as reported to the coreboot mailing list already [1][2], using GRUB > (4778) as a payload [3] on the AMD SB800 based ASRock E350M1 [4], the > SATA disk attached to the SATA controller is not found when the > controller is in AHCI mode. Using IDE mode works. [=E2=80=A6] > I=E2=80=99ll gladly test patches and provide more information. Vladmir gave me the following patch to test [5]. =3D=3D=3D modified file 'grub-core/disk/ahci.c' --- grub-core/disk/ahci.c 2013-03-25 09:32:56 +0000 +++ grub-core/disk/ahci.c 2013-04-12 16:30:24 +0000 @@ -218,6 +218,21 @@ dev->hba->ports[dev->port].command &=3D ~GRUB_AHCI_HBA_PORT_CMD_F= RE; goto out; } + dev->hba->ports[dev->port].command |=3D 2; + while (1) + { + int det =3D dev->hba->ports[dev->port].status & 7; + grub_dprintf ("ahci", "det =3D %d\n", det); + if (det =3D=3D 1 || det =3D=3D 3) + break; + if (grub_get_time_ms () > endtime) + { + grub_dprintf ("ahci", "couldn't spin-up\n"); + dev->hba->ports[dev->port].command &=3D ~GRUB_AHCI_HBA_PORT_CMD= _CR; + goto out_stop_fr; + } + } + dev->hba->ports[dev->port].command |=3D GRUB_AHCI_HBA_PORT_CMD_S= T; while (!(dev->hba->ports[dev->port].command & GRUB_AHCI_HBA_PORT= _CMD_CR)) if (grub_get_time_ms () > endtime) =3D=3D=3D modified file 'grub-core/disk/pata.c' --- grub-core/disk/pata.c 2013-01-20 15:52:15 +0000 +++ grub-core/disk/pata.c 2013-04-12 15:52:44 +0000 @@ -366,7 +366,7 @@ } =20 /* Check if this class ID matches that of a PCI IDE Controller. = */ - if (!cs5536 && (class >> 16 !=3D 0x0101)) + if (!cs5536 && (class >> 16 !=3D 0x0101) && (class >> 8 !=3D 0x0= 10601)) return 0; for (i =3D 0; i < nports; i++) The PATA change did not make any difference and the module did not load on my system. The change to `ahci.c` did make a change and it progressed further. grub> insmod pata disk/pata.c:295: sectors=3D0x5a disk/pata.c:295: sectors=3D0x5a disk/pata.c:295: sectors=3D0xff error: no device connected. disk/pata.c:295: sectors=3D0xff error: no device connected. grub> insmod ahci disk/ahci.c:308: Requesting AHCI ownership disk/ahci.c:311: Waiting for BIOS to give up ownership disk/ahci.c:322: AHCI ownership obtained disk/ahci.c:328: AHCI is in compat mode. Switching disk/ahci.c:374: 6 AHCI ports disk/ahci.c:384: status 0:123 disk/ahci.c:186: found device ahci0 (port 0) disk/ahci.c:229: det =3D 3 disk/ahci.c:240: link up disk/ahci.c:246: After PORT_CMD_ST disk/ahci.c:255: before return 0 disk/ahci.c:384: status 1:0 disk/ahci.c:384: status 2:0 disk/ahci.c:384: status 3:0 disk/ahci.c:384: status 4:0 disk/ahci.c:384: status 5:0 grub> ls disk/ahci.c:710: opening AHCI dev `ahci0' disk/ahci.c:535: AHCI tfd =3D 150 disk/ahci.c:561: grub_ahci_read (size=3D512, cmdsize =3D 0) disk/ahci.c:574: AHCI tfd =3D 150 disk/ahci.c:604: cfis: 27 80 ec 00 00 00 00 e0 disk/ahci.c:609: cfis: 00 00 00 00 00 00 00 00 disk/ahci.c:622: PRDT =3D c7eed800, 0, 800001ff (128) disk/ahci.c:627: AHCI command schedulded disk/ahci.c:629: AHCI tfd =3D 150 disk/ahci.c:633: AHCI tfd =3D 150 disk/ahci.c:635: AHCI sig =3D 101 disk/ahci.c:637: AHCI tfd =3D 150 disk/ahci.c:646: AHCI status <1 0 150> disk/ahci.c:658: AHCI command completed <1 0 150 0 0, 0 0> disk/ahci.c:668: last PIO FIS 00000000 00000000 00000000 00000000 0= 0000000 00000000 00000000 00000000 disk/ahci.c:678: last REG FIS 00000000 00000000 00000000 00000000 0= 0000000 00000000 00000000 00000000 disk/pata.c:295: sectors=3D0x5a disk/pata.c:295: sectors=3D0x5a disk/pata.c:295: sectors=3D0xff disk/pata.c:295: sectors=3D0xff disk/ahci.c:710: opening AHCI dev `ahci0' disk/ahci.c:535: AHCI tfd =3D 150 disk/ahci.c:561: grub_ahci_read (size=3D512, cmdsize =3D 0) disk/ahci.c:574: AHCI tfd =3D 150 disk/ahci.c:604: cfis: 27 80 ec 00 00 00 00 e0 disk/ahci.c:609: cfis: 00 00 00 00 00 00 00 00 disk/ahci.c:622: PRDT =3D c7eed800, 0, 800001ff (128) disk/ahci.c:627: AHCI command schedulded disk/ahci.c:629: AHCI tfd =3D 150 disk/ahci.c:633: AHCI tfd =3D 150 disk/ahci.c:635: AHCI sig =3D 101 disk/ahci.c:637: AHCI tfd =3D 150 disk/ahci.c:646: AHCI status <1 0 150> disk/ahci.c:658: AHCI command completed <1 0 150 0 0, 0 0> disk/ahci.c:668: last PIO FIS 00000000 00000000 00000000 00000000 0= 0000000 00000000 00000000 00000000 disk/ahci.c:678: last REG FIS 00000000 00000000 00000000 00000000 0= 0000000 00000000 00000000 00000000 disk/pata.c:295: sectors=3D0x5a disk/pata.c:295: sectors=3D0x5a disk/pata.c:295: sectors=3D0xff disk/pata.c:295: sectors=3D0xff (memdisk) So it gets further but still does not find the disk. Vladimir also said, he can reproduce this issue, when putting his AMD board=E2=80=99s SATA controller in IDE mode in the BIOS and then trying to change it in GRUB to AHCI mode. Thanks, Paul > [1] http://www.coreboot.org/pipermail/coreboot/2013-March/075583.html > [2] http://www.coreboot.org/pipermail/coreboot/2013-April/075592.html > [3] http://www.coreboot.org/GRUB2 > [4] http://www.coreboot.org/ASRock_E350M1 [5] http://paste.debian.net/249135/ --=-ujF00s3nl0elJF+MSYhw Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEABECAAYFAlFv1PMACgkQPX1aK2wOHVhxTQCePtAZ7rjrKe2rKJ2hk3H/2KpR hK0AnRcgYEcr9ttKO8/dlSVKD5sauqZj =S3D7 -----END PGP SIGNATURE----- --=-ujF00s3nl0elJF+MSYhw--