summaryrefslogtreecommitdiff
path: root/hw/ide/pci.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2011-05-19 10:58:19 +0200
committerKevin Wolf <kwolf@redhat.com>2011-06-15 14:36:16 +0200
commitd353fb72f59cd0e1f67baf773e74719cda761a89 (patch)
tree994311cabf1fd896af097c7165fa4176b991c09c /hw/ide/pci.c
parent4e1e00515e2522bbae98a0653ea2692ec20851ac (diff)
downloadqemu-d353fb72f59cd0e1f67baf773e74719cda761a89.tar.gz
ide: add TRIM support
Add support for TRIM sub function of the data set management command, and wire it up to the qemu discard infrastructure. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'hw/ide/pci.c')
-rw-r--r--hw/ide/pci.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/hw/ide/pci.c b/hw/ide/pci.c
index 80c579457a..c940375064 100644
--- a/hw/ide/pci.c
+++ b/hw/ide/pci.c
@@ -200,8 +200,13 @@ static void bmdma_restart_bh(void *opaque)
is_read = !!(bus->error_status & BM_STATUS_RETRY_READ);
if (bus->error_status & BM_STATUS_DMA_RETRY) {
- bus->error_status &= ~(BM_STATUS_DMA_RETRY | BM_STATUS_RETRY_READ);
- bmdma_restart_dma(bm, is_read ? IDE_DMA_READ : IDE_DMA_WRITE);
+ if (bus->error_status & BM_STATUS_RETRY_TRIM) {
+ bus->error_status &= ~BM_STATUS_RETRY_TRIM;
+ bmdma_restart_dma(bm, IDE_DMA_TRIM);
+ } else {
+ bus->error_status &= ~(BM_STATUS_DMA_RETRY | BM_STATUS_RETRY_READ);
+ bmdma_restart_dma(bm, is_read ? IDE_DMA_READ : IDE_DMA_WRITE);
+ }
} else if (bus->error_status & BM_STATUS_PIO_RETRY) {
bus->error_status &= ~(BM_STATUS_PIO_RETRY | BM_STATUS_RETRY_READ);
if (is_read) {