From owner-svn-soc-all@FreeBSD.ORG Tue Sep 17 15:41:15 2013 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7E2EE243 for ; Tue, 17 Sep 2013 15:41:15 +0000 (UTC) (envelope-from zcore@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 69C732D48 for ; Tue, 17 Sep 2013 15:41:15 +0000 (UTC) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8HFfFTE074754 for ; Tue, 17 Sep 2013 15:41:15 GMT (envelope-from zcore@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.7/8.14.6/Submit) id r8HFfFaY074745 for svn-soc-all@FreeBSD.org; Tue, 17 Sep 2013 15:41:15 GMT (envelope-from zcore@FreeBSD.org) Date: Tue, 17 Sep 2013 15:41:15 GMT Message-Id: <201309171541.r8HFfFaY074745@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to zcore@FreeBSD.org using -f From: zcore@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r257427 - soc2013/zcore/head/usr.sbin/bhyve MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Sep 2013 15:41:15 -0000 Author: zcore Date: Tue Sep 17 15:41:15 2013 New Revision: 257427 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=257427 Log: fix CI clear for NCQ Modified: soc2013/zcore/head/usr.sbin/bhyve/pci_ahci.c Modified: soc2013/zcore/head/usr.sbin/bhyve/pci_ahci.c ============================================================================== --- soc2013/zcore/head/usr.sbin/bhyve/pci_ahci.c Tue Sep 17 14:23:15 2013 (r257426) +++ soc2013/zcore/head/usr.sbin/bhyve/pci_ahci.c Tue Sep 17 15:41:15 2013 (r257427) @@ -256,7 +256,6 @@ if (fis[2] & ATA_S_ERROR) p->is |= AHCI_P_IX_TFE; p->tfd = tfd; - p->ci &= ~(1 << slot); ahci_write_fis(p, FIS_TYPE_SETDEVBITS, fis); } @@ -374,7 +373,7 @@ static void handle_dma(struct ahci_port *p, int slot, uint8_t *cfis) { - int i, err, readop = 1; + int i, err, ncq = 0, readop = 1; uint64_t lba; uint32_t len; struct ahci_ioreq *aior; @@ -398,6 +397,7 @@ len = cfis[11] << 8 | cfis[3]; if (!len) len = 65536; + ncq = 1; } else if (cfis[2] == ATA_READ_DMA48 || cfis[2] == ATA_WRITE_DMA48) { lba = ((uint64_t)cfis[10] << 40) | ((uint64_t)cfis[9] << 32) | @@ -445,6 +445,9 @@ else err = blockif_write(p->bctx, breq); assert(err == 0); + + if (ncq) + p->ci &= ~(1 << slot); } static void