linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Paul Mackerras <paulus@samba.org>
To: mlan@cpu.lu
Cc: linuxppc-dev@lists.linuxppc.org
Subject: Re: Oops when inserting PCMCIA flash card (IDE)
Date: Tue, 25 Feb 2003 16:39:45 +1100	[thread overview]
Message-ID: <15963.417.778407.277896@argo.ozlabs.ibm.com> (raw)
In-Reply-To: <E18nL1U-0007Ag-00@piglet.grunz.lu>


Michel Lanners writes:

> For a number of kernel versions (at least 4 months) I get a kernel oops
> when inserting a CF card in my TiBook's PCMCIA slot.
[snip]
> The NIP in the oops points to ide_mm_inb(); it's trying to read from the
> IDE ports. However, the port the new IDE interface got assinged seems to

It should of course be using ide_inb().

The problem is that there are 3 IDE interfaces on the tibook, and the
third one doesn't have anything attached.  Thus ide2 gets set up as a
pmac-ide interface but ends up with the `present' flag false, since
the IDE layer has no way to represent an interface that is present but
has no drives attached.  Then when you plug in the CF card it gets to
use ide2, but the data structures don't get properly initialized and
it goes off and tries to use pmac-ide routines on it.

I explained this problem to Alan Cox but didn't get him to focus on it
long enough to fix it properly.  In the meantime I am using this hack:

diff -urN linux-2.5/drivers/ide/ide.c pmac-2.5/drivers/ide/ide.c
--- linux-2.5/drivers/ide/ide.c	2003-02-22 12:30:01.000000000 +1100
+++ pmac-2.5/drivers/ide/ide.c	2003-02-25 16:37:40.000000000 +1100
@@ -904,6 +904,7 @@
 		ide_unregister(index);
 	if (hwif->present)
 		return -1;
+	init_hwif_data(index);
 	memcpy(&hwif->hw, hw, sizeof(*hw));
 	memcpy(hwif->io_ports, hwif->hw.io_ports, sizeof(hwif->hw.io_ports));
 	hwif->irq = hw->irq;

Regards,
Paul.

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

  parent reply	other threads:[~2003-02-25  5:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-24 16:00 Oops when inserting PCMCIA flash card (IDE) Michel Lanners
2003-02-24 16:51 ` Jeffery von Ronne
2003-02-24 17:40 ` Benjamin Herrenschmidt
2003-02-25  5:39 ` Paul Mackerras [this message]
2003-02-25 16:44   ` Michel Lanners

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=15963.417.778407.277896@argo.ozlabs.ibm.com \
    --to=paulus@samba.org \
    --cc=linuxppc-dev@lists.linuxppc.org \
    --cc=mlan@cpu.lu \
    /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;
as well as URLs for NNTP newsgroup(s).