mirror of https://lore.kernel.org/lkml/
 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-ac1
Date: 23 Oct 2002 07:39:35 -0400	[thread overview]
Message-ID: <1035373185.24550.21.camel@cermanius.suth.com> (raw)
In-Reply-To: <200210221727.g9MHR6128999@devserv.devel.redhat.com>

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

On Tue, 2002-10-22 at 13:27, Alan Cox wrote:
> ** I strongly recommend saying N to IDE TCQ options otherwise this
>    should hopefully build and run happily.

I don't have the IDE TCQ options on and am still having an issue with a
kernel oops in the default kernel code.  I did some digging after  I
noticed it in 2.5.43 and found a possibility for a null pointer in the
code within the ide_iomio_dma function in ide-dma.c The problem shows
itself if you only enable the secondary channel of your IDE controller. 
I understand this is a strange set up, but it could happen in a machine
that boots off of SCSI and uses IDE disks for DATA or a CD Burner. I
came up with a fix, some extra sanity checks before this line in the
code:

hwif->dma_master = (hwif->channel) ? hwif->mate->dma_base : base;

Because it is the hwif->mate variable that is null when it gets here and
if hwif->channel is not 0 I am taking it from the logic on this line
that hwif->mate should not be a null variable.  So I applied the sainity
checks in the attached patch and this seems to work.  I did this against
the 2.5.43 and 2.5.44 kernels, and have posted patches for each of them
but no one seems interested.  If I am completely off base here, just let
me know and I'll go back to the code and look for a different way to
conquer this little bug.

Jason





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

diff -u -r linux-2.5.44-vanilla/drivers/ide/ide-dma.c linux-2.5.44/drivers/ide/ide-dma.c
--- linux-2.5.44-vanilla/drivers/ide/ide-dma.c	2002-10-21 08:02:49.000000000 -0500
+++ linux-2.5.44/drivers/ide/ide-dma.c	2002-10-21 08:56:49.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->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))
 		{


  parent reply	other threads:[~2002-10-23 11:30 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-22 17:27 Alan Cox
2002-10-22 17:56 ` Nicholas Wourms
2002-10-22 18:20   ` Alan Cox
2002-10-22 18:29 ` Steven Cole
2002-10-22 19:45 ` Andres Salomon
2002-10-22 22:53   ` Nicholas Wourms
2002-10-23  1:11     ` Andres Salomon
2002-10-22 19:58 ` Adrian Bunk
2002-10-23 12:53   ` Krzysztof Halasa
2002-10-22 22:12 ` Mark Haverkamp
2002-10-23 11:39 ` Jason Williams [this message]
2002-10-23 11:49   ` Alan Cox
2002-10-23 12:09     ` Jason Williams

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=1035373185.24550.21.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

all inboxes | Powered by JetHome®