[PATCH] scsi: mpi3mr: keep DevicePage0 SAS/SATA log on one line

Ilya Khomyakov <[email protected]> Tue, 4 Aug 2026 16:51:32 +0300
Newsgroups gmane.linux.scsi
Message-ID <[email protected]>
The DevicePage0 SAS/SATA diagnostic message contains an embedded newline
inside a single ioc_info() format string.

The first record receives the normal mpi3mr prefix, while the continuation
starts directly with device_info. Consequently, common filtered captures
such as

  dmesg | grep -i mpi3mr

retain only the first part of the message and omit device_info, phy_num,
attached_phy_id, and negotiated_link_rate. These fields are useful when
diagnosing SAS discovery and negotiated link-rate problems.

Before the change, a filtered capture stopped after:

  mpi3mr0: device_pg0: sas_sata:
  sas_address(0x5000cca2708a13c2),flags(0x0000),

Remove the embedded newline and retain only the final newline so the entire
message is emitted as one prefixed kernel log record. Also add the missing
spaces after commas in the format string.

After the change, the same device is reported in one record as:

  mpi3mr0: device_pg0: sas_sata: sas_address(0x5000cca2708a13c2),
  flags(0x0000), device_info(0x0101), phy_num(18),
  attached_phy_id(1), negotiated_link_rate(0x0b)

The wrapping above is only for the changelog. The kernel emits the actual
message on one line.

The change was tested with an out-of-tree mpi3mr 8.17.1.0.4 build. All nine
DevicePage0 SAS/SATA records retained every field in the output of
`dmesg | grep -i mpi3mr`.

This is a diagnostic-output-only change. It does not modify discovery, I/O,
or link-management behavior.

Signed-off-by: Ilya Khomyakov <[email protected]>

---
 drivers/scsi/mpi3mr/mpi3mr_os.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/mpi3mr/mpi3mr_os.c b/drivers/scsi/mpi3mr/mpi3mr_os.c
--- a/drivers/scsi/mpi3mr/mpi3mr_os.c
+++ b/drivers/scsi/mpi3mr/mpi3mr_os.c
@@ -1290,8 +1290,9 @@ mpi3mr_debug_dump_devpg0(struct mpi3mr_ioc *mrioc, struct mpi3_device_page0 *dev
 		struct mpi3_device0_sas_sata_format *sasinf =
 		    &dev_pg0->device_specific.sas_sata_format;
 		ioc_info(mrioc,
-		    "device_pg0: sas_sata: sas_address(0x%016llx),flags(0x%04x),\n"
-		    "device_info(0x%04x), phy_num(%d), attached_phy_id(%d),negotiated_link_rate(0x%02x)\n",
+		    "device_pg0: sas_sata: sas_address(0x%016llx), flags(0x%04x), "
+		    "device_info(0x%04x), phy_num(%d), attached_phy_id(%d), "
+		    "negotiated_link_rate(0x%02x)\n",
 		    le64_to_cpu(sasinf->sas_address),
 		    le16_to_cpu(sasinf->flags),
 		    le16_to_cpu(sasinf->device_info), sasinf->phy_num,