All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] cxl: Set the PBCQ Tunnel BAR register when enabling capi mode
@ 2018-04-13 11:59 Philippe Bergheaud
  2018-04-16 12:02 ` christophe lombard
  0 siblings, 1 reply; 2+ messages in thread
From: Philippe Bergheaud @ 2018-04-13 11:59 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: fbarrat, clombard, benh, Philippe Bergheaud

Skiboot used to set the default Tunnel BAR register value when capi mode
was enabled. This approach was ok for the cxl driver, but prevented other
drivers from choosing different values.

Skiboot versions > 5.11 will not set the default value any longer. This
patch modifies the cxl driver to set/reset the Tunnel BAR register when
entering/exiting the cxl mode, with pnv_pci_set_tunnel_bar().

Signed-off-by: Philippe Bergheaud <felix@linux.ibm.com>
---
Changelog:

v2: Restrict tunnel bar setting to power9.
    Do not fail cxl_configure_adapter() on tunnel bar setting error.
    Log an info message instead, and continue configuring capi mode.
---
 drivers/misc/cxl/pci.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/misc/cxl/pci.c b/drivers/misc/cxl/pci.c
index 83f1d08058fc..355c789406f7 100644
--- a/drivers/misc/cxl/pci.c
+++ b/drivers/misc/cxl/pci.c
@@ -1742,6 +1742,10 @@ static int cxl_configure_adapter(struct cxl *adapter, struct pci_dev *dev)
 	/* Required for devices using CAPP DMA mode, harmless for others */
 	pci_set_master(dev);
 
+	if (cxl_is_power9())
+		if (pnv_pci_set_tunnel_bar(dev, 0x00020000E0000000ull, 1))
+			dev_info(&dev->dev, "Tunneled operations unsupported\n");
+
 	if ((rc = pnv_phb_to_cxl_mode(dev, adapter->native->sl_ops->capi_mode)))
 		goto err;
 
@@ -1768,6 +1772,8 @@ static void cxl_deconfigure_adapter(struct cxl *adapter)
 {
 	struct pci_dev *pdev = to_pci_dev(adapter->dev.parent);
 
+	if (cxl_is_power9())
+		pnv_pci_set_tunnel_bar(pdev, 0x00020000E0000000ull, 0);
 	cxl_native_release_psl_err_irq(adapter);
 	cxl_unmap_adapter_regs(adapter);
 
-- 
2.16.2

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] cxl: Set the PBCQ Tunnel BAR register when enabling capi mode
  2018-04-13 11:59 [PATCH v2] cxl: Set the PBCQ Tunnel BAR register when enabling capi mode Philippe Bergheaud
@ 2018-04-16 12:02 ` christophe lombard
  0 siblings, 0 replies; 2+ messages in thread
From: christophe lombard @ 2018-04-16 12:02 UTC (permalink / raw)
  To: Philippe Bergheaud, linuxppc-dev; +Cc: fbarrat, clombard, benh

Le 13/04/2018 à 13:59, Philippe Bergheaud a écrit :
> Skiboot used to set the default Tunnel BAR register value when capi mode
> was enabled. This approach was ok for the cxl driver, but prevented other
> drivers from choosing different values.
> 
> Skiboot versions > 5.11 will not set the default value any longer. This
> patch modifies the cxl driver to set/reset the Tunnel BAR register when
> entering/exiting the cxl mode, with pnv_pci_set_tunnel_bar().
> 
> Signed-off-by: Philippe Bergheaud <felix@linux.ibm.com>
> ---

Thanks

Reviewed-by: Christophe Lombard <clombard@linux.vnet.ibm.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-04-16 12:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-13 11:59 [PATCH v2] cxl: Set the PBCQ Tunnel BAR register when enabling capi mode Philippe Bergheaud
2018-04-16 12:02 ` christophe lombard

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.