Merge remote-tracking branches 'regmap/fix/header' and 'regmap/fix/macro' into regmap...
[cascardo/linux.git] / drivers / misc / cxl / pci.c
index 6f0c4ac..e96be9c 100644 (file)
@@ -1239,6 +1239,9 @@ int cxl_pci_reset(struct cxl *adapter)
 
        dev_info(&dev->dev, "CXL reset\n");
 
+       /* the adapter is about to be reset, so ignore errors */
+       cxl_data_cache_flush(adapter);
+
        /* pcie_warm_reset requests a fundamental pci reset which includes a
         * PERST assert/deassert.  PERST triggers a loading of the image
         * if "user" or "factory" is selected in sysfs */
@@ -1484,6 +1487,8 @@ static int cxl_configure_adapter(struct cxl *adapter, struct pci_dev *dev)
        if ((rc = cxl_native_register_psl_err_irq(adapter)))
                goto err;
 
+       /* Release the context lock as adapter is configured */
+       cxl_adapter_context_unlock(adapter);
        return 0;
 
 err:
@@ -1530,11 +1535,11 @@ static void set_sl_ops(struct cxl *adapter, struct pci_dev *dev)
 {
        if (dev->vendor == PCI_VENDOR_ID_MELLANOX && dev->device == 0x1013) {
                /* Mellanox CX-4 */
-               dev_info(&adapter->dev, "Device uses an XSL\n");
+               dev_info(&dev->dev, "Device uses an XSL\n");
                adapter->native->sl_ops = &xsl_ops;
                adapter->min_pe = 1; /* Workaround for CX-4 hardware bug */
        } else {
-               dev_info(&adapter->dev, "Device uses a PSL\n");
+               dev_info(&dev->dev, "Device uses a PSL\n");
                adapter->native->sl_ops = &psl_ops;
        }
 }