* pci: question about the life cycle of pci_dev and its parent pci_bus
@ 2012-08-23 5:24 Liu ping fan
2012-08-24 14:30 ` Jiang Liu
0 siblings, 1 reply; 3+ messages in thread
From: Liu ping fan @ 2012-08-23 5:24 UTC (permalink / raw)
To: linux-pci; +Cc: linux-kernel, Scott Murray, Bjorn Helgaas
Hi,
I have a question about the life cycle of pci_dev and its parent pci_bus.
In pci_destroy_dev(), we remove the pci_dev from the bus_list, so
pci_dev is isolated from its parent pci_bus, and their life cycle are
independent too. But it seems that in pci_dev, we can still access the
pci_bus from the pointer pci_dev->bus. To resolve such issue, I think
during the pci_dev removal, there should be process to 1.prevent the
reader incoming 2. ensure the current reader has exit. But can not
find them.
Could anyone tell me?
Thanx, pingfan
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: pci: question about the life cycle of pci_dev and its parent pci_bus
2012-08-23 5:24 pci: question about the life cycle of pci_dev and its parent pci_bus Liu ping fan
@ 2012-08-24 14:30 ` Jiang Liu
2012-08-27 1:54 ` Liu ping fan
0 siblings, 1 reply; 3+ messages in thread
From: Jiang Liu @ 2012-08-24 14:30 UTC (permalink / raw)
To: Liu ping fan; +Cc: linux-pci, linux-kernel, Scott Murray, Bjorn Helgaas
Hi Pingfan,
We have realized the same when implementing lock mechanisms for PCI hotplug
operations, and we are planning to holding a reference to parent bus for each pci dev.
Regards!
Gerry
On 08/23/2012 01:24 PM, Liu ping fan wrote:
> Hi,
>
> I have a question about the life cycle of pci_dev and its parent pci_bus.
> In pci_destroy_dev(), we remove the pci_dev from the bus_list, so
> pci_dev is isolated from its parent pci_bus, and their life cycle are
> independent too. But it seems that in pci_dev, we can still access the
> pci_bus from the pointer pci_dev->bus. To resolve such issue, I think
> during the pci_dev removal, there should be process to 1.prevent the
> reader incoming 2. ensure the current reader has exit. But can not
> find them.
>
> Could anyone tell me?
>
> Thanx, pingfan
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: pci: question about the life cycle of pci_dev and its parent pci_bus
2012-08-24 14:30 ` Jiang Liu
@ 2012-08-27 1:54 ` Liu ping fan
0 siblings, 0 replies; 3+ messages in thread
From: Liu ping fan @ 2012-08-27 1:54 UTC (permalink / raw)
To: Jiang Liu; +Cc: linux-pci, linux-kernel, Scott Murray, Bjorn Helgaas
On Fri, Aug 24, 2012 at 10:30 PM, Jiang Liu <liuj97@gmail.com> wrote:
> Hi Pingfan,
>
> We have realized the same when implementing lock mechanisms for PCI hotplug
> operations, and we are planning to holding a reference to parent bus for each pci dev.
Thanks! You save me from searching such codes.
Regards,
pingfan
> Regards!
> Gerry
>
> On 08/23/2012 01:24 PM, Liu ping fan wrote:
>> Hi,
>>
>> I have a question about the life cycle of pci_dev and its parent pci_bus.
>> In pci_destroy_dev(), we remove the pci_dev from the bus_list, so
>> pci_dev is isolated from its parent pci_bus, and their life cycle are
>> independent too. But it seems that in pci_dev, we can still access the
>> pci_bus from the pointer pci_dev->bus. To resolve such issue, I think
>> during the pci_dev removal, there should be process to 1.prevent the
>> reader incoming 2. ensure the current reader has exit. But can not
>> find them.
>>
>> Could anyone tell me?
>>
>> Thanx, pingfan
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>> Please read the FAQ at http://www.tux.org/lkml/
>>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-08-27 1:54 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-23 5:24 pci: question about the life cycle of pci_dev and its parent pci_bus Liu ping fan
2012-08-24 14:30 ` Jiang Liu
2012-08-27 1:54 ` Liu ping fan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).