The legacy sysfs EDAC interface has been made obsolete more than a decade
ago through the introduction of a new per-DIMM interface.
The legacy interface however, hasn't been removed till date.
Begin deprecating it so that it can eventually be removed two releases
later.
Signed-off-by: Avadhut Naik <avadhut.naik@amd.com>
---
Changes in v3:
Patch introduced.
---
drivers/edac/Kconfig | 2 +-
drivers/edac/edac_mc_sysfs.c | 14 ++++++++++++++
2 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/drivers/edac/Kconfig b/drivers/edac/Kconfig
index b824472208c4..19470f4efee7 100644
--- a/drivers/edac/Kconfig
+++ b/drivers/edac/Kconfig
@@ -25,7 +25,7 @@ if EDAC
config EDAC_LEGACY_SYSFS
bool "EDAC legacy sysfs"
- default y
+ default n
help
Enable the compatibility sysfs nodes.
Use 'Y' if your edac utilities aren't ported to work with the newer
diff --git a/drivers/edac/edac_mc_sysfs.c b/drivers/edac/edac_mc_sysfs.c
index 8689631f1905..3840eef942f8 100644
--- a/drivers/edac/edac_mc_sysfs.c
+++ b/drivers/edac/edac_mc_sysfs.c
@@ -144,6 +144,8 @@ struct dev_ch_attribute {
static ssize_t csrow_ue_count_show(struct device *dev,
struct device_attribute *mattr, char *data)
{
+ pr_warn_once("Depcreated interface! Will be removed within two future releases. Please switch to using the new interface!\n");
+
struct csrow_info *csrow = to_csrow(dev);
return sysfs_emit(data, "%u\n", csrow->ue_count);
@@ -152,6 +154,8 @@ static ssize_t csrow_ue_count_show(struct device *dev,
static ssize_t csrow_ce_count_show(struct device *dev,
struct device_attribute *mattr, char *data)
{
+ pr_warn_once("Depcreated interface! Will be removed within two future releases. Please switch to using the new interface!\n");
+
struct csrow_info *csrow = to_csrow(dev);
return sysfs_emit(data, "%u\n", csrow->ce_count);
@@ -160,6 +164,8 @@ static ssize_t csrow_ce_count_show(struct device *dev,
static ssize_t csrow_size_show(struct device *dev,
struct device_attribute *mattr, char *data)
{
+ pr_warn_once("Depcreated interface! Will be removed within two future releases. Please switch to using the new interface!\n");
+
struct csrow_info *csrow = to_csrow(dev);
int i;
u32 nr_pages = 0;
@@ -172,6 +178,8 @@ static ssize_t csrow_size_show(struct device *dev,
static ssize_t csrow_mem_type_show(struct device *dev,
struct device_attribute *mattr, char *data)
{
+ pr_warn_once("Depcreated interface! Will be removed within two future releases. Please switch to using the new interface!\n");
+
struct csrow_info *csrow = to_csrow(dev);
return sysfs_emit(data, "%s\n", edac_mem_types[csrow->channels[0]->dimm->mtype]);
@@ -180,6 +188,8 @@ static ssize_t csrow_mem_type_show(struct device *dev,
static ssize_t csrow_dev_type_show(struct device *dev,
struct device_attribute *mattr, char *data)
{
+ pr_warn_once("Depcreated interface! Will be removed within two future releases. Please switch to using the new interface!\n");
+
struct csrow_info *csrow = to_csrow(dev);
return sysfs_emit(data, "%s\n", dev_types[csrow->channels[0]->dimm->dtype]);
@@ -189,6 +199,8 @@ static ssize_t csrow_edac_mode_show(struct device *dev,
struct device_attribute *mattr,
char *data)
{
+ pr_warn_once("Depcreated interface! Will be removed within two future releases. Please switch to using the new interface!\n");
+
struct csrow_info *csrow = to_csrow(dev);
return sysfs_emit(data, "%s\n", edac_caps[csrow->channels[0]->dimm->edac_mode]);
@@ -199,6 +211,7 @@ static ssize_t channel_dimm_label_show(struct device *dev,
struct device_attribute *mattr,
char *data)
{
+ pr_warn_once("Depcreated interface! Will be removed within two future releases. Please switch to using the new interface!\n");
struct csrow_info *csrow = to_csrow(dev);
unsigned int chan = to_channel(mattr);
struct rank_info *rank = csrow->channels[chan];
@@ -238,6 +251,7 @@ static ssize_t channel_dimm_label_store(struct device *dev,
static ssize_t channel_ce_count_show(struct device *dev,
struct device_attribute *mattr, char *data)
{
+ pr_warn_once("Depcreated interface! Will be removed within two future releases. Please switch to using the new interface!\n");
struct csrow_info *csrow = to_csrow(dev);
unsigned int chan = to_channel(mattr);
struct rank_info *rank = csrow->channels[chan];
--
2.43.0
On Tue, Sep 09, 2025 at 06:53:14PM +0000, Avadhut Naik wrote: > The legacy sysfs EDAC interface has been made obsolete more than a decade > ago through the introduction of a new per-DIMM interface. > > The legacy interface however, hasn't been removed till date. > > Begin deprecating it so that it can eventually be removed two releases > later. > > Signed-off-by: Avadhut Naik <avadhut.naik@amd.com> > --- > Changes in v3: > Patch introduced. > --- > drivers/edac/Kconfig | 2 +- > drivers/edac/edac_mc_sysfs.c | 14 ++++++++++++++ > 2 files changed, 15 insertions(+), 1 deletion(-) > > diff --git a/drivers/edac/Kconfig b/drivers/edac/Kconfig > index b824472208c4..19470f4efee7 100644 > --- a/drivers/edac/Kconfig > +++ b/drivers/edac/Kconfig > @@ -25,7 +25,7 @@ if EDAC > > config EDAC_LEGACY_SYSFS > bool "EDAC legacy sysfs" > - default y > + default n > help > Enable the compatibility sysfs nodes. > Use 'Y' if your edac utilities aren't ported to work with the newer > diff --git a/drivers/edac/edac_mc_sysfs.c b/drivers/edac/edac_mc_sysfs.c > index 8689631f1905..3840eef942f8 100644 > --- a/drivers/edac/edac_mc_sysfs.c > +++ b/drivers/edac/edac_mc_sysfs.c > @@ -144,6 +144,8 @@ struct dev_ch_attribute { > static ssize_t csrow_ue_count_show(struct device *dev, > struct device_attribute *mattr, char *data) > { > + pr_warn_once("Depcreated interface! Will be removed within two future releases. Please switch to using the new interface!\n"); > + > struct csrow_info *csrow = to_csrow(dev); > > return sysfs_emit(data, "%u\n", csrow->ue_count); > @@ -152,6 +154,8 @@ static ssize_t csrow_ue_count_show(struct device *dev, > static ssize_t csrow_ce_count_show(struct device *dev, > struct device_attribute *mattr, char *data) > { > + pr_warn_once("Depcreated interface! Will be removed within two future releases. Please switch to using the new interface!\n"); > + > struct csrow_info *csrow = to_csrow(dev); > > return sysfs_emit(data, "%u\n", csrow->ce_count); > @@ -160,6 +164,8 @@ static ssize_t csrow_ce_count_show(struct device *dev, > static ssize_t csrow_size_show(struct device *dev, > struct device_attribute *mattr, char *data) > { > + pr_warn_once("Depcreated interface! Will be removed within two future releases. Please switch to using the new interface!\n"); > + > struct csrow_info *csrow = to_csrow(dev); > int i; > u32 nr_pages = 0; > @@ -172,6 +178,8 @@ static ssize_t csrow_size_show(struct device *dev, > static ssize_t csrow_mem_type_show(struct device *dev, > struct device_attribute *mattr, char *data) > { > + pr_warn_once("Depcreated interface! Will be removed within two future releases. Please switch to using the new interface!\n"); > + > struct csrow_info *csrow = to_csrow(dev); > > return sysfs_emit(data, "%s\n", edac_mem_types[csrow->channels[0]->dimm->mtype]); > @@ -180,6 +188,8 @@ static ssize_t csrow_mem_type_show(struct device *dev, > static ssize_t csrow_dev_type_show(struct device *dev, > struct device_attribute *mattr, char *data) > { > + pr_warn_once("Depcreated interface! Will be removed within two future releases. Please switch to using the new interface!\n"); > + > struct csrow_info *csrow = to_csrow(dev); > > return sysfs_emit(data, "%s\n", dev_types[csrow->channels[0]->dimm->dtype]); > @@ -189,6 +199,8 @@ static ssize_t csrow_edac_mode_show(struct device *dev, > struct device_attribute *mattr, > char *data) > { > + pr_warn_once("Depcreated interface! Will be removed within two future releases. Please switch to using the new interface!\n"); > + > struct csrow_info *csrow = to_csrow(dev); > > return sysfs_emit(data, "%s\n", edac_caps[csrow->channels[0]->dimm->edac_mode]); > @@ -199,6 +211,7 @@ static ssize_t channel_dimm_label_show(struct device *dev, > struct device_attribute *mattr, > char *data) > { > + pr_warn_once("Depcreated interface! Will be removed within two future releases. Please switch to using the new interface!\n"); > struct csrow_info *csrow = to_csrow(dev); > unsigned int chan = to_channel(mattr); > struct rank_info *rank = csrow->channels[chan]; > @@ -238,6 +251,7 @@ static ssize_t channel_dimm_label_store(struct device *dev, > static ssize_t channel_ce_count_show(struct device *dev, > struct device_attribute *mattr, char *data) > { > + pr_warn_once("Depcreated interface! Will be removed within two future releases. Please switch to using the new interface!\n"); > struct csrow_info *csrow = to_csrow(dev); > unsigned int chan = to_channel(mattr); > struct rank_info *rank = csrow->channels[chan]; > -- Depcreated -> Deprecated And maybe the warning can go in an short inline function? Sorry, I forgot if this came up already. Also, "two future releases" is vague. And it may be confusing if this is backported. Does anyone have a better suggestion, or is this good as-is? Thanks, Yazen
On 9/10/2025 10:24, Yazen Ghannam wrote: > On Tue, Sep 09, 2025 at 06:53:14PM +0000, Avadhut Naik wrote: >> The legacy sysfs EDAC interface has been made obsolete more than a decade >> ago through the introduction of a new per-DIMM interface. >> >> The legacy interface however, hasn't been removed till date. >> >> Begin deprecating it so that it can eventually be removed two releases >> later. >> >> Signed-off-by: Avadhut Naik <avadhut.naik@amd.com> >> --- >> Changes in v3: >> Patch introduced. >> --- >> drivers/edac/Kconfig | 2 +- >> drivers/edac/edac_mc_sysfs.c | 14 ++++++++++++++ >> 2 files changed, 15 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/edac/Kconfig b/drivers/edac/Kconfig >> index b824472208c4..19470f4efee7 100644 >> --- a/drivers/edac/Kconfig >> +++ b/drivers/edac/Kconfig >> @@ -25,7 +25,7 @@ if EDAC >> >> config EDAC_LEGACY_SYSFS >> bool "EDAC legacy sysfs" >> - default y >> + default n >> help >> Enable the compatibility sysfs nodes. >> Use 'Y' if your edac utilities aren't ported to work with the newer >> diff --git a/drivers/edac/edac_mc_sysfs.c b/drivers/edac/edac_mc_sysfs.c >> index 8689631f1905..3840eef942f8 100644 >> --- a/drivers/edac/edac_mc_sysfs.c >> +++ b/drivers/edac/edac_mc_sysfs.c >> @@ -144,6 +144,8 @@ struct dev_ch_attribute { >> static ssize_t csrow_ue_count_show(struct device *dev, >> struct device_attribute *mattr, char *data) >> { >> + pr_warn_once("Depcreated interface! Will be removed within two future releases. Please switch to using the new interface!\n"); >> + >> struct csrow_info *csrow = to_csrow(dev); >> >> return sysfs_emit(data, "%u\n", csrow->ue_count); >> @@ -152,6 +154,8 @@ static ssize_t csrow_ue_count_show(struct device *dev, >> static ssize_t csrow_ce_count_show(struct device *dev, >> struct device_attribute *mattr, char *data) >> { >> + pr_warn_once("Depcreated interface! Will be removed within two future releases. Please switch to using the new interface!\n"); >> + >> struct csrow_info *csrow = to_csrow(dev); >> >> return sysfs_emit(data, "%u\n", csrow->ce_count); >> @@ -160,6 +164,8 @@ static ssize_t csrow_ce_count_show(struct device *dev, >> static ssize_t csrow_size_show(struct device *dev, >> struct device_attribute *mattr, char *data) >> { >> + pr_warn_once("Depcreated interface! Will be removed within two future releases. Please switch to using the new interface!\n"); >> + >> struct csrow_info *csrow = to_csrow(dev); >> int i; >> u32 nr_pages = 0; >> @@ -172,6 +178,8 @@ static ssize_t csrow_size_show(struct device *dev, >> static ssize_t csrow_mem_type_show(struct device *dev, >> struct device_attribute *mattr, char *data) >> { >> + pr_warn_once("Depcreated interface! Will be removed within two future releases. Please switch to using the new interface!\n"); >> + >> struct csrow_info *csrow = to_csrow(dev); >> >> return sysfs_emit(data, "%s\n", edac_mem_types[csrow->channels[0]->dimm->mtype]); >> @@ -180,6 +188,8 @@ static ssize_t csrow_mem_type_show(struct device *dev, >> static ssize_t csrow_dev_type_show(struct device *dev, >> struct device_attribute *mattr, char *data) >> { >> + pr_warn_once("Depcreated interface! Will be removed within two future releases. Please switch to using the new interface!\n"); >> + >> struct csrow_info *csrow = to_csrow(dev); >> >> return sysfs_emit(data, "%s\n", dev_types[csrow->channels[0]->dimm->dtype]); >> @@ -189,6 +199,8 @@ static ssize_t csrow_edac_mode_show(struct device *dev, >> struct device_attribute *mattr, >> char *data) >> { >> + pr_warn_once("Depcreated interface! Will be removed within two future releases. Please switch to using the new interface!\n"); >> + >> struct csrow_info *csrow = to_csrow(dev); >> >> return sysfs_emit(data, "%s\n", edac_caps[csrow->channels[0]->dimm->edac_mode]); >> @@ -199,6 +211,7 @@ static ssize_t channel_dimm_label_show(struct device *dev, >> struct device_attribute *mattr, >> char *data) >> { >> + pr_warn_once("Depcreated interface! Will be removed within two future releases. Please switch to using the new interface!\n"); >> struct csrow_info *csrow = to_csrow(dev); >> unsigned int chan = to_channel(mattr); >> struct rank_info *rank = csrow->channels[chan]; >> @@ -238,6 +251,7 @@ static ssize_t channel_dimm_label_store(struct device *dev, >> static ssize_t channel_ce_count_show(struct device *dev, >> struct device_attribute *mattr, char *data) >> { >> + pr_warn_once("Depcreated interface! Will be removed within two future releases. Please switch to using the new interface!\n"); >> struct csrow_info *csrow = to_csrow(dev); >> unsigned int chan = to_channel(mattr); >> struct rank_info *rank = csrow->channels[chan]; >> -- > > Depcreated -> Deprecated > Will change. > And maybe the warning can go in an short inline function? Sorry, I > forgot if this came up already. > > Also, "two future releases" is vague. And it may be confusing if this is > backported. > > Does anyone have a better suggestion, or is this good as-is? > How about explicitly stating a release? 6.20, for example. > Thanks, > Yazen -- Thanks, Avadhut Naik
On Wed, Sep 10, 2025 at 12:38:44PM -0500, Naik, Avadhut wrote: [...] > > And maybe the warning can go in an short inline function? Sorry, I > > forgot if this came up already. > > > > Also, "two future releases" is vague. And it may be confusing if this is > > backported. > > > > Does anyone have a better suggestion, or is this good as-is? > > > > How about explicitly stating a release? > 6.20, for example. > I think that may be okay, but I'm not sure. Boris, what do you think? Thanks, Yazen
On 9/15/2025 12:04, Yazen Ghannam wrote: > On Wed, Sep 10, 2025 at 12:38:44PM -0500, Naik, Avadhut wrote: > > [...] >>> And maybe the warning can go in an short inline function? Sorry, I >>> forgot if this came up already. >>> >>> Also, "two future releases" is vague. And it may be confusing if this is >>> backported. >>> >>> Does anyone have a better suggestion, or is this good as-is? >>> >> >> How about explicitly stating a release? >> 6.20, for example. >> > > I think that may be okay, but I'm not sure. > > Boris, what do you think? > > Thanks, > Yazen Another alternative could be doing something like this: [ 1340.644001] NOTICE: Automounting of tracing to debugfs is deprecated and will be removed in 2030 Mention the year instead of release! -- Thanks, Avadhut Naik
© 2016 - 2025 Red Hat, Inc.