linux-edac.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yazen Ghannam <yazen.ghannam@amd.com>
To: Borislav Petkov <bp@alien8.de>, linux-edac <linux-edac@vger.kernel.org>
Cc: yazen.ghannam@amd.com, LKML <linux-kernel@vger.kernel.org>,
	"anthony s . k ." <akira.2020@protonmail.com>
Subject: Re: [PATCH] RAS/AMD/FMPM: Fix build when debugfs is not enabled
Date: Tue, 26 Mar 2024 09:41:41 -0400	[thread overview]
Message-ID: <eede2586-f143-4107-a065-2860ed413d0a@amd.com> (raw)
In-Reply-To: <20240325183755.776-1-bp@alien8.de>


On 3/25/24 14:37, Borislav Petkov wrote:
> From: "Borislav Petkov (AMD)" <bp@alien8.de>
> 
> Have the driver depend on DEBUG_FS as it is useless without it.

This isn't true which is why the module doesn't fail to load if debugfs
is not available.

> 
> Fixes: 6f15e617cc99 ("RAS: Introduce a FRU memory poison manager")
> Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218640
> Reported-by: anthony s.k. <akira.2020@protonmail.com>
> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
> Cc: Yazen Ghannam <yazen.ghannam@amd.com>
> ---
>   drivers/ras/Kconfig | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/ras/Kconfig b/drivers/ras/Kconfig
> index fc4f4bb94a4c..41697e326fa6 100644
> --- a/drivers/ras/Kconfig
> +++ b/drivers/ras/Kconfig
> @@ -37,7 +37,7 @@ source "drivers/ras/amd/atl/Kconfig"
>   config RAS_FMPM
>   	tristate "FRU Memory Poison Manager"
>   	default m
> -	depends on AMD_ATL && ACPI_APEI
> +	depends on AMD_ATL && ACPI_APEI && DEBUG_FS

This was my first thought too. However, besides not true as stated
above, this also leaves the issue open for others to hit.

I think the fix below (not tested) would be more appropriate.

What do you think?

Thanks,
Yazen

diff --git a/drivers/ras/debugfs.h b/drivers/ras/debugfs.h
index 4749ccdeeba1..ab95831e7710 100644
--- a/drivers/ras/debugfs.h
+++ b/drivers/ras/debugfs.h
@@ -4,6 +4,10 @@

  #include <linux/debugfs.h>

+#if IS_ENABLED(DEBUG_FS)
  struct dentry *ras_get_debugfs_root(void);
+#else
+static inline struct dentry *ras_get_debugfs_root(void) { return NULL; }
+#endif /* DEBUG_FS */

  #endif /* __RAS_DEBUGFS_H__ */

  reply	other threads:[~2024-03-26 13:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-25 18:37 [PATCH] RAS/AMD/FMPM: Fix build when debugfs is not enabled Borislav Petkov
2024-03-26 13:41 ` Yazen Ghannam [this message]
2024-03-26 14:07   ` Borislav Petkov
2024-03-26 14:22     ` Yazen Ghannam
2024-03-26 14:27       ` Borislav Petkov
2024-03-26 14:20   ` A
2024-03-26 14:29     ` Yazen Ghannam
2024-03-26 18:37       ` A

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=eede2586-f143-4107-a065-2860ed413d0a@amd.com \
    --to=yazen.ghannam@amd.com \
    --cc=akira.2020@protonmail.com \
    --cc=bp@alien8.de \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).