cxl/memdev: Only show sanitize sysfs files when supported
authorDavidlohr Bueso <dave@stgolabs.net>
Wed, 26 Jul 2023 05:19:40 +0000 (22:19 -0700)
committerVishal Verma <vishal.l.verma@intel.com>
Fri, 28 Jul 2023 19:16:54 +0000 (13:16 -0600)
commitad64f5952ce3ea565c7f76ec37ab41df0dde773a
tree1f59e4c7b4050b00270578fb00e6e2abc7f37b71
parent3de8cd2242419fb0adaee629d488acfd6cd93c92
cxl/memdev: Only show sanitize sysfs files when supported

If the device does not support Sanitize or Secure Erase commands,
hide the respective sysfs interfaces such that the operation can
never be attempted.

In order to be generic, keep track of the enabled security commands
found in the CEL - the driver does not support Security Passthrough.

Signed-off-by: Davidlohr Bueso <dave@stgolabs.net>
Link: https://lore.kernel.org/r/20230726051940.3570-4-dave@stgolabs.net
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
Documentation/ABI/testing/sysfs-bus-cxl
drivers/cxl/core/mbox.c
drivers/cxl/core/memdev.c
drivers/cxl/cxlmem.h