public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* struct pci_bus, no release() function?
@ 2004-08-02 20:15 John Rose
  2004-08-09  6:45 ` [Pcihpd-discuss] " Greg KH
  0 siblings, 1 reply; 4+ messages in thread
From: John Rose @ 2004-08-02 20:15 UTC (permalink / raw)
  To: Greg KH; +Cc: lkml, Hotplug List

At probe time, pci_scan_bus_parented() allocates and registers a struct
device for each PCI bus it scans.  This generic device structure never
gets assigned a "release" function.  

Attempts to unregister such a PCI Bus at runtime result in a kernel
message like:
Device 'pci0001:00' does not have a release() function, it is broken and
must be fixed.

Are architectures free to assign their own release function for
"devices" associated with struct pci_bus?  If so, does this have to
happen at boot, or can it happen right before the remove?

Thanks-
John


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Pcihpd-discuss] struct pci_bus, no release() function?
  2004-08-02 20:15 struct pci_bus, no release() function? John Rose
@ 2004-08-09  6:45 ` Greg KH
  2004-08-09 16:34   ` John Rose
  0 siblings, 1 reply; 4+ messages in thread
From: Greg KH @ 2004-08-09  6:45 UTC (permalink / raw)
  To: John Rose; +Cc: lkml, Hotplug List

On Mon, Aug 02, 2004 at 03:15:28PM -0500, John Rose wrote:
> At probe time, pci_scan_bus_parented() allocates and registers a struct
> device for each PCI bus it scans.  This generic device structure never
> gets assigned a "release" function.  
> 
> Attempts to unregister such a PCI Bus at runtime result in a kernel
> message like:
> Device 'pci0001:00' does not have a release() function, it is broken and
> must be fixed.

You're right, that should be fixed.  Care to send a patch?  Should just
be a 1 line change.  You can tell no one else has tried to remove a root
bus device before...

> Are architectures free to assign their own release function for
> "devices" associated with struct pci_bus?

Why would they want to?  It should just be set to pci_release_dev, like
all other struct pci_dev devices are, right?

> If so, does this have to happen at boot, or can it happen right before
> the remove?

Heh, you can't assign a release function after it is needed :)

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Pcihpd-discuss] struct pci_bus, no release() function?
  2004-08-09  6:45 ` [Pcihpd-discuss] " Greg KH
@ 2004-08-09 16:34   ` John Rose
  2004-08-10 16:30     ` Greg KH
  0 siblings, 1 reply; 4+ messages in thread
From: John Rose @ 2004-08-09 16:34 UTC (permalink / raw)
  To: Greg KH; +Cc: lkml, Hotplug List

On Mon, 2004-08-09 at 01:45, Greg KH wrote:
> On Mon, Aug 02, 2004 at 03:15:28PM -0500, John Rose wrote:
> > At probe time, pci_scan_bus_parented() allocates and registers a struct
> > device for each PCI bus it scans.  This generic device structure never
> > gets assigned a "release" function.  
> > 
> > Attempts to unregister such a PCI Bus at runtime result in a kernel
> > message like:
> > Device 'pci0001:00' does not have a release() function, it is broken and
> > must be fixed.
> 
> You're right, that should be fixed.  Care to send a patch?  Should just
> be a 1 line change.  You can tell no one else has tried to remove a root
> bus device before...
> 
> > Are architectures free to assign their own release function for
> > "devices" associated with struct pci_bus?
> 
> Why would they want to?  It should just be set to pci_release_dev, like
> all other struct pci_dev devices are, right?

Root buses don't have an associated pci_dev struct, so this function
won't do.  Is that specific to ppc64?  Regardless, seems like we need a
special release func for this case.

Thanks-
John


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Pcihpd-discuss] struct pci_bus, no release() function?
  2004-08-09 16:34   ` John Rose
@ 2004-08-10 16:30     ` Greg KH
  0 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2004-08-10 16:30 UTC (permalink / raw)
  To: John Rose; +Cc: lkml, Hotplug List

On Mon, Aug 09, 2004 at 11:34:46AM -0500, John Rose wrote:
> On Mon, 2004-08-09 at 01:45, Greg KH wrote:
> > On Mon, Aug 02, 2004 at 03:15:28PM -0500, John Rose wrote:
> > > At probe time, pci_scan_bus_parented() allocates and registers a struct
> > > device for each PCI bus it scans.  This generic device structure never
> > > gets assigned a "release" function.  
> > > 
> > > Attempts to unregister such a PCI Bus at runtime result in a kernel
> > > message like:
> > > Device 'pci0001:00' does not have a release() function, it is broken and
> > > must be fixed.
> > 
> > You're right, that should be fixed.  Care to send a patch?  Should just
> > be a 1 line change.  You can tell no one else has tried to remove a root
> > bus device before...
> > 
> > > Are architectures free to assign their own release function for
> > > "devices" associated with struct pci_bus?
> > 
> > Why would they want to?  It should just be set to pci_release_dev, like
> > all other struct pci_dev devices are, right?
> 
> Root buses don't have an associated pci_dev struct, so this function
> won't do.

Ah, good point.  We should probably fix that up and make it a struct
pci_dev.  Or just make a release function for the struct device we
create.  Either way is fine for me.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-08-10 18:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-02 20:15 struct pci_bus, no release() function? John Rose
2004-08-09  6:45 ` [Pcihpd-discuss] " Greg KH
2004-08-09 16:34   ` John Rose
2004-08-10 16:30     ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox