Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CDROM: Fix START STOP UNIT preventing drive use #234

Merged
merged 1 commit into from Jun 3, 2023

Conversation

saybur
Copy link
Contributor

@saybur saybur commented Jun 3, 2023

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.

This fixes an issue where Macs on reboot would stop the drive and never try to restart it. This also matches observed behavior on a Matshita drive, which would just spin down in response to this command and continue to indicate a good response to TEST UNIT READY as long as a disk was in the drive.
@PetteriAimonen
Copy link
Collaborator

I wonder if the same issue might affect harddrive emulation also?

@aperezbios aperezbios merged commit 7f7868b into ZuluSCSI:main Jun 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants