summaryrefslogtreecommitdiff
path: root/drivers/cxl
diff options
context:
space:
mode:
authorAlison Schofield <alison.schofield@intel.com>2022-03-31 04:27:12 +0300
committerDan Williams <dan.j.williams@intel.com>2022-04-13 02:07:00 +0300
commit39ed8da4f341c8dbe9c15f716d3a328269a07fc7 (patch)
tree1d88ebe4411629e794f00757a32f762402d9520d /drivers/cxl
parent6dd0e5cc87b33aee9cfe4d485c4d8b8382701558 (diff)
downloadlinux-39ed8da4f341c8dbe9c15f716d3a328269a07fc7.tar.xz
cxl/mbox: Move raw command warning to raw command validation
This move serves two purposes: 1) Emit the warning in the raw command validation path, and 2) Remove the dependency on the struct cxl_mem_command in handle_mailbox_cmd_from_user() in preparation for a refactor of that function. Signed-off-by: Alison Schofield <alison.schofield@intel.com> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Dan Williams <dan.j.williams@intel.com> Link: https://lore.kernel.org/r/df5f0e0ec8afa1f75299aa86b4226ab4479ef325.1648687552.git.alison.schofield@intel.com Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/cxl')
-rw-r--r--drivers/cxl/core/mbox.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/cxl/core/mbox.c b/drivers/cxl/core/mbox.c
index 1f2175f0f687..39c8f6ded175 100644
--- a/drivers/cxl/core/mbox.c
+++ b/drivers/cxl/core/mbox.c
@@ -225,6 +225,8 @@ static int cxl_to_mem_cmd_raw(struct cxl_mem_command *mem_cmd,
if (!cxl_mem_raw_command_allowed(send_cmd->raw.opcode))
return -EPERM;
+ dev_WARN_ONCE(cxlds->dev, true, "raw command path used\n");
+
*mem_cmd = (struct cxl_mem_command) {
.info = {
.id = CXL_MEM_COMMAND_ID_RAW,
@@ -417,9 +419,6 @@ static int handle_mailbox_cmd_from_user(struct cxl_dev_state *cxlds,
cxl_command_names[cmd->info.id].name, mbox_cmd.opcode,
cmd->info.size_in);
- dev_WARN_ONCE(dev, cmd->info.id == CXL_MEM_COMMAND_ID_RAW,
- "raw command path used\n");
-
rc = cxlds->mbox_send(cxlds, &mbox_cmd);
if (rc)
goto out;