From: Frederic Barrat <fbarrat@linux.vnet.ibm.com>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
mpe@ellerman.id.au, linuxppc-dev@lists.ozlabs.org,
mikey@neuling.org, brking@linux.vnet.ibm.com,
clsoto@linux.vnet.ibm.com
Subject: Re: [PATCH v2] powerpc/powernv: Enable PCI peer-to-peer
Date: Wed, 12 Jul 2017 18:01:31 -0500 [thread overview]
Message-ID: <040bff3c-6afd-0e20-2d3c-d26716137eeb@linux.vnet.ibm.com> (raw)
In-Reply-To: <1499899179.2865.42.camel@kernel.crashing.org>
Le 12/07/2017 à 17:39, Benjamin Herrenschmidt a écrit :
> On Mon, 2017-06-26 at 20:08 +0200, Frederic Barrat wrote:
>> + if (desc & OPAL_PCI_P2P_ENABLE) {
>> + pe_init->p2p_initiator_count++;
>> + } else {
>> + if (pe_init->p2p_initiator_count > 0) {
>> + pe_init->p2p_initiator_count--;
>> + if (!pe_init->p2p_initiator_count)
>> + pnv_pci_ioda2_set_bypass(pe_init, true);
>> + }
>
> So you have the initiator refcounting in Linux and the target
> refcounting in OPAL ... any reason for that ?
The initiator refcount is per PE and skiboot doesn't track PEs. Also
when the initiator refcount falls back to 0, we should restore the
default bypass setting for the TVE, and that's more easily done from
linux, since it knows the start and end address of the memory. So for
those reasons, I don't really have the choice, the initiator refcount
seems better suited in linux.
The target refcount is per PHB and it just seemed easier to keep it in opal.
Does the lack of symmetry bother you?
Fred
next prev parent reply other threads:[~2017-07-12 23:01 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-26 18:08 [PATCH v2] powerpc/powernv: Enable PCI peer-to-peer Frederic Barrat
2017-06-27 12:32 ` David Laight
2017-06-27 18:52 ` Frederic Barrat
2017-07-12 22:39 ` Benjamin Herrenschmidt
2017-07-12 23:01 ` Frederic Barrat [this message]
2017-07-13 0:25 ` Benjamin Herrenschmidt
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=040bff3c-6afd-0e20-2d3c-d26716137eeb@linux.vnet.ibm.com \
--to=fbarrat@linux.vnet.ibm.com \
--cc=benh@kernel.crashing.org \
--cc=brking@linux.vnet.ibm.com \
--cc=clsoto@linux.vnet.ibm.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mikey@neuling.org \
--cc=mpe@ellerman.id.au \
/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 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).