From owner-svn-soc-all@FreeBSD.ORG Sat Sep 7 16:08:48 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 9B9C7AD1 for ; Sat, 7 Sep 2013 16:08:48 +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 883EA2809 for ; Sat, 7 Sep 2013 16:08:48 +0000 (UTC) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.7/8.14.7) with ESMTP id r87G8mkP011070 for ; Sat, 7 Sep 2013 16:08:48 GMT (envelope-from zcore@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.7/8.14.6/Submit) id r87G8mV6011065 for svn-soc-all@FreeBSD.org; Sat, 7 Sep 2013 16:08:48 GMT (envelope-from zcore@FreeBSD.org) Date: Sat, 7 Sep 2013 16:08:48 GMT Message-Id: <201309071608.r87G8mV6011065@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: r257084 - 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: Sat, 07 Sep 2013 16:08:48 -0000 Author: zcore Date: Sat Sep 7 16:08:48 2013 New Revision: 257084 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=257084 Log: should set prdbc before send h2d fis 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 Sat Sep 7 16:08:00 2013 (r257083) +++ soc2013/zcore/head/usr.sbin/bhyve/pci_ahci.c Sat Sep 7 16:08:48 2013 (r257084) @@ -83,6 +83,7 @@ struct ahci_port *io_pr; STAILQ_ENTRY(ahci_ioreq) io_list; uint8_t *cfis; + uint32_t len; int slot; }; @@ -369,6 +370,7 @@ p->iofree--; aior->cfis = cfis; aior->slot = slot; + aior->len = len; breq = &aior->io_req; breq->br_offset = lba; breq->br_iovcnt = hdr->prdtl; @@ -618,18 +620,23 @@ struct pci_ahci_softc *sc; struct ahci_ioreq *aior; uint32_t tfd; + struct ahci_cmd_hdr *hdr; aior = br->br_param; p = aior->io_pr; sc = p->pr_sc; + hdr = p->cmd_lst + aior->slot * AHCI_CL_SIZE; DPRINTF(("ahci_ioreq_cb %d\n", err)); pthread_mutex_lock(&sc->mtx); - if (err) - tfd = (ATA_E_ABORT << 8) | ATA_S_READY | ATA_S_ERROR; - else + if (!err) { tfd = ATA_S_READY | ATA_S_DSC; + hdr->prdbc = aior->len; + } else { + tfd = (ATA_E_ABORT << 8) | ATA_S_READY | ATA_S_ERROR; + hdr->prdbc = 0; + } ahci_write_fis_d2h(p, aior->slot, aior->cfis, tfd); /*