Skip to contentSkip to conversation

Defining new section for bus driver init

DISCUSSION Dave Jones 2 participants 2 messages Jan 15, 2002

lore
Share & tools
lore

Dave Jones

author
#0 lore raw
Quoted 7 lines

Attached is a patch that creates a new section for device subsystem init calls. With it, the root bus init calls are handled just like init calls
- the section consists of a table of function pointers. device_driver_init() iterates over that table and calls each one. (device_driver_init() currently happens just before that pci_init() call above).
What do people think about the concept?

Well, it chops out a load of ugly ifdefs, and makes adding support for a new bus less intrusive than it currently is. I quite like it.

Quoted 3 lines

I will warn that the name is kinda clumsy, but it's the best that I could come up with (I wasted my creativity for the day on thinking about Penelope). I used "subsystem" because I have alterior motives.

I think you hit the nail on the head with the subject line. struct BusDriver also conjures up amusing[*] imagery.

One thing I'm wondering about though. Is it possible for a new bus to be added after boot ? Docking stations etc show up as children on the root PCI bus, so that shouldn't be an issue.

Ah! hotplug PCI USB controller ?

Dave.

[*] I'm easily amused.

Signature · 2 lines
Dave Jones.                    http://www.codemonkey.org.uk
SuSE Labs.
#1 lore raw
Quoted 5 lines
Quoted 2 lines

What do people think about the concept?

Well, it chops out a load of ugly ifdefs, and makes adding support for a new bus less intrusive than it currently is. I quite like it.

Cool. I'll change the other buses in init/main.c and post it.

Quoted 6 lines
Quoted 3 lines

I will warn that the name is kinda clumsy, but it's the best that I could come up with (I wasted my creativity for the day on thinking about Penelope). I used "subsystem" because I have alterior motives.

I think you hit the nail on the head with the subject line. struct BusDriver also conjures up amusing[*] imagery.

Yes, next I'll be adding a common set of routines for BusDrivers, including drive(), stop(), give_people_dirty_looks(), and swerve()...

Quoted 3 lines

One thing I'm wondering about though. Is it possible for a new bus to be added after boot ? Docking stations etc show up as children on the root PCI bus, so that shouldn't be an issue.

A new bus? Sure, the bus driver just has to probe behind it.

USB can do it. The PCI probe routines are all declared __devinit, so if you have hotplug support, you should be able to do it in theory. Greg?

Quoted 1 line

Ah! hotplug PCI USB controller ?

Cardbus, Hotplug PCI, docking stations..

-pat