From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57532) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZG9jy-0002WR-QB for qemu-devel@nongnu.org; Fri, 17 Jul 2015 13:48:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZG9jx-0001zG-OS for qemu-devel@nongnu.org; Fri, 17 Jul 2015 13:48:06 -0400 Message-ID: <55A93FCE.8000008@redhat.com> Date: Fri, 17 Jul 2015 13:47:58 -0400 From: John Snow MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] ahci: Force ICC bits in PxCMD to zero List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Fritsch , qemu-block@nongnu.org Cc: qemu-devel On 07/16/2015 03:54 PM, Stefan Fritsch wrote: > The AHCI spec requires that the HBA sets the ICC bits to zero after the > ICC change is done. Since we don't do any ICC change, force the bits to > zero all the time. >=20 > This fixes delays with some OSs (e.g. OpenBSD) waiting for the ICC bits > to change to 0. >=20 > Signed-off-by: Stefan Fritsch > --- > hw/ide/ahci.c | 9 +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) >=20 > diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c > index bb6a92f..48749c1 100644 > --- a/hw/ide/ahci.c > +++ b/hw/ide/ahci.c > @@ -279,8 +279,13 @@ static void ahci_port_write(AHCIState *s, int por= t, int offset, uint32_t val) > break; > case PORT_CMD: > /* Block any Read-only fields from being set; > - * including LIST_ON and FIS_ON. */ > - pr->cmd =3D (pr->cmd & PORT_CMD_RO_MASK) | (val & ~PORT_CM= D_RO_MASK); > + * including LIST_ON and FIS_ON. > + * The spec requires to set ICC bits to zero after the ICC= change > + * is done. We don't support ICC state changes, therefore = always > + * force the ICC bits to zero. > + */ > + pr->cmd =3D (pr->cmd & PORT_CMD_RO_MASK) | > + (val & ~(PORT_CMD_RO_MASK|PORT_CMD_ICC_MASK)); > =20 > /* Check FIS RX and CLB engines, allow transition to false= : */ > ahci_cond_start_engines(&s->dev[port], true); >=20 I guess I'll need to start testing with OpenBSD... Looks good to me -- (If there's a next time, please also CC qemu-devel so patch management tools pick this up.) Reviewed-by: John Snow and: Thanks, applied to my IDE tree: https://github.com/jnsnow/qemu/commits/ide https://github.com/jnsnow/qemu.git --js