Page MenuHomeFreeBSD

uart: Go back to returning '0' when we've probed the device.
ClosedPublic

Authored by imp on Oct 12 2024, 6:50 PM.
Tags
None
Referenced Files
F108594491: D47095.id144883.diff
Sun, Jan 26, 6:18 PM
Unknown Object (File)
Fri, Jan 24, 5:09 PM
Unknown Object (File)
Wed, Jan 22, 7:26 AM
Unknown Object (File)
Sat, Jan 18, 6:35 PM
Unknown Object (File)
Mon, Jan 6, 4:23 AM
Unknown Object (File)
Dec 19 2024, 1:30 AM
Unknown Object (File)
Dec 17 2024, 10:13 PM
Unknown Object (File)
Nov 24 2024, 3:02 AM
Subscribers
None

Details

Summary

Two reasons for this: we know it's a uart after we call probe and it
returns successfully. Second, uart passes data between probe and attach
with softc. As it is now, we call probe twice, once in the bidding
process and once after bidding id done. However, the probe process for
uart isn't completely idempotent (we change state of the uart
sometimes). The second call can result in odd behavior (though so far
only in buggy version of other code I've not committed). The bigger
problem is the softc: newbus creates it, we populate it, then frees it
when we don't return 0 to claim the device. It then calls us again, we
repopulate it, and this time it doesn't free it before calling attach.
Returning 0 avoids both of these issues. The justification for doing it
in the commit that changed it was 'while I'm here', so there doesn't
seem to be a use case for it.

Sponsored by: Netflix

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 59945
Build 56830: arc lint + arc unit