]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blobdiff - drivers/misc/cxl/context.c
cxl: Drop commands if the PCI channel is not in normal state
[mirror_ubuntu-zesty-kernel.git] / drivers / misc / cxl / context.c
index 1287148629c0d6f0b6e6066d4c883d8dfaebf9da..615842115848fe7bddfe1c9a5320d8d3b879cbb2 100644 (file)
@@ -193,7 +193,11 @@ int __detach_context(struct cxl_context *ctx)
        if (status != STARTED)
                return -EBUSY;
 
-       WARN_ON(cxl_detach_process(ctx));
+       /* Only warn if we detached while the link was OK.
+        * If detach fails when hw is down, we don't care.
+        */
+       WARN_ON(cxl_detach_process(ctx) &&
+               cxl_adapter_link_ok(ctx->afu->adapter));
        flush_work(&ctx->fault_work); /* Only needed for dedicated process */
        put_pid(ctx->pid);
        cxl_ctx_put();