Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4559011ybb; Tue, 7 Apr 2020 09:47:06 -0700 (PDT) X-Google-Smtp-Source: APiQypIqm3rZJuXIVBh8VFo6HT2nxjwFyhyKaHN8Jssn0bzxCd+XRkAnieoYDs9vAxjH5gORjNHx X-Received: by 2002:a9d:221:: with SMTP id 30mr2206796otb.41.1586278026345; Tue, 07 Apr 2020 09:47:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586278026; cv=none; d=google.com; s=arc-20160816; b=0dNVQN9tkhv/VQJ+mhI6cB5Lp6VpW5krcRa8mpu079FnfBg/pCkQsh5pBvYiZfJB0l xPH3JJFk5UMkYkZrQJsuDYfh+9i1ADyfedDhWjXKgvwIkpaTWly74aiJaqG0uyZNMuaD UJt1FE+wlFSD1H2ZR7tLP1vtDvFM5AwlRjpWKMBM5Tgyq1d241Sh960gD5cxiosseCL1 10wkyWY5GtBe92/Du5ceL3O7Iikjl167IUmryfYCtSur2ZgamQ765oLDi+7+0yy+iy7b GmsBLZRzidN80KWLMcaLrW8LzObTj3JIJ7fo8L6yvlciIYzTz5TthozW7QISWmUHxq/f u+VQ== 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=xdgq/m7wdEH2dNnMYJSAVng7ahhHHb6G51Gt5KF/eIE=; b=upGWnC/YA3xU4rxNtRrHsSE/jhRm4ZKkMuNDaGWknhrp9j2zJdCqIY+ujREhiUL7/d sQxopYlGxTnE4uxLmJCz7Adk+PIpcpBbZgbXuBvKsRN3y7K2SZOlMcgTv9Qgp7Ionc65 Vx8iIgio4hxhx6U8Z85MjZpZCw/WFXcHtGGkzUJeCluVwcJado+XgnY1mRXeC0CU3d8s bFfrwWL+VrBs7ZqaOBIS44OmbkKv1w5gJFEIc9d/8TTs1TrI5ekgxZyMMusGQzqAiGX+ 997ldoG7y02gwPzysZY2vFNGbG1NuhOPqIE6e0OF3yC0uTT6uFJZ+TDrzGLfFa9fT2/K oKrw== 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 z3si1432582oth.163.2020.04.07.09.46.53; Tue, 07 Apr 2020 09:47:06 -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 S1726595AbgDGQqO (ORCPT + 99 others); Tue, 7 Apr 2020 12:46:14 -0400 Received: from mail-ot1-f68.google.com ([209.85.210.68]:42989 "EHLO mail-ot1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726332AbgDGQqO (ORCPT ); Tue, 7 Apr 2020 12:46:14 -0400 Received: by mail-ot1-f68.google.com with SMTP id z5so3791385oth.9; Tue, 07 Apr 2020 09:46:13 -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=xdgq/m7wdEH2dNnMYJSAVng7ahhHHb6G51Gt5KF/eIE=; b=s4Lo3YTd/0taYIpS/hvoRk2OPALB6aVfQbAzrtaBMDyyOWxo8unOLTX1mfFXkh+Rsr VvImF9fLGZQJtSzd/BD4SZ6ywE1JwWl8BtX+odVNtnXhVD/kh2l64EZYxUeDq+Mxg3mH K96189OihepaUS8GSBYwwEzijhXyty2os9fFw+ua9cGJ/lahPaEWryoInNEQQzBh2JWF Fu0p5DhxmsIXyPI1r96X5RpbXxqYfl6HwEtgD6wdja2E5dtDchGulg14FMkyVzNprLOJ q9HWUbFjqJgt+90T2htK7jvVbbpOnoznW2nswZ9Fd83SUTdr7LHyfY15KpnTFGL7pCuW +Urw== X-Gm-Message-State: AGi0PuZAEKxB+aDnr6+HjDwYmlYAETqoJTrTZA6PS/Sy2b3NqN2wFa8J OV/wXMIEzzPu892pnUsD+7mPLyu5TNdA5GQCvWhO7w== X-Received: by 2002:a4a:a442:: with SMTP id w2mr2604642ool.90.1586277973542; Tue, 07 Apr 2020 09:46:13 -0700 (PDT) MIME-Version: 1.0 References: <20200407070609.42865-1-john.stultz@linaro.org> In-Reply-To: From: Geert Uytterhoeven Date: Tue, 7 Apr 2020 18:46:02 +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: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. 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