cxl: Fix sysfs export of qos_class for memdev
authorDave Jiang <dave.jiang@intel.com>
Tue, 6 Feb 2024 19:03:39 +0000 (12:03 -0700)
committerDan Williams <dan.j.williams@intel.com>
Sat, 17 Feb 2024 07:20:34 +0000 (23:20 -0800)
commitcc214417f06f6b0a8f6da09220c8bcdb742210b9
treeb047a19e05f3acb3b746be751f5c766eb72339d9
parent10cb393d769bed9473e1fa8d34e4d6d389db9155
cxl: Fix sysfs export of qos_class for memdev

Current implementation exports only to
/sys/bus/cxl/devices/.../memN/qos_class. With both ram and pmem exposed,
the second registered sysfs attribute is rejected as duplicate. It's not
possible to create qos_class under the dev_groups via the driver due to
the ram and pmem sysfs sub-directories already created by the device sysfs
groups. Move the ram and pmem qos_class to the device sysfs groups and add
a call to sysfs_update() after the perf data are validated so the
qos_class can be visible. The end results should be
/sys/bus/cxl/devices/.../memN/ram/qos_class and
/sys/bus/cxl/devices/.../memN/pmem/qos_class.

Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Link: https://lore.kernel.org/r/20240206190431.1810289-4-dave.jiang@intel.com
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/cxl/core/cdat.c
drivers/cxl/core/memdev.c
drivers/cxl/cxl.h
drivers/cxl/mem.c