public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jason Williams <jason_williams@suth.com>
To: Alan Cox <alan@redhat.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: Linux 2.5.44-ac3
Date: 25 Oct 2002 11:34:59 -0400	[thread overview]
Message-ID: <1035560104.12219.37.camel@cermanius.suth.com> (raw)
In-Reply-To: <200210251019.g9PAJ8V14406@devserv.devel.redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1319 bytes --]

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
 

[-- Attachment #2: Type: text/x-patch, Size: 828 bytes --]

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;
 }
 

  parent reply	other threads:[~2002-10-25 15:25 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-25 10:19 Linux 2.5.44-ac3 Alan Cox
2002-10-25 12:55 ` Marco Roeland
2002-10-29 22:12   ` Greg KH
2002-10-25 14:38 ` patch: Linux 2.5.44-ac3, i386/config.in typo, "make xconfig" broken Alex Riesen
2002-10-25 14:39 ` Linux 2.5.44-ac3 Jurriaan
2002-10-25 15:34 ` Jason Williams [this message]
2002-10-28 15:15 ` Doug Ledford
2002-10-28 16:08   ` Alan Cox
2002-10-28 16:25   ` Alan Cox

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1035560104.12219.37.camel@cermanius.suth.com \
    --to=jason_williams@suth.com \
    --cc=alan@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox