From nobody Tue Jan 04 17:18:18 2022 X-Original-To: dev-commits-src-branches@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 3A97619353A6; Tue, 4 Jan 2022 17:18:19 +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 4JSzpf6jDlz4ghx; Tue, 4 Jan 2022 17:18:18 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 C58561CE1C; Tue, 4 Jan 2022 17:18:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 204HIIZR057951; Tue, 4 Jan 2022 17:18:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 204HIIdr057950; Tue, 4 Jan 2022 17:18:18 GMT (envelope-from git) Date: Tue, 4 Jan 2022 17:18:18 GMT Message-Id: <202201041718.204HIIdr057950@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: 7be46aeea126 - stable/13 - bus: retire DF_REBID List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7be46aeea126bcdac228ef8dbbdf9f8606b8bc16 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1641316699; 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=IUM+oJv18bXputKXJjOAzKIBnn9NFznDNK9Ap8I0GjM=; b=mVzlb7rS8c3R1Fnm8zVR9q3aSIoyMu/cO2Jgb5jkVapmd+k+hXblZYZWYmv9Kdhs3NkewS Jp6/mVI7gkaaRlLsBVNtT1LBsALFjZTV6V8mCGjXrUurCH20VVrPKfJZTlSM9nzWhe50OR +PrGc5YG/5FvVb3BMM3211NRTUCxa4N+VlKcCpqzOItmAKnETBw6DKrauvKtk3StE9icqt xEqEn760Rd8jt/RM38xLz8jXnBLOqhbwRFGu4Xm26vn/ZUfq6Y22mkV5Wb2a/AFXqSaKyZ jZKovm/2h75qriScj7Yacg45/OQplQfOs509wHjcRHZkOZdzdLhZOTi6q4OdPA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1641316699; a=rsa-sha256; cv=none; b=j03MDfQ/hd6d9lH1GZL+7sKbcyMgDf7xmG5noIJkyvtYm98lSKbjQw0mnScEHOAhH9wG0S Uh0b9TNC202rDOWtTm+yC+0RnOqzZX5cEhaMETyqpZz/OzEa/Fr9tJWB7FO36fDvaXCF6f 7+GHiO3qCB0xxH4gWPtZBtiVd45zeAqvGaERbIFm8TWQ11yCejvY2YLClJVK933em7wG+S La8yMxywn+utGeK2wMyq14fRkqV5/BCoFcY9XBshgDhhKVuEGnAWPnEc9uSbQ1OdanNnRQ lp9MDvCXQSw3OBDpBFq5+DZkuQatmqbO5/fsuNa0bQ9gYF06cYYs5UodKtvPBA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=7be46aeea126bcdac228ef8dbbdf9f8606b8bc16 commit 7be46aeea126bcdac228ef8dbbdf9f8606b8bc16 Author: Warner Losh AuthorDate: 2021-09-24 18:10:18 +0000 Commit: Alexander Motin CommitDate: 2022-01-04 17:00:53 +0000 bus: retire DF_REBID I did DF_REBID to allow for 'hoover' drivers that would attach to otherwise unattached devices in the tree. This notion didn't catch on as it was tricky to make work well and it was easier to just publish a /dev node of some flavor by the parent device. It's been nothing but dead weight for a long time. Reviewed by: mav Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D32056 (cherry picked from commit 0389e9be63c5e24ecedbb366c5682ddc2ff4de60) --- sys/kern/subr_bus.c | 41 ++++++----------------------------------- sys/sys/bus.h | 1 - 2 files changed, 6 insertions(+), 36 deletions(-) diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index 42c6c3f802d7..04302ab0adf7 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -2085,10 +2085,9 @@ device_probe_child(device_t dev, device_t child) panic("device_probe_child: parent device has no devclass"); /* - * If the state is already probed, then return. However, don't - * return if we can rebid this object. + * If the state is already probed, then return. */ - if (child->state == DS_ALIVE && (child->flags & DF_REBID) == 0) + if (child->state == DS_ALIVE) return (0); for (; dc; dc = dc->parent) { @@ -2190,29 +2189,7 @@ device_probe_child(device_t dev, device_t child) /* * If we found a driver, change state and initialise the devclass. */ - /* XXX What happens if we rebid and got no best? */ if (best) { - /* - * If this device was attached, and we were asked to - * rescan, and it is a different driver, then we have - * to detach the old driver and reattach this new one. - * Note, we don't have to check for DF_REBID here - * because if the state is > DS_ALIVE, we know it must - * be. - * - * This assumes that all DF_REBID drivers can have - * their probe routine called at any time and that - * they are idempotent as well as completely benign in - * normal operations. - * - * We also have to make sure that the detach - * succeeded, otherwise we fail the operation (or - * maybe it should just fail silently? I'm torn). - */ - if (child->state > DS_ALIVE && best->driver != child->driver) - if ((result = device_detach(dev)) != 0) - return (result); - /* Set the winning driver, devclass, and flags. */ if (!child->devclass) { result = device_set_devclass(child, best->driver->name); @@ -2231,11 +2208,7 @@ device_probe_child(device_t dev, device_t child) * sure that we have the right description. */ DEVICE_PROBE(child); -#if 0 - child->flags |= DF_REBID; -#endif - } else - child->flags &= ~DF_REBID; + } child->state = DS_ALIVE; bus_data_generation_update(); @@ -2868,7 +2841,7 @@ device_probe(device_t dev) GIANT_REQUIRED; - if (dev->state >= DS_ALIVE && (dev->flags & DF_REBID) == 0) + if (dev->state >= DS_ALIVE) return (-1); if (!(dev->flags & DF_ENABLED)) { @@ -4092,8 +4065,7 @@ bus_generic_driver_added(device_t dev, driver_t *driver) DEVICE_IDENTIFY(driver, dev); TAILQ_FOREACH(child, &dev->children, link) { - if (child->state == DS_NOTPRESENT || - (child->flags & DF_REBID)) + if (child->state == DS_NOTPRESENT) device_probe_and_attach(child); } } @@ -5327,7 +5299,6 @@ print_device_short(device_t dev, int indent) (dev->flags&DF_FIXEDCLASS? "fixed,":""), (dev->flags&DF_WILDCARD? "wildcard,":""), (dev->flags&DF_DESCMALLOCED? "descmalloced,":""), - (dev->flags&DF_REBID? "rebiddable,":""), (dev->flags&DF_SUSPENDED? "suspended,":""), (dev->ivars? "":"no "), (dev->softc? "":"no "), @@ -5729,7 +5700,7 @@ devctl2_ioctl(struct cdev *cdev, u_long cmd, caddr_t data, int fflag, /* Perform the requested operation. */ switch (cmd) { case DEV_ATTACH: - if (device_is_attached(dev) && (dev->flags & DF_REBID) == 0) + if (device_is_attached(dev)) error = EBUSY; else if (!device_is_enabled(dev)) error = ENXIO; diff --git a/sys/sys/bus.h b/sys/sys/bus.h index fa2b17008691..80fdeb7cd61d 100644 --- a/sys/sys/bus.h +++ b/sys/sys/bus.h @@ -90,7 +90,6 @@ struct u_device { #define DF_QUIET 0x10 /* don't print verbose attach message */ #define DF_DONENOMATCH 0x20 /* don't execute DEVICE_NOMATCH again */ #define DF_EXTERNALSOFTC 0x40 /* softc not allocated by us */ -#define DF_REBID 0x80 /* Can rebid after attach */ #define DF_SUSPENDED 0x100 /* Device is suspended. */ #define DF_QUIET_CHILDREN 0x200 /* Default to quiet for all my children */ #define DF_ATTACHED_ONCE 0x400 /* Has been attached at least once */