git: f3c0dcde0e20 - main - ipmi: Add some additional diagnostic output on errors

From: David Bright <dab_at_FreeBSD.org>
Date: Mon, 28 Sep 2026 17:01:01 UTC
The branch main has been updated by dab:

URL: https://cgit.FreeBSD.org/src/commit/?id=f3c0dcde0e2065d7db8ffa6e5980d0f6b3bcc8ed

commit f3c0dcde0e2065d7db8ffa6e5980d0f6b3bcc8ed
Author:     David Bright <dab@FreeBSD.org>
AuthorDate: 2026-03-13 01:11:08 +0000
Commit:     David Bright <dab@FreeBSD.org>
CommitDate: 2026-09-28 17:00:57 +0000

    ipmi: Add some additional diagnostic output on errors
    
    Add some additional diagnostic output for IPMI code,
    particularly on error paths. This has been found to be helpful at
    $WORK and seems generally useful, so contributing the changes back to
    upstream.
    
    Sponsored by: Dell Technologies
    Reviewed by: vangyzen@
    Differential Revision: https://reviews.freebsd.org/D60091
---
 sys/dev/ipmi/ipmi_isa.c | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/sys/dev/ipmi/ipmi_isa.c b/sys/dev/ipmi/ipmi_isa.c
index 6d84496b0ef1..46c304b125ba 100644
--- a/sys/dev/ipmi/ipmi_isa.c
+++ b/sys/dev/ipmi/ipmi_isa.c
@@ -108,6 +108,7 @@ ipmi_hint_identify(device_t dev, struct ipmi_get_info *info)
 
 	/* Set the mode and default I/O resources for each mode. */
 	bzero(info, sizeof(struct ipmi_get_info));
+	device_printf(dev, "ipmi_hint_identify - %s hint\n", mode);
 	if (strcasecmp(mode, "KCS") == 0) {
 		info->iface_type = KCS_MODE;
 		info->address = 0xca2;
@@ -250,20 +251,34 @@ ipmi_isa_attach(device_t dev)
 	switch (info.iface_type) {
 	case KCS_MODE:
 		error = ipmi_kcs_attach(sc);
+		if (error) {
+			device_printf(dev, "ipmi_kcs_attach error\n");
+			goto bad;
+		}
 		break;
 	case SMIC_MODE:
 		error = ipmi_smic_attach(sc);
+		if (error) {
+			device_printf(dev, "ipmi_smic_attach error\n");
+			goto bad;
+		}
 		break;
 	case BT_MODE:
 		error = ipmi_bt_attach(sc);
+		if (error) {
+			device_printf(dev, "ipmi_bt_attach error\n");
+			goto bad;
+		}
 		break;
 	}
 
 	if (error)
 		goto bad;
 	error = ipmi_attach(dev);
-	if (error)
+	if (error) {
+		device_printf(dev, "ipmi_attach error\n");
 		goto bad;
+	}
 
 	return (0);
 bad: