context.c (3a7651e683701dbb4c7d02e20661c923fa4c6901) context.c (0b3f9c757cabad4b8101c5fcddddd029ed5506a6)
1/*
2 * Copyright 2014 IBM Corp.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
8 */

--- 179 unchanged lines hidden (view full) ---

188
189 mutex_lock(&ctx->status_mutex);
190 status = ctx->status;
191 ctx->status = CLOSED;
192 mutex_unlock(&ctx->status_mutex);
193 if (status != STARTED)
194 return -EBUSY;
195
1/*
2 * Copyright 2014 IBM Corp.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
8 */

--- 179 unchanged lines hidden (view full) ---

188
189 mutex_lock(&ctx->status_mutex);
190 status = ctx->status;
191 ctx->status = CLOSED;
192 mutex_unlock(&ctx->status_mutex);
193 if (status != STARTED)
194 return -EBUSY;
195
196 WARN_ON(cxl_detach_process(ctx));
196 /* Only warn if we detached while the link was OK.
197 * If detach fails when hw is down, we don't care.
198 */
199 WARN_ON(cxl_detach_process(ctx) &&
200 cxl_adapter_link_ok(ctx->afu->adapter));
197 flush_work(&ctx->fault_work); /* Only needed for dedicated process */
198 put_pid(ctx->pid);
199 cxl_ctx_put();
200 return 0;
201}
202
203/*
204 * Detach the given context from the AFU. This doesn't actually

--- 63 unchanged lines hidden ---
201 flush_work(&ctx->fault_work); /* Only needed for dedicated process */
202 put_pid(ctx->pid);
203 cxl_ctx_put();
204 return 0;
205}
206
207/*
208 * Detach the given context from the AFU. This doesn't actually

--- 63 unchanged lines hidden ---