Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp1901250pxb; Thu, 7 Oct 2021 18:15:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJytEVYBfZtiRMCMQFm+uYKAYRIUFl4d/0C8Dt9t0W+zf5sDo/kbpLqVbJG1qSbQznhZbuw6 X-Received: by 2002:a17:906:60c7:: with SMTP id f7mr400669ejk.57.1633655738600; Thu, 07 Oct 2021 18:15:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633655738; cv=none; d=google.com; s=arc-20160816; b=ySBS1bHnuKZAT9/G2L8/3J23u4lca+Y+TW0SUxf+CBswyD+oJDioGW7g4xSEeDX24p MIy7klXOjPImMecB4VMx0dwi1eh2l0C0+onsPNnYQ24IgUUVeZBftHBIjBUSI+BK8cs2 pEUdvcWGlb+VfuKx6FdiItkauwR+09TVukRNKb6+sut5SCBRgB6MeoQljyFJHeEsv2lX yMF8Er+HMmRq+p99J9a/vT2bYeQ92tQN7iqQ+gyOsZp9lWhqj7Ma790mXRDOEGRhjTZ9 A4DaDMLm89dihHb1LnJT6wqltqU/2NK59b8IbziqLHmak3/haoKOtv0WSlO1bQTbLlZv VNgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=fu1qbb9TIftGGLiopDIHJNKJDVey9e03m26BW4nVQKw=; b=h7PRO6YeguKobnBibvPivYJ39qLHKTV58w/JydRgcAKcSZV6swPu0Z3Iout5kJg9L7 /0a4mAbXke7E/NxRa+WNQQ84RE1mubA/561URoULvidSSz0S0vU5JmF7brqdywaqrRJA 3jKipEcxuC6Zs+qxoXH8paq3l+dRYoEtnjvllsyEy0BNO30ocPbJXFciZeZVx+fM3sfx p3a/wmY2NllkHxe0CWuQW5M+fsLGO+ra7VJ5olcAsIdOrmXPaRdzvp6MHnhhd1S5dTKd IYNeiI/P+P9O5E4Wi1zagaCl2ZwVHVF8XakXH0wDV0f1mWkeCwmUOWQYHQB5PuyDVJsK sXqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=Po56gcNd; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l17si1116162edj.620.2021.10.07.18.15.14; Thu, 07 Oct 2021 18:15:38 -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; dkim=pass header.i=@google.com header.s=20210112 header.b=Po56gcNd; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231207AbhJHBM4 (ORCPT + 99 others); Thu, 7 Oct 2021 21:12:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35662 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231230AbhJHBMz (ORCPT ); Thu, 7 Oct 2021 21:12:55 -0400 Received: from mail-yb1-xb29.google.com (mail-yb1-xb29.google.com [IPv6:2607:f8b0:4864:20::b29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 442BDC061714 for ; Thu, 7 Oct 2021 18:11:01 -0700 (PDT) Received: by mail-yb1-xb29.google.com with SMTP id d131so17500125ybd.5 for ; Thu, 07 Oct 2021 18:11:01 -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=fu1qbb9TIftGGLiopDIHJNKJDVey9e03m26BW4nVQKw=; b=Po56gcNdg4y0ShSFya7iIGBaaYp8lJIgoWK2sKkC2odnhSdrhLke32eYYchYWX3zz+ Nm+/wq0ok2Zr5dKDvEpdJYix/07lkxeuSx0249JyESbN5Xlr5CvvlEpFo9YwzyBq4Zq4 1PQnUlPIfYnZ2LBNy7px4RtIpECNMUR89AfE/U1pJLC6OaPFz9abQjsmmjE/j997mdbB lGGZXG8PwWP30MjktBdRJYtUrcKJafkHtsB/3XYpV5m82PgtMgNDuMRTMqnqWUCe9t3U 54SSiScQ9DFOj6TFDreDNUcuEGJS1Lbudtab9yqFIoMbpb/qDs2KFo0pJm+ezMpmEAkN nFoQ== 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=fu1qbb9TIftGGLiopDIHJNKJDVey9e03m26BW4nVQKw=; b=KNDV5m1ICt8drpXtWpqrsc31s7levLsUiONiqnY1ny+ViSZ5Qua5mqDFLkdLcx/75i DHTPr7Qohq6qvEfSNPNYZLkL1kg2IyLIcO4f33HKD1AqDWBYiQ/rCtcfeFItfIHQl4n6 6BMG8CE6qDOi5pZ8GnzYAjsru8+hqu7uzd/ADJJJ9Lytf7hq63VgQoia2nbGMi7rPwih nrZTBdbpRIkU5iM4lNhQmcf3rOSjQdBSs/aHeFJwPDxQOXuJjCwj1NG8q4dBnEzsi6IG vzkEKo+NB2owIAyXN2a6V2RJwDzMe/4fHZW7+rqnJ6HyHv/nN2JGeuuTiKly7nYECj/P 9brg== X-Gm-Message-State: AOAM530/X5IGMeEUHr1V2BPnRIokP+jhc27yMkz1sEB35NS6OVUcuKUz ypD086C3qk9Cq7eIWND0Dn6brk2TWrFZI1gwp4xR6w== X-Received: by 2002:a25:bd93:: with SMTP id f19mr285693ybh.23.1633655460310; Thu, 07 Oct 2021 18:11:00 -0700 (PDT) MIME-Version: 1.0 References: <20211006193819.2654854-1-swboyd@chromium.org> <20211006193819.2654854-3-swboyd@chromium.org> In-Reply-To: From: Saravana Kannan Date: Thu, 7 Oct 2021 18:10:24 -0700 Message-ID: Subject: Re: [PATCH v2 02/34] component: Introduce the aggregate bus_type To: Stephen Boyd Cc: Greg Kroah-Hartman , linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, Daniel Vetter , "Rafael J. Wysocki" , Rob Clark , Russell King Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 7, 2021 at 1:11 PM Stephen Boyd wrote: > > Quoting Stephen Boyd (2021-10-07 11:40:07) > > Quoting Saravana Kannan (2021-10-06 20:07:11) > > > On Wed, Oct 6, 2021 at 12:38 PM Stephen Boyd wrote: > > > > diff --git a/drivers/base/component.c b/drivers/base/component.c > > > > index 0a41bbe14981..d99e99cabb99 100644 > > > > --- a/drivers/base/component.c > > > > +++ b/drivers/base/component.c > > [...] > > > > + continue; > > > > + > > > > + /* Matches put in component_del() */ > > > > + get_device(&adev->dev); > > > > + c->link = device_link_add(&adev->dev, c->dev, > > > > + DL_FLAG_STATELESS | DL_FLAG_PM_RUNTIME); > > > > > > Remove the STATELESS flag and you'll get a bunch of other stuff done for free: > > > > I tried that and it didn't work for me. The aggregate device never > > probed and I was left with no display. Let me see if I can reproduce it > > with logging to provide more details. > > This patch fixes it (whitespace damaged sorry). Not sure why you have to trigger an explicit rescan, but instead of this patch below, you could also try setting this flag instead? DL_FLAG_AUTOPROBE_CONSUMER -Saravana > > ----8<---- > diff --git a/drivers/base/component.c b/drivers/base/component.c > index 65042c9f8a42..43cac9ed70b7 100644 > --- a/drivers/base/component.c > +++ b/drivers/base/component.c > @@ -202,7 +202,7 @@ static int find_components(struct aggregate_device *adev) > /* Matches put in component_del() */ > get_device(&adev->dev); > c->link = device_link_add(&adev->dev, c->dev, > - DL_FLAG_STATELESS | DL_FLAG_PM_RUNTIME); > + DL_FLAG_PM_RUNTIME); > c->adev = adev; > } > > @@ -749,7 +749,9 @@ static int __component_add(struct device *dev, > const struct component_ops *ops, > mutex_unlock(&component_mutex); > > /* Try to bind */ > - return bus_rescan_devices(&aggregate_bus_type); > + bus_rescan_devices(&aggregate_bus_type); > + > + return 0; > } > > /** > > > The important part is ignoring the return value of bus_rescan_devices(). > It's a cycle problem. The last component is probing and calling > component_add() in its probe function. The call to component_add() is > trying to probe the aggregate device now that all components are added. > But when it tries to probe the aggregate device it sees that a supplier, > which is this component calling compnent_add(), hasn't been probed yet, > so it returns -EPROBE_DEFER. That is passed up to the component and it > defers probe. > > I don't think the component device cares at all about the aggregate > device being able to probe or not. We should be able to ignore the > return value of bus_rescan_devices() in component_add(). I'll add a > comment to the code here so it's more obvious.