On Mon, Nov 11, 2024 at 04:54:48PM +0000, Shiju Jose wrote: > Presently, 0 (soft memory repair) and 1 (hard memory repair), depends on > which mode/s a memory device is supported. What if the device supports more than one mode? > However for CXL memory sparing feature, the persistent mode is configurable at runtime > for a memory sparing instance, thus both soft and hard sparing are supported. > Example given for CXL memory sparing feature in Documentation/edac/memory_repair.rst, > root@localhost:~# cat /sys/bus/edac/devices/cxl_mem0/mem_repair1/persist_mode_avail > 0,1 Ok, and how is the user supposed to know what those mean? > Kernel sysfs doc mentioned about array of values as follows, though not seen much examples. > https://docs.kernel.org/filesystems/sysfs.html > "Attributes should be ASCII text files, preferably with only one value per file. It is noted that > it may not be efficient to contain only one value per file, so it is socially acceptable to express > an array of values of the same type." True story. Ok, so there's an exception to that rule. > The values of these attributes are specific to device and portion of the memory to repair. > For example, In CXL repair features, > CXL memory device identifies a failure on a memory component, device provides the corresponding > values of the attributes (DPA, channel, rank, nibble mask, bank group, bank, row, column or sub-channel etc) > in an event record to the host and to the userspace in the corresponding trace event. > Userspace shall use these values for the query resource availability and repair operations. I don't think you're answering my question. Lemme try again: I am on a machine with such an interface. I do echo 0xdeadbeef > /sys/devices... -EINVAL echo 0xface > ... -EINVAL How do I know what the allowed ranges are? > This will work for the CXL PPR feature where the result of the query operation for resources availability > return to the command, however for the CXL memory sparing features, the result of the query resources > availability command returned later in a Memory Sparing Event Record from the device. > Userspace shall issue repair operation with the attributes values received on the Memory Sparing trace event. > Thus for the CXL memory sparing feature, query for resources availability and repair operation > cannot be combined. What happens if the resources availability changes between the query and the start of the repair operation? The cat catches fire? -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette