CDROM: Fix START STOP UNIT preventing drive use #234
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes an issue I observed where two different Macs would issue a START STOP UNIT with LoEj=0,Start=0 to stop a virtual CD-ROM drive during restart but never try to reinitialize the drive afterwards. This makes it look like the device has "disappeared" until it is power cycled.
I also tested this on a modern Linux system using
sg3_utils
against an older Matshita drive. Executing START STOP UNIT as above the unit would just spin down in response and continue to indicate a good condition to TEST UNIT READY as long as a disk was in the drive. Media commands issued while in this state would cause it to spin back up again without a matching START STOP UNIT command with Start=1.To be candid, I'm not 100% confident that the above tests are robust: there may be a re-initialization issue for the device during bus reset or a Linux driver interfering with the utility tests.