linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [linux-usb-devel] [FEATURE REQUEST] Transparent hot plugging of root file system on portable storage devices.
@ 2007-11-26 19:04 Raymano Garibaldi
  2008-01-01 20:29 ` Pavel Machek
  0 siblings, 1 reply; 10+ messages in thread
From: Raymano Garibaldi @ 2007-11-26 19:04 UTC (permalink / raw)
  To: Alan Stern
  Cc: Andrew Morton, Denys Vlasenko, Kernel development list,
	USB development list

Hi,

I would like to request a feature in the Linux kernel that would allow
a user to unplug a live read-only root file system which exists on a
detachable storage device such as a USB key drive. The desired
behavior is that once the same device is reattached to the computer
the user can continue work transparently without having to reboot.

Having such a feature is becoming more important with advances in
detachable solid state drive technology.

Having the root FS on a wireless storage device such as D.A.V.E.
(http://www.seagate.com/www/en-us/products/consumer_electronics/DAVE)
would require such a feature in the kernel in case the wireless
connection between the storage device and the computer is temporarily
lost. The user should have the ability to continue work transparently
once the wireless connection is reestablished.

Thank you,
Raymano G.

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

* Re: [linux-usb-devel] [FEATURE REQUEST] Transparent hot plugging of root file system on portable storage devices.
  2007-11-26 19:04 [linux-usb-devel] [FEATURE REQUEST] Transparent hot plugging of root file system on portable storage devices Raymano Garibaldi
@ 2008-01-01 20:29 ` Pavel Machek
  2008-01-02 10:19   ` Oliver Neukum
  0 siblings, 1 reply; 10+ messages in thread
From: Pavel Machek @ 2008-01-01 20:29 UTC (permalink / raw)
  To: Raymano Garibaldi
  Cc: Alan Stern, Andrew Morton, Denys Vlasenko,
	Kernel development list, USB development list

Hi1

> I would like to request a feature in the Linux kernel that would allow
> a user to unplug a live read-only root file system which exists on a
> detachable storage device such as a USB key drive. The desired
> behavior is that once the same device is reattached to the computer
> the user can continue work transparently without having to reboot.
> 
> Having such a feature is becoming more important with advances in
> detachable solid state drive technology.

Yep, that would be nice.... In fact, patch would be very welcome :-).


-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

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

* Re: [linux-usb-devel] [FEATURE REQUEST] Transparent hot plugging of root file system on portable storage devices.
  2008-01-01 20:29 ` Pavel Machek
@ 2008-01-02 10:19   ` Oliver Neukum
  2008-01-02 20:23     ` Alan Stern
  0 siblings, 1 reply; 10+ messages in thread
From: Oliver Neukum @ 2008-01-02 10:19 UTC (permalink / raw)
  To: Pavel Machek
  Cc: Raymano Garibaldi, Alan Stern, Andrew Morton, Denys Vlasenko,
	Kernel development list, USB development list

Am Dienstag 01 Januar 2008 schrieb Pavel Machek:
> Hi1
> 
> > I would like to request a feature in the Linux kernel that would allow
> > a user to unplug a live read-only root file system which exists on a
> > detachable storage device such as a USB key drive. The desired
> > behavior is that once the same device is reattached to the computer
> > the user can continue work transparently without having to reboot.
> > 
> > Having such a feature is becoming more important with advances in
> > detachable solid state drive technology.
> 
> Yep, that would be nice.... In fact, patch would be very welcome :-).

Use the USB persist feature and hibernate. It should work. If you modify
the fs in any way, you'll crash and burn. Unmounting / is harder which you
need if you want to do this safely.

	Regards
		Oliver


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

* Re: [linux-usb-devel] [FEATURE REQUEST] Transparent hot plugging of root file system on portable storage devices.
  2008-01-02 10:19   ` Oliver Neukum
@ 2008-01-02 20:23     ` Alan Stern
  2008-01-05 21:52       ` Pavel Machek
  0 siblings, 1 reply; 10+ messages in thread
From: Alan Stern @ 2008-01-02 20:23 UTC (permalink / raw)
  To: Oliver Neukum
  Cc: Pavel Machek, Raymano Garibaldi, Andrew Morton, Denys Vlasenko,
	Kernel development list, USB development list

On Wed, 2 Jan 2008, Oliver Neukum wrote:

> Am Dienstag 01 Januar 2008 schrieb Pavel Machek:
> > Hi1
> > 
> > > I would like to request a feature in the Linux kernel that would allow
> > > a user to unplug a live read-only root file system which exists on a
> > > detachable storage device such as a USB key drive. The desired
> > > behavior is that once the same device is reattached to the computer
> > > the user can continue work transparently without having to reboot.
> > > 
> > > Having such a feature is becoming more important with advances in
> > > detachable solid state drive technology.
> > 
> > Yep, that would be nice.... In fact, patch would be very welcome :-).
> 
> Use the USB persist feature and hibernate. It should work. If you modify
> the fs in any way, you'll crash and burn. Unmounting / is harder which you
> need if you want to do this safely.

What about people who prefer (for reasons of restart latency or
non-availability of swap space) to suspend rather than hibernate?

Alan Stern


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

* Re: [linux-usb-devel] [FEATURE REQUEST] Transparent hot plugging of root file system on portable storage devices.
  2008-01-02 20:23     ` Alan Stern
