Page MenuHomeFreeBSD

D56832.1795439959.diff
No OneTemporary

Authored By
Unknown
Size
12 KB
Referenced Files
None
Subscribers
None

D56832.1795439959.diff

diff --git a/share/man/man4/smartpqi.4 b/share/man/man4/smartpqi.4
--- a/share/man/man4/smartpqi.4
+++ b/share/man/man4/smartpqi.4
@@ -1,4 +1,4 @@
-.\" Copyright (C) 2019-2025, Microchip Technology Inc. and its subsidiaries
+.\" Copyright (C) 2019-2026, Microchip Technology Inc. and its subsidiaries
.\" Copyright (C) 2016-2018, Microsemi Corporation
.\" Copyright (C) 2016, PMC-Sierra, Inc.
.\" Written by John Hall <john.hall@microchip.com>
@@ -24,7 +24,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd August 28, 2025
+.Dd April 14, 2026
.Dt SMARTPQI 4 amd64
.Os
.Sh NAME
@@ -64,11 +64,13 @@
and SmartIOC Chipsets
.El
.Sh DEBUGGING
-Driver diagnostic printing is controlled in
+Driver diagnostic printing is controlled at boot time in
.Xr loader.conf 5
by using the global
.Va hw.smartpqi.debug_level
-tunable.
+tunable, or at runtime via the per-controller
+.Va dev.smartpqi.<unit>.debug_level
+sysctl.
.Pp
The
.Va debug_level
@@ -82,11 +84,27 @@
.It 0x0002 Ta info Ta Basic information
.It 0x0004 Ta function Ta Used to show function entry and exit
.It 0x0008 Ta io Ta Logging data from controller
-.It 0x0010 Ta discovery Ta Device discovery
+.It 0x0010 Ta discovery Ta Device discovery state transitions
.It 0x0020 Ta warning Ta Operational warnings
.It 0x0040 Ta error Ta Parameter errors and programming bugs
.It 0x0080 Ta note Ta More detailed information
.El
+.Pp
+In addition to the level-gated debug output, the driver always logs
+device addition, device removal, and controller events
+(hotplug, hardware, physical/logical device changes, AIO state and
+configuration changes) via
+.Xr device_printf 9 ,
+which appear in
+.Xr dmesg 8
+regardless of the
+.Va debug_level
+setting.
+.Pp
+For example, to enable discovery logging at runtime on the first controller:
+.Bd -literal -offset indent
+sysctl dev.smartpqi.0.debug_level=0x0070
+.Ed
.Sh DEVICE HINTS
The following tunable values can be set in
.Pa /boot/device.hints
@@ -162,7 +180,9 @@
.Xr xpt 4 ,
.Xr loader.conf 5 ,
.Xr camcontrol 8 ,
-.Xr kldload 8
+.Xr dmesg 8 ,
+.Xr kldload 8 ,
+.Xr sysctl 8
.Sh HISTORY
The
.Nm
diff --git a/sys/dev/smartpqi/smartpqi_cam.c b/sys/dev/smartpqi/smartpqi_cam.c
--- a/sys/dev/smartpqi/smartpqi_cam.c
+++ b/sys/dev/smartpqi/smartpqi_cam.c
@@ -1,5 +1,5 @@
/*-
- * Copyright 2016-2025 Microchip Technology, Inc. and/or its subsidiaries.
+ * Copyright 2016-2026 Microchip Technology, Inc. and/or its subsidiaries.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -1300,7 +1300,7 @@
csa.callback_arg = softs;
xpt_action((union ccb *)&csa);
if (csa.ccb_h.status != CAM_REQ_CMP) {
- DBG_ERR("Unable to register smartpqi_aysnc handler: %d!\n",
+ DBG_ERR("Unable to register smartpqi_async handler: %d!\n",
csa.ccb_h.status);
}
diff --git a/sys/dev/smartpqi/smartpqi_discovery.c b/sys/dev/smartpqi/smartpqi_discovery.c
--- a/sys/dev/smartpqi/smartpqi_discovery.c
+++ b/sys/dev/smartpqi/smartpqi_discovery.c
@@ -1,5 +1,5 @@
/*-
- * Copyright 2016-2025 Microchip Technology, Inc. and/or its subsidiaries.
+ * Copyright 2016-2026 Microchip Technology, Inc. and/or its subsidiaries.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -155,7 +155,7 @@
softs->bit_map.bit_vector[target] = SLOT_AVAILABLE;
}
-/* Use bit map to find availible targets */
+/* Use bit map to find available targets */
int
pqisrc_find_avail_target(pqisrc_softstate_t *softs)
{
@@ -1423,7 +1423,11 @@
if(device->expose_device) {
pqisrc_init_device_active_io(softs, device);
- /* TBD: Call OS upper layer function to add the device entry */
+ device_printf(softs->os_specific.pqi_dev,
+ "device added: vendor=%s model=%s B%d:T%d:L%d type=%s\n",
+ device->vendor, device->model,
+ device->bus, device->target, device->lun,
+ device->is_physical_device ? "physical" : "logical");
os_add_device(softs,device);
}
DBG_FUNC("OUT\n");
@@ -1451,6 +1455,11 @@
}
/* Wait for device outstanding Io's */
pqisrc_wait_for_device_commands_to_complete(softs, device);
+ device_printf(softs->os_specific.pqi_dev,
+ "device removed: vendor=%s model=%s B%d:T%d:L%d type=%s\n",
+ device->vendor, device->model,
+ device->bus, device->target, device->lun,
+ device->is_physical_device ? "physical" : "logical");
/* Call OS upper layer function to remove the exposed device entry */
os_remove_device(softs,device);
DBG_FUNC("OUT\n");
@@ -1674,10 +1683,14 @@
case DEVICE_NOT_FOUND:
/* Device not found in existing list */
device->new_device = true;
+ DBG_DISC("new device found B%d:T%d:L%d\n",
+ device->bus, device->target, device->lun);
break;
case DEVICE_CHANGED:
/* Actual device gone need to add device to list*/
device->new_device = true;
+ DBG_DISC("device changed B%d:T%d:L%d\n",
+ device->bus, device->target, device->lun);
break;
case DEVICE_IN_REMOVE:
/*Older device with same target/lun is in removal stage*/
@@ -1686,6 +1699,8 @@
* free call*/
device->new_device = false;
same_device->schedule_rescan = true;
+ DBG_DISC("device in removal B%d:T%d:L%d, scheduling rescan\n",
+ device->bus, device->target, device->lun);
break;
default:
break;
diff --git a/sys/dev/smartpqi/smartpqi_event.c b/sys/dev/smartpqi/smartpqi_event.c
--- a/sys/dev/smartpqi/smartpqi_event.c
+++ b/sys/dev/smartpqi/smartpqi_event.c
@@ -1,5 +1,5 @@
/*-
- * Copyright 2016-2025 Microchip Technology, Inc. and/or its subsidiaries.
+ * Copyright 2016-2026 Microchip Technology, Inc. and/or its subsidiaries.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -204,6 +204,17 @@
}
if (event_index >= 0) {
+ static const char *event_names[] = {
+ [PQI_EVENT_HOTPLUG] = "hotplug",
+ [PQI_EVENT_HARDWARE] = "hardware",
+ [PQI_EVENT_PHYSICAL_DEVICE] = "physical device",
+ [PQI_EVENT_LOGICAL_DEVICE] = "logical device",
+ [PQI_EVENT_AIO_STATE_CHANGE] = "AIO state change",
+ [PQI_EVENT_AIO_CONFIG_CHANGE] = "AIO config change",
+ };
+ device_printf(softs->os_specific.pqi_dev,
+ "event: %s (type=0x%x)\n",
+ event_names[event_index], response.event_type);
if(response.request_acknowledge) {
pending_event = &softs->pending_events[event_index];
pending_event->pending = true;
@@ -385,7 +396,7 @@
pqi_event_config_request_t request;
pqi_event_config_t *event_config_p ;
dma_mem_t buf_report_event ;
- /*bytes to be allocaed for report event config data-in buffer */
+ /*bytes to be allocated for report event config data-in buffer */
uint32_t alloc_size = sizeof(pqi_event_config_t) ;
memset(&request, 0 , sizeof(request));
@@ -446,7 +457,7 @@
pqi_event_config_request_t request;
pqi_event_config_t *event_config_p;
dma_mem_t buf_set_event;
- /*bytes to be allocaed for set event config data-out buffer */
+ /*bytes to be allocated for set event config data-out buffer */
uint32_t alloc_size = sizeof(pqi_event_config_t);
memset(&request, 0 , sizeof(request));
diff --git a/sys/dev/smartpqi/smartpqi_main.c b/sys/dev/smartpqi/smartpqi_main.c
--- a/sys/dev/smartpqi/smartpqi_main.c
+++ b/sys/dev/smartpqi/smartpqi_main.c
@@ -1,5 +1,5 @@
/*-
- * Copyright 2016-2025 Microchip Technology, Inc. and/or its subsidiaries.
+ * Copyright 2016-2026 Microchip Technology, Inc. and/or its subsidiaries.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -427,6 +427,16 @@
goto out;
}
+ /* Register sysctl for runtime debug_level changes */
+ {
+ struct sysctl_ctx_list *ctx = device_get_sysctl_ctx(dev);
+ struct sysctl_oid *tree = device_get_sysctl_tree(dev);
+
+ SYSCTL_ADD_ULONG(ctx, SYSCTL_CHILDREN(tree), OID_AUTO,
+ "debug_level", CTLFLAG_RW, &logging_level,
+ "Debug logging bitmask");
+ }
+
goto out;
dma_out:
diff --git a/sys/dev/smartpqi/smartpqi_misc.c b/sys/dev/smartpqi/smartpqi_misc.c
--- a/sys/dev/smartpqi/smartpqi_misc.c
+++ b/sys/dev/smartpqi/smartpqi_misc.c
@@ -1,5 +1,5 @@
/*-
- * Copyright 2016-2025 Microchip Technology, Inc. and/or its subsidiaries.
+ * Copyright 2016-2026 Microchip Technology, Inc. and/or its subsidiaries.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -252,7 +252,7 @@
DBG_FUNC("IN\n");
- /* At least > 16 sg's required to wotk hint correctly.
+ /* At least > 16 sg's required to work hint correctly.
* Default the sg count set by driver/controller. */
if ((!softs->hint.sg_segments) || (softs->hint.sg_segments >
diff --git a/sys/dev/smartpqi/smartpqi_queue.c b/sys/dev/smartpqi/smartpqi_queue.c
--- a/sys/dev/smartpqi/smartpqi_queue.c
+++ b/sys/dev/smartpqi/smartpqi_queue.c
@@ -1,5 +1,5 @@
/*-
- * Copyright 2016-2025 Microchip Technology, Inc. and/or its subsidiaries.
+ * Copyright 2016-2026 Microchip Technology, Inc. and/or its subsidiaries.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -729,7 +729,7 @@
op_ib_q->pi_register_offset);
} else {
int i = 0;
- DBG_WARN("Error Status Decsriptors\n");
+ DBG_WARN("Error Status Descriptors\n");
for (i = 0; i < 4; i++)
DBG_WARN(" %x\n",admin_resp.resp_type.create_op_iq.status_desc[i]);
}
diff --git a/sys/dev/smartpqi/smartpqi_request.c b/sys/dev/smartpqi/smartpqi_request.c
--- a/sys/dev/smartpqi/smartpqi_request.c
+++ b/sys/dev/smartpqi/smartpqi_request.c
@@ -1,5 +1,5 @@
/*-
- * Copyright 2016-2025 Microchip Technology, Inc. and/or its subsidiaries.
+ * Copyright 2016-2026 Microchip Technology, Inc. and/or its subsidiaries.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -1998,7 +1998,7 @@
if (softs->timeout_in_tmf &&
tmf_type == SOP_TASK_MANAGEMENT_LUN_RESET) {
- /* OS_TMF_TIMEOUT_SEC - 1 to accomodate driver processing */
+ /* OS_TMF_TIMEOUT_SEC - 1 to accommodate driver processing */
tmf_req.timeout_in_sec = OS_TMF_TIMEOUT_SEC - 1;
}
diff --git a/sys/dev/smartpqi/smartpqi_response.c b/sys/dev/smartpqi/smartpqi_response.c
--- a/sys/dev/smartpqi/smartpqi_response.c
+++ b/sys/dev/smartpqi/smartpqi_response.c
@@ -1,5 +1,5 @@
/*-
- * Copyright 2016-2025 Microchip Technology, Inc. and/or its subsidiaries.
+ * Copyright 2016-2026 Microchip Technology, Inc. and/or its subsidiaries.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -275,7 +275,7 @@
if (raid_err->data_out_result == PQI_RAID_DATA_IN_OUT_UNDERFLOW)
return true;
- /* We get these a alot: leave a tiny breadcrumb about the error,
+ /* We get these a lot: leave a tiny breadcrumb about the error,
but don't do full spew about it */
if (raid_err->status == PQI_AIO_STATUS_CHECK_CONDITION)
{
diff --git a/sys/dev/smartpqi/smartpqi_sis.c b/sys/dev/smartpqi/smartpqi_sis.c
--- a/sys/dev/smartpqi/smartpqi_sis.c
+++ b/sys/dev/smartpqi/smartpqi_sis.c
@@ -1,5 +1,5 @@
/*-
- * Copyright 2016-2025 Microchip Technology, Inc. and/or its subsidiaries.
+ * Copyright 2016-2026 Microchip Technology, Inc. and/or its subsidiaries.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -26,7 +26,7 @@
#include "smartpqi_includes.h"
-/* Function for disabling msix interrupots */
+/* Function for disabling msix interrupts */
void
sis_disable_msix(pqisrc_softstate_t *softs)
{
@@ -96,7 +96,7 @@
sis_disable_msix(softs);
break;
default:
- DBG_ERR("Inerrupt mode none!\n");
+ DBG_ERR("Interrupt mode none!\n");
break;
}
diff --git a/sys/dev/smartpqi/smartpqi_structures.h b/sys/dev/smartpqi/smartpqi_structures.h
--- a/sys/dev/smartpqi/smartpqi_structures.h
+++ b/sys/dev/smartpqi/smartpqi_structures.h
@@ -1,5 +1,5 @@
/*-
- * Copyright 2016-2025 Microchip Technology, Inc. and/or its subsidiaries.
+ * Copyright 2016-2026 Microchip Technology, Inc. and/or its subsidiaries.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -1168,7 +1168,7 @@
uint8_t page;
uint8_t sub_page;
uint16_t total_length; /** Total length of the page.
- * The length is the same wheteher the request buffer is too short or not.
+ * The length is the same whether the request buffer is too short or not.
* When printing out the page, only print the buffer length. */
} OS_ATTRIBUTE_PACKED bmic_sense_feature_page_header_t;

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 23, 1:19 PM (17 h, 14 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41932233
Default Alt Text
D56832.1795439959.diff (12 KB)

Event Timeline