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
Unknown Object (File)
Mon, Jan 6, 4:23 AM
Unknown Object (File)
Thu, Dec 19, 1:30 AM
Unknown Object (File)
Tue, Dec 17, 10:13 PM
Unknown Object (File)
Nov 24 2024, 3:02 AM
Unknown Object (File)
Nov 23 2024, 1:04 PM
Unknown Object (File)
Nov 18 2024, 5:42 AM
Unknown Object (File)
Nov 13 2024, 7:44 AM
Unknown Object (File)
Nov 6 2024, 10:08 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 Not Applicable
Unit
Tests Not Applicable