atapibasedevice: Clear BSY and signal interrupt on unsupported ATA command - #206
Merged
Merged
Conversation
Owner
|
Looks good. My only say about this is that the two changes should be separate commits. |
…mmand The default case in perform_command() set the ABRT/ERR flags but left BSY asserted and never fired the interrupt. Open Firmware therefore hung waiting on the ATAPI CD-ROM after issuing commands it does not support (e.g. 0xEC IDENTIFY_DEVICE during the boot device probe).
Move the Page 0x31 getter from ScsiCdrom into ScsiCdromCmds so it is also registered for the ATAPI CD-ROM, which Mac OS queries via MODE_SENSE.
probonopd
force-pushed
the
fix-atapi-cdrom-boot-hang
branch
from
August 8, 2026 21:31
664a797 to
3f1f2d7
Compare
Contributor
Author
Contributor
Author
|
That was quick. Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
The ATAPI CD-ROM hung Open Firmware during device probing on the Power Mac G3 beige, leaving a grey screen with a cursor after the 3rd display extension init.
Root cause
AtapiBaseDevice::perform_command()default case set the ABRT/ERR bits but leftBSYasserted and never fired the interrupt. When Open Firmware issued an unsupported ATA command during its boot device probe (0xEC IDENTIFY_DEVICE), the device stayed busy forever and the machine never progressed past probing the CD-ROM.Changes
BSYand callupdate_intrq(1)so the host receives a proper error status and can continue, matching the other command paths and the behavior inAtaHardDisk.ScsiCdromintoScsiCdromCmdsso it is registered for the ATAPI CD-ROM as well as the SCSI one. The Mac OS driver requests this page on device errors; the ATAPI path previously replied "page not supported".Verification
Booting Mac OS 9.2.2 from the install CD on the Power Mac G3 beige with a 256 MB RAM bank now proceeds past the point where it previously hung. No compiler warnings.