From owner-svn-src-head@FreeBSD.ORG Sun Feb 15 14:44:55 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 40E9C106566C; Sun, 15 Feb 2009 14:44:55 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from cmail.optima.ua (cmail.optima.ua [195.248.191.121]) by mx1.freebsd.org (Postfix) with ESMTP id 0D4588FC08; Sun, 15 Feb 2009 14:44:53 +0000 (UTC) (envelope-from mav@FreeBSD.org) X-Spam-Flag: SKIP X-Spam-Yversion: Spamooborona-2.1.0 Received: from [212.86.226.226] (account mav@alkar.net HELO mavbook.mavhome.dp.ua) by cmail.optima.ua (CommuniGate Pro SMTP 5.2.9) with ESMTPSA id 234678607; Sun, 15 Feb 2009 16:44:52 +0200 Message-ID: <49982A62.1040507@FreeBSD.org> Date: Sun, 15 Feb 2009 16:44:50 +0200 From: Alexander Motin User-Agent: Thunderbird 2.0.0.19 (X11/20090118) MIME-Version: 1.0 To: gary.jennejohn@freenet.de References: <20090215124757.4aacabbc@ernst.jennejohn.org> <49980DC1.7090900@FreeBSD.org> <20090215143219.718a8bec@ernst.jennejohn.org> In-Reply-To: <20090215143219.718a8bec@ernst.jennejohn.org> Content-Type: multipart/mixed; boundary="------------050207020204000004060502" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: booting with ATA-AHCI now broken X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Feb 2009 14:44:55 -0000 This is a multi-part message in MIME format. --------------050207020204000004060502 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Gary Jennejohn wrote: > On Sun, 15 Feb 2009 14:42:41 +0200 > Alexander Motin wrote: > >> Gary Jennejohn wrote: >>> The latest commit to dev/ata/chipsets/ata-ahci.c totally breaks >>> booting on my machine. >>> >>> I didn't save the commit message so I can't quote the exact commit >>> revision number. >>> >>> _Every_ ata port now times out. >>> >>> Here the relevant bits from pciconf: >>> >>> atapci0@pci0:0:17:0: class=0x010601 card=0xb0021458 chip=0x43911002 rev=0x00 hdr=0x00 >>> vendor = 'ATI Technologies Inc' >>> class = mass storage >>> subclass = SATA >> According to Linux drivers, this chip has bug with port multiplier >> probing which this commit may trigger. Can you try to change >> 'ata_ahci_softreset(dev, ATA_PM)' with 'ata_ahci_softreset(dev, 0)' in >> ata-ahci.c to check it? >> > > Yes, that fixes it. Thanks for the quick response. > > Do you still want the verbose boot output? Please try attached patch instead, it should be more correct solution, and send me it's output instead. -- Alexander Motin --------------050207020204000004060502 Content-Type: text/plain; name="ata.ati_pm.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="ata.ati_pm.patch" diff -ruNp ata.prev3/chipsets/ata-ahci.c ata/chipsets/ata-ahci.c --- ata.prev3/chipsets/ata-ahci.c 2009-02-14 23:07:18.000000000 +0200 +++ ata/chipsets/ata-ahci.c 2009-02-15 16:36:39.000000000 +0200 @@ -595,7 +595,7 @@ ata_ahci_start(device_t dev) (ch->devices & ATA_PORTMULTIPLIER ? ATA_AHCI_P_CMD_PMA : 0)); } -static void +static int ata_ahci_wait_ready(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); @@ -608,11 +608,12 @@ ata_ahci_wait_ready(device_t dev) DELAY(1000); if (timeout++ > 1000) { device_printf(dev, "port is not ready\n"); - break; + return (-1); } } if (bootverbose) device_printf(dev, "ready wait time=%dms\n", timeout); + return (0); } static u_int32_t @@ -651,7 +652,8 @@ ata_ahci_softreset(device_t dev, int por if (ata_ahci_issue_cmd(dev, 0, 0)) return -1; - ata_ahci_wait_ready(dev); + if (ata_ahci_wait_ready(dev)) + return (-1); return ATA_INL(ctlr->r_res2, ATA_AHCI_P_SIG + offset); } @@ -713,9 +715,14 @@ ata_ahci_reset(device_t dev) ata_ahci_wait_ready(dev); /* only probe for PortMultiplier if HW has support */ - if (ATA_INL(ctlr->r_res2, ATA_AHCI_CAP) & ATA_AHCI_CAP_SPM) + if (ATA_INL(ctlr->r_res2, ATA_AHCI_CAP) & ATA_AHCI_CAP_SPM) { signature = ata_ahci_softreset(dev, ATA_PM); - else { + /* Workaround for some ATI chips, failing to soft-reset + * when port multiplicator supported, but absent. + * XXX: We can also check PxIS.IPMS==1 here to be sure. */ + if (signature == 0xffffffff) + signature = ata_ahci_softreset(dev, 0); + } else { signature = ata_ahci_softreset(dev, 0); } if (bootverbose) --------------050207020204000004060502--