git: f59c6677ee34 - stable/13 - mfi(4)/mrsas(4): Set sysctl name for driver versions consistently
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 03 May 2026 19:46:20 UTC
The branch stable/13 has been updated by michaelo:
URL: https://cgit.FreeBSD.org/src/commit/?id=f59c6677ee347e79c93e4423bd5323d84216925b
commit f59c6677ee347e79c93e4423bd5323d84216925b
Author: Michael Osipov <michaelo@FreeBSD.org>
AuthorDate: 2026-02-25 19:48:34 +0000
Commit: Michael Osipov <michaelo@FreeBSD.org>
CommitDate: 2026-05-03 19:45:15 +0000
mfi(4)/mrsas(4): Set sysctl name for driver versions consistently
Instead of printing the driver version over and over again if multiple
controllers are used, set a sysctl name for the used driver version.
Approved by: imp, ziaee
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D56110
(cherry picked from commit ea1764e5fcf0fc11680dc104e663ae3d1d0fd7be)
---
sys/dev/mfi/mfi.c | 7 ++++---
sys/dev/mrsas/mrsas.c | 3 ---
2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/sys/dev/mfi/mfi.c b/sys/dev/mfi/mfi.c
index a41d1f589835..658d47cb1777 100644
--- a/sys/dev/mfi/mfi.c
+++ b/sys/dev/mfi/mfi.c
@@ -372,9 +372,6 @@ mfi_attach(struct mfi_softc *sc)
if (sc == NULL)
return EINVAL;
- device_printf(sc->mfi_dev, "LSI MegaRAID SAS driver version: %s\n",
- MEGASAS_VERSION);
-
mtx_init(&sc->mfi_io_lock, "MFI I/O lock", NULL, MTX_DEF);
sx_init(&sc->mfi_config_lock, "MFI config");
TAILQ_INIT(&sc->mfi_ld_tqh);
@@ -765,6 +762,10 @@ mfi_attach(struct mfi_softc *sc)
sc->mfi_cdev, "%s", "megaraid_sas_ioctl_node");
if (sc->mfi_cdev != NULL)
sc->mfi_cdev->si_drv1 = sc;
+ SYSCTL_ADD_STRING(device_get_sysctl_ctx(sc->mfi_dev),
+ SYSCTL_CHILDREN(device_get_sysctl_tree(sc->mfi_dev)),
+ OID_AUTO, "driver_version", CTLFLAG_RD, MEGASAS_VERSION,
+ strlen(MEGASAS_VERSION), "driver version");
SYSCTL_ADD_INT(device_get_sysctl_ctx(sc->mfi_dev),
SYSCTL_CHILDREN(device_get_sysctl_tree(sc->mfi_dev)),
OID_AUTO, "delete_busy_volumes", CTLFLAG_RW,
diff --git a/sys/dev/mrsas/mrsas.c b/sys/dev/mrsas/mrsas.c
index dc13a24864c6..46d9e32ae6e9 100644
--- a/sys/dev/mrsas/mrsas.c
+++ b/sys/dev/mrsas/mrsas.c
@@ -856,9 +856,6 @@ mrsas_attach(device_t dev)
struct mrsas_softc *sc = device_get_softc(dev);
uint32_t cmd, error;
- device_printf(dev, "AVAGO MegaRAID SAS driver version: %s\n",
- MRSAS_VERSION);
-
memset(sc, 0, sizeof(struct mrsas_softc));
/* Look up our softc and initialize its fields. */