All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH bug fix 13378] pata_legacy: wait for async probing
@ 2009-06-05 14:41 James Bottomley
  2009-06-05 15:04 ` Mikael Pettersson
  0 siblings, 1 reply; 4+ messages in thread
From: James Bottomley @ 2009-06-05 14:41 UTC (permalink / raw)
  To: Tejun Heo, Jeff Garzik; +Cc: linux-ide, Mikael Pettersson

The basic problem here 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 leading to this warning:

ata1: PATA max PIO4 cmd 0x1f0 ctl 0x3f6 irq 14
------------[ cut here ]------------
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
---[ end trace ef1ee36e873ae3a0 ]---

Because it detaches before the probe is complete.

One way to fix it would be to put an async_synchronize_full() before looking
for devices, which this patch does.  A better way might be to separate libata
into its own domain and only wait for that.

Reported-by: Mikael Pettersson <mikpe@it.uu.se>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>


---

Index: linux-2.6/drivers/ata/pata_legacy.c
===================================================================
--- linux-2.6.orig/drivers/ata/pata_legacy.c
+++ linux-2.6/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_sht);
 	if (ret)
 		goto fail;
+	async_synchronize_full();
 	ld->platform_dev = pdev;
 
 	/* Nothing found means we drop the port as its probably not there */



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH bug fix 13378] pata_legacy: wait for async probing
  2009-06-05 14:41 [PATCH bug fix 13378] pata_legacy: wait for async probing James Bottomley
@ 2009-06-05 15:04 ` Mikael Pettersson
  2009-06-05 15:26   ` Alan Cox
  0 siblings, 1 reply; 4+ messages in thread
From: Mikael Pettersson @ 2009-06-05 15:04 UTC (permalink / raw)
  To: James Bottomley; +Cc: Tejun Heo, Jeff Garzik, linux-ide, Mikael Pettersson

James Bottomley writes:
 > The basic problem here 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 leading to this warning:
 > 
 > ata1: PATA max PIO4 cmd 0x1f0 ctl 0x3f6 irq 14
 > ------------[ cut here ]------------
 > 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
 > ---[ end trace ef1ee36e873ae3a0 ]---
 > 
 > Because it detaches before the probe is complete.
 > 
 > One way to fix it would be to put an async_synchronize_full() before looking
 > for devices, which this patch does.  A better way might be to separate libata
 > into its own domain and only wait for that.

It's not apparent from this description, but the bug is worse
than some warnings from the kernel: the kernel hangs hard.

 > 
 > Reported-by: Mikael Pettersson <mikpe@it.uu.se>
 > Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>

and
Tested-by: Mikael Pettersson <mikpe@it.uu.se>

 > 
 > 
 > ---
 > 
 > Index: linux-2.6/drivers/ata/pata_legacy.c
 > ===================================================================
 > --- linux-2.6.orig/drivers/ata/pata_legacy.c
 > +++ linux-2.6/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_sht);
 >  	if (ret)
 >  		goto fail;
 > +	async_synchronize_full();
 >  	ld->platform_dev = pdev;
 >  
 >  	/* Nothing found means we drop the port as its probably not there */
 > 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH bug fix 13378] pata_legacy: wait for async probing
  2009-06-05 15:04 ` Mikael Pettersson
@ 2009-06-05 15:26   ` Alan Cox
  2009-06-05 15:31     ` Jeff Garzik
  0 siblings, 1 reply; 4+ messages in thread
From: Alan Cox @ 2009-06-05 15:26 UTC (permalink / raw)
  Cc: James Bottomley, Tejun Heo, Jeff Garzik, linux-ide,
	Mikael Pettersson, torvalds

> It's not apparent from this description, but the bug is worse
> than some warnings from the kernel: the kernel hangs hard.

Jeff seems to have vanished - some of the other trivial ATA one liners
haven't gone upstream either. He's posted 3 replies since 20th May so
I've no idea what he is up to (Fedora 11 mad panics perhaps) but this
patch probably wants to go direct to Linus.

Alan

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH bug fix 13378] pata_legacy: wait for async probing
  2009-06-05 15:26   ` Alan Cox
@ 2009-06-05 15:31     ` Jeff Garzik
  0 siblings, 0 replies; 4+ messages in thread
From: Jeff Garzik @ 2009-06-05 15:31 UTC (permalink / raw)
  To: Alan Cox
  Cc: Mikael Pettersson, James Bottomley, Tejun Heo, linux-ide, torvalds

Alan Cox wrote:
>> It's not apparent from this description, but the bug is worse
>> than some warnings from the kernel: the kernel hangs hard.
> 
> Jeff seems to have vanished - some of the other trivial ATA one liners
> haven't gone upstream either. He's posted 3 replies since 20th May so
> I've no idea what he is up to (Fedora 11 mad panics perhaps) but this
> patch probably wants to go direct to Linus.

Sorry, yeah that stuff looks good.  Will push today.

	Jeff




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-06-05 15:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-05 14:41 [PATCH bug fix 13378] pata_legacy: wait for async probing James Bottomley
2009-06-05 15:04 ` Mikael Pettersson
2009-06-05 15:26   ` Alan Cox
2009-06-05 15:31     ` Jeff Garzik

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.