lkml.org 
[lkml]   [2002]   [Oct]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: Linux 2.5.44-ac3
From
Date
On Fri, 2002-10-25 at 06:19, Alan Cox wrote:
> ** I strongly recommend saying N to IDE TCQ options otherwise this
> should hopefully build and run happily.
>

Ok, so I did some "head-banging-against-the-wall" digging into the IDE
code(my wall is dented now...) and I found where hwif->mate gets
populated. Checking out this code and the code of the calling function,
I found that since the Primary interface is disabled, the first call to
the ide_hwif_configure is for the secondary channel. Being the first
call to the function the mate argument to the ide_hwif_configure
function is null. Since the mate argument is null this makes the
secondary interface have no mate, and it needs one(don't we all). I
figured it might be alright to populate it's hwif->mate var with a copy
of itself. I thought about this and if that var gets called elsewhere
in the code, worst it would do is attempt to double initialize something
on that interface, I think. So it seems like a few lines right by the
assignment of hwif->mate might take care of this. I basically check
mate for null, AND port for not zero. If those 2 conditions are met, I
set hwif->mate to a copy of hwif itself and let it go. It looks like
this runs ok on my boxen. I am just wondering everyone's opinion on
this proposed fix.


Jason Williams

diff -u -r linux-2.5.44-ac3/drivers/ide/setup-pci.c linux-2.5.44-ac3-idefix/drivers/ide/setup-pci.c
--- linux-2.5.44-ac3/drivers/ide/setup-pci.c 2002-10-18 23:01:49.000000000 -0500
+++ linux-2.5.44-ac3-idefix/drivers/ide/setup-pci.c 2002-10-25 10:54:30.000000000 -0500
@@ -472,6 +472,16 @@
hwif->mate = mate;
mate->mate = hwif;
}
+ else if(port){
+ // if mate is NULL and port is 1
+ // then we have a secondary without a primary
+ // which can happen on some bioses
+ // to avoid a null exception later in the code
+ // we populate mate with itself.
+ // Worst case is it says the controller is already
+ // initialized later.
+ hwif->mate = hwif;
+ }
return hwif;
}
\
 
 \ /
  Last update: 2005-03-22 13:30    [W:0.073 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site