Skip to contentSkip to conversation

2.5.44 and Secondary Channel Only configuration Kernel Ooops

PATCH New Jason Williams 1 participant 1 message Oct 21, 2002

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 2.5.44 and Secondary Channel Only configuration Kernel Ooops

Here is a patch to correct the problem with the IDE code when you have the Secondary Channel Only enabled in your BIOS. If you have only the secondary channel enabled, a null pointer get passed to the ide_iomio_dma function as the part of the hwif var (more specifically hwif->mate) This patch puts in some extra sanity checks in that section so make sure we don't hit the null.

Jason

P.S. This is a continuation of a previous patch I submitted for 2.5.43 which wasn't committed and I didn't send that to the maintainer (Sorry Andre) so I am resending it now as a patch to the 2.5.44 kernel.

drivers/ide/ide-dma.c +12 -2
diff -u -r linux-2.5.44-vanilla/drivers/ide/ide-dma.c linux-2.5.44/drivers/ide/ide-dma.c
@@ -905,7 +905,12 @@
 		request_region(base+16, hwif->cds->extra, hwif->cds->name);
 		hwif->dma_extra = hwif->cds->extra;
 	}
-	hwif->dma_master = (hwif->channel) ? hwif->mate->dma_base : base;
+	if(!hwif->mate && hwif->channel){
+		hwif->dma_master=base;
+	}
+	else{
+		hwif->dma_master = (hwif->channel) ? hwif->mate->dma_base : base;
+	}
 	if (hwif->dma_base2) {
 		if (!check_mem_region(hwif->dma_base2, ports))
 			request_mem_region(hwif->dma_base2, ports, hwif->name);
@@ -925,8 +930,13 @@
 	if ((hwif->cds->extra) && (hwif->channel == 0)) {
 		request_region(base+16, hwif->cds->extra, hwif->cds->name);
 		hwif->dma_extra = hwif->cds->extra;
+	}	
+	if(!hwif->mate && hwif->channel){
+		hwif->dma_master=base;
+	}
+	else{
+		hwif->dma_master = (hwif->channel) ? hwif->mate->dma_base : base;
 	}
-	hwif->dma_master = (hwif->channel) ? hwif->mate->dma_base : base;
 	if (hwif->dma_base2) {
 		if (!request_region(hwif->dma_base2, ports, hwif->name))
 		{