Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4120282ybb; Tue, 7 Apr 2020 00:51:39 -0700 (PDT) X-Google-Smtp-Source: APiQypLyAnfi5nMVL2bjvSTMHDrJjE4b5HR+pcrzufqgdiwH0k//tuyCl6vFzaaUvVVgF5UCHRxm X-Received: by 2002:aca:b854:: with SMTP id i81mr709666oif.22.1586245899466; Tue, 07 Apr 2020 00:51:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586245899; cv=none; d=google.com; s=arc-20160816; b=ANsb9c4zMYTq777mm/RsfxYYHtFFHiLPsYTIGBWnEcGO96isqSEbQzb2Bl8FFq6JpW AFisfE9X5LTVpFT7RqQse7iAmDB2Acutz7jM7dCs50yfqCS0OitUb2oAqREbqKnTQIuf vmkVzqkkXZA8phKHvS2UNv2OIbgGWxxNPGbaAcopgIHGMVI01nRE7qcedybwhGXX5v45 ThNvzez8IPGvAr41yCBCKaC0q/sSDT/mbD6h7B/HBK/aJpQMinOAjRdEZS4mgtcruF5v g63HRuVBiVl0GyVGcED9Ivdj2gwROULT88UHEtNaR9PnlxChhQDAtD4757Pln5WDdOCm /F+g== 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; bh=0xy6duWOZRsuHgXNoNpThMEK6ifcrseX8Tb2v5L0t3w=; b=olscM/ljzuCmdIv7Ecv0Zpq9XjZhImW9wdGn3aWmU3xHTCVK7yIoGrGeYQGLcWRLX2 DYiNA3jPcwNp0sCBf2g6Z4gugUFxeJTAF1Kn/qig+7oIl/MmleZMVJ5b2uhrBfy0ssgY v8o/XYLhIPyggwU4TKCiQsM4YgTg2MviA52DWCYXx2rQaZ5j7iyIPLjspDDIN2EtbKMz DJccfr+4CQ6+cSFGxEQ36mhAejCkpx3yPxbG/bExwN8I1e/8r/wTfxztCH5xDi1UKgh/ 3A7vv6LYmYomp9N3cJWZoLxHwqsOFc1Q4xlttd6kmAdVE+Uu77ikIUi6kxOQFNWk8G1G 0YKw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c26si968002ooe.30.2020.04.07.00.51.27; Tue, 07 Apr 2020 00:51:39 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727873AbgDGHu5 (ORCPT + 99 others); Tue, 7 Apr 2020 03:50:57 -0400 Received: from mail-oi1-f193.google.com ([209.85.167.193]:37861 "EHLO mail-oi1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726393AbgDGHu4 (ORCPT ); Tue, 7 Apr 2020 03:50:56 -0400 Received: by mail-oi1-f193.google.com with SMTP id u20so704036oic.4; Tue, 07 Apr 2020 00:50:56 -0700 (PDT) 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=0xy6duWOZRsuHgXNoNpThMEK6ifcrseX8Tb2v5L0t3w=; b=GjmjozCa9XABCQsxu8udzhj+4g0cFo/678VvU34pINIJ8YH8Kji7kPBBFpOI0n47LI kgDmxgHmsgUcrQtxFBCPHmB1sTfdzCQQytFnlcL84+rnVc99mBS2FAJSpcZzRWBUdrHq jtgtMMx+FV+KN1J0e/ppLVeV/I/vaOcbQQgk0S6rkkVN4l+ZBRFU8RZXWSE0wGglg2Ob oDgy7RVN5YwIyoeI2IE3lk8AEtEF5e/wAHZkUGzg1rGmo7SvM5HUZyEZRfUrKgMwkBn9 ewNBSQhbpMEx5TXUm5mjElvabw7m2HHiLRaIKgJeu1eDyFnQBHztb0jkqO0XPYOns61d Bw1w== X-Gm-Message-State: AGi0Puasw42vU11wl0+z1T4pdTwV4oS+tQ/G98zWBLrUaatDZvuP2E8J A+5HJoUpOVO9j6kM9fle04EjIPZw7EK5pbMUXvgnYg== X-Received: by 2002:aca:cdd1:: with SMTP id d200mr671758oig.153.1586245855947; Tue, 07 Apr 2020 00:50:55 -0700 (PDT) MIME-Version: 1.0 References: <20200407070609.42865-1-john.stultz@linaro.org> In-Reply-To: <20200407070609.42865-1-john.stultz@linaro.org> From: Geert Uytterhoeven Date: Tue, 7 Apr 2020 09:50:44 +0200 Message-ID: Subject: Re: [RFC][PATCH] driver core: Ensure wait_for_device_probe() waits until the deferred_probe_timeout fires To: John Stultz 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 Hi John, 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 Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds