public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Phillip Susi <psusi@cfl.rr.com>
To: Kyle Moffett <mrmacman_g4@mac.com>
Cc: Alan Stern <stern@rowland.harvard.edu>,
	Alon Bar-Lev <alon.barlev@gmail.com>,
	Kernel development list <linux-kernel@vger.kernel.org>
Subject: Re: Flames over -- Re: Which is simpler?
Date: Mon, 13 Feb 2006 21:09:35 -0500	[thread overview]
Message-ID: <43F13BDF.3060208@cfl.rr.com> (raw)
In-Reply-To: <BCC8C7FA-25A2-4460-A667-5AA88BF5BC6D@mac.com>

Kyle Moffett wrote:
> 
> No, that information is the most reliable that can be obtained.  It 
> tells us that we can no longer make any guarantees about the device or 
> its state.  The USB spec is quite clear on this point.
> 

That is what it says but the kernel is interpreting it as "this device 
HAS been removed" rather than "this device MAY have been removed".  That 
is wrong and should be fixed.

> 
> Except we can't reliably decide that.  Say I plug my USB camera in, 
> mount it, and download some pictures.  I then suspend the computer, 
> unplug the camera after suspending, take more pictures, plug it back in 
> and resume.  That's a fairly reasonable situation and the computer 
> considering the camera's state to be unchanged would be a serious bug 
> and probably result in data loss.  By contrast, just considering the 
> camera to be spontaneously unplugged would cause no more data loss than 
> actually spontaneously unplugging the flash drive.
> 

But again, that would be user error and thus, the data loss can not be 
avoided and is their fault.  Having data loss result from user error is 
far more acceptable than having data loss ALLWAYS result from a 
perfectly acceptable user action, namely hibernating the machine and 
resuming it some time later without altering anything.  You already 
teach users not to unplug the drive without ejecting it from the desktop 
first, why should you also force them to eject before hibernating?

> 
> This is why hardware suspend is a good thing.  When I suspend and resume 
> my laptop, there are _no_ USB disconnects.  The controller puts all the 
> hubs into low-power mode, but it never disconnects them or causes problems.
> 

That's fantastic for your system, but not all systems will maintain 
standby power to USB, and users expect to be able to suspend to disk and 
not loose data, just like they do with non USB drives.

> 
> No, you have this wrong.  The USB spec indicates that the device _HAS_ 
> changed and all old state should be thrown away (even the address).  
> There is no way around that issue.  USB was designed to support hardware 
> suspend; you can put all the hardware in low-power mode and still be 
> able to detect changes.

That's great, except that feature is not always used so you must be able 
to live without it.  The fact that the hardware flag is set is no 
indication that the hardware HAS changed, you said so yourself; all it 
knows is that the bus/device lost power.  The use case we are talking 
about is one in which power loss happens, but the device is still the 
same, and so access to it should not be interrupted.

> 
> In fact, I would argue that turning off all the busses completely when 
> you want to maintain a connection to a device is broken.  If you want to 
> maintain the connection, you should keep the busses powered.  Otherwise, 
> according to the USB spec, it's the _kernel_ that is terminating the 
> connection, and assuming that it exists after explicitly terminating it 
> is wrong.
> 

Yes, assuming that it exists is wrong.  Probing the hardware and seeing 
that it exists and is _probably_ the same device is entirely different. 
  In that case it is preferable to assume the probable case rather than 
the improbable one because it will lead to less data loss.




  reply	other threads:[~2006-02-14  2:09 UTC|newest]

Thread overview: 78+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-12 16:57 Flames over -- Re: Which is simpler? Alan Stern
2006-02-13  0:51 ` Phillip Susi
2006-02-13  2:19   ` Alan Stern
2006-02-13  3:52     ` Phillip Susi
2006-02-13  5:43       ` Kyle Moffett
2006-02-13 16:40         ` Phillip Susi
2006-02-13 16:31       ` Alan Stern
2006-02-13 17:14         ` Phillip Susi
2006-02-13 20:04           ` Alan Stern
2006-02-13 20:38             ` Phillip Susi
2006-02-13 21:24               ` Alan Stern
2006-02-13 22:27                 ` Rafael J. Wysocki
2006-02-14 19:26                   ` Alan Stern
2006-02-14 20:41                     ` Rafael J. Wysocki
2006-02-14 21:08                       ` Lee Revell
2006-02-15 15:56                       ` Alan Stern
2006-02-13 22:51                 ` J. Bruce Fields
2006-02-13 23:47                 ` Phillip Susi
2006-02-14  0:50                   ` Kyle Moffett
2006-02-14  2:09                     ` Phillip Susi [this message]
2006-02-14  4:09                       ` Kyle Moffett
2006-02-14  4:28                         ` Alan Stern
2006-02-14  5:11                           ` Kyle Moffett
2006-02-14 15:33                             ` Alan Stern
2006-02-14  6:27                         ` Phillip Susi
2006-02-14 16:23                           ` Kyle Moffett
2006-02-14 18:39                             ` Phillip Susi
2006-02-14 19:55                               ` Kyle Moffett
2006-02-14 21:13                                 ` Phillip Susi
2006-02-14 23:32                                   ` Kyle Moffett
2006-02-15  3:08                                     ` Phillip Susi
2006-02-14 19:14                             ` Olivier Galibert
2006-02-14 19:37                               ` Phillip Susi
2006-02-17 21:04                   ` Pavel Machek
2006-02-18 16:34                     ` Phillip Susi
2006-02-18 17:29                       ` Pavel Machek
2006-02-19  5:52                         ` Phillip Susi
2006-02-19  9:02                           ` Pavel Machek
2006-02-19 16:35                             ` Phillip Susi
2006-02-19 16:41                               ` Alan Stern
2006-02-19 19:17                                 ` Phillip Susi
2006-02-19 19:43                                   ` Pavel Machek
2006-02-20  0:56                                     ` Olivier Galibert
2006-02-20  1:01                                       ` Pavel Machek
2006-02-20  1:26                                         ` Olivier Galibert
2006-02-20  4:04                                           ` Alan Stern
2006-02-19 20:16                                   ` Bernd Eckenfels
2006-02-18 21:04                     ` Alan Stern
2006-02-19  0:02                       ` Andrew Morton
2006-02-19  6:02                         ` Phillip Susi
2006-02-19  6:32                           ` Andrew Morton
2006-02-19 16:39                             ` Phillip Susi
2006-02-19 16:54                               ` Alan Stern
2006-02-19 20:02                                 ` Andrew Morton
2006-02-19 20:44                                   ` Oliver Neukum
2006-02-19 21:02                                     ` Andrew Morton
2006-02-20  6:55                                       ` Oliver Neukum
2006-02-20  7:29                                         ` Andrew Morton
2006-02-20  7:57                                           ` Andrew Morton
2006-02-14 14:15     ` hackmiester / Hunter Fuller
2006-02-15 23:51     ` Pavel Machek
2006-02-13  2:25   ` Kyle Moffett
  -- strict thread matches above, loose matches on Subject: below --
2006-02-13 19:16 David Brownell
2006-02-13 20:08 ` Phillip Susi
2006-02-14  3:10   ` David Brownell
2006-02-14  6:05     ` Phillip Susi
2006-02-14 17:04       ` David Brownell
2006-02-15 23:43   ` Pavel Machek
2006-02-18 20:51     ` David Brownell
2006-02-19  6:06       ` Phillip Susi
2006-02-20  5:50         ` David Brownell
2006-02-20 16:07           ` Phillip Susi
2006-02-20 16:51             ` Olivier Galibert
2006-02-20 18:20               ` Phillip Susi
2006-02-20 18:44                 ` Olivier Galibert
2006-02-20 21:45                   ` Phillip Susi
2006-02-21 16:19             ` David Brownell
2006-02-21 18:30               ` Phillip Susi

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=43F13BDF.3060208@cfl.rr.com \
    --to=psusi@cfl.rr.com \
    --cc=alon.barlev@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mrmacman_g4@mac.com \
    --cc=stern@rowland.harvard.edu \
    /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