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

Improve DtIo->Lookup and DtDeviceCreate #85

Open
andreiw opened this issue Feb 16, 2024 · 0 comments
Open

Improve DtIo->Lookup and DtDeviceCreate #85

andreiw opened this issue Feb 16, 2024 · 0 comments

Comments

@andreiw
Copy link
Contributor

andreiw commented Feb 16, 2024

DtIoLookup first translates the ASCII DT path to an EFI_DEVICE_PATH_PROTOCOL, then uses DtPathToHandle to lookup/connect the handle. DtPathToHandle uses LocateDevicePath.

Glancing at LocateDevicePath, this seems rather suboptimal, as it can iterate over potentially quite a lot of handles (esp. if LocateDevicePath is successively called as controllers are connected).

Another issue is that LocateDevicePath has no notion of "fuzzy" matching, e.g. when we want /soc/pci to match /soc/pci@3000000 (dropping the unit address in unambiguous situations).

This should be fixed by directly traversing the ASCII DT path. DT_DEVICE has a Parent already, and could be made to keep a linked list of children as well.

The other place DtPathToHandle is used is inside DtDeviceCreate, to avoid creating duplicates. Again, if a DtDevice knows what children it has, this problem becomes much cheaper to solve.

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

No branches or pull requests

1 participant