From nobody Tue Nov 12 23:28:51 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xp2fq3c5kz5cnZ1; Tue, 12 Nov 2024 23:28:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xp2fq1z7Lz4bZR; Tue, 12 Nov 2024 23:28:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731454131; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jwFGZuzpZFseUg5ZW/131rSLIeLMV5yI1O2pHH69mmc=; b=uObBCZmOUcK2hiwMIYQh38fe6VuDvOpPHVMhMszAGIHdXXiiMRpo2Y10Lco8OHugunpGLO wS638v9PuHMMOcBBt7Op0aIKFuPjEWE4fr5T/LEmhiAEmLjpIFz8kgxaP6HX/zKjDU/32i fVBiParFk2+9VBAKoxLX5g6iQ4IxAG9+E1z/wrlbytqJFDJbnxWJwcPoSSVC54BgN5xM17 jXWrBUSB/EmQ1p2mkJ0ns9R9CSOjFNZUCqLqC4xIVHJ9uoHk0DdOlDpucNAZigMO7NB0hW FGCh/JvTtJ2ATzpNm1bSHmSTmStwy5MfE+ZOgAYs6ZHSFAIw/wls2CugsOoLeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731454131; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jwFGZuzpZFseUg5ZW/131rSLIeLMV5yI1O2pHH69mmc=; b=mpOdJ6f+++W1J4OEJf2RdGg1+LLalZmRkJBOo0klVsEXVieKxhm8grmwNSCqj7ncdpl7aU Rv2mL644plgD9Zi8lzaOsOWvpoS1XIN/75H2p51WoZx2AnYF9XDXjJ2O2NG07oimV2knD0 ydAbb8/4EG9UDpEl4wTpy1Ot7/Pp4teVqSCbnZuMnM98fxMEzrQ7pyeY8tM8cMULTxCnul sHiwR6BrHu2BzTTvvcGzqfWpUB/RJamC/INTujLaZF3pgkcYCyXgqyhpdrBLIiuMVqBoJG Mqn4TpRa+wbfRIhoOb4qlHT03ooXxRab7m1vXhiV9Zry49UXxG4Dw7RZtab07A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1731454131; a=rsa-sha256; cv=none; b=qbb8yL/4zZ5wLBJPH3rGLlnEqhy7UCNtFG4BkUhkd7dg3Xzdv6IRXTqyTvytdYZeJ3dpsX 68C/dvyp5PZ/iahgfOKo+HYeoi3A/ODTsqwFNinHABkqOJvP48GGgMBhsrkCnVt/6sRkWF 3iN8bESUdA2/ruORXvYDvWfZvpEs03mLMob019t3UzeIkPAlptZgCqxP37zuWJIhYKryfm gIJlk5j0uCMguyl9a832mg8vmaAxgJve9HB0k4LlEKaMe5Ed5rhWusgKUUgAfIygQH1j9k 9fObPBVbfAvWhgEBr/vOajaLQ4Y10ZOwHrLpZQGSoSzsXZS0t9u+Hbhl4mitVg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xp2fq1S94zW51; Tue, 12 Nov 2024 23:28:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4ACNSpbj003096; Tue, 12 Nov 2024 23:28:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4ACNSpfj003093; Tue, 12 Nov 2024 23:28:51 GMT (envelope-from git) Date: Tue, 12 Nov 2024 23:28:51 GMT Message-Id: <202411122328.4ACNSpfj003093@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: b8276743e4bb - releng/14.2 - iichid(4): Do not power down opened device in attach handler List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.2 X-Git-Reftype: branch X-Git-Commit: b8276743e4bbff1c11e910eef1599cbdfd88bc38 Auto-Submitted: auto-generated The branch releng/14.2 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=b8276743e4bbff1c11e910eef1599cbdfd88bc38 commit b8276743e4bbff1c11e910eef1599cbdfd88bc38 Author: Vladimir Kondratyev AuthorDate: 2024-11-08 19:23:38 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-11-12 23:27:30 +0000 iichid(4): Do not power down opened device in attach handler Some iichid(4) child devices, currently hkbd(4) only, opens parent device in their attach handlers. That breaks internal iichid(4) state leading to rejecting any incoming data on software and hardware levels. Fix it with adding of extra state check in iichid(4) attach handler. Approved by: re (cperciva) Reported by: many Submitted by: trasz (initial version) PR: 280290 MFC after: 3 days (cherry picked from commit 018cb11cb7d412b031e1be681a6a19e734473f99) (cherry picked from commit c53ec86f0ee97f07f80c0902b189c845bf448e7d) --- sys/dev/iicbus/iichid.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/dev/iicbus/iichid.c b/sys/dev/iicbus/iichid.c index 1e0dac2ee5dd..e99facdb06bb 100644 --- a/sys/dev/iicbus/iichid.c +++ b/sys/dev/iicbus/iichid.c @@ -1205,8 +1205,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); }