Re: [PATCH v4] cxl/core: Create einj_types when EINJ becomes available
From: Cheatham, Benjamin
Date: Fri Oct 30 2026 - 15:24:44 EST
>> diff --git a/drivers/cxl/cxl.h b/drivers/cxl/cxl.h
>> index cab8ce39f465..b9245261ee39 100644
>> --- a/drivers/cxl/cxl.h
>> +++ b/drivers/cxl/cxl.h
>> @@ -926,4 +926,6 @@ struct cxl_dport *devm_cxl_add_dport_by_dev(struct cxl_port *port,
>>
>> u16 cxl_gpf_get_dvsec(struct device *dev);
>>
>> +void cxl_debugfs_einj_add_types(void);
>> +
>> #endif /* __CXL_H__ */
>
> Maybe drop the cxl_acpi_probe() hook? Host bridge dports, RCH included, already go through __devm_cxl_add_dport() -> cxl_debugfs_create_dport_dir() -> cxl_debugfs_einj_add_types() inside the same probe, so the hook runs at the same time and adds nothing. That also removes the export.
>
> Also, the RCH all built-in case still never gets einj_types since the only RCH dport is added at subsys_initcall_sync. Should the commit log say so?
>
> I do wonder if it's simpler to always create einj_types in cxl_core_init() and have einj_cxl_available_error_type_show() return -ENODEV when EINJ isn't initialized. That covers every config without the lock and the extra hooks. Any thoughts Ben?
Yeah, that sounds good to me. Wish I had thought of it :)
Thanks,
Ben
>
> The NULL resets in cxl_core_exit() aren't needed. Module reload gets fresh .bss.