From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6CEC3C433EF for ; Thu, 26 May 2022 04:05:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229795AbiEZEFN (ORCPT ); Thu, 26 May 2022 00:05:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233422AbiEZEFH (ORCPT ); Thu, 26 May 2022 00:05:07 -0400 Received: from mail-vk1-xa2e.google.com (mail-vk1-xa2e.google.com [IPv6:2607:f8b0:4864:20::a2e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B4DDC0398 for ; Wed, 25 May 2022 21:05:06 -0700 (PDT) Received: by mail-vk1-xa2e.google.com with SMTP id bs5so235855vkb.4 for ; Wed, 25 May 2022 21:05:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Gh0p65lc0LygEWPTrX4+R74Dvkc+J7AlFlQ6fMQGs7A=; b=WDkVHJyAjYPx0qORIb1n/xz4fIQ74Ge5Y/ctI4/Lw+pJle3PzU2EcyqIVgnnSsn4xf HVgkTtjbNoaAu45jpdxbwPh9r4WsbSvWzRI/Efu3n3LTmr2CFj7H/P6HuhOFTPqrevgk HpiJr3HxRnGD0jjF4ag4ujYLFlrb2QBmDng3GGhklkOb7/WXcsBAlgOf23sWX3vcuO6q /9PtxMskfC8ETgsS4riAjqpGiTqHVTFXhopJ24NBHuiA5oKHTIe4YekOh/9pEf7+ecpa T0Tpv22t9Qc/bbrSQMKI7DGm+iuShpt9N5lpg4SmwHord9VX3ddWPz9iDyk7t5Vvt6g0 xuMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Gh0p65lc0LygEWPTrX4+R74Dvkc+J7AlFlQ6fMQGs7A=; b=fC3Iggy0J6Degs1LB2UL2lXeLtHt62jt/eW7N6mnelYfLJEIXTMjgno9F8N88tG+C2 nP69u2/kvGPd6xawbttWsW3BSd/CC4dkg5IikzWI7Kgcef7fsB9x0y99k4iSvfDUNDgN 0OkkW/YFvEtweIh+hJHS+JhP/zlruoGyn5BWDqZJGd6P8G8zUNUkJowRX+9Tbmq3sZ9F tJ6aWpkHlkkPQUe04Tny3e3TjNT90TX9WGZba7IXBjI2WIpK+lO/87gfdCPIbKGwOKmk QYMiP/xekFyFNej9xlHK/COj9MQfvrgYRolh20DFN2jpiDvHwQr6GZ3dts37fPmdoQCH hqVA== X-Gm-Message-State: AOAM531OLRxGQh5QBk7NL0XOf+lHcw9xrT5+9Fs3Q+6SzYxI5Yb7volD iK9RcyOsn7XQ2OgxugJon0lUc5AqoqklW9Hb0qUI X-Google-Smtp-Source: ABdhPJyIENIzh9EMBQ4zMGQQOQ7hrSoT6bxT/xDlhXYIZFK9LsIQjft/JoNh4I8fcpEm+s6X+UR+/ZaTg+Yu1MK33E4= X-Received: by 2002:a1f:2854:0:b0:357:f4fe:3f94 with SMTP id o81-20020a1f2854000000b00357f4fe3f94mr5061673vko.7.1653537905182; Wed, 25 May 2022 21:05:05 -0700 (PDT) MIME-Version: 1.0 References: <20220526034609.480766-1-saravanak@google.com> <20220526034609.480766-2-saravanak@google.com> In-Reply-To: <20220526034609.480766-2-saravanak@google.com> From: John Stultz Date: Wed, 25 May 2022 21:04:55 -0700 Message-ID: Subject: Re: [PATCH v1 1/2] driver core: Fix wait_for_device_probe() & deferred_probe_timeout interaction To: Saravana Kannan Cc: Greg Kroah-Hartman , "Rafael J. Wysocki" , John Stultz , Mark Brown , Rob Herring , kernel-team@android.com, linux-kernel@vger.kernel.org, "David S. Miller" , Alexey Kuznetsov , Hideaki YOSHIFUJI , Jakub Kicinski , "Rafael J . Wysocki" , Geert Uytterhoeven , Yoshihiro Shimoda , Robin Murphy , Andy Shevchenko , Sudeep Holla , Andy Shevchenko , Naresh Kamboju , Basil Eljuse , Ferry Toth , Arnd Bergmann , Anders Roxell , linux-pm@vger.kernel.org, Nathan Chancellor , Sebastian Andrzej Siewior Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 25, 2022 at 8:46 PM Saravana Kannan wrote: > > Mounting NFS rootfs was timing out when deferred_probe_timeout was > non-zero [1]. This was because ip_auto_config() initcall times out > waiting for the network interfaces to show up when > deferred_probe_timeout was non-zero. While ip_auto_config() calls > wait_for_device_probe() to make sure any currently running deferred > probe work or asynchronous probe finishes, that wasn't sufficient to > account for devices being deferred until deferred_probe_timeout. > > Commit 35a672363ab3 ("driver core: Ensure wait_for_device_probe() waits > until the deferred_probe_timeout fires") tried to fix that by making > sure wait_for_device_probe() waits for deferred_probe_timeout to expire > before returning. > > However, if wait_for_device_probe() is called from the kernel_init() > context: > > - Before deferred_probe_initcall() [2], it causes the boot process to > hang due to a deadlock. > > - After deferred_probe_initcall() [3], it blocks kernel_init() from > continuing till deferred_probe_timeout expires and beats the point of > deferred_probe_timeout that's trying to wait for userspace to load > modules. > > Neither of this is good. So revert the changes to > wait_for_device_probe(). > > [1] - https://lore.kernel.org/lkml/TYAPR01MB45443DF63B9EF29054F7C41FD8C60@TYAPR01MB4544.jpnprd01.prod.outlook.com/ > [2] - https://lore.kernel.org/lkml/YowHNo4sBjr9ijZr@dev-arch.thelio-3990X/ > [3] - https://lore.kernel.org/lkml/Yo3WvGnNk3LvLb7R@linutronix.de/ > > Cc: John Stultz > Cc: "David S. Miller" > Cc: Alexey Kuznetsov > Cc: Hideaki YOSHIFUJI > Cc: Jakub Kicinski > 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: linux-pm@vger.kernel.org > Fixes: 35a672363ab3 ("driver core: Ensure wait_for_device_probe() waits until the deferred_probe_timeout fires") > Reported-by: Nathan Chancellor > Reported-by: Sebastian Andrzej Siewior > Signed-off-by: Saravana Kannan Apologies for the trouble this caused. Thanks for chasing it down! Acked-by: John Stultz thanks -john