mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-31 08:25:38 +00:00
dde_linux: iterate over PCI devices in ascending BDF order
On a Lenovo ThinkCentre M57p, the system locks up when the UHCI controller BIOS handoff (disabling bit 4 in the LEGSUP register) for the controller with PCI BDF 00:1d:2 is attempted before the handoff for the controller with BDF 00:1a:0. Fixes #3138
This commit is contained in:
parent
e9e048c4ea
commit
369d60bc21
@ -71,7 +71,15 @@ class Pci_dev_list
|
|||||||
*/
|
*/
|
||||||
while (cap.valid()) {
|
while (cap.valid()) {
|
||||||
|
|
||||||
_pci_caps.insert(new (Lx::Malloc::mem()) Element(cap));
|
/*
|
||||||
|
* Keep PCI devices in natural bus order. Otherwise on a Lenovo
|
||||||
|
* ThinkCentre M57p, the system locks up when the UHCI
|
||||||
|
* controller BIOS handoff (disabling bit 4 in the LEGSUP
|
||||||
|
* register) for the controller with PCI BDF 00:1d:2 is
|
||||||
|
* attempted before the handoff for the controller with BDF
|
||||||
|
* 00:1a:0.
|
||||||
|
*/
|
||||||
|
_pci_caps.append(new (Lx::Malloc::mem()) Element(cap));
|
||||||
|
|
||||||
/* try next one. Upgrade session quota on demand.*/
|
/* try next one. Upgrade session quota on demand.*/
|
||||||
Lx::pci()->with_upgrade([&] () {
|
Lx::pci()->with_upgrade([&] () {
|
||||||
|
@ -45,7 +45,14 @@ class Lx::Pci_dev_registry
|
|||||||
|
|
||||||
void insert(Pci_dev *pci_dev)
|
void insert(Pci_dev *pci_dev)
|
||||||
{
|
{
|
||||||
_devs.insert(pci_dev);
|
/*
|
||||||
|
* Keep PCI devices in natural bus order. Otherwise on a Lenovo
|
||||||
|
* ThinkCentre M57p, the system locks up when the UHCI controller
|
||||||
|
* BIOS handoff (disabling bit 4 in the LEGSUP register) for the
|
||||||
|
* controller with PCI BDF 00:1d:2 is attempted before the handoff
|
||||||
|
* for the controller with BDF 00:1a:0.
|
||||||
|
*/
|
||||||
|
_devs.append(pci_dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
void remove(Pci_dev *pci_dev)
|
void remove(Pci_dev *pci_dev)
|
||||||
|
@ -69,7 +69,15 @@ class Pci_dev_list
|
|||||||
*/
|
*/
|
||||||
while (cap.valid()) {
|
while (cap.valid()) {
|
||||||
|
|
||||||
_pci_caps.insert(new (Lx::Malloc::mem()) Element(cap));
|
/*
|
||||||
|
* Keep PCI devices in natural bus order. Otherwise on a Lenovo
|
||||||
|
* ThinkCentre M57p, the system locks up when the UHCI
|
||||||
|
* controller BIOS handoff (disabling bit 4 in the LEGSUP
|
||||||
|
* register) for the controller with PCI BDF 00:1d:2 is
|
||||||
|
* attempted before the handoff for the controller with BDF
|
||||||
|
* 00:1a:0.
|
||||||
|
*/
|
||||||
|
_pci_caps.append(new (Lx::Malloc::mem()) Element(cap));
|
||||||
|
|
||||||
/* try next one. Upgrade session quota on demand.*/
|
/* try next one. Upgrade session quota on demand.*/
|
||||||
Lx::pci()->with_upgrade([&] () {
|
Lx::pci()->with_upgrade([&] () {
|
||||||
@ -105,7 +113,7 @@ extern "C" int pci_register_driver(struct pci_driver *driver)
|
|||||||
|
|
||||||
bool found = false;
|
bool found = false;
|
||||||
|
|
||||||
auto lamda = [&] (Platform::Device_capability cap) {
|
auto lambda = [&] (Platform::Device_capability cap) {
|
||||||
|
|
||||||
Platform::Device_client client(cap);
|
Platform::Device_client client(cap);
|
||||||
|
|
||||||
@ -164,7 +172,7 @@ extern "C" int pci_register_driver(struct pci_driver *driver)
|
|||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
pci_dev_list()->for_each_pci_device(lamda);
|
pci_dev_list()->for_each_pci_device(lambda);
|
||||||
|
|
||||||
return found ? 0 : -ENODEV;
|
return found ? 0 : -ENODEV;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user