Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 21 Jul 2016 11:57:41 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r303138 - stable/11/usr.sbin/bhyve
Message-ID:  <201607211157.u6LBvfaQ034404@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Thu Jul 21 11:57:41 2016
New Revision: 303138
URL: https://svnweb.freebsd.org/changeset/base/303138

Log:
  MFC r302957: Fix NCQ TRIM emulation.
  
  When this code was written, there was no guests using it to test.
  
  Approved by:	re (kib)

Modified:
  stable/11/usr.sbin/bhyve/pci_ahci.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.sbin/bhyve/pci_ahci.c
==============================================================================
--- stable/11/usr.sbin/bhyve/pci_ahci.c	Thu Jul 21 11:41:27 2016	(r303137)
+++ stable/11/usr.sbin/bhyve/pci_ahci.c	Thu Jul 21 11:57:41 2016	(r303138)
@@ -784,7 +784,15 @@ next:
 	done += 8;
 	if (elen == 0) {
 		if (done >= len) {
-			ahci_write_fis_d2h(p, slot, cfis, ATA_S_READY | ATA_S_DSC);
+			if (ncq) {
+				if (first)
+					ahci_write_fis_d2h_ncq(p, slot);
+				ahci_write_fis_sdb(p, slot, cfis,
+				    ATA_S_READY | ATA_S_DSC);
+			} else {
+				ahci_write_fis_d2h(p, slot, cfis,
+				    ATA_S_READY | ATA_S_DSC);
+			}
 			p->pending &= ~(1 << slot);
 			ahci_check_stopped(p);
 			if (!first)
@@ -1665,7 +1673,7 @@ ahci_handle_cmd(struct ahci_port *p, int
 	case ATA_SEND_FPDMA_QUEUED:
 		if ((cfis[13] & 0x1f) == ATA_SFPDMA_DSM &&
 		    cfis[17] == 0 && cfis[16] == ATA_DSM_TRIM &&
-		    cfis[11] == 0 && cfis[13] == 1) {
+		    cfis[11] == 0 && cfis[3] == 1) {
 			ahci_handle_dsm_trim(p, slot, cfis, 0);
 			break;
 		}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201607211157.u6LBvfaQ034404>