From nobody Thu Apr 18 18:12:30 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 4VL5Tp4d0Kz5HKLQ; Thu, 18 Apr 2024 18:12:30 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VL5Tp25Ypz400Z; Thu, 18 Apr 2024 18:12:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713463950; 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=rnKNZqH9P9MqTJq0gnhafU3I9HnUXlATmX7Qw3ZlwwI=; b=Vl1UfSVIs9klSNiw97xMir6jJgKf95BMZd5r9BcAifJcXjytiIIyu7ER8N1vdX5CNQW9lr snZjj12sOZK8Z0GOgwyNW/ficrkcOSxRfsSxECiVoY4h3EoxztPfkjUhlZ1+6Gv2BF/jNz dkoKI3JSTWo6NqAqPOiDfuhlk7B6kBgTlpHeUuidlD5D/e6emi91RlNYWutZpiC35I93+a 0IS8V3U9vTnoq/cHzPB3EZWNIOIySXYTUNHFfTN++vhL7dRFk5hJD8XonIhHRw1XKDsBoy TR+AL4gUCsSAQ/DF9egb/IcmJsLgrpHo3vbysBCLdAmR8JrTqaom6QLm5SqJMA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1713463950; a=rsa-sha256; cv=none; b=gJwN3P26NQqGOtVfOS4XLB8BSJ/6SyaO/pBN8r/65TkCyFGTgwIpaonQ8zAyCfV2GzSVRs Rm0G62wOqyq0L0ezfGia6o1E1sbIls82vYRa2gNEAN7i9V1RdVAvbKem6h/HONlQDZIGF2 kTHWfs10MNs5mJe7Nm/73KVbRAw8+0NUaqCtWr0BeFqfWVgA3tB9tETBXS5z7iQzcV4WS3 Htpteudum2HkjKQBWlg38EJI/J1VNOqHU5mwvR+CEuq3IScQwE2CohQLw9PZU7ailZ71ou t4+WFUGAgRdDEflfOflKakEJNYU8gIo0sqGuwGOiXbf7bqPQmUqfZQuiYeuQ8w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713463950; 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=rnKNZqH9P9MqTJq0gnhafU3I9HnUXlATmX7Qw3ZlwwI=; b=Qw8uwp7nmwnA9EtvvXOnrmlrGfSxmf7UD8tbURzPsXGkaTmFvbwx6b/yc7C95kb3sze5Re DzqaCnFeFUV6VqtOv1/p9nAIOXU5bjrN9xNd95W9V0qcIsPaVtBvWywI4AoU6uOcDVISuo 4tI7GvKuRc8aGqbzpeM2lFs4530pZ0DEJVNheZtUw5xXebvn1lt//NsJtWmfktOHjSrl9v 5UpMvFMt1PSTVjYjGoTUiYwI1DEf3MI3y/QX5Io131O7Sh5tDjSiHVvDlx2TBXuLAnNTk4 wTyHpq1ty7IZQnXkgxiD7PdQIxazwBZEO0yY1Ao+NNWAe8aW7ziB5+DfZtgDtA== 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 4VL5Tp1jXPzJxd; Thu, 18 Apr 2024 18:12:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43IICUO4016326; Thu, 18 Apr 2024 18:12:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43IICUTb016323; Thu, 18 Apr 2024 18:12:30 GMT (envelope-from git) Date: Thu, 18 Apr 2024 18:12:30 GMT Message-Id: <202404181812.43IICUTb016323@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 9319a8a11a6f - stable/14 - simple_mfd: don't attach children twice 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: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9319a8a11a6fcebc87109f8bf0f5dc362dd1fe07 Auto-Submitted: auto-generated The branch stable/14 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=9319a8a11a6fcebc87109f8bf0f5dc362dd1fe07 commit 9319a8a11a6fcebc87109f8bf0f5dc362dd1fe07 Author: Mitchell Horne AuthorDate: 2024-03-08 14:09:17 +0000 Commit: Mitchell Horne CommitDate: 2024-04-18 18:11:31 +0000 simple_mfd: don't attach children twice Trying to probe+attach the child device at the point it is added comes before the syscon handle is set up (if relevant). It will therefore be unavailable to the attach method which is expecting it, and the first attempt to attach the device will fail. Just rely on the call to bus_generic_attach() at the end of the function to perform probe+attach of dev's children. Reviewed by: manu MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D44268 (cherry picked from commit accda781531788a814bc438e1e96ef544c12aeaf) --- sys/dev/fdt/simple_mfd.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/sys/dev/fdt/simple_mfd.c b/sys/dev/fdt/simple_mfd.c index 888de7756f39..865cd0e2b9ab 100644 --- a/sys/dev/fdt/simple_mfd.c +++ b/sys/dev/fdt/simple_mfd.c @@ -169,7 +169,6 @@ simple_mfd_attach(device_t dev) { struct simple_mfd_softc *sc; phandle_t node, child; - device_t cdev; int rid; sc = device_get_softc(dev); @@ -204,9 +203,7 @@ simple_mfd_attach(device_t dev) /* Attach child devices */ for (child = OF_child(node); child > 0; child = OF_peer(child)) { - cdev = simple_mfd_add_device(dev, child, 0, NULL, -1, NULL); - if (cdev != NULL) - device_probe_and_attach(cdev); + (void)simple_mfd_add_device(dev, child, 0, NULL, -1, NULL); } if (ofw_bus_is_compatible(dev, "syscon")) {