From owner-svn-src-all@FreeBSD.ORG Wed May 6 05:04:15 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 24B6298B; Wed, 6 May 2015 05:04:15 +0000 (UTC) Received: from mail-wi0-x22c.google.com (mail-wi0-x22c.google.com [IPv6:2a00:1450:400c:c05::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C44541EA4; Wed, 6 May 2015 05:04:14 +0000 (UTC) Received: by wief7 with SMTP id f7so116372697wie.0; Tue, 05 May 2015 22:04:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=4xiSbmAJo/45WNBqAVxbDHYg09ll4dqecUWSlBgc650=; b=v2raEgNt9hM5rurt6kHJEG3x1TLwStS6rGEP25V7ocYaoYALOUnJSLDzTb444ssOqr fuVFHsLmrjJukHXjDYGmfT9UWbefNNwBpDf877lraN+19Nsv/9NKC2awyCpw1wGooLip M3RfnAnOueSOVhN1tymY0+nsM2k3F09EbfJ7RCH6oFigMblBwdxNBcAW7Cd0rAC3sIAl jRezkeqVg5x/wytiPggSEAH2koG09TUSHS4fx1gfm2l375Dciy3sN/E4F6BtpWNFWNeF 9doIPxwtvrqd5RoOgvLtddPiBs2wsTAG9zA296aTidDx8ak/FM2DcBuZFySNdTjFyt6t YBZg== MIME-Version: 1.0 X-Received: by 10.195.11.165 with SMTP id ej5mr12398452wjd.127.1430888652219; Tue, 05 May 2015 22:04:12 -0700 (PDT) Received: by 10.27.52.18 with HTTP; Tue, 5 May 2015 22:04:12 -0700 (PDT) In-Reply-To: <201505041955.t44Jt28d008533@svn.freebsd.org> References: <201505041955.t44Jt28d008533@svn.freebsd.org> Date: Tue, 5 May 2015 22:04:12 -0700 Message-ID: Subject: Re: svn commit: r282429 - head/usr.sbin/bhyve From: Neel Natu To: Alexander Motin Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 05:04:15 -0000 Hi Alexander, I am getting the following error(?) messages with an ahci-cd device on Centos 6.4 x86_64: ata1.00: qc timeout (cmd 0xa0) ata1: limiting SATA link speed to 1.5 Gbps ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 frozen ata1.00: irq_stat 0x40000001 sr 0:0:0:0: [sr0] CDB: Get configuration: 46 00 00 00 00 00 00 00 08 00 ata1.00: cmd a0/00:00:00:08:00/00:00:00:00:00/a0 tag 0 pio 16392 in res 41/50:00:03:08:00/00:00:00:00:00/a0 Emask 0x5 (timeout) ata1.00: status: { DRDY ERR } ata1: hard resetting link ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 310) ata1.00: configured for UDMA/133 ata1: EH complete I have the boot log for the r282364 (working) and r282429 (not working) here: https://people.freebsd.org/~neel/bhyve/r282364_working.txt https://people.freebsd.org/~neel/bhyve/r282429_not_working.txt Any idea what the problem is? best Neel On Mon, May 4, 2015 at 12:55 PM, Alexander Motin wrote: > Author: mav > Date: Mon May 4 19:55:01 2015 > New Revision: 282429 > URL: https://svnweb.freebsd.org/changeset/base/282429 > > Log: > Implement in-order execution of non-NCQ commands. > > Using status updates in r282364, block queue on BSY, DRQ or ERR bits set. > This can be a performance penalization for non-NCQ commands, but it is > required for proper error recovery and standard compliance. > > MFC after: 2 weeks > > Modified: > head/usr.sbin/bhyve/pci_ahci.c > > Modified: head/usr.sbin/bhyve/pci_ahci.c > ============================================================================== > --- head/usr.sbin/bhyve/pci_ahci.c Mon May 4 19:34:59 2015 (r282428) > +++ head/usr.sbin/bhyve/pci_ahci.c Mon May 4 19:55:01 2015 (r282429) > @@ -140,6 +140,7 @@ struct ahci_port { > uint8_t err_cfis[20]; > uint8_t sense_key; > uint8_t asc; > + u_int ccs; > uint32_t pending; > > uint32_t clb; > @@ -204,6 +205,8 @@ struct pci_ahci_softc { > }; > #define ahci_ctx(sc) ((sc)->asc_pi->pi_vmctx) > > +static void ahci_handle_port(struct ahci_port *p); > + > static inline void lba_to_msf(uint8_t *buf, int lba) > { > lba += 150; > @@ -406,6 +409,7 @@ ahci_check_stopped(struct ahci_port *p) > */ > if (!(p->cmd & AHCI_P_CMD_ST)) { > if (p->pending == 0) { > + p->ccs = 0; > p->cmd &= ~(AHCI_P_CMD_CR | AHCI_P_CMD_CCS_MASK); > p->ci = 0; > p->sact = 0; > @@ -783,6 +787,8 @@ next: > ahci_write_fis_d2h(p, slot, cfis, ATA_S_READY | ATA_S_DSC); > p->pending &= ~(1 << slot); > ahci_check_stopped(p); > + if (!first) > + ahci_handle_port(p); > return; > } > goto next; > @@ -1754,20 +1760,21 @@ ahci_handle_slot(struct ahci_port *p, in > static void > ahci_handle_port(struct ahci_port *p) > { > - int i; > > if (!(p->cmd & AHCI_P_CMD_ST)) > return; > > /* > * Search for any new commands to issue ignoring those that > - * are already in-flight. > + * are already in-flight. Stop if device is busy or in error. > */ > - for (i = 0; (i < 32) && p->ci; i++) { > - if ((p->ci & (1 << i)) && !(p->pending & (1 << i))) { > + for (; (p->ci & ~p->pending) != 0; p->ccs = ((p->ccs + 1) & 31)) { > + if ((p->tfd & (ATA_S_BUSY | ATA_S_DRQ | ATA_S_ERROR)) != 0) > + break; > + if ((p->ci & ~p->pending & (1 << p->ccs)) != 0) { > p->cmd &= ~AHCI_P_CMD_CCS_MASK; > - p->cmd |= i << AHCI_P_CMD_CCS_SHIFT; > - ahci_handle_slot(p, i); > + p->cmd |= p->ccs << AHCI_P_CMD_CCS_SHIFT; > + ahci_handle_slot(p, p->ccs); > } > } > } > @@ -1844,6 +1851,7 @@ ata_ioreq_cb(struct blockif_req *br, int > p->pending &= ~(1 << slot); > > ahci_check_stopped(p); > + ahci_handle_port(p); > out: > pthread_mutex_unlock(&sc->mtx); > DPRINTF("%s exit\n", __func__); > @@ -1905,6 +1913,7 @@ atapi_ioreq_cb(struct blockif_req *br, i > p->pending &= ~(1 << slot); > > ahci_check_stopped(p); > + ahci_handle_port(p); > out: > pthread_mutex_unlock(&sc->mtx); > DPRINTF("%s exit\n", __func__); >