diff options
author | mav <mav@FreeBSD.org> | 2016-07-21 11:57:41 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2016-07-21 11:57:41 +0000 |
commit | 92f8958571314e65da16e854a8c54bf393e4b5f0 (patch) | |
tree | 339a442a65591f3dee362eccb694203a11bcfab1 /usr.sbin | |
parent | 079e0310daeafcffa121c3afd0fecda0a9e199f6 (diff) | |
download | FreeBSD-src-92f8958571314e65da16e854a8c54bf393e4b5f0.zip FreeBSD-src-92f8958571314e65da16e854a8c54bf393e4b5f0.tar.gz |
MFC r302957: Fix NCQ TRIM emulation.
When this code was written, there was no guests using it to test.
Approved by: re (kib)
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/bhyve/pci_ahci.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/usr.sbin/bhyve/pci_ahci.c b/usr.sbin/bhyve/pci_ahci.c index 1cf6f10..50b4495 100644 --- a/usr.sbin/bhyve/pci_ahci.c +++ b/usr.sbin/bhyve/pci_ahci.c @@ -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 slot, uint8_t *cfis) 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; } |