* question on detecting a media change
@ 2010-02-12 22:01 Oliver Neukum
2010-02-13 16:42 ` Douglas Gilbert
0 siblings, 1 reply; 3+ messages in thread
From: Oliver Neukum @ 2010-02-12 22:01 UTC (permalink / raw)
To: linux-scsi
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?
Regards
Oliver
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: question on detecting a media change
2010-02-12 22:01 question on detecting a media change Oliver Neukum
@ 2010-02-13 16:42 ` Douglas Gilbert
2010-02-17 13:05 ` Oliver Neukum
0 siblings, 1 reply; 3+ messages in thread
From: Douglas Gilbert @ 2010-02-13 16:42 UTC (permalink / raw)
To: Oliver Neukum; +Cc: linux-scsi
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: question on detecting a media change
2010-02-13 16:42 ` Douglas Gilbert
@ 2010-02-17 13:05 ` Oliver Neukum
0 siblings, 0 replies; 3+ messages in thread
From: Oliver Neukum @ 2010-02-17 13:05 UTC (permalink / raw)
To: dgilbert; +Cc: linux-scsi
Am Samstag, 13. Februar 2010 17:42:21 schrieb Douglas Gilbert:
> 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.
Thanks. That's not the answer I would have liked, but it'll
have to do.
Thanks
Oliver
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-02-17 13:05 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-12 22:01 question on detecting a media change Oliver Neukum
2010-02-13 16:42 ` Douglas Gilbert
2010-02-17 13:05 ` Oliver Neukum
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).