Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 Oct 2024 14:53:10 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 280290] hms(4): Broken fresh after boot, fixed by resume
Message-ID:  <bug-280290-227-J2qn4q3Yrd@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-280290-227@https.bugs.freebsd.org/bugzilla/>
References:  <bug-280290-227@https.bugs.freebsd.org/bugzilla/>

index | next in thread | previous in thread | raw e-mail

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=280290

--- Comment #34 from Vladimir Kondratyev <wulf@freebsd.org> ---
Try this patch (untested):

diff --git a/sys/dev/iicbus/iichid.c b/sys/dev/iicbus/iichid.c
index 6f0563d4e55..397c0917d43 100644
--- a/sys/dev/iicbus/iichid.c
+++ b/sys/dev/iicbus/iichid.c
@@ -1250,8 +1250,12 @@ iichid_attach(device_t dev)
                iichid_detach(dev);
        }
 done:
-       (void)iichid_set_power(sc, I2C_HID_POWER_OFF);
-       sc->power_on = false;
+       iicbus_request_bus(device_get_parent(dev), dev, IIC_WAIT);
+       if (!sc->open) {
+               (void)iichid_set_power(sc, I2C_HID_POWER_OFF);
+               sc->power_on = false;
+       }
+       iicbus_release_bus(device_get_parent(dev), dev);
        return (error);
 }

-- 
You are receiving this mail because:
You are the assignee for the bug.

help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-280290-227-J2qn4q3Yrd>