From: Douglas Gilbert <dgilbert@interlog.com>
To: Oliver Neukum <oliver@neukum.org>
Cc: linux-scsi@vger.kernel.org
Subject: Re: question on detecting a media change
Date: Sat, 13 Feb 2010 17:42:21 +0100 [thread overview]
Message-ID: <4B76D66D.9050602@interlog.com> (raw)
In-Reply-To: <201002122301.31366.oliver@neukum.org>
Oliver Neukum wrote:
> Hi,
>
> how can I find out a medium has been actually changed?
> I find ASC 0x28 ASCQ 0x00 NOT READY TO READY CHANGE, MEDIUM MAY HAVE CHANGED
> in the tables but my card reader emits this when it wakes up from runtime
> suspension. How do you find out whether the medium has actually been
> changed?
Oliver,
What you see is what you get ... In the absence of
Asynchronous Notifications (with USB, forget it)
a SCSI target is passive. It knows the media might
have changed but does not know if the same media
has been put back in (or if something else caused the
READY->NOT_READY->READY transitions).
So the next SCSI command sent to the device gets ignored
and a Unit Attention (sense key) is issued with an
additional sense code like the one you have shown.
[At least that is what should happen.]
If you are lucky the SCSI subsystem does not swallow
this deferred notification (a real pain for pass-throughs).
To detect the media has changed something at a higher
level needed to get a unique key associated with the
media before the Unit attention then generate another
unique key from the media after the Unit attention.
The comparison tells you the answer.
Doug Gilbert
next prev parent reply other threads:[~2010-02-13 16:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-12 22:01 question on detecting a media change Oliver Neukum
2010-02-13 16:42 ` Douglas Gilbert [this message]
2010-02-17 13:05 ` Oliver Neukum
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=4B76D66D.9050602@interlog.com \
--to=dgilbert@interlog.com \
--cc=linux-scsi@vger.kernel.org \
--cc=oliver@neukum.org \
/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 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.