From nobody Fri Nov 19 00:02:27 2021 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 D06AD188F4C8; Fri, 19 Nov 2021 00:02:32 +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 4HwH0h2nKXz4vtt; Fri, 19 Nov 2021 00:02:27 +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 5FFB11E2CF; Fri, 19 Nov 2021 00:02:27 +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 1AJ02RD3072254; Fri, 19 Nov 2021 00:02:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AJ02RuP072253; Fri, 19 Nov 2021 00:02:27 GMT (envelope-from git) Date: Fri, 19 Nov 2021 00:02:27 GMT Message-Id: <202111190002.1AJ02RuP072253@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 870e31d839c6 - stable/13 - LinuxKPI: disable device_release_driver() 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: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 870e31d839c69a5d90e56399a55a7d30d556c126 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=870e31d839c69a5d90e56399a55a7d30d556c126 commit 870e31d839c69a5d90e56399a55a7d30d556c126 Author: Bjoern A. Zeeb AuthorDate: 2021-09-27 17:38:41 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-11-19 00:01:24 +0000 LinuxKPI: disable device_release_driver() As reported by multiple people testing iwlwifi, device_release_driver() can lead to a panic on secondary errors (usually during attach). Disable device_release_driver() for the short-term to prevent the panic but leave it in place so it can be re-worked and fixed properly for the long-term more easily. Sponsored by: The FreeBSD Foundation (cherry picked from commit 93b14194acaf2c2d80df9c4900a90c6644dcd92b) --- sys/compat/linuxkpi/common/include/linux/device.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/device.h b/sys/compat/linuxkpi/common/include/linux/device.h index 4bdc3b831e58..abafcd7ba5c4 100644 --- a/sys/compat/linuxkpi/common/include/linux/device.h +++ b/sys/compat/linuxkpi/common/include/linux/device.h @@ -506,6 +506,9 @@ static inline void device_release_driver(struct device *dev) { +#if 0 + /* This leads to panics. Disable temporarily. Keep to rework. */ + /* We also need to cleanup LinuxKPI bits. What else? */ lkpi_devres_release_free_list(dev); dev_set_drvdata(dev, NULL); @@ -515,6 +518,7 @@ device_release_driver(struct device *dev) if (device_is_attached(dev->bsddev)) device_detach(dev->bsddev); mtx_unlock(&Giant); +#endif } static inline int