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

Reply via email to