There are some common PCI infos like domain, msi_controller, these
infos are saved in arch PCI sysdata, and lots arch specific functions
like pci_domain_nr() and pcibios_msi_controller() required.
We could separate pci_host_bridge creation out of pci_create_root_bus(),
then we could put the common
On Monday 17 November 2014 18:21:41 Yijing Wang wrote:
> There are some common PCI infos like domain, msi_controller, these
> infos are saved in arch PCI sysdata, and lots arch specific functions
> like pci_domain_nr() and pcibios_msi_controller() required.
> We could separate pci_host_bridge creat
>> +LIST_HEAD(pci_host_bridge_list);
>> +DECLARE_RWSEM(pci_host_bridge_sem);
>
> Unless the pci_host_bridge_sem is accessed thousands of times per second,
> it's normally better to use a simple mutex instead.
OK, I will use simple mutex instead.
>
>> +static struct resource busn_resource = {
>
On Tuesday 18 November 2014 16:32:26 Yijing Wang wrote:
> >> +static struct resource busn_resource = {
> >> + .name = "PCI busn",
> >> + .start = 0,
> >> + .end= 255,
> >> + .flags = IORESOURCE_BUS,
> >> +};
> >
> > I think it would be better to require callers to pass the bus resourc
On 2014/11/18 17:30, Arnd Bergmann wrote:
> On Tuesday 18 November 2014 16:32:26 Yijing Wang wrote:
>
+static struct resource busn_resource = {
+ .name = "PCI busn",
+ .start = 0,
+ .end= 255,
+ .flags = IORESOURCE_BUS,
+};
>>>
>>> I think it would be bett
On Tuesday 18 November 2014 19:44:36 Yijing Wang wrote:
> On 2014/11/18 17:30, Arnd Bergmann wrote:
> > On Tuesday 18 November 2014 16:32:26 Yijing Wang wrote:
> >
> +static struct resource busn_resource = {
> +.name = "PCI busn",
> +.start = 0,
> +.e
We need, some platforms pass NULL pointer as host bridge parent.
>>>
>>> But those don't have to use the new pci_create_host_bridge() function,
>>> right?
>>
>> As I mentioned in another reply, I hope all pci host drivers could use
>> pci_create_host_bridge(), keep different PCI scan interface
On Tue, Nov 18, 2014 at 08:32:26AM +, Yijing Wang wrote:
>
> >> +LIST_HEAD(pci_host_bridge_list);
> >> +DECLARE_RWSEM(pci_host_bridge_sem);
> >
> > Unless the pci_host_bridge_sem is accessed thousands of times per second,
> > it's normally better to use a simple mutex instead.
>
> OK, I will
On Mon, Nov 17, 2014 at 10:21:41AM +, Yijing Wang wrote:
> There are some common PCI infos like domain, msi_controller, these
> infos are saved in arch PCI sysdata, and lots arch specific functions
> like pci_domain_nr() and pcibios_msi_controller() required.
> We could separate pci_host_bridge
On 2014/11/18 23:30, Liviu Dudau wrote:
> On Mon, Nov 17, 2014 at 10:21:41AM +, Yijing Wang wrote:
>> There are some common PCI infos like domain, msi_controller, these
>> infos are saved in arch PCI sysdata, and lots arch specific functions
>> like pci_domain_nr() and pcibios_msi_controller()
>> We need, some platforms pass NULL pointer as host bridge parent.
>
> Yijing,
>
> May I suggest a different approach here? Rather than having to pass an opaque
> pointer that gets converted by the host bridge driver back to the private
> structure, what about promoting a new style of usage, tha
On Wed, Nov 19, 2014 at 10:24:52AM +0800, Yijing Wang wrote:
> >> We need, some platforms pass NULL pointer as host bridge parent.
> >
> > Yijing,
> >
> > May I suggest a different approach here? Rather than having to pass an
> > opaque
> > pointer that gets converted by the host bridge driver b
On Wed, Nov 19, 2014 at 01:42:52AM +, Yijing Wang wrote:
> On 2014/11/18 23:30, Liviu Dudau wrote:
> > On Mon, Nov 17, 2014 at 10:21:41AM +, Yijing Wang wrote:
> >> There are some common PCI infos like domain, msi_controller, these
> >> infos are saved in arch PCI sysdata, and lots arch spe
>>> Something like this:
>>>
>>> struct pci_controller {
>>> struct pci_host_bridge bridge;
>>> /* private host bridge data here */
>>> .
>>> };
>>>
>>> #define PCI_CONTROLLER(bus) ({
>>> struct pci_host_bridge *hb = to_pci_host_bridge(bus->bridge); \
>>> container_of(hb, st
+static void pci_release_host_bridge_dev(struct device *dev)
+{
+ struct pci_host_bridge *bridge = to_pci_host_bridge(dev);
+
+ if (bridge->release_fn)
+ bridge->release_fn(bridge);
+ pci_free_resource_list(&bridge->windows);
+
On Thu, Nov 20, 2014 at 02:47:35AM +, Yijing Wang wrote:
> +static void pci_release_host_bridge_dev(struct device *dev)
> +{
> + struct pci_host_bridge *bridge = to_pci_host_bridge(dev);
> +
> + if (bridge->release_fn)
> + bridge->release_
>>> pci_create_host_bridge() can get pci_host_bridge ops while
>>> pci_create_root_bus() gets
>>> the bus ops. For find out the MSI controller, the domain number and any
>>> other HB
>>> specific stuff, you use the HB ops. For config R/W acceses you use bus ops.
>>>
>>
>> I want to unexport pci_c
On Fri, Nov 21, 2014 at 02:53:01AM +, Yijing Wang wrote:
> >>> pci_create_host_bridge() can get pci_host_bridge ops while
> >>> pci_create_root_bus() gets
> >>> the bus ops. For find out the MSI controller, the domain number and any
> >>> other HB
> >>> specific stuff, you use the HB ops. For
18 matches
Mail list logo