Skip to content

Commit 401dca8

Browse files
philippe56mpe
authored andcommitted
cxl: Set the PBCQ Tunnel BAR register when enabling capi mode
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(). That should work with old skiboot (since we are re-writing the value already set) and new skiboot. mpe: The tunnel support was only merged into Linux recently, in commit d6a90bb ("powerpc/powernv: Enable tunneled operations") (v4.17-rc1), so with new skiboot kernels between that commit and this will not work correctly. Fixes: d6a90bb ("powerpc/powernv: Enable tunneled operations") Signed-off-by: Philippe Bergheaud <felix@linux.ibm.com> Reviewed-by: Christophe Lombard <clombard@linux.vnet.ibm.com> Acked-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
1 parent 6c0a8f6 commit 401dca8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/misc/cxl/pci.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1742,6 +1742,10 @@ static int cxl_configure_adapter(struct cxl *adapter, struct pci_dev *dev)
17421742
/* Required for devices using CAPP DMA mode, harmless for others */
17431743
pci_set_master(dev);
17441744

1745+
if (cxl_is_power9())
1746+
if (pnv_pci_set_tunnel_bar(dev, 0x00020000E0000000ull, 1))
1747+
dev_info(&dev->dev, "Tunneled operations unsupported\n");
1748+
17451749
if ((rc = pnv_phb_to_cxl_mode(dev, adapter->native->sl_ops->capi_mode)))
17461750
goto err;
17471751

@@ -1768,6 +1772,9 @@ static void cxl_deconfigure_adapter(struct cxl *adapter)
17681772
{
17691773
struct pci_dev *pdev = to_pci_dev(adapter->dev.parent);
17701774

1775+
if (cxl_is_power9())
1776+
pnv_pci_set_tunnel_bar(pdev, 0x00020000E0000000ull, 0);
1777+
17711778
cxl_native_release_psl_err_irq(adapter);
17721779
cxl_unmap_adapter_regs(adapter);
17731780

0 commit comments

Comments
 (0)