Messages in this thread Patch in this message | | | Subject | [PATCH] IDE handles Secondary Only incorrectly | From | Jason Williams <> | Date | 18 Oct 2002 12:30:34 -0400 |
| |
After some investigation, I found that the IDE System in the 2.5.43 kernel didn't handle IDE set up correctly on an interface with just the secondary channel enabled in BIOS. I thought it was a problem with the VIA controller, but it was actually a piece of code not handling a null variable properly. This variable is not being populated because one of the interfaces in the system is not enabled. The culprit is in the ide-dma.c file. Attached is a patch to act as a quick fix to this problem. It circumvents the kernel oops my checking the variable in question and ignoring it if there is only one interface. This is safe to do for development purposes, but a real fix should probably come out of the IDE folks. The behavior that I think might be what is intended is that the hwif->mate should be populated with the same values as the hwif variable itself is there is only the secondary interface enabled. Just a thought, I am not sure if it is on the right path though.
Jason Williams
--- ide-dma.orig.c 2002-10-18 12:25:08.000000000 -0500 +++ ide-dma.c 2002-10-18 12:23:55.000000000 -0500 @@ -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->channel && hwif->mate == NULL) { + 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); @@ -926,7 +931,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 == NULL && hwif->channel) { + hwif->dma_master = base; + } + else { + hwif->dma_master = (hwif->channel) ? hwif->mate->dma_base : base; + } if (hwif->dma_base2) { if (!request_region(hwif->dma_base2, ports, hwif->name)) | |