Skip to content

SmbusI801: continue after INUSE timeout and retain HOST_BUSY check - #137

Draft
aluzin wants to merge 4 commits into
namazso:mainfrom
aluzin:rfc/i801-startup-recovery
Draft

aluzin wants to merge 4 commits into
namazso:mainfrom
aluzin:rfc/i801-startup-recovery

Conversation

@aluzin

@aluzin aluzin commented Nov 5, 2026 •

Copy link
Copy Markdown

Persistent i801 INUSE causes boot-time SMBus transfers to fail on an ASUS Z890 system. Following Steve-Tech's suggestion, this patch retains the existing ~80 ms wait but removes the STATUS_IO_TIMEOUT return when INUSE remains set. The existing HOST_BUSY preflight check and normal cleanup remain in place.

Only SmbusI801.p is changed. Comments and the debug message now describe best-effort acquisition. No new ioctl, driver backend or board-specific recovery path is introduced.

Validation

Regression tests and their workflow are kept separately in the fork's validation/i801-inuse branch. Its SmbusI801.p is byte-for-byte identical to the file in this PR (blob fbbf4aafe77ad80eb7090e39f04bbda91a3df791).

  • Regression tests and Pawn compilation: 28 offline cases across simple/block access, six rejected mutations, warning-free Pawn 4.1.7152 C64 build.
  • Standard build for the trimmed PR.
  • No candidate hardware execution or installation. The tests translate actual Pawn control flow to C++ with fake registers/time/transactions; they do not establish firmware coexistence.

The observed system is ASUS TUF GAMING Z890-PRO WIFI / Core Ultra 7 265K, BIOS 2207, using signed SmbusI801 0.2.11. Kernel capture reported INUSE held by BIOS/ACPI before FanControl started. A separately authorized vendor-driver status clear restored access through the unchanged PawnIO module; the timeout recurred after reboot. This is evidence motivating the patch, not validation of this candidate.

HOST_BUSY is a snapshot, not complete firmware synchronization. The existing cleanup still clears INUSE | STATUS_FLAGS even after preflight rejects HOST_BUSY. The tests document this behavior without claiming semaphore ownership. A signed test build for a bounded hardware trial would be appreciated.

AI authorship

Code, tests and text were prepared by OpenAI Codex on behalf of @aluzin at his explicit request. The original submission session reported model gpt-6-astra, reasoning xhigh, Codex runtime 0.164.0-alpha.11.1. Independent human hardware-code review remains outstanding.

Limit the experimental ioctl to 8086:7F23 / 1043:88EF, preserve normal transfer behavior, and document unresolved firmware ownership races. Include offline model/mutation tests and a warning-free Pawn compile check.

Prepared by OpenAI Codex (gpt-6-astra, xhigh; runtime 0.164.0-alpha.11.1) on behalf of aluzin. Not independently human-reviewed or hardware validated.
Trust only the known checkout for the git rev-parse invocation; leave global configuration unchanged. Module compilation and offline tests had already passed.
@Steve-Tech

Steve-Tech commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

IMO, I think a better solution would be to just remove this line:

return STATUS_IO_TIMEOUT;

Which would still wait ~80ms for a transaction to finish under normal circumstances, and then if it doesn't get unlocked we ignore it and continue. We also check SMBHSTSTS_HOST_BUSY before starting anyway, so we still have some method to avoid collisions; and Linux already doesn't wait for ACPI to unlock it, so it should be reasonably fine.

@aluzin

aluzin commented Nov 5, 2026

Copy link
Copy Markdown
Author

better solution would be to just remove this line

@Steve-Tech Thanks for reviewing! I'll revise this PR following your suggestion: remove the timeout return after the INUSE wait, retain the existing HOST_BUSY check, and drop the separate recovery ioctl. I'll add regression tests for these paths and report hardware validation separately.

Follow Steve-Tech's review of PR namazso#137: retain the 80 ms wait and HOST_BUSY preflight check, but do not return a timeout solely for persistent INUSE. Remove the separate recovery ioctl and document normal cleanup after best-effort acquisition.

Add offline regression coverage of the actual acquisition/preflight/access bodies: 28 simple/block cases and six rejected mutations. No hardware execution. Prepared by OpenAI Codex on behalf of aluzin.
@Steve-Tech

Copy link
Copy Markdown
Contributor

Cool! That seems more reasonable to me.
I doubt you'd be able to keep the tests though if you were intending on getting this merged. Like a PR with just SmbusI801.p is usually preferable here.

@aluzin

aluzin commented Nov 5, 2026

Copy link
Copy Markdown
Author

Cool! That seems more reasonable to me. I doubt you'd be able to keep the tests though if you were intending on getting this merged. Like a PR with just SmbusI801.p is usually preferable here.

@Steve-Tech Thanks! I'll keep the regression tests in a separate branch of my fork and trim this PR to SmbusI801.p only, with a link to the validation results.

Preserve regression tests and their workflow on validation/i801-inuse at 6825e30. Remove only fork-side test infrastructure from the PR; the validated SmbusI801.p blob is unchanged.

Follow Steve-Tech's review preference for a single-file patch. Prepared by OpenAI Codex on behalf of aluzin.
@aluzin aluzin changed the title RFC: explicit recovery of persistent i801 INUSE on ASUS Z890 SmbusI801: continue after INUSE timeout and retain HOST_BUSY check Nov 5, 2026
@aluzin

aluzin commented Nov 5, 2026

Copy link
Copy Markdown
Author

@Steve-Tech Done: the PR now changes only SmbusI801.p. The regression tests and workflow are preserved on my fork's validation/i801-inuse branch, with the exact same module source.

28 offline cases, six rejected mutations and Pawn compilation passed, as did the standard build of the trimmed PR. No hardware testing has been performed.

@Steve-Tech Steve-Tech left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good, and I've tested this on my hardware by reading HSTSTS (which sets INUSE) before running my SMBus test script.

I believe now that it's been tested on hardware, you should be fine to mark this PR as ready.

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.

2 participants