mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jason Williams <jason_williams@suth.com>
To: linux-kernel@vger.kernel.org
Subject: [PATCH] IDE handles Secondary Only incorrectly
Date: 18 Oct 2002 12:30:34 -0400	[thread overview]
Message-ID: <1034958639.26868.14.camel@cermanius.suth.com> (raw)

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

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



[-- Attachment #2: ide_sec_fix.patch --]
[-- Type: text/plain, Size: 1067 bytes --]

--- 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))

                 reply	other threads:[~2002-10-18 16:22 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1034958639.26868.14.camel@cermanius.suth.com \
    --to=jason_williams@suth.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

all inboxes | Powered by JetHome®