Article View: linux.kernel.netdev
Article #23395[RFC] PCIe host controller async probe vs PHY request_module deadlock
From: Hans Zhang
Date: Fri, 27 Nov 2026 07:43
Date: Fri, 27 Nov 2026 07:43
55 lines
10640 bytes
10640 bytes
Hi Andrew, Bjorn, Mani, I'd like to raise a cross-subsystem issue before sending a one-line fix. Several PCIe host controller drivers set PROBE_PREFER_ASYNCHRONOUS so their root complexes are enumerated in parallel. On the CIX Sky1 SoC the driver probes up to five root complexes. When it enumerates an RTL8126A NIC, the NIC's mdiobus_register() runs in an async worker, and phy_device_create() then calls request_module() synchronously. That hits: WARN_ON_ONCE(wait && current_is_async()); and can deadlock, because module init may call async_synchronize_full(). This is not specific to Sky1. The same pattern exists in many PCIe host drivers, for example: pcie-mediatek-gen3.c, pcie-rzg3s-host.c, pcie-aspeed.c, pcie-stm32.c, pcie-qcom.c, pcie-spacemit-k1.c, pcie-rcar-gen4.c, pcie-andes-qilai.c, pci-layerscape.c, pci-imx6.c, pcie-nxp-s32g.c So any of them could hit the same problem when a downstream device probes an MDIO bus. I see two possible fixes: 1. PCI side: force synchronous probing on the affected host controller driver (PROBE_FORCE_SYNCHRONOUS). This is self-contained and low-risk, but serializes the root complex enumeration. On sky1-xcp (three root complexes) the measured boot time is close to the async baseline, but that measurement does not include PCIe PHY enumeration or link-training timeouts. Serializing the root complexes would sum those latencies, so the real cost grows with the number of root complexes and PHYs. 2. net/phy side: return -EPROBE_DEFER from __mdiobus_register() when current_is_async() is true. This keeps async probing and fixes all MAC drivers, but I audited the in-tree mdiobus_register() callers and found some (lantiq_etop, smsc911x, smsc9420) that convert any error to -ENXIO and would not defer correctly. Could you advise which layer should carry the fix? If the preference is the general net/phy approach, I can follow up with a more detailed audit of the callers. Test data on sky1-xcp: - unpatched async kernel: the kmod WARN is present; - PROBE_FORCE_SYNCHRONOUS: WARN is gone, both RTL8126A NICs still probe and bind their PHY driver, NVMe/root and the serial console are normal. Init starts at ~2.63s versus ~2.79s for the async baseline in this three-root-complex configuration. This measurement has no PCIe PHY or link-training timeout in the path, so it is a lower bound. Best regards, Hans
Technical Details
Message-ID:
<20261127074329.747914-1-18255117159@163.com>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-372522-linux-kernel-netdev=dewy.ruShow Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-372522-linux-kernel-netdev=dewy.ru From: 18255117159@163.com (Hans Zhang) Newsgroups: linux.kernel.netdev Subject: [RFC] PCIe host controller async probe vs PHY request_module deadlock Date: Fri, 27 Nov 2026 15:43:29 +0800 Organization: Usenet Network Message-ID: <20261127074329.747914-1-18255117159@163.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="674053"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:iYtMv8xgJsZdktPcNsJ+qvFcCtE= sha256:qaZrhNz810HDftxmraNpMI06ukCNU4fTGHsmRUwqLHg= sha1:gVsqVZhgvTwkrq8dfloIyOecYZE= sha256:apw1WzIf1bJ4ny+q6+9afego+PudeNer3EGRJvCjVVU= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 196D2125F13; Fri, 27 Nov 2026 10:44:56 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -2.816 X-Spam-Status: No, score=-2.816 tagged_above=-9999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, FROM_LOCAL_DIGITS=0.001, FROM_LOCAL_HEX=0.331, HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, UNPARSEABLE_RELAY=0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (1024-bit key) header.d=163.com X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7SSzJ6DfSHFs; Fri, 27 Nov 2026 10:44:52 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-372522-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=163.com X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mail.dewy.ru (Postfix) with ESMTPS id 40094125F10; Fri, 27 Nov 2026 10:44:43 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by tor.lore.kernel.org (Postfix) with ESMTP id 03204256FB; Fri, 27 Nov 2026 07:44:40 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1795765479; b=nYyOZUepeE5rrOcOmtqU8XQ0kBjPknvtXUx59Az9xXlo5lO+Kgi7mC0LOFLBFjWWe9HH 0NAZe3CuswiCzWXwcB6F2IQTOEvKUseEfLqNIOeCH9rBdRPJGr5gyrfAzt3uWmJGEriOp 32Axotx3U/IKb6ZY5aAkvogePpicBTdLuCcfBPqC3fodMYAM/0JEBRnaLaJ1hb4lvNrbZ xpbd6SQPvMwu6QNHV7NJnNbSV0t0kRxO14e3TeWNzVB6rKKVZikfs3FqkAWDcfaMlDgp1 cCiI2EKdpSgTwfVwp2blW48gJHDUOgq2dMcpsYMxSEGR7IYe67jCPkxtAW1D6ncJ4cg== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795765479; h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:Received:From:To: Cc:Subject:Date:Message-ID:X-Mailer:X-Mailing-List:List-Id:List-Post: List-Help:List-Subscribe:List-Unsubscribe:List-Owner:Precedence: MIME-Version:Content-Transfer-Encoding:X-CM-TRANSID: X-Coremail-Antispam:X-CM-SenderInfo; bh=FPV4ZeWzsKzafgZAHwIqdOFaSmYfPco7h5vg+lLApZ8=; b=ZukMlgr7NUVmPBBvyRp51Pefcwcgk4YpxSu2tNXwIfnYPEdfFvb3VLsW+AuTSi+pXc7s dMcgUIgotNNM3yVyEvPkYi+C0QZG6MnJDezsU8gn7toY3HyiW1PMP+ZnXj7/9lJIui9Ht zvNZzp9G6Hcc0wSLP3HxhPXxTPXqKcJWhaLH4t+E8oEg9uyDgqdVoXhfyYVgmVXniP9K1 MUXwtOUEzAqYgZl1AMIsRz7NH7JsEELDko4VT6YzyhNTsUyC3+Wcax8F5g2YgE9mBbfBc saHsT3VztLg6ZqbZXVv2GQJ/XaoQp8cpgpnNnPxaIb73he2UQWAqJKPChH555M5EjyA== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=163.com header.i=@163.com header.a=rsa-sha256 header.s=s110527 header.b=OtqegQ+W; dmarc=pass header.from=163.com; spf=pass smtp.mailfrom=163.com; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4E765606A329; Fri, 27 Nov 2026 07:44:39 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.a=rsa-sha256 header.s=s110527 header.b=OtqegQ+W X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=220.197.31.3 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795765478; b=wXr33sWrz5YqGiKzx6TIt/bGAkF19+B9q38/XYBcF6+SQV4QU7zynvKKIFUxKKII7YVh pi37W0nSIou9aJmiejsaa1fw5LpaXIRsNl98nLHXc1Oy8jFcUAoFSQQ3nD8l2MPVszfYG OGPbMAV3nVkWRQnvDvBcC7JD6SYlNjPX/yvFueYfNv2S/78JwmLhsqw22LVTbXwgZGqfL x8BXQ9dNesH7PJGy6PbUEcrOQ7BYiRcnFqCx5790AX0kFkj7yBEW9VXhYTUkNUw6msAdj HS4i/XIn17i8O0bjho2yRU8rl90W6KzpbQuCCXnZu/jGXOdU1nZGGSa7wphz36laukg== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795765478; h=DMARC-Filter:DKIM-Signature:Received:From:To:Cc:Subject:Date: Message-ID:X-Mailer:MIME-Version:Content-Transfer-Encoding: X-CM-TRANSID:X-Coremail-Antispam:X-CM-SenderInfo; bh=FPV4ZeWzsKzafgZAHwIqdOFaSmYfPco7h5vg+lLApZ8=; b=ehyxfwVBeNmB/b/HXeGV8wewZuv9Pm109J4Yig2lWFdBp9uzDt/lLRfTKHPdmgfz9laW x507Unvkn7xJm7LvzgUx1c9YVfxDBjZIGUVsbogc4DQnffwZOT7JaqwQkPK1ju+7rZJjb QG8wX8DDEdqSvnBrOPUsspPHsEkQrXjzV8g7hzvClfU5XOLvI+3qQ2qN4XAikZkoXlME+ /Mi6lE9d9dzQIW7rLmSZ4JRvpgaUl9AgEOgPGEaOx+IZsKsZCxVe546uwEDiQL1Ky87BA oJoD4aE4M8pBEGsvoq30cQ9fZMmOvTvYx7tqIetUHqpZCkDSd8ilrV2BKl5saDfEoYA== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=163.com; spf=pass smtp.mailfrom=163.com; dkim=pass header.d=163.com header.i=@163.com header.a=rsa-sha256 header.s=s110527 header.b=OtqegQ+W; arc=none smtp.remote-ip=220.197.31.3 X-Received: from m16.mail.163.com (m16.mail.163.com [220.197.31.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 531DE606A683; Fri, 27 Nov 2026 07:44:35 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 531DE606A683 X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=163.com X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:To:Subject:Date:Message-ID:MIME-Version; bh=FP V4ZeWzsKzafgZAHwIqdOFaSmYfPco7h5vg+lLApZ8=; b=OtqegQ+WsoVQZC4jWs fNL6ucp3gde4uh0U6/m8UPE6PjtxtuTNIRIFv2nlVU0nOtEncAoiorj2NfgV6uSV zLcAkKd/bfVEVD6sLRewWwkMljY5HxrSGUEpLR8CxjPgw24qQQdv/OTv2Zg8c52V jEic8T9D77GAxcNlB2TXLwpw0= X-Received: from Precision-7960.. (unknown []) by gzga-smtp-mtada-g1-0 (Coremail) with SMTP id _____wDnL2WhNAlr_sSUJw--.29769S2; Fri, 27 Nov 2026 15:43:31 +0800 (CST) X-Cc: linux@armlinux.org.uk, netdev@vger.kernel.org, inux-pci@vger.kernel.org, linux-kernel@vger.kernel.org X-Mailer: git-send-email 2.43.0 X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list X-CM-TRANSID: _____wDnL2WhNAlr_sSUJw--.29769S2 X-Coremail-Antispam: 1Uf129KBjvJXoW7KF45Ar15ur4xuF1rAr43Wrg_yoW5Jr4rpF WrWa9Iyr4qqrZ2vr4kAr4DZFySg3yxCay7tFn5J3y5A3Z0y34q9FWjk3y3ZF4DGrZ2k3W2 qF4j9rW5u34DAFJanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07jjuWLUUUUU= X-CM-SenderInfo: rpryjkyvrrlimvzbiqqrwthudrp/xtbC6wRT9msJNKQLpQAA3W