* [PATCH] mlxbf-bootctl: use sysfs_emit_at() in secure_boot_fuse_state_show()
@ 2025-04-07 13:25 David Thompson
2025-04-11 10:03 ` Ilpo Järvinen
0 siblings, 1 reply; 2+ messages in thread
From: David Thompson @ 2025-04-07 13:25 UTC (permalink / raw)
To: hdegoede, ilpo.jarvinen, vadimp
Cc: platform-driver-x86, linux-kernel, David Thompson
A warning is seen when running the latest kernel on a BlueField SOC:
[251.512704] ------------[ cut here ]------------
[251.512711] invalid sysfs_emit: buf:0000000003aa32ae
[251.512720] WARNING: CPU: 1 PID: 705264 at fs/sysfs/file.c:767 sysfs_emit+0xac/0xc8
The warning is triggered because the mlxbf-bootctl driver invokes
"sysfs_emit()" with a buffer pointer that is not aligned to the
start of the page. The driver should instead use "sysfs_emit_at()"
to support non-zero offsets into the destination buffer.
Fixes: 9886f575de5a ("platform/mellanox: mlxbf-bootctl: use sysfs_emit() instead of sprintf()")
Signed-off-by: David Thompson <davthompson@nvidia.com>
---
drivers/platform/mellanox/mlxbf-bootctl.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/platform/mellanox/mlxbf-bootctl.c b/drivers/platform/mellanox/mlxbf-bootctl.c
index b95dcb8d483c..c18a5b96de5c 100644
--- a/drivers/platform/mellanox/mlxbf-bootctl.c
+++ b/drivers/platform/mellanox/mlxbf-bootctl.c
@@ -333,9 +333,9 @@ static ssize_t secure_boot_fuse_state_show(struct device *dev,
else
status = valid ? "Invalid" : "Free";
}
- buf_len += sysfs_emit(buf + buf_len, "%d:%s ", key, status);
+ buf_len += sysfs_emit_at(buf, buf_len, "%d:%s ", key, status);
}
- buf_len += sysfs_emit(buf + buf_len, "\n");
+ buf_len += sysfs_emit_at(buf, buf_len, "\n");
return buf_len;
}
--
2.43.2
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] mlxbf-bootctl: use sysfs_emit_at() in secure_boot_fuse_state_show()
2025-04-07 13:25 [PATCH] mlxbf-bootctl: use sysfs_emit_at() in secure_boot_fuse_state_show() David Thompson
@ 2025-04-11 10:03 ` Ilpo Järvinen
0 siblings, 0 replies; 2+ messages in thread
From: Ilpo Järvinen @ 2025-04-11 10:03 UTC (permalink / raw)
To: hdegoede, vadimp, David Thompson; +Cc: platform-driver-x86, linux-kernel
On Mon, 07 Apr 2025 13:25:58 +0000, David Thompson wrote:
> A warning is seen when running the latest kernel on a BlueField SOC:
> [251.512704] ------------[ cut here ]------------
> [251.512711] invalid sysfs_emit: buf:0000000003aa32ae
> [251.512720] WARNING: CPU: 1 PID: 705264 at fs/sysfs/file.c:767 sysfs_emit+0xac/0xc8
>
> The warning is triggered because the mlxbf-bootctl driver invokes
> "sysfs_emit()" with a buffer pointer that is not aligned to the
> start of the page. The driver should instead use "sysfs_emit_at()"
> to support non-zero offsets into the destination buffer.
>
> [...]
Thank you for your contribution, it has been applied to my local
review-ilpo-fixes branch. Note it will show up in the public
platform-drivers-x86/review-ilpo-fixes branch only once I've pushed my
local branch there, which might take a while.
The list of commits applied:
[1/1] mlxbf-bootctl: use sysfs_emit_at() in secure_boot_fuse_state_show()
commit: b129005ddfc0e6daf04a6d3b928a9e474f9b3918
--
i.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-04-11 10:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-07 13:25 [PATCH] mlxbf-bootctl: use sysfs_emit_at() in secure_boot_fuse_state_show() David Thompson
2025-04-11 10:03 ` Ilpo Järvinen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®