All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiang Liu <liuj97@gmail.com>
To: Liu ping fan <kernelfans@gmail.com>
Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
	Scott Murray <scott@spiteful.org>,
	Bjorn Helgaas <bhelgaas@google.com>
Subject: Re: pci: question about the life cycle of pci_dev and its parent pci_bus
Date: Fri, 24 Aug 2012 22:30:32 +0800	[thread overview]
Message-ID: <50379008.3080500@gmail.com> (raw)
In-Reply-To: <CAFgQCTt82Mu2mhVxeZ01=1bJzuzDWZjBEV58X9xjeEPQY3R8ww@mail.gmail.com>

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/
> 


  reply	other threads:[~2012-08-24 14:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2012-08-27  1:54   ` Liu ping fan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50379008.3080500@gmail.com \
    --to=liuj97@gmail.com \
    --cc=bhelgaas@google.com \
    --cc=kernelfans@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=scott@spiteful.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.