@ 2008-01-05 21:52       ` Pavel Machek
  2008-01-06 17:18         ` Alan Stern
  0 siblings, 1 reply; 10+ messages in thread
From: Pavel Machek @ 2008-01-05 21:52 UTC (permalink / raw)
  To: Alan Stern
  Cc: Oliver Neukum, Raymano Garibaldi, Andrew Morton, Denys Vlasenko,
	Kernel development list, USB development list

On Wed 2008-01-02 15:23:30, Alan Stern wrote:
> On Wed, 2 Jan 2008, Oliver Neukum wrote:
> 
> > Am Dienstag 01 Januar 2008 schrieb Pavel Machek:
> > > Hi1
> > > 
> > > > I would like to request a feature in the Linux kernel that would allow
> > > > a user to unplug a live read-only root file system which exists on a
> > > > detachable storage device such as a USB key drive. The desired
> > > > behavior is that once the same device is reattached to the computer
> > > > the user can continue work transparently without having to reboot.
> > > > 
> > > > Having such a feature is becoming more important with advances in
> > > > detachable solid state drive technology.
> > > 
> > > Yep, that would be nice.... In fact, patch would be very welcome :-).
> > 
> > Use the USB persist feature and hibernate. It should work. If you modify
> > the fs in any way, you'll crash and burn. Unmounting / is harder which you
> > need if you want to do this safely.
> 
> What about people who prefer (for reasons of restart latency or
> non-availability of swap space) to suspend rather than hibernate?

For suspend to RAM, we can keep the power session, and be _sure_ noone
unplugged our USB disks, right? So that one should work nicely.
									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

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

* Re: [linux-usb-devel] [FEATURE REQUEST] Transparent hot plugging of root file system on portable storage devices.
  2008-01-05 21:52       ` Pavel Machek
@ 2008-01-06 17:18         ` Alan Stern
  2008-01-06 20:59           ` Oliver Neukum
  0 siblings, 1 reply; 10+ messages in thread
From: Alan Stern @ 2008-01-06 17:18 UTC (permalink / raw)
  To: Pavel Machek
  Cc: Oliver Neukum, Raymano Garibaldi, Andrew Morton, Denys Vlasenko,
	Kernel development list, USB development list

On Sat, 5 Jan 2008, Pavel Machek wrote:

> On Wed 2008-01-02 15:23:30, Alan Stern wrote:
> > On Wed, 2 Jan 2008, Oliver Neukum wrote:
> > 
> > > Am Dienstag 01 Januar 2008 schrieb Pavel Machek:
> > > > Hi1
> > > > 
> > > > > I would like to request a feature in the Linux kernel that would allow
> > > > > a user to unplug a live read-only root file system which exists on a
> > > > > detachable storage device such as a USB key drive. The desired
> > > > > behavior is that once the same device is reattached to the computer
> > > > > the user can continue work transparently without having to reboot.
> > > > > 
> > > > > Having such a feature is becoming more important with advances in
> > > > > detachable solid state drive technology.
> > > > 
> > > > Yep, that would be nice.... In fact, patch would be very welcome :-).
> > > 
> > > Use the USB persist feature and hibernate. It should work. If you modify
> > > the fs in any way, you'll crash and burn. Unmounting / is harder which you
> > > need if you want to do this safely.
> > 
> > What about people who prefer (for reasons of restart latency or
> > non-availability of swap space) to suspend rather than hibernate?
> 
> For suspend to RAM, we can keep the power session, and be _sure_ noone
> unplugged our USB disks, right? So that one should work nicely.

No, no.  You didn't understand the question.

What about people who want to suspend to RAM instead of hibernating and
_do_ want to unplug the USB device containing their root filesystem
while the machine is asleep?  In this case we will _know_ that the
power session has been interrupted, but USB Persist won't activate
because the host controller never lost power.

Alan Stern


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

* Re: [linux-usb-devel] [FEATURE REQUEST] Transparent hot plugging of root file system on portable storage devices.
  2008-01-06 17:18         ` Alan Stern
@ 2008-01-06 20:59           ` Oliver Neukum
  2008-01-06 22:26             ` Alan Stern
  0 siblings, 1 reply; 10+ messages in thread
From: Oliver Neukum @ 2008-01-06 20:59 UTC (permalink / raw)
  To: Alan Stern
  Cc: Pavel Machek, Raymano Garibaldi, Andrew Morton, Denys Vlasenko,
	Kernel development list, USB development list

Am Sonntag 06 Januar 2008 schrieb Alan Stern:
> What about people who want to suspend to RAM instead of hibernating and
> _do_ want to unplug the USB device containing their root filesystem
> while the machine is asleep?  In this case we will _know_ that the
> power session has been interrupted, but USB Persist won't activate
> because the host controller never lost power.

Would it be hard to force the persist feature on for a replugged device?

	Regards
		Oliver


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

* Re: [linux-usb-devel] [FEATURE REQUEST] Transparent hot plugging of root file system on portable storage devices.
  2008-01-06 20:59           ` Oliver Neukum
@ 2008-01-06 22:26             ` Alan Stern
  2008-01-06 22:44               ` Pavel Machek
  0 siblings, 1 reply; 10+ messages in thread
From: Alan Stern @ 2008-01-06 22:26 UTC (permalink / raw)
  To: Oliver Neukum
  Cc: Pavel Machek, Raymano Garibaldi, Andrew Morton, Denys Vlasenko,
	Kernel development list, USB development list

On Sun, 6 Jan 2008, Oliver Neukum wrote:

> Am Sonntag 06 Januar 2008 schrieb Alan Stern:
> > What about people who want to suspend to RAM instead of hibernating and
> > _do_ want to unplug the USB device containing their root filesystem
> > while the machine is asleep?  In this case we will _know_ that the
> > power session has been interrupted, but USB Persist won't activate
> > because the host controller never lost power.
> 
> Would it be hard to force the persist feature on for a replugged device?

Right now the persist feature is enabled by a per-device boolean flag.  
In theory the flag could accept 3 values: off, on if power was lost,
or on for any resume transition.  This would not be a hard change.

Alan Stern


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

* Re: [linux-usb-devel] [FEATURE REQUEST] Transparent hot plugging of root file system on portable storage devices.
  2008-01-06 22:26             ` Alan Stern
@ 2008-01-06 22:44               ` Pavel Machek
  2008-01-07 15:39                 ` Alan Stern
  0 siblings, 1 reply; 10+ messages in thread
From: Pavel Machek @ 2008-01-06 22:44 UTC (permalink / raw)
  To: Alan Stern
  Cc: Oliver Neukum, Raymano Garibaldi, Andrew Morton, Denys Vlasenko,
	Kernel development list, USB development list

On Sun 2008-01-06 17:26:17, Alan Stern wrote:
> On Sun, 6 Jan 2008, Oliver Neukum wrote:
> 
> > Am Sonntag 06 Januar 2008 schrieb Alan Stern:
> > > What about people who want to suspend to RAM instead of hibernating and
> > > _do_ want to unplug the USB device containing their root filesystem
> > > while the machine is asleep? 

Ok, I guess I'm lost here. That sounds like a nice way to do
self-leg-shooting. Are there such people?

> > >  In this case we will _know_ that the
> > > power session has been interrupted, but USB Persist won't activate
> > > because the host controller never lost power.
> > 
> > Would it be hard to force the persist feature on for a replugged device?
> 
> Right now the persist feature is enabled by a per-device boolean flag.  
> In theory the flag could accept 3 values: off, on if power was lost,
> or on for any resume transition.  This would not be a hard change.

But do we need it?

Did you progress on "usb-storage-autosuspend"?

Here are my hacks to try to get SATA to survive autosuspend;
unfortunately they do not work :-(.
									Pavel



diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 54f38c2..21e6709 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -1808,8 +1808,22 @@ static void ahci_thaw(struct ata_port *a
 	writel(pp->intr_mask, port_mmio + PORT_IRQ_MASK);
 }
 
+struct pci_dev *my_pdev;
+
 static void ahci_error_handler(struct ata_port *ap)
 {
+	struct ata_host *host = ap->host;
+	int rc;
+	extern int slept;
+	
+	if (slept) {
+		printk("ahci_error_handler: Resuming...\n");
+		rc =ahci_pci_device_resume(my_pdev);
+		     printk("ahci: bad %d\n", rc);
+
+		printk("ahci_error_handler: Device resumed?\n");
+	}
+
 	if (!(ap->pflags & ATA_PFLAG_FROZEN)) {
 		/* restart engine */
 		ahci_stop_engine(ap);
@@ -1945,7 +1959,7 @@ static int ahci_pci_device_resume(struct
 	if (rc)
 		return rc;
 
-	if (pdev->dev.power.power_state.event == PM_EVENT_SUSPEND) {
+	if (1) {
 		rc = ahci_reset_controller(host);
 		if (rc)
 			return rc;
@@ -2179,6 +2193,7 @@ static void ahci_p5wdh_workaround(struct
 	}
 }
 
+
 static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 {
 	static int printed_version;
@@ -2190,6 +2205,7 @@ static int ahci_init_one(struct pci_dev 
 	int i, rc;
 
 	VPRINTK("ENTER\n");
+	my_pdev = pdev;
 
 	WARN_ON(ATA_MAX_QUEUE > AHCI_MAX_CMDS);
 
@@ -2283,8 +2299,11 @@ static int ahci_init_one(struct pci_dev 
 	ahci_print_info(host);
 
 	pci_set_master(pdev);
-	return ata_host_activate(host, pdev->irq, ahci_interrupt, IRQF_SHARED,
+
+	rc = ata_host_activate(host, pdev->irq, ahci_interrupt, IRQF_SHARED,
 				 &ahci_sht);
+	pci_save_state(pdev);
+	return rc;
 }
 
 static int __init ahci_init(void)

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

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

* Re: [linux-usb-devel] [FEATURE REQUEST] Transparent hot plugging of root file system on portable storage devices.
  2008-01-06 22:44               ` Pavel Machek
@ 2008-01-07 15:39                 ` Alan Stern
  0 siblings, 0 replies; 10+ messages in thread
From: Alan Stern @ 2008-01-07 15:39 UTC (permalink / raw)
  To: Pavel Machek
  Cc: Oliver Neukum, Raymano Garibaldi, Andrew Morton, Denys Vlasenko,
	Kernel development list, USB development list

On Sun, 6 Jan 2008, Pavel Machek wrote:

> On Sun 2008-01-06 17:26:17, Alan Stern wrote:
> > On Sun, 6 Jan 2008, Oliver Neukum wrote:
> > 
> > > Am Sonntag 06 Januar 2008 schrieb Alan Stern:
> > > > What about people who want to suspend to RAM instead of hibernating and
> > > > _do_ want to unplug the USB device containing their root filesystem
> > > > while the machine is asleep? 
> 
> Ok, I guess I'm lost here. That sounds like a nice way to do
> self-leg-shooting. Are there such people?

Yes.  People with small systems having extremely limited rw storage (no
swap space), using removable read-only media as their root fs.

You can find the thread leading up to this request here:

	http://marc.info/?t=119544588400002&r=1&w=2

> > > Would it be hard to force the persist feature on for a replugged device?
> > 
> > Right now the persist feature is enabled by a per-device boolean flag.  
> > In theory the flag could accept 3 values: off, on if power was lost,
> > or on for any resume transition.  This would not be a hard change.
> 
> But do we need it?

That depends on whom you ask!  :-)

> Did you progress on "usb-storage-autosuspend"?

Yes; the first round of patches will be posted later today.

> Here are my hacks to try to get SATA to survive autosuspend;
> unfortunately they do not work :-(.

You should start off with minimal support for manual runtime suspend
(through a sysfs attribute).  When that's working, autosuspend will be
easier to add in.

Alan Stern


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

end of thread, other threads:[~2008-01-07 15:39 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-26 19:04 [linux-usb-devel] [FEATURE REQUEST] Transparent hot plugging of root file system on portable storage devices Raymano Garibaldi
2008-01-01 20:29 ` Pavel Machek
2008-01-02 10:19   ` Oliver Neukum
2008-01-02 20:23     ` Alan Stern
2008-01-05 21:52       ` Pavel Machek
2008-01-06 17:18         ` Alan Stern
2008-01-06 20:59           ` Oliver Neukum
2008-01-06 22:26             ` Alan Stern
2008-01-06 22:44               ` Pavel Machek
2008-01-07 15:39                 ` Alan Stern

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).