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 -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html