From patchwork Tue Feb 25 05:08:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 183808 Delivered-To: patches@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp1262757ile; Mon, 24 Feb 2020 21:08:35 -0800 (PST) X-Received: by 2002:aa7:9556:: with SMTP id w22mr55325308pfq.198.1582607314851; Mon, 24 Feb 2020 21:08:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582607314; cv=none; d=google.com; s=arc-20160816; b=w8XpP2jSjIh0EeRyTCfHsNt6JkQhWHW9/n03tH1uT06aLYWPrLwMSEj+pYTpFewXgd 5nqdAlGpqIfq/FvN85zNmLM+pMm4j8GZoZz4WwZ5Qp0nojUjMns7WqU+38jIFV8g+hIL sQVr/tp1jAvr8mKkYuH0Thy9THPIrZBRV/koW9tYEwgQ76zn7qSgTXjNHf36m/AWVbvu LHpfp6seJYD2HXR9agnfeQm9Sszn8oTRFDdNFQCHcIZ/uQF6G32l4GRV6XmxUtu20h2/ OqdjRnIhjb+lU50y8n0M0lqmPtjSnAI8VxFzFg2y3lw5dVzjN1bREIrBx/DS26RUN7Vu zxtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:dkim-signature; bh=tqUZYiy81UZHq8KwguRSjJqW3NIJKHOMPFN5dA6hUv8=; b=Q+0U5CUEDQX/ee+092REDtfew+xOEFCw9sLWXlcmTrH41U3uVAgdQrpDA3u0hZUJDl nWqtE0hQFVL0BlSKYrnAsseIc+qkA32U3E2o3nrE3oS+xLI31PiilA/QJqLzkqvP7YRZ U/by6bkKJa02vgcHwBb+1AlVgwnItFG+ekLw0kzm/pNFTcGLMyBZTOL3XGn7LKoxg7if ag6fE3oOVPzESHHK8kCzom+lI2RoRdj8zsbbqLbop/UaoR3O0i35NTVaSroj1j+Kdlt/ 2dXZDeoS2rtLl93TxNTjobtcoGnsydDSITOY548s/QpmeMa1CeBo2jHU4SB0wP/Cs2nc 1yOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HGakzGud; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id 82sor16784014pfu.9.2020.02.24.21.08.34 for (Google Transport Security); Mon, 24 Feb 2020 21:08:34 -0800 (PST) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HGakzGud; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=tqUZYiy81UZHq8KwguRSjJqW3NIJKHOMPFN5dA6hUv8=; b=HGakzGuddi3jXQkWHnNveg1vOMeIzRUtO/HXDf4I2PUzHfltbjm1Qezj+1200nLeOB TQvKVErZTc5ASbCnmw+DEp1J0aTGRROvPcxXLhkOhmFlbwjoca4lTNscoG8v3YySwblG Tv7aOi6vW0mj+pArzFrotksKu9IMk6MiwwrmDodrY1/X5U51Le3pXnoRpcW1kF8bicPZ d10DqU4SEZ9Imy5zD+ds94sLfJPaFa7cpdFCuxwMCg7xjk/fu8OlPoCLglRW3DkIcCWl ZNR7NukXTFSf/c9NrJRxAkIBcaMiGanlWaynkU5LP+2+pVU7o5bb0NWxWW8u3ajLM/tN 6ZFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=tqUZYiy81UZHq8KwguRSjJqW3NIJKHOMPFN5dA6hUv8=; b=jV4V5Refdl5ekTW8xAO2XuQCWeSwTFJETEdKjH861KTh8amiKM4qAq0gY0EjN/oa5k 4P/sq1IflYMZLY6S38nORNcTTBVMoum1sKGdTmdUFZfjzQIcCz9Szja/+GrLi24o64/j Yp6XVXgiIcak1YE8+6Jce9+usFZL+hoB5QbFLUyu+xhi1J/Kp3leVKyZcyhHVmt/ORJ5 9bKCGlJ08EzNTOvJFuLeVSDh5QSzDssbw5aznXLNT+JlCw69u7m4A59gLVfj62WtVG38 i4j7vjIG5TfUuxk69qBfzJzH0RaeKxT5r3xYOtJCli0s0nZciznHXSeAT3nMFiZ21e7W k2fA== X-Gm-Message-State: APjAAAVtNJYHoqLTZGjUXx0ZGnMyVthhxIpjBLB50al7iG+N5o0SyAs5 inqSlOcmb4JTSEU3DwTBSd9kmHf1 X-Google-Smtp-Source: APXvYqz6IE9jh60Xr9+8h5LussuaMmJSlBt6AR00pDT9XEyDZcJ9EfJ4du1eFt5MYekdaXcI574iUw== X-Received: by 2002:a62:6342:: with SMTP id x63mr54999297pfb.103.1582607314399; Mon, 24 Feb 2020 21:08:34 -0800 (PST) Return-Path: Received: from localhost.localdomain ([2601:1c2:680:1319:692:26ff:feda:3a81]) by smtp.gmail.com with ESMTPSA id r66sm15156450pfc.74.2020.02.24.21.08.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Feb 2020 21:08:33 -0800 (PST) From: John Stultz To: lkml Cc: John Stultz , Rob Herring , "Rafael J. Wysocki" , Kevin Hilman , Ulf Hansson , Pavel Machek , Len Brown , Todd Kjos , Saravana Kannan , Bjorn Andersson , Liam Girdwood , Mark Brown , Thierry Reding , Linus Walleij , Greg Kroah-Hartman , linux-pm@vger.kernel.org Subject: [PATCH v5 0/6] driver core: Improve and cleanup driver_deferred_probe_check_state() Date: Tue, 25 Feb 2020 05:08:22 +0000 Message-Id: <20200225050828.56458-1-john.stultz@linaro.org> X-Mailer: git-send-email 2.17.1 This series goal is to improve and cleanup the driver_deferred_probe_check_state() code in the driver core. This series is useful for being able to support modules dependencies which may be loaded by userland, far after late_initcall is done. For instance, this series allows us to successfully use various clk drivers as modules on the db845c board. And without it, those drivers have to be statically built in to work. Since I first sent out this patch, Saravana suggested an alternative approach which also works for our needs, and is a bit simpler: https://lore.kernel.org/lkml/20200220055250.196456-1-saravanak@google.com/T/#u However, while that patch provides the functionality we need, I still suspect the driver_deferred_probe_check_state() code could benefit from the cleanup in this patch, as the existing logic is somewhat muddy. New in v5: * Reworked the driver_deferred_probe_check_state() logic as suggested by Saravana to tie the initcall_done checking with modules being enabled. * Cleanup some comment wording as suggested by Rafael * Try to slightly simplify the regulator logic as suggested by Bjorn Thanks so much to Bjorn, Saravana and Rafael for their reviews and suggestions! Additional review and feedback is always greatly appreciated! thanks -john Cc: Rob Herring Cc: "Rafael J. Wysocki" Cc: Kevin Hilman Cc: Ulf Hansson Cc: Pavel Machek Cc: Len Brown Cc: Todd Kjos Cc: Saravana Kannan Cc: Bjorn Andersson Cc: Liam Girdwood Cc: Mark Brown Cc: Thierry Reding Cc: Linus Walleij Cc: Greg Kroah-Hartman Cc: linux-pm@vger.kernel.org John Stultz (6): driver core: Fix driver_deferred_probe_check_state() logic driver core: Set deferred_probe_timeout to a longer default if CONFIG_MODULES is set pinctrl: Remove use of driver_deferred_probe_check_state_continue() driver core: Remove driver_deferred_probe_check_state_continue() driver core: Rename deferred_probe_timeout and make it global regulator: Use driver_deferred_probe_timeout for regulator_init_complete_work drivers/base/dd.c | 82 +++++++++++++---------------------- drivers/pinctrl/devicetree.c | 9 ++-- drivers/regulator/core.c | 25 ++++++----- include/linux/device/driver.h | 2 +- 4 files changed, 49 insertions(+), 69 deletions(-) -- 2.17.1