From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-dl1-f51.google.com (mail-dl1-f51.google.com [74.125.82.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BFEAE1B983F for ; Wed, 25 Mar 2026 04:13:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774412009; cv=none; b=J6WqpDbBk+/eURl3SbRYydhhAFbUHyeMEluhO6G5kbDkZYGmINKEjcjd1t3lgAtYOTpjOncI2ZcNUbOL7/sjPhXuj+F8HOHoLeJY6x23X0TJMt8qtgnPxvhIcU6j7AwKbagjANMLi88di5NMDZ6s1/G+zthxRqZhn1F2Z+IL9YU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774412009; c=relaxed/simple; bh=YWJtRNIJC9eKjyIJLS3+9nz0cFYlkBsezKB5NPwjwvA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=rrPejyHnLCDjjyKhGiXitEwCh8MXfTa5VLU5VH8Dnt2odp7Zhs3HmjLx3d6HplN8dBKZuJpBLKOBh7qenKAs7t/KGocfxkCCkVmZVZeRg8kxCVHTYclerYqUgcCW+YDlDgk20tXP4MdC+cojLNFoGWA3DWwqoW4nzr2hgNWXU70= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=UQfMxbmT; arc=none smtp.client-ip=74.125.82.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="UQfMxbmT" Received: by mail-dl1-f51.google.com with SMTP id a92af1059eb24-12a693cdf29so518370c88.0 for ; Tue, 24 Mar 2026 21:13:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774412006; x=1775016806; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=A1zx9FotWDsXciTr6vSKC3+KwJ/ZkglPq04NJzxyt/k=; b=UQfMxbmTrLV6eq+Zt9gmka9m+t8q+z8ZRCAYdsprOeurEdoLf8JnuYsFFVGgCP0u80 baVPFhsV1saSqBD8V97wtaxlx7nk0+/3P1cV6GcsonqQ5viOIjo+lTuW5LAR/rs0F4iz vJcYlOT4lzjutaPIvtkQZ62JB1DoFdLQD3rpvUaTfw2oNXZwJHkVJBzb+6dJxqGS1rjm tzwDqxawRKAGM4ng9Zf2DsFhuM3vyV1r9XS5Fy2maHOQJ/WDBuvfp5SAKoZOJ/mSNSjt BDLh72FCChkaJg1cVlRNXL4ZVY3Vql+d8VoLDueWjsVFswkl3m9YlB3gZ8Dul5vmY/8a uwmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774412006; x=1775016806; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=A1zx9FotWDsXciTr6vSKC3+KwJ/ZkglPq04NJzxyt/k=; b=Qb69lwRpTdUIi05fXpuRd1bELnhfI+lw8CJHsIGN/D6ok+n/vnFhh6RLDJU9Wb+mT6 OBHiPoN4RlIlFnhkiq/jevLT7dN2+exvlTGuF/VNsKcHXKmnxfDbV6tc+OobEyTostH4 fH8l33ak6teDtuVMHwiLs8ssIHumetDhQnyLEmx5x/KQa0NlilTCFbqMIpCGE3SXa96l 0ktPRC4CciqzMoeIC9X8rOsAMO4MOK+pQTJ+FIvGyFv34TyV7CZNeWFzNChHwFX3Ztlm 8cnDdgrErQxr6h156up8nZtU82VJE6iuhSs+fFfjYyp6Q8Nq71YZX+JTtKkEufI8KxSg YLaA== X-Forwarded-Encrypted: i=1; AJvYcCX9ibQcxX2udj3z/jc2Mzj5OnZ+735EdAIGIeHp1DGHHApuWbpmWM/NEEdwJR67JfDVQU037UjaCAHaEK0=@vger.kernel.org X-Gm-Message-State: AOJu0YwWgZkegvDcvDa0jVxzR+ycpKCP57EGgSWct5n3yuiBpB4g/rNo G/HeISJBygXQowenlDONk0Dz2GzB3S7ixEG9tcj7QICeAcDxcoG7hUYK X-Gm-Gg: ATEYQzyLpEDjYcO0m4O5JE/7Ku+80nRio/zSA+XMNp2rPKaftqt6KZc2qAdaLMSaXAX HgJDvhiggh/6tB/snrOJxKZw6smE0BJWmu/mXC70HGiIPRHr0A4i+iZqBU7eDQ/NCJBU1nJhD/W TVazukOl6Jp2tG3AdphQdjczHujxx952B3m/6BOv8dSLYD8xBeUAUELEiHAz72kfgcKeaOdSDwJ vgT7PMtwNWzsYZnE2CAdPr5QQIX4t15efvp944HC8OHzco7vIwwXNcN3N0ArG5t9uq5khg7IKgX fERkT2q6vumfkePEiYj5D7Sp15sjxrS8FaC7Xhh+iVTK70y7dcORU8UBPMISjyvgpPMJZJEdn1A +2lW43gMZtOUEhNTj/4GpQjxliEW5j6K2jBmu5w4xC62TZ6rxPIDQhLYB/IX7MNG1StgZsbZ1Op 5/bHxLB5aLdswhQn7xSg3h5eXpBQ1GWEmBc5TYxRgccNZnQ4uLIEPeLz57uSZmoSLtBSJSC2jAk Ec= X-Received: by 2002:a05:7022:418b:b0:128:f1fd:78be with SMTP id a92af1059eb24-12a9684c64cmr1091744c88.5.1774412005575; Tue, 24 Mar 2026 21:13:25 -0700 (PDT) Received: from google.com ([2a00:79e0:2ebe:8:a686:fd7f:70d3:9156]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-12a733b4a39sm12292420c88.3.2026.03.24.21.13.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Mar 2026 21:13:24 -0700 (PDT) Date: Tue, 24 Mar 2026 21:13:20 -0700 From: Dmitry Torokhov To: Robin Murphy Cc: Danilo Krummrich , Manivannan Sadhasivam , Manivannan Sadhasivam , Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Rob Herring , Bjorn Helgaas , Heiko Stuebner , Niklas Cassel , Shawn Lin , Hans Zhang <18255117159@163.com>, Nicolas Frattaroli , Wilfred Mallawa , linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Anand Moon , Grimmauld , Greg Kroah-Hartman , "Rafael J. Wysocki" , driver-core@lists.linux.dev, Lukas Wunner Subject: Re: [PATCH v3] PCI: dw-rockchip: Enable async probe by default Message-ID: References: <20260226101032.1042-1-linux.amoon@gmail.com> <177260693908.10259.13055467642416391434.b4-ty@kernel.org> <87bc37ee-234c-4568-b72e-955c130a6838@arm.com> <5d88fb5b-e771-4ea6-8d2c-c5cfd21e5860@arm.com> <55c28218-1638-4b90-a9cd-a177fb5abcb6@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55c28218-1638-4b90-a9cd-a177fb5abcb6@arm.com> On Thu, Mar 12, 2026 at 12:48:36PM +0000, Robin Murphy wrote: > On 2026-03-11 9:09 pm, Danilo Krummrich wrote: > > On Wed Mar 11, 2026 at 1:28 PM CET, Manivannan Sadhasivam wrote: > > > On Wed, Mar 11, 2026 at 12:46:03PM +0100, Danilo Krummrich wrote: > > > > On Wed Mar 11, 2026 at 6:24 AM CET, Manivannan Sadhasivam wrote: > > > > > I have a contrary view here. If just a single driver or lib doesn't handle async > > > > > probe, it cannot just force other drivers to not take the advantage of async > > > > > probe. As I said above, enabling async probe easily saves a few hunderd ms or > > > > > even more if there are more than one Root Port or Root Complex in an SoC. > > > > > > > > Then the driver or lib has to be fixed / improved first or the driver core has > > > > to be enabled to deal with a case where PROBE_FORCE_SYNCHRONOUS is requested > > > > from an async path, etc. > > > > > > > > In any case, applying the patch and breaking things (knowingly?) doesn't seem > > > > like the correct approach. > > > > > > > > > I strongly agree with you here that the underlying issue should be fixed. But > > > > > the real impact to end users is not this splat, but not having the boot time > > > > > optimization that this patch brings in. As an end user, one would want their > > > > > systems to boot quickly and they wouldn't bother much about a harmless warning > > > > > splat appearing in the dmesg log. > > > > > > > > You mean quickly booting into a "harmless" potential deadlock condition the > > > > warning splat tries to make people aware of? :) > > > > > > > > > > Hmm, I overlooked the built-as-module part where the deadlock could be possible > > > as indicated by the comment about the WARN_ON_ONCE(). > > > > > > But what is the path forward here? Do you want the phylib to fix the > > > request_module() call or fix the driver core instead? > > > > Here are a few thoughts. > > > > In general, I think the best would be to get rid of the (affected) > > PROBE_FORCE_SYNCHRONOUS cases. > > > > Now, I guess this can be pretty hard for a PCI controller driver, as you can't > > really predict what ends up being probed from you async context, i.e. it could > > even be some other bus controller and things could even propagate further. > > > > Not sure how big of a deal it is in practice though, there are not a lot of > > PROBE_FORCE_SYNCHRONOUS drivers (left), but note that specifying neither > > PROBE_FORCE_SYNCHRONOUS nor PROBE_PREFER_ASYNCHRONOUS currently results in > > synchronous by default. > > > > (Also, quite some other PCI controller drivers do set PROBE_PREFER_ASYNCHRONOUS > > and apparently got lucky with it.) > > > > From a driver-core perspective I think we're rather limited on what we can do; > > we are already in async context at this point and can't magically go back to > > initcall context. > > > > So, the only thing I can think of is to kick off work on a workqueue, which in > > the end would be the same as the deferred probe handling. > > Hmm, in fact, isn't the deferred probe mechanism itself actually quite > appropriate? A suitable calling context isn't the most obvious "resource > provider" to wait for, but ultimately it's still a case of "we don't > have everything we need right now, but it's worth trying again soon". > I may have missed some subtleties, but my instinct is that it could > perhaps be as simple as something like this (completely untested). > > Cheers, > Robin. > > ----->8----- > > diff --git a/drivers/base/dd.c b/drivers/base/dd.c > index bea8da5f8a3a..3c4a0207ae3f 100644 > --- a/drivers/base/dd.c > +++ b/drivers/base/dd.c > @@ -954,6 +954,16 @@ static int __device_attach_driver(struct device_driver *drv, void *_data) > if (data->check_async && async_allowed != data->want_async) > return 0; > + /* > + * Bus drivers may probe asynchronously, but be adding a child device > + * whose driver still wants a synchronous probe. In this case, just > + * defer it, to be triggered by the parent driver probe succeeding. > + */ > + if (!async_allowed && current_is_async()) { > + driver_deferred_probe_add(dev); > + return 0; > + } That means that you are kicking the majority devices (for now) into deferral path. I do not think this is optimal. Does phy really need to request modules synchronously (and on its own)? Why can't it rely on udev to load the modules and signal when phy devices are ready? Seems like a deficiency on PHY subsystem that is stuck in times long past. Thanks. -- Dmitry