Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1543375ybz; Thu, 23 Apr 2020 00:27:15 -0700 (PDT) X-Google-Smtp-Source: APiQypJWk9Q5XFydDmeGldMcqZstoQ3BcVQVkyYrr4xmGdxeeWYa2AzbApITYEq/0XBj6iQkDLz0 X-Received: by 2002:a17:906:fc3:: with SMTP id c3mr1625089ejk.28.1587626835605; Thu, 23 Apr 2020 00:27:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587626835; cv=none; d=google.com; s=arc-20160816; b=Y3szEUvMsRDNbCHxSRSzBdRu/cWurDEfYGM588nroxM9/3NdWvszaxPjq1JXeB1PEN DTAIxOf8oM5GtO1Qu0ehJ/P29VbPicpmOzceKly7LvGQLriakWUo2BZWcn5XTpOM8sg/ BEjAq+Il5VAQ+6jex0UmcvQfPX9AXLOpuiSTE8OvK7aDPUjrreAVePg5RUk99tLb/T/X B3tpopLk8pZV2iNiX2XXZ73iASlX+xudRQ1ap17lpzuiezQw/l/5lENtBZMdf62Owfte 9YdyOCG7CwmYgVJQe322PTcQEapA87k2DFDZ2Qs9pTRx9+Hr9K3PSCnfGskzOpx8d7ti M2qA== 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=hR8qXCUrS03VnRh/6R/411wkkwogCDGoXvXRhMjvIwM=; b=CgW+15F6PbIj4Y+qQnJ6rPG5olIN9d1lrGA1zpUWIKyNG37nZVe62fFG9kDmcuKaCU 167Hst6DxfCHXQ6kXCIXov66Kq6yqjJy46K9gXieZdCzWoj6au8hO6bMfSpLwgy1EHER zTA5L8Yunj5pD8mdF75dViLgfqkiRkN84Mgx1VUk38tJj92KqAM3vKcr166kmWK0Hy90 7eO+eXds9b3Hc6Ld0JvP/hRLFHt4fDciOO3FJ3fsrExe5a+uytEkFasiqEfezuc4OhlP 6oVbwSv++I+/Pzw831DXEwrhmc6scXj30LDN7yMP7U1l3DBcE9HQkwWlB1Hh/pewcJnh m0Pw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e13si819787ejx.393.2020.04.23.00.26.52; Thu, 23 Apr 2020 00:27:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726667AbgDWHZ1 (ORCPT + 99 others); Thu, 23 Apr 2020 03:25:27 -0400 Received: from mail-oi1-f193.google.com ([209.85.167.193]:45379 "EHLO mail-oi1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725562AbgDWHZ1 (ORCPT ); Thu, 23 Apr 2020 03:25:27 -0400 Received: by mail-oi1-f193.google.com with SMTP id k133so4416554oih.12; Thu, 23 Apr 2020 00:25:26 -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=hR8qXCUrS03VnRh/6R/411wkkwogCDGoXvXRhMjvIwM=; b=WSlXXB0JyekDvRAWPxa01m01YVvu17Ufdn8reO7r4B8Y/ppystzAk0z3IwAEq77aNy Q/3d0osO44oOxyTtPC9TodZw46sin87oMWdk+BIt120fN3xJMpmFHbKjn4kwhwH/g7q8 2yNx/HJUk85YelSeM69j/BA0iuipcC8bq4Y9RcyMUKR7qBXY0J16vpg70Dwd10Lr2m/j mgi2Bcv3segf7+xrlQ+EbIS5OWVRb235vfYNEr/THEXh70Mh8Fzg15MWvVGSbjbC+du6 hLFLF0jbuLtp5dvizb2APDD3+gqHtnqGWzEwOdo5ajT9CXUkods7zmoRmLsS1Zja1t6x j5TA== X-Gm-Message-State: AGi0PuYL3ZctprqIs2TbqOdS0zR30qngHiTUGXIlU/Q1Lj4jzK6nV33I 4VzwORcS+YEZi2rx/HWCt3thLTeyVP+43PeMdvy2dQHQ X-Received: by 2002:aca:f541:: with SMTP id t62mr1960515oih.148.1587626726069; Thu, 23 Apr 2020 00:25:26 -0700 (PDT) MIME-Version: 1.0 References: <20200422203245.83244-1-john.stultz@linaro.org> <20200422203245.83244-4-john.stultz@linaro.org> In-Reply-To: <20200422203245.83244-4-john.stultz@linaro.org> From: Geert Uytterhoeven Date: Thu, 23 Apr 2020 09:25:15 +0200 Message-ID: Subject: Re: [PATCH v3 3/3] 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 , Robin Murphy , Andy Shevchenko , Sudeep Holla , Andy Shevchenko , Naresh Kamboju , Basil Eljuse , Ferry Toth , Arnd Bergmann , Anders Roxell , 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 Wed, Apr 22, 2020 at 10:33 PM 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. > > The downside to this solution is that kernel functionality that > uses wait_for_device_probe(), will block until the > driver_deferred_probe_timeout fires, regardless of if there is > any missing dependencies. > > However, the previous patch reverts the default timeout value to > zero, so this side-effect will only affect users who specify a > driver_deferred_probe_timeout= value as a boot argument, where > the additional delay would be beneficial to allow modules to > load later during boot. > > 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: Robin Murphy > Cc: Andy Shevchenko > Cc: Sudeep Holla > Cc: Andy Shevchenko > Cc: Naresh Kamboju > Cc: Basil Eljuse > Cc: Ferry Toth > Cc: Arnd Bergmann > Cc: Anders Roxell > Cc: netdev > Cc: linux-pm@vger.kernel.org > Reported-by: Yoshihiro Shimoda > Tested-by: Yoshihiro Shimoda > Fixes: c8c43cee29f6 ("driver core: Fix driver_deferred_probe_check_state() logic") > Signed-off-by: John Stultz Let's add my Tested-by: Geert Uytterhoeven for v2. 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