summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2018-06-13 20:12:14 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2018-06-13 20:13:05 +0200
commitca11788a906e126b85bdfaf78fbc58821b0cea46 (patch)
tree269e3ad0ea4bb9ca70252fe0958b645eb873982d
parent926090c399ab503d6f7f67a9556d46b5094fd20f (diff)
Keep DMA enabled on QEMU disks
When the host is very loaded, some requests might time out, but that is not a reason for disabling DMA, so keep it enabled. * linux/src/drivers/block/triton.c (config_drive_for_dma): When disk is QEMU, set using_dma and keep_settings to 1.
-rw-r--r--linux/src/drivers/block/triton.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/linux/src/drivers/block/triton.c b/linux/src/drivers/block/triton.c
index 37eff2b3..f4633d21 100644
--- a/linux/src/drivers/block/triton.c
+++ b/linux/src/drivers/block/triton.c
@@ -226,6 +226,14 @@ static int config_drive_for_dma (ide_drive_t *drive)
return 1; /* DMA disabled */
}
}
+
+ if (!strcmp("QEMU HARDDISK", id->model)) {
+ /* Virtual disks don't have issues with DMA :) */
+ drive->using_dma = 1;
+ /* And keep enabled even if some requests time out due to emulation lag. */
+ drive->keep_settings = 1;
+ return 1; /* DMA enabled */
+ }
/* Enable DMA on any drive that has mode 4 or 2 UltraDMA enabled */
if (id->field_valid & 4) { /* UltraDMA */
/* Enable DMA on any drive that has mode 4 UltraDMA enabled */