QEMU-Devel Archive on lore.kernel.org
 help / color / Atom feed
From: John Snow <jsnow@redhat.com>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, Stefan Fritsch <sf@sfritsch.de>,
Subject: [Qemu-devel] [PULL 2/3] ahci: Force ICC bits in PxCMD to zero
Date: Mon, 20 Jul 2015 14:29:20 -0400
Message-ID: <1437416961-26348-3-git-send-email-jsnow@redhat.com> (raw)
In-Reply-To: <1437416961-26348-1-git-send-email-jsnow@redhat.com>

From: Stefan Fritsch <sf@sfritsch.de>

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.

This fixes delays with some OSs (e.g. OpenBSD) waiting for the ICC bits
to change to 0.

Signed-off-by: Stefan Fritsch <sf@sfritsch.de>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Message-id: E1ZFpg7-00027N-HW@eru.sfritsch.de
Signed-off-by: John Snow <jsnow@redhat.com>
 hw/ide/ahci.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

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 port, int offset, uint32_t val)
         case PORT_CMD:
             /* Block any Read-only fields from being set;
-             * including LIST_ON and FIS_ON. */
-            pr->cmd = (pr->cmd & PORT_CMD_RO_MASK) | (val & ~PORT_CMD_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 = (pr->cmd & PORT_CMD_RO_MASK) |
+                      (val & ~(PORT_CMD_RO_MASK|PORT_CMD_ICC_MASK));
             /* Check FIS RX and CLB engines, allow transition to false: */
             ahci_cond_start_engines(&s->dev[port], true);

  parent reply index

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-20 18:29 [Qemu-devel] [PULL 0/3] Ide patches John Snow
2015-07-20 18:29 ` [Qemu-devel] [PULL 1/3] qtest/ide: add another short PRDT test flavor John Snow
2015-07-20 18:29 ` John Snow [this message]
2015-07-21 11:38   ` [Qemu-devel] [PULL 2/3] ahci: Force ICC bits in PxCMD to zero Peter Maydell
2015-07-21 12:55     ` Eric Blake
2015-07-21 13:02       ` Peter Maydell
2015-07-21 17:41         ` John Snow
2015-07-20 18:29 ` [Qemu-devel] [PULL 3/3] tests: Fix broken targets check-report-qtest-* John Snow
2015-07-21 10:18 ` [Qemu-devel] [PULL 0/3] Ide patches Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1437416961-26348-3-git-send-email-jsnow@redhat.com \
    --to=jsnow@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=sf@sfritsch.de \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

QEMU-Devel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/qemu-devel/0 qemu-devel/git/0.git
	git clone --mirror https://lore.kernel.org/qemu-devel/1 qemu-devel/git/1.git
	git clone --mirror https://lore.kernel.org/qemu-devel/2 qemu-devel/git/2.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 qemu-devel qemu-devel/ https://lore.kernel.org/qemu-devel \
	public-inbox-index qemu-devel

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git