All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cxl/mbox: Fix CEL logic for poison and security commands
@ 2023-09-03 21:42 Ira Weiny
  2023-09-04 15:19 ` Jonathan Cameron
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Ira Weiny @ 2023-09-03 21:42 UTC (permalink / raw)
  To: Davidlohr Bueso, Jonathan Cameron, Dave Jiang, Alison Schofield,
	Vishal Verma, Dan Williams
  Cc: linux-cxl, linux-kernel, Ira Weiny

The following debug output was observed while testing CXL

cxl_core:cxl_walk_cel:721: cxl_mock_mem cxl_mem.0: Opcode 0x4300 unsupported by driver

opcode 0x4300 (Get Poison) is supported by the driver and the mock
device supports it.  The logic should be checking that the opcode is
both not poison and not security.

Fix the logic to allow poison and security commands.

Fixes: ad64f5952ce3 ("cxl/memdev: Only show sanitize sysfs files when supported")
Cc: Davidlohr Bueso <dave@stgolabs.net>
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
---
 drivers/cxl/core/mbox.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/cxl/core/mbox.c b/drivers/cxl/core/mbox.c
index ca60bb8114f2..b315bdab9197 100644
--- a/drivers/cxl/core/mbox.c
+++ b/drivers/cxl/core/mbox.c
@@ -716,8 +716,8 @@ static void cxl_walk_cel(struct cxl_memdev_state *mds, size_t size, u8 *cel)
 		u16 opcode = le16_to_cpu(cel_entry[i].opcode);
 		struct cxl_mem_command *cmd = cxl_mem_find_command(opcode);
 
-		if (!cmd && (!cxl_is_poison_command(opcode) ||
-			     !cxl_is_security_command(opcode))) {
+		if (!cmd && !cxl_is_poison_command(opcode) &&
+		    !cxl_is_security_command(opcode)) {
 			dev_dbg(dev,
 				"Opcode 0x%04x unsupported by driver\n", opcode);
 			continue;

---
base-commit: 1c59d383390f970b891b503b7f79b63a02db2ec5
change-id: 20230903-cxl-cel-fix-9da269bf0f21

Best regards,
-- 
Ira Weiny <ira.weiny@intel.com>


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-09-13 19:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-03 21:42 [PATCH] cxl/mbox: Fix CEL logic for poison and security commands Ira Weiny
2023-09-04 15:19 ` Jonathan Cameron
2023-09-04 17:24 ` Davidlohr Bueso
2023-09-12 22:39 ` Dan Williams
2023-09-13 18:17   ` Ira Weiny
2023-09-13 19:45   ` Davidlohr Bueso

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.