summaryrefslogtreecommitdiff
path: root/debian/patches/50_ide_bm.patch
blob: 982f28bf7367998facaaa85f68cf6c4fd60cb9ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Enable Bus Mastering if not enabled by BIOS (Bochs' BIOS doesn't).

Index: b/linux/src/drivers/block/triton.c
===================================================================
--- a/linux/src/drivers/block/triton.c
+++ b/linux/src/drivers/block/triton.c
@@ -632,7 +632,17 @@ hpt343_jump_in:
 		goto quit;
 	}
 	if ((pcicmd & 4) == 0) {
-		printk("ide: BM-DMA feature is not enabled (BIOS)\n");
+		printk("ide: BM-DMA feature is not enabled (BIOS), enabling\n");
+		pcicmd |= 4;
+		pcibios_write_config_word(bus, fn, 0x04, pcicmd);
+		if ((rc = pcibios_read_config_word(bus, fn, 0x04, &pcicmd))) {
+			printk("ide: Couldn't read back PCI command\n");
+			goto quit;
+		}
+	}
+
+	if ((pcicmd & 4) == 0) {
+		printk("ide: BM-DMA feature couldn't be enabled\n");
 	} else {
 		/*
 		 * Get the bmiba base address