All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gavin Shan <gwshan@linux.vnet.ibm.com>
To: Benjamin Herrenschmidt <benh@au1.ibm.com>
Cc: aik@au1.ibm.com, Wei Yang <weiyang@linux.vnet.ibm.com>,
	linuxppc-dev@lists.ozlabs.org,
	Gavin Shan <gwshan@linux.vnet.ibm.com>
Subject: Re: [PATCH 1/2] powerpc/powernv: clear the refcount for pci_dev on powernv platform
Date: Wed, 23 Apr 2014 09:00:33 +1000	[thread overview]
Message-ID: <20140422230033.GA12208@shangw> (raw)
In-Reply-To: <1398155109.19682.89.camel@pasglop>

On Tue, Apr 22, 2014 at 06:25:09PM +1000, Benjamin Herrenschmidt wrote:
>On Tue, 2014-04-22 at 15:44 +0800, Wei Yang wrote:
>> So this patch(the 2nd one) doesn't contribute to clear the warning and
>> error.
>> Only the first patch did it. Please ignore this one.
>
>But is it correct ? It's not right to keep a refcount elevated if we
>don't have to.
>
>Gavin, can you get to the bottom of that refcount business ?
>

Ben, "struct pci_dn::pcidev" was used by EEH originally. We don't
use it any more. So it can be removed.

Currently, EEH has following 4 functions to do conversion from
one to another. None of them relies on "struct pci_dn::pcidev".

of_node_to_eeh_dev()	device_node -> pci_dn -> eeh_dev
pci_dev_to_eeh_dev()    pci_dev     -> device -> archdata -> eeh_dev
eeh_dev_to_of_node()    eeh_dev     -> device_node
eeh_dev_to_pci_dev()    eeh_dev     -> pci_dev

The side effect of holding pci_dev refcount is the pci_dev, eeh_dev,
eeh_pe instance can't be free'ed during fully hotplug though EEH can
survive. It's reasonable to remove it.

Thanks,
Gavin

  parent reply	other threads:[~2014-04-22 23:00 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-21  2:25 [PATCH 1/2] powerpc/powernv: clear the refcount for pci_dev on powernv platform Wei Yang
2014-04-21  2:25 ` [PATCH 2/2] powerpc/powernc: revert part of commit d905c5df(PPC: POWERNV: move iommu_add_device earlier) Wei Yang
2014-04-21  3:37   ` Benjamin Herrenschmidt
2014-04-21  5:22     ` Wei Yang
2014-04-21  6:11       ` Wei Yang
2014-04-21  3:35 ` [PATCH 1/2] powerpc/powernv: clear the refcount for pci_dev on powernv platform Benjamin Herrenschmidt
2014-04-21  6:03   ` Wei Yang
2014-04-21 23:34 ` Gavin Shan
2014-04-22  7:44   ` Wei Yang
2014-04-22  8:25     ` Benjamin Herrenschmidt
2014-04-22  9:44       ` Wei Yang
2014-04-22 23:00       ` Gavin Shan [this message]
2014-04-23  0:26         ` Benjamin Herrenschmidt
2014-04-23  1:56           ` Wei Yang

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=20140422230033.GA12208@shangw \
    --to=gwshan@linux.vnet.ibm.com \
    --cc=aik@au1.ibm.com \
    --cc=benh@au1.ibm.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=weiyang@linux.vnet.ibm.com \
    /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.