Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1998452imm; Sun, 9 Sep 2018 13:24:16 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZHNvq6HWxDT8IstDXKcF1JUqYas4tJuSo6RW6eaY0q+dca/JVZ1nOJZ8xvq7STjqeuqLcg X-Received: by 2002:a17:902:7145:: with SMTP id u5-v6mr18718180plm.259.1536524656094; Sun, 09 Sep 2018 13:24:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536524656; cv=none; d=google.com; s=arc-20160816; b=uPVtaNHGuFf1PoZyCtzxkFXQ9LLnre83tx2bJLx+fkbvZOS8+Xn0mz65UnX8Ha1Yjy E5ZP5+aTzfkjBioYdwXlpEbupxHD9/F1WHA2E7C8WhhpTGSlDWVNHPl7aXx3tsq8pSjd 6n1lrswXT5gCBry1MXSe6Lf9L3ghNswviUjq4PQgu2he2K4TCZAQ2tyF4C6D59kWrm8+ mbgtl2Ieh+yMaOtDKon/3KSCQQcGBntFl//FeLpD5s38bu0M6mKll35wdgj7iVyRUtc4 k82F8XhH3371/HSD5nbWNlpZtqbOKGsqhWe8MCRs0obJv2d4h31tPx0YnZO7KaGgHrqL voZQ== 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=X+dMeOka9TY4dCNV3KChU1LDPCS+8dqySNYiXAZLRwc=; b=ipQsqg9aQOnAPZP3JQqL18hWbkfmuVxdXfCdgZBm6L+BvHKdhDZvtwpigynTh3DEV3 rRJrj0c1E8KYMBNTTRiHUD1xa/cYjqbyIqSlpjmGdqlStwD7847AXDutiCyyFdfqd+A7 egf3afsaHFwShvH6kZki/pngdO6j1TfehoaARhlUH8BZRm2iiWLRJAPshROJknpEbSgq IhTH1Ohy/yUqUn6jfy+hCtPOd2dKK1Pfn7fn44ZVCtX6jDmjN7xDk5XvMXYQ5tGA60XK 42QNTeOeTAckvBFPKyZYHYUjA3JNScXvWUmOqZSUGS/dWN0isrjdyoHq5nAk+9wdQCnf jHrg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h8-v6si16333366pli.14.2018.09.09.13.23.58; Sun, 09 Sep 2018 13:24:16 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726736AbeIJBNi (ORCPT + 99 others); Sun, 9 Sep 2018 21:13:38 -0400 Received: from mail-oi0-f66.google.com ([209.85.218.66]:37966 "EHLO mail-oi0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726605AbeIJBNi (ORCPT ); Sun, 9 Sep 2018 21:13:38 -0400 Received: by mail-oi0-f66.google.com with SMTP id x197-v6so36400022oix.5; Sun, 09 Sep 2018 13:22:47 -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=X+dMeOka9TY4dCNV3KChU1LDPCS+8dqySNYiXAZLRwc=; b=VX1yre2ReG2TvdL59GaFhjxL6BsevMmAQSA6SYKkIs1HgJRz+BFAaSqJh82BC4TKjX Fk73zsTwoNOd1RNAPwlm58Uz1vyZa0b5TFADqxY5pkgFmey5PJjx8t1TkapXzGwrsujm h9W/G5WyyYh/+ZsS10NuTp0V266Mhdpa0PlTFdju0gwqlX8l76VB9akIAy6ef4jAzcqR tWj00H2dLc0/hOf+9LzHUQlHPkQ9bZQQMUBOokWHpipUKZH1uMcdGP8kAovSSN4kf757 fzXeic3b/AJ0fR+eIxsvdfGkB1fCZduQbBl66MofNnIGF3GBArT782o7x3cuYEUDRu3C qDng== X-Gm-Message-State: APzg51BGJfrRmac+tIXO0FtlVOTBgMjgUHlQbLBhXcY330MkGOSpOolP oZ/6IRVMKxmP8zuQ0NcFo8sSqfbiyPaSy2CKJOQ= X-Received: by 2002:aca:aa06:: with SMTP id t6-v6mr19425898oie.152.1536524566498; Sun, 09 Sep 2018 13:22:46 -0700 (PDT) MIME-Version: 1.0 References: <1534181989-22536-1-git-send-email-rishabhb@quicinc.com> In-Reply-To: <1534181989-22536-1-git-send-email-rishabhb@quicinc.com> From: "Rafael J. Wysocki" Date: Sun, 9 Sep 2018 22:22:35 +0200 Message-ID: Subject: Re: [PATCH v1] dd: Invoke one probe retry cycle after some initcall levels To: rishabhb@quicinc.com Cc: "Rafael J. Wysocki" , Greg Kroah-Hartman , Linux Kernel Mailing List , Sodagudi Prasad , ckadabi@codeaurora.org, tsoni@codeaurora.org, Linux PM , Rishabh Bhatnagar , Vikram Mulukutla 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 Mon, Aug 13, 2018 at 7:40 PM Rishabh Bhatnagar wrote: > > From: Rishabh Bhatnagar > > Drivers that are registered at an initcall level may have to > wait until late_init before the probe deferral mechanism can > retry their probe functions. It is possible that their > dependencies were resolved much earlier, in some cases even > before the next initcall level. Invoke one probe retry cycle > at every _sync initcall level after subsys initcall, allowing > these drivers to be probed earlier. > To give an example many Qualcomm drivers are dependent on the > regulator and bus driver. Both the regulator and bus driver > are probed in the subsys_initcall level. Now the probe of bus > driver requires regulator to be working. If the probe of bus > driver happens before regulator, then bus driver's probe will > be deferred and all other device's probes which depend on bus > driver will also be deferred. > The impact of this problem is reduced if we have this patch. > > Signed-off-by: Vikram Mulukutla > Signed-off-by: Rishabh Bhatnagar > --- > > Changes since v0: > * Remove arch_initcall_sync(deferred_probe_initcall) from patch. This is not > really needed as none of the devices are re-probed in arch_initcall_sync > level. > > drivers/base/dd.c | 32 ++++++++++++++++++++++++++------ > 1 file changed, 26 insertions(+), 6 deletions(-) > > diff --git a/drivers/base/dd.c b/drivers/base/dd.c > index 1435d72..9aa41aa 100644 > --- a/drivers/base/dd.c > +++ b/drivers/base/dd.c > @@ -224,23 +224,43 @@ void device_unblock_probing(void) > driver_deferred_probe_trigger(); > } > > +static void enable_trigger_defer_cycle(void) > +{ > + driver_deferred_probe_enable = true; Isn't it sufficient to enable it once? > + driver_deferred_probe_trigger(); > + /* > + * Sort as many dependencies as possible before the next initcall > + * level > + */ > + flush_work(&deferred_probe_work); > +} I would call this function driver_deferred_probe_sync() or similar to indicate that it is a synchronization point. Thanks, Rafael