From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Mikael Pettersson <mikpe@it.uu.se>
Cc: linux-kernel@vger.kernel.org, linux-ide@vger.kernel.org,
arjan@linux.intel.com
Subject: Re: [2.6.30-rc7 regression] kernel/async.c broke pata_legacy.c
Date: Sun, 24 May 2009 14:15:26 -0500 [thread overview]
Message-ID: <1243192526.2889.26.camel@localhost.localdomain> (raw)
In-Reply-To: <18969.29245.610133.834819@pilspetsen.it.uu.se>
On Sun, 2009-05-24 at 18:13 +0200, Mikael Pettersson wrote:
> I tried booting 2.6.30-rc7 on my old '486, but it fails miserably
> during libata/pata_legacy's device scan:
[...]
> WARNING: at drivers/ata/libata-core.c:6222 ata_host_detach+0x75/0x90()
> Modules linked in:
> Pid: 1, comm: swapper Not tainted 2.6.30-rc7 #1
> Call Trace:
> [<c01fbb05>] ? ata_host_detach+0x75/0x90
> [<c01fbb05>] ? ata_host_detach+0x75/0x90
> [<c01139b5>] ? warn_slowpath_common+0x45/0x80
> [<c01139fa>] ? warn_slowpath_null+0xa/0x10
> [<c01fbb05>] ? ata_host_detach+0x75/0x90
> [<c02f40e0>] ? legacy_init+0x44e/0x87f
> [<c02f3c92>] ? legacy_init+0x0/0x87f
> [<c0101021>] ? _stext+0x21/0x140
> [<c01890ff>] ? proc_register+0x2f/0x190
> [<c018938c>] ? create_proc_entry+0x5c/0xc0
> [<c0135ebe>] ? register_irq_proc+0x6e/0x90
> [<c02e6484>] ? kernel_init+0x6e/0xbf
> [<c02e6416>] ? kernel_init+0x0/0xbf
> [<c01031d7>] ? kernel_thread_helper+0x7/0x10
OK, so the basic problem here is that pata_legacy attaches the host,
sees if it found any devices and detaches it if none were found. With
async probing, it's not waiting until discovery is finished before
deciding it has no devices and trying the detach ... the warning is
because the detach is racing with the asynchronous probe.
One way to fix it would be to put an async_synchronize_full() before
looking for devices (try the patch below). A better way might be to
separate libata into its own domain and only wait for that.
James
---
diff --git a/drivers/ata/pata_legacy.c b/drivers/ata/pata_legacy.c
index f72c6c5..6932e56 100644
--- a/drivers/ata/pata_legacy.c
+++ b/drivers/ata/pata_legacy.c
@@ -48,6 +48,7 @@
*
*/
+#include <linux/async.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/pci.h>
@@ -1028,6 +1029,7 @@ static __init int legacy_init_one(struct legacy_probe *probe)
&legacy_sht);
if (ret)
goto fail;
+ async_synchronize_full();
ld->platform_dev = pdev;
/* Nothing found means we drop the port as its probably not there */
next prev parent reply other threads:[~2009-05-24 19:15 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-24 16:13 [2.6.30-rc7 regression] kernel/async.c broke pata_legacy.c Mikael Pettersson
2009-05-24 19:15 ` James Bottomley [this message]
2009-05-24 20:49 ` Mikael Pettersson
2009-05-24 19:20 ` Robert Hancock
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=1243192526.2889.26.camel@localhost.localdomain \
--to=james.bottomley@hansenpartnership.com \
--cc=arjan@linux.intel.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mikpe@it.uu.se \
/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).