From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Cc: list linux-ide <linux-ide@vger.kernel.org>,
linuxppc-dev list <linuxppc-dev@ozlabs.org>
Subject: ide pmac breakage
Date: Mon, 28 Jul 2008 11:29:56 +1000 [thread overview]
Message-ID: <1217208596.11188.144.camel@pasglop> (raw)
The current ide-pmac upstream is broken. It calls
media_bay_set_ide_infos() with an uninitialized "hwif" argument.
It's not a trivial mistake, there's a chicken-and-egg problem in the
init code in there.
I've locally fixed it with this patch that i'll merge via the powerpc
tree unless you have an objection.
However, the machine crashes when removing the media-bay CD-ROM drive.
Crash appears to be a NULL deref, possibly in elv_may_queue() though
I don't have a clean backtrace yet, working on it...
Cheers,
Ben.
diff --git a/drivers/ide/ppc/pmac.c b/drivers/ide/ppc/pmac.c
index c521bf6..fa2be26 100644
--- a/drivers/ide/ppc/pmac.c
+++ b/drivers/ide/ppc/pmac.c
@@ -1086,6 +1086,11 @@ static int __devinit pmac_ide_setup_device(pmac_ide_hwif_t *pmif, hw_regs_t *hw)
/* Make sure we have sane timings */
sanitize_timings(pmif);
+ host = ide_host_alloc(&d, hws);
+ if (host == NULL)
+ return -ENOMEM;
+ hwif = host->ports[0];
+
#ifndef CONFIG_PPC64
/* XXX FIXME: Media bay stuff need re-organizing */
if (np->parent && np->parent->name
@@ -1119,11 +1124,11 @@ static int __devinit pmac_ide_setup_device(pmac_ide_hwif_t *pmif, hw_regs_t *hw)
pmif->mdev ? "macio" : "PCI", pmif->aapl_bus_id,
pmif->mediabay ? " (mediabay)" : "", hw->irq);
- rc = ide_host_add(&d, hws, &host);
- if (rc)
+ rc = ide_host_register(host, &d, hws);
+ if (rc) {
+ ide_host_free(host);
return rc;
-
- hwif = host->ports[0];
+ }
return 0;
}
next reply other threads:[~2008-07-28 1:30 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-28 1:29 Benjamin Herrenschmidt [this message]
2008-07-28 2:02 ` ide pmac breakage Benjamin Herrenschmidt
2008-07-28 14:31 ` Bartlomiej Zolnierkiewicz
2008-07-29 5:17 ` FUJITA Tomonori
2008-07-29 5:20 ` Benjamin Herrenschmidt
2008-07-29 11:41 ` Bartlomiej Zolnierkiewicz
2008-07-29 12:02 ` Benjamin Herrenschmidt
2008-07-29 12:04 ` Bartlomiej Zolnierkiewicz
2008-07-29 14:45 ` Bartlomiej Zolnierkiewicz
2008-07-29 19:26 ` Bartlomiej Zolnierkiewicz
2008-07-29 21:30 ` Benjamin Herrenschmidt
2008-07-30 1:23 ` FUJITA Tomonori
2008-07-30 6:57 ` Benjamin Herrenschmidt
2008-07-30 19:11 ` Bartlomiej Zolnierkiewicz
2008-07-30 22:49 ` Benjamin Herrenschmidt
2008-07-31 0:48 ` Bartlomiej Zolnierkiewicz
2008-07-31 1:09 ` Benjamin Herrenschmidt
2008-07-31 3:17 ` Bartlomiej Zolnierkiewicz
2008-07-31 8:49 ` Alan Cox
2008-07-31 9:11 ` Benjamin Herrenschmidt
2008-07-31 9:13 ` Alan Cox
2008-07-31 9:48 ` Benjamin Herrenschmidt
2008-07-31 4:25 ` Benjamin Herrenschmidt
2008-07-31 10:51 ` Bartlomiej Zolnierkiewicz
2008-08-01 10:54 ` Bartlomiej Zolnierkiewicz
2008-08-01 22:26 ` Benjamin Herrenschmidt
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=1217208596.11188.144.camel@pasglop \
--to=benh@kernel.crashing.org \
--cc=bzolnier@gmail.com \
--cc=linux-ide@vger.kernel.org \
--cc=linuxppc-dev@ozlabs.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;
as well as URLs for NNTP newsgroup(s).