Skip to content

Commit

Permalink
cxl: Define process problem state area at attach time only
Browse files Browse the repository at this point in the history
CXL kernel API was defining the process problem state area during
context initialization, making it possible to map the problem state
area before attaching the context. This won't work on a powerVM
guest. So force the logical behavior, like in userspace: attach first,
then map the problem state area.
Remove calls to cxl_assign_psn_space during init. The function is
already called on the attach paths.

Co-authored-by: Christophe Lombard <clombard@linux.vnet.ibm.com>
Signed-off-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com>
Signed-off-by: Christophe Lombard <clombard@linux.vnet.ibm.com>
Reviewed-by: Manoj Kumar <manoj@linux.vnet.ibm.com>
Acked-by: Ian Munsie <imunsie@au1.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
  • Loading branch information
2 people authored and Michael Ellerman committed Mar 9, 2016
1 parent d56d301 commit cca44c0
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions drivers/misc/cxl/api.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ struct cxl_context *cxl_dev_context_init(struct pci_dev *dev)
if (rc)
goto err_mapping;

cxl_assign_psn_space(ctx);

return ctx;

err_mapping:
Expand Down Expand Up @@ -207,7 +205,6 @@ EXPORT_SYMBOL_GPL(cxl_stop_context);
void cxl_set_master(struct cxl_context *ctx)
{
ctx->master = true;
cxl_assign_psn_space(ctx);
}
EXPORT_SYMBOL_GPL(cxl_set_master);

Expand Down Expand Up @@ -325,15 +322,11 @@ EXPORT_SYMBOL_GPL(cxl_start_work);

void __iomem *cxl_psa_map(struct cxl_context *ctx)
{
struct cxl_afu *afu = ctx->afu;
int rc;

rc = cxl_afu_check_and_enable(afu);
if (rc)
if (ctx->status != STARTED)
return NULL;

pr_devel("%s: psn_phys%llx size:%llx\n",
__func__, afu->psn_phys, afu->adapter->ps_size);
__func__, ctx->psn_phys, ctx->psn_size);
return ioremap(ctx->psn_phys, ctx->psn_size);
}
EXPORT_SYMBOL_GPL(cxl_psa_map);
Expand Down

0 comments on commit cca44c0

Please sign in to comment.