Skip to contentSkip to conversation

pci_bus_lock question

DISCUSSION John Rose 2 participants 5 messages Jul 22, 2004 – Jul 24, 2004

lore
Share & tools
lore

John Rose

author
#0 lore raw

Is the intended purpose of pci_bus_lock to synchronize access to _just_ the global list of pci devices, or also to the pci_root_buses list?

If it is intended to protect the latter, I see many unfortunate places where it's not being used :)

Thanks-
John

author
#1 lore raw

But then, most of these violations are in __init functions. I think I just answered my own question :)

Thanks-
John

Quoted 8 lines · John Rose

Is the intended purpose of pci_bus_lock to synchronize access to _just_ the global list of pci devices, or also to the pci_root_buses list?

If it is intended to protect the latter, I see many unfortunate places where it's not being used :)

Thanks-
John

#2 lore raw
Quoted 2 lines · John Rose

But then, most of these violations are in __init functions. I think I just answered my own question :)

Yes, we don't protect the lists in those __init functions, as it isn't needed at that point in time.

thanks,

greg k-h

author
#3 lore raw

I need to remove a bus from the pci_root_buses() list, and I need to do so from a module. Would it be preferable to export the pci_bus_lock symbol or create wrappers in the PCI core that safely add/remove buses to/from this list?

I'm guessing the latter :)

Thanks-
John

Quoted 11 lines · Greg KH
Quoted 2 lines · John Rose

But then, most of these violations are in __init functions. I think I just answered my own question :)

Yes, we don't protect the lists in those __init functions, as it isn't needed at that point in time.

thanks,

greg k-h

#4 lore raw
Quoted 6 lines · John Rose

I need to remove a bus from the pci_root_buses() list, and I need to do so from a module. Would it be preferable to export the pci_bus_lock symbol or create wrappers in the PCI core that safely add/remove buses to/from this list?

I'm guessing the latter :)

Good guess :)

greg k-h