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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D576DC433F5 for ; Fri, 8 Oct 2021 01:11:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AD6D060F5E for ; Fri, 8 Oct 2021 01:11:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231182AbhJHBM4 (ORCPT ); Thu, 7 Oct 2021 21:12:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231207AbhJHBMz (ORCPT ); Thu, 7 Oct 2021 21:12:55 -0400 Received: from mail-yb1-xb2c.google.com (mail-yb1-xb2c.google.com [IPv6:2607:f8b0:4864:20::b2c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 408B3C061570 for ; Thu, 7 Oct 2021 18:11:01 -0700 (PDT) Received: by mail-yb1-xb2c.google.com with SMTP id s4so17434507ybs.8 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=cWsitReaojqSafLYtSk+m9zS5ikI3X36vCJhyrRK1HWXO7IV8/izJWwwD0wLYh0Ngw NH6lwdgyEPGXMmGSP1ZUGjpJQ08cwvq5WrQS5puVJ48Zf1PD3ESqbmUvxrE9uGgHpAyn aPMkHu19q+CnLk/ObN0CWLNvYYcqg+n76L9dY5oGqB5H8g0CNDaYINaBzYnryFHDNKco j1CSyk3dqEd4P+w4xqCSmvTpurX/NipNRcGaFIlnqbdOw18E/Cj7sWCgflI4QPHfTLr/ MhhhTd4r1A1ixri2zq6/vZCvHaqJRPhGaBfEjEhyr7CP8p1GFJiN1pe/5UoVyHNSkRGv lfWw== X-Gm-Message-State: AOAM530Ah+NJWSjTyy4m3MF6ukqpNHuhq59ct4wS8rsAZC3bxZItE/Gd u04kycw1r8cTCF6mDvv3YCQQzPlki93EdXcU6mAPzw== X-Google-Smtp-Source: ABdhPJzRqmpc7ZCLtvfPCPlOJuwh7NKrbymtx/f5NZk8E50MzwzoBQeCzV16ElGWYbGopGOusWI0XFQieBWdHv96j04= 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-arm-msm@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.