Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4653261ybb; Tue, 7 Apr 2020 11:39:49 -0700 (PDT) X-Google-Smtp-Source: APiQypK7YL1J+DU0RPYhLSwvmBK/Bnd9uilUleexuk4MGuDVP5U1mwbZc239sGXWNgYtHAuoJPcS X-Received: by 2002:a05:6830:1e19:: with SMTP id s25mr2790848otr.86.1586284789695; Tue, 07 Apr 2020 11:39:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586284789; cv=none; d=google.com; s=arc-20160816; b=W7BI6p08OTR86beTurCjC/VsyVQHBhR2bhtxpD92NmlrQSDSv3ZEVFstjUHTujE4u8 RfFa+VNwvrNIcsfYED0jghL9ju5/rbbZ5AUNo6jT8QzCoF/+huUxetKjXstXAGhMTAl4 dVWxoFSTb4syeP8Y0SfoljEj0pPxmJEWsMJZM8PuFXDFfAD0c4iGxoWQCCAH9hvuztTL NN3l8ywABd0MLEdjaefyEGT4vLrFbuS3Y5A6B+Q4+p9HBG4N0E7XsMi6s37pmiDHUEKu JbrLyNfvIaTOvcP4J6LnUpbjcltofDNPII6vC3gTl6OqNVxh9hQr4mym22eiWWqX6+JQ XjjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=DfU5H29fCXE3UgX+4sVCKl7laMGWi7iSdKnWzwJAqFc=; b=yLo8kPxrQlozI5w37ITvQ81iOr3sgNnXnSLbs3j1SL7Zieass92akBZPAWzL54jZmS kSnSvia0OGtcNh0Ov1F/2Kld3nMYCqj2+soROqCoGXNQLG+r9ju4Pd7MwhpIyrKSw7hx bWdlnZ2oTeAWa5V0rbLpTF+khLHdir672i240DYEr46bfiGfVgAXkpPuQtgBtV6ysbmY 0/DU/aAuMPrIjRu8UG69UxKjzz3A8ZjS5OQbwKYcXvmTMFhmVoZvmklpkopB8Nevegz0 WnFn7Wj9U577gJVdsVBDCvl24PftG18vv3nkl4KXsmKWCcJqUFzfmf0KY4rDDLWkzMbN QYgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=r3Amgov5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m125si942787oia.240.2020.04.07.11.39.34; Tue, 07 Apr 2020 11:39:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=r3Amgov5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727897AbgDGSil (ORCPT + 99 others); Tue, 7 Apr 2020 14:38:41 -0400 Received: from mail-ot1-f66.google.com ([209.85.210.66]:36168 "EHLO mail-ot1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727849AbgDGSii (ORCPT ); Tue, 7 Apr 2020 14:38:38 -0400 Received: by mail-ot1-f66.google.com with SMTP id l23so4225210otf.3 for ; Tue, 07 Apr 2020 11:38:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=DfU5H29fCXE3UgX+4sVCKl7laMGWi7iSdKnWzwJAqFc=; b=r3Amgov5t5gHc1Vo6J48zl+Kwo3vO8poNSiulyIrPrwzvvmc+vbExumlXUUezgp2e0 ahmpdd62XIm162m5mZX27P7RzSvQAjLc8hopGL9glBIVZT4cxLnIkZiayMsUpTYERFhE kCIkAEBhIgZXyoUB9Nzt5UtNj7sEwP0fWY129L/TacgRefrZ7gOkLBCoRLwlUnT7xk+w cuEjeefzyNNNQWc8hThFdp1JqyLnAoEimChKY9ubvSA0d+CN8nCpBFy6VQfHNkEuMF2N Ahk4ha84IJF27fgAaDOlQV1GuDyNZISxoWXaTkz7i4u+BfZKS8a3wvroUIExmQcz7E1v 5h3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=DfU5H29fCXE3UgX+4sVCKl7laMGWi7iSdKnWzwJAqFc=; b=X3bXEfcDAt1BWUIvirYyIL35M7rMqvmgXJrrZZrt95MUwBlu7jX7j4//SvrCiZgdhs d7d2v/0P7Mf7eYodmZZvzxxo2qBAPXMOQuPdf+zHUsA0mskvrW9kSoqGxIrQv/lTLtFI YLDycre4wqmGnCCmFQN2dhoo+q7SQnXGLgtbDYv5K1ro4utqprvNobsBXDqGIeJUI09f DMzMebQjUL3KYBc+57RMMvuo4r5+ThJE62/q6Uzt1nhSnjhmUSBSRUF7OoRO57qmCAyH yXZ/yjbxACz7bDvJ15QXAZcIvLwuDfC9mU7dPqPwpsjm1AX37UaJKJ1zcvBxXg5FFJpT EObg== X-Gm-Message-State: AGi0PubX4j8z+dQTEwvwjkbKNAKXYcrum3aQzm5+6OHWZAOXh8aFX+JK Odz0QYN6fAYkhOqqvD3xA6Ptp0P2ecTrEPdtMYHehDwM X-Received: by 2002:a9d:7349:: with SMTP id l9mr601660otk.221.1586284717081; Tue, 07 Apr 2020 11:38:37 -0700 (PDT) MIME-Version: 1.0 References: <20200407070609.42865-1-john.stultz@linaro.org> In-Reply-To: From: John Stultz Date: Tue, 7 Apr 2020 11:38:25 -0700 Message-ID: Subject: Re: [RFC][PATCH] driver core: Ensure wait_for_device_probe() waits until the deferred_probe_timeout fires To: Geert Uytterhoeven Cc: lkml , "David S. Miller" , Alexey Kuznetsov , Hideaki YOSHIFUJI , Jakub Kicinski , Greg Kroah-Hartman , "Rafael J . Wysocki" , Rob Herring , Yoshihiro Shimoda , netdev , Linux PM list Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 7, 2020 at 9:46 AM Geert Uytterhoeven wrote: > > Hi John, > > On Tue, Apr 7, 2020 at 9:50 AM Geert Uytterhoeven wrote: > > On Tue, Apr 7, 2020 at 9:06 AM John Stultz wrote: > > > In commit c8c43cee29f6 ("driver core: Fix > > > driver_deferred_probe_check_state() logic"), we set the default > > > driver_deferred_probe_timeout value to 30 seconds to allow for > > > drivers that are missing dependencies to have some time so that > > > the dependency may be loaded from userland after initcalls_done > > > is set. > > > > > > However, Yoshihiro Shimoda reported that on his device that > > > expects to have unmet dependencies (due to "optional links" in > > > its devicetree), was failing to mount the NFS root. > > > > > > In digging further, it seemed the problem was that while the > > > device properly probes after waiting 30 seconds for any missing > > > modules to load, the ip_auto_config() had already failed, > > > resulting in NFS to fail. This was due to ip_auto_config() > > > calling wait_for_device_probe() which doesn't wait for the > > > driver_deferred_probe_timeout to fire. > > > > > > This patch tries to fix the issue by creating a waitqueue > > > for the driver_deferred_probe_timeout, and calling wait_event() > > > to make sure driver_deferred_probe_timeout is zero in > > > wait_for_device_probe() to make sure all the probing is > > > finished. > > > > > > NOTE: I'm not 100% sure this won't have other unwanted side > > > effects (I don't have failing hardware myself to validate), > > > so I'd apprecate testing and close review. > > > > > > If this approach doesn't work, I'll simply set the default > > > driver_deferred_probe_timeout value back to zero, to avoid any > > > behavioral change from before. > > > > > > Thanks to Geert for chasing down that ip_auto_config was why NFS > > > was failing in this case! > > > > > > Cc: "David S. Miller" > > > Cc: Alexey Kuznetsov > > > Cc: Hideaki YOSHIFUJI > > > Cc: Jakub Kicinski > > > Cc: Greg Kroah-Hartman > > > Cc: Rafael J. Wysocki > > > Cc: Rob Herring > > > Cc: Geert Uytterhoeven > > > Cc: Yoshihiro Shimoda > > > Cc: netdev > > > Cc: linux-pm@vger.kernel.org > > > Reported-by: Yoshihiro Shimoda > > > Fixes: c8c43cee29f6 ("driver core: Fix driver_deferred_probe_check_state() logic") > > > Signed-off-by: John Stultz > > > > Thanks, this fixes the issue for me! > > > > Tested-by: Geert Uytterhoeven > > Unfortunately this adds another delay of ca. 30 s to mounting NFS root > when using a kernel config that does include IOMMU and MODULES > support. Yea. I worry the other downside is that systems with no missing dependencies will also see the stall here since we're waiting for the timeout regardless of if there's any drivers missing. So in the light of morning (well, just barely), I think just setting the probe timeout to zero by default is the best approach. The series then doesn't change behavior but just cleans things up. Though, I guess one could argue this fix should go along with setting the value to zero, so at least if folks specify a delay on the boot cmd, things don't fail because they didn't wait. thanks -john