From: Charles Hannum <root@ihack.net>
To: James Bottomley <James.Bottomley@hansenpartnership.com>
Cc: Alan Stern <stern@rowland.harvard.edu>,
"Rafael J. Wysocki" <rjw@sisk.pl>,
linux-kernel@vger.kernel.org, Greg Kroah-Hartman <gregkh@suse.de>,
linux-scsi <linux-scsi@vger.kernel.org>,
linux-usb@vger.kernel.org
Subject: Re: [PATCH] scsi/sd: fix suspend with USB-connected Android phone (one line)
Date: Thu, 12 May 2011 18:41:32 -0400 [thread overview]
Message-ID: <BANLkTinYvgcT8OqD9Fc7e_w1FPEchRkGLQ@mail.gmail.com> (raw)
In-Reply-To: <1305236616.2575.95.camel@mulgrave.site>
On Thu, May 12, 2011 at 17:43, James Bottomley
<James.Bottomley@hansenpartnership.com> wrote:
> It depends what the drive is caching and what's removable. If it's some
> type of hybrid, and the cache isn't mapped to the media for instance.
Except that the SCSI spec says the cache affected by SYNCHRONIZE CACHE
is related to the medium.
> The point really is that if the cache is in the housing, setting it to
> write through when it's not is not a correct reflection of reality.
Since this pretty clearly violates the intent of the spec, I have to
ask whether you are aware of any such device. I've never seen one.
Also, the only actual behavioral difference between my proposed patch
and your proposed one is to print out a message; you still weren't
calling sd_sync_cache() if the medium was not present. I'm not
beholden to a specific patch—but printing out an extra message, which
seems to imply that something is wrong, is decidely uncool in the
original case I referenced (my Android phone, after “Turn on USB
storage” and then “/usr/bin/eject”), where nothing is wrong other than
the driver trying to SYNCHRONIZE CACHE to a medium that it already
knows is not present.
> or actually, just checking the value when it looks at the return code.
That was what I did first, but then I realized two things:
1) The pre-use (before clicking “Turn on USB storage”) state has
WCE==0 because the mode page code hasn't been called at that point.
There is no good reason the pre-use and post-eject behavior should be
different, given that the device itself is in *exactly* the same state
at these points.
2) I definitely do not want a spurious message that could be
interpreted as an error, since this is perfectly normal and acceptable
use.
next prev parent reply other threads:[~2011-05-12 22:41 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-11 22:35 Charles Hannum
2011-05-12 20:03 ` Rafael J. Wysocki
2011-05-12 20:36 ` James Bottomley
2011-05-12 20:59 ` Charles Hannum
2011-05-12 21:32 ` Alan Stern
2011-05-12 21:43 ` James Bottomley
2011-05-12 22:41 ` Charles Hannum [this message]
2011-05-14 19:11 ` Oliver Neukum
2011-05-16 5:56 ` Hannes Reinecke
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=BANLkTinYvgcT8OqD9Fc7e_w1FPEchRkGLQ@mail.gmail.com \
--to=root@ihack.net \
--cc=James.Bottomley@hansenpartnership.com \
--cc=gregkh@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=rjw@sisk.pl \
--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
all inboxes | Powered by JetHome®