From nobody Mon Oct 28 14:10:04 2024 X-Original-To: bugs@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 4XcZz10xlYz5bNpL for ; Mon, 28 Oct 2024 14:10:05 +0000 (UTC) (envelope-from bugzilla-noreply@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 4XcZz06Dhfz4jfg for ; Mon, 28 Oct 2024 14:10:04 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730124604; 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: in-reply-to:in-reply-to:references:references; bh=mx1046txK8dUToRcxEuOT3LyzoRAU/Vgvb9wRG/zUpk=; b=rzniTgO9KVTLKpyxcROQzj4WUmdTkBcrBnrJO+9i/Jbw3IWdETaDSgb8wkQ5aKqKgMcYm1 v4Z6FpcCMZLfr9RUWcf8+IGSnIhk3eemfC70KorNrWJdt+NnNOn5jnjBqlmiy9N1nF6FaI sRTByMX28fIzKezTAXj3/RurAOYfyJuTWOUkTdYVSutkc0RtCGCV3o7AYNx7FuSPT1jkIG ooQKxZcmaysWRpx9ebMUFqUouLuUCVobdhJB33SjvAO8m0NNElBMdzbTyzGTGAOx6RrFuu Aoi7T5Fe9qLpTKVXXw/e1vv15Buab4xKa2tO3dKVGFa1ZmMnf9esHlj+BJY4Pg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730124604; a=rsa-sha256; cv=none; b=mLZ/13nuj57xOXqHX9t6ai4oZAe9oeuMTBuoWrch2nB8skPDNjX2yMNZ3M8Psejt+c2Aqi wSJLNZgHfzokfTRr+AlyLeGGqi+VG+jOTeG5SJsbQJe4RJlyIIlHbQstQoj51zq5B6pCp6 M1jWUdHr0yQOkzuER40nY1mO4O7FyDSxm6mT3uipYud9xHGBCBlKnGqk5JAiE1o0b4hzUB W87Y3dmKSe3eFABM4B4ov+VXfGZdT/9kppbuCHcY7xAPAkSuGsdrqvQIMsuOpNRxbw1ua5 Yk8n+5nEdeI0gt2F188MbUOWuNFZvXu+zBbbmB7i6rB4tWUfTnc9ZYyQCtnLZA== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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 4XcZz05hXXzhP4 for ; Mon, 28 Oct 2024 14:10:04 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 49SEA4AR076996 for ; Mon, 28 Oct 2024 14:10:04 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 49SEA4Hk076995 for bugs@FreeBSD.org; Mon, 28 Oct 2024 14:10:04 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 280290] hms(4): Broken fresh after boot, fixed by resume Date: Mon, 28 Oct 2024 14:10:04 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 15.0-CURRENT X-Bugzilla-Keywords: regression X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: trasz@FreeBSD.org X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@FreeBSD.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D280290 --- Comment #31 from Edward Tomasz Napierala --- Okay, after talking to jhb@ it appears the child devices are attaching too early, and the easiest way to solve it is to move the call to bus_generic_attach() further down, after power off. Here's the proposed pa= tch: diff --git a/sys/dev/iicbus/iichid.c b/sys/dev/iicbus/iichid.c index fc9f5c2a68b3..a2c0878697f6 100644 --- a/sys/dev/iicbus/iichid.c +++ b/sys/dev/iicbus/iichid.c @@ -1124,7 +1124,7 @@ iichid_attach(device_t dev) if (error) { device_printf(dev, "failed to reset hardware: %d\n", error); error =3D ENXIO; - goto done; + goto fail; } sc->power_on =3D true; @@ -1162,7 +1162,7 @@ iichid_attach(device_t dev) bus_release_resource(dev, SYS_RES_IRQ, sc->irq_rid, sc->irq_res); error =3D ENXIO; - goto done; + goto fail; #endif } @@ -1195,16 +1195,21 @@ iichid_attach(device_t dev) device_printf(sc->dev, "Could not add I2C device\n"); iichid_detach(dev); error =3D ENOMEM; - goto done; + goto fail; } + (void)iichid_set_power(sc, I2C_HID_POWER_OFF); + sc->power_on =3D false; + device_set_ivars(child, &sc->hw); error =3D bus_generic_attach(dev); if (error) { device_printf(dev, "failed to attach child: error %d\n", error); iichid_detach(dev); } -done: + return (error); + +fail: (void)iichid_set_power(sc, I2C_HID_POWER_OFF); sc->power_on =3D false; return (error); --=20 You are receiving this mail because: You are the assignee for the bug.=