lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090319174215.GB26248@kroah.com>
Date:	Thu, 19 Mar 2009 10:42:15 -0700
From:	Greg KH <greg@...ah.com>
To:	Alex Chiang <achiang@...com>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	jbarnes@...tuousgeek.org, linux-pci@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 06/12] PCI: Introduce pci_rescan_bus()

On Thu, Mar 19, 2009 at 11:05:48AM -0600, Alex Chiang wrote:
> * Andrew Morton <akpm@...ux-foundation.org>:
> > On Wed, 18 Mar 2009 16:39:56 -0600 Alex Chiang <achiang@...com> wrote:
> > 
> > > This API is used by the PCI core to rescan a bus and rediscover
> > > newly added devices.
> > > 
> > > Over time, it is expected that the various PCI hotplug drivers
> > > will migrate to this interface and away from the old
> > > pci_do_scan_bus() interface.
> > > 
> > > ...
> > >
> > > @@ -1195,10 +1195,39 @@ struct pci_bus * __devinit pci_scan_bus_parented(struct device *parent,
> > >  EXPORT_SYMBOL(pci_scan_bus_parented);
> > >  
> > >  #ifdef CONFIG_HOTPLUG
> > > +/**
> > > + * pci_rescan_bus - scan a PCI bus for devices.
> > > + * @bus: PCI bus to scan
> > > + *
> > > + * Scan a PCI bus and child buses for new devices, adds them,
> > > + * and enables them.
> > > + *
> > > + * Returns the max number of subordinate bus discovered.
> > > + */
> > > +unsigned int __devinit pci_rescan_bus(struct pci_bus *bus)
> > > +{
> > > +	unsigned int max;
> > > +	struct pci_dev *dev;
> > > +
> > > +	max = pci_scan_child_bus(bus);
> > > +	list_for_each_entry(dev, &bus->devices, bus_list)
> > > +		if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE ||
> > > +		    dev->hdr_type == PCI_HEADER_TYPE_CARDBUS)
> > > +			if (dev->subordinate)
> > > +				pci_bus_size_bridges(dev->subordinate);
> > > +
> > > +	pci_bus_assign_resources(bus);
> > > +	pci_enable_bridges(bus);
> > > +	pci_bus_add_devices(bus);
> > > +
> > > +	return max;
> > > +}
> > > +
> > >  EXPORT_SYMBOL(pci_add_new_bus);
> > >  EXPORT_SYMBOL(pci_scan_slot);
> > >  EXPORT_SYMBOL(pci_scan_bridge);
> > >  EXPORT_SYMBOL_GPL(pci_scan_child_bus);
> > > +EXPORT_SYMBOL_GPL(pci_rescan_bus);
> > 
> > uhm, is there any rationale for the seemingly-random mixup of export types
> > in this interface?
> 
> History?
> 
> I've no clue why we're mixing EXPORT_SYMBOL and EXPORT_SYMBOL_GPL.

I do :)

New PCI core exports were added with _GPL, it's the older ones that were
left at the "normal" level.

> git-blame says that the mishmash existed pre-git.
> 
> For my new interface, I thought that EXPORT_SYMBOL_GPL would be
> most appropriate, but maybe not?

Yes it is, pci hotplug exports has always been EXPORT_SYMBOL_GPL(), in
fact I think it was the first in-tree user of this marking.

> What would you like me to do? Make them all the same?

New ones should be _GPL() please.

But please put the export in the proper place, checkpatch.pl will
complain if you do not.  Which means you didn't run it on your patches
:)

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