Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp1912396pxb; Thu, 7 Oct 2021 18:35:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxhzLgG/zV8DfU4CnE1a2VVSEDY4YwM/BT125DnJbEWjXfXiYbDwUZ0+EdHncpUhoaLe7cN X-Received: by 2002:a65:6658:: with SMTP id z24mr2434221pgv.266.1633656948029; Thu, 07 Oct 2021 18:35:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633656948; cv=none; d=google.com; s=arc-20160816; b=k4C1oceEW8cml6RRU2kqOa4bmwFLvwmybAh2wFZxoLn+jVEK9xP8iYLbShXjTX/wH+ aVjUTwvPP24AM5kHJQwmz18FqFma9dQg6lqd8aYP0IwAE7nTAIA3HMCpNF6iwk4H/exL wrslJnN+DfbYR9zMYsHpYqpA4Ch0Swdp7IVo/gzQ/x6Nikhc7tNdoXmI0gEymLKbYKmy xKTdP4xLkT2IC8HYqC5GtaK427RSm/hRUUp5pvTnzjF7s6D/MUXvilWP6F733AndVRmT tFMFUspeGzg94z+rL58eKgM4u9Jngl63kHOy06ZALBk7gIogSEvJJk10djJdIs/DzvTa 6w9w== 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=gq7gSaT8ZCVg6gwqjOCmpvWG1r7KdegQCpYgjA1Cxgs=; b=ZZZru0BieAByRyQ5k3+QPNmHUpnoDdPtTBAru5vMZBv9hpzF30sU+cfHBo5ktcc0md TMS63o+xNXttL8MeruyO1z+jidM2VsLy0w0/saTlX3Bd3kXUFMlke7C7dL3krtrrZjik uosY8UAMY2ZcIC4aZbqMHJGExw7zpcad6momyp0xtEsScOHH3OPCjbqgQ5bVhmDC8ftI 4G+XdYRlZaCJInS21thk2lWxqu2LpMhTCGyZwn74CARC8bCo6DDbGwCSBj/iEsxUWkMB vbErauVRmKfi/ochQ9F1tZ/u2otpd8ZU7Bfojei+sJmxqLjzxlP0kE6ddb+KHM6zm9DU Sw1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=hVG5BypZ; 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 rm12si7659656pjb.48.2021.10.07.18.35.32; Thu, 07 Oct 2021 18:35:48 -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=hVG5BypZ; 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 S229955AbhJHBex (ORCPT + 99 others); Thu, 7 Oct 2021 21:34:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40552 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230234AbhJHBev (ORCPT ); Thu, 7 Oct 2021 21:34:51 -0400 Received: from mail-yb1-xb33.google.com (mail-yb1-xb33.google.com [IPv6:2607:f8b0:4864:20::b33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 93C1BC061714 for ; Thu, 7 Oct 2021 18:32:57 -0700 (PDT) Received: by mail-yb1-xb33.google.com with SMTP id g6so17583317ybb.3 for ; Thu, 07 Oct 2021 18:32:57 -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=gq7gSaT8ZCVg6gwqjOCmpvWG1r7KdegQCpYgjA1Cxgs=; b=hVG5BypZOZMCcxoDGMEmb2d9pZUnGW/iR+RCKisjdYIqpy8yvWSifIvE2OUdlFI6Ja 13maROVbcAL6wGxCVvyunsWZL+fOFSQXxIgBep9HCx1s5QSsO2JL52Vt7IYYdTRXNX0L vUEQhiRyZqpCWn+6wdnHnutN9SnZ578yCdcqtzgCeWsxPd2G85GnvCPuz76qi56gD9Wn x2t+4Xgurl5aJkUUghCq6mdySZ2DRhRRZ5CAvm0obdf1j2xHacoZzAcDEovfozPu51f6 3P8Fi8Jd0PUWTi7Ii5Uf3Nu9ORslbQq/dIBGVASDJ2mv1bWoFG0h1Ml6tuUz1GBHr9ry UhYQ== 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=gq7gSaT8ZCVg6gwqjOCmpvWG1r7KdegQCpYgjA1Cxgs=; b=42YH1ARLbs0ce0feMuueEo73fJSeHF1GZQZeH9cXhmcMfRUQ/wDh7xxF17guZSlbx6 wj2u7npcVYUDO5yQBtmT63g06BiNzmHYt0JBet1EXK87wEEydP9wzdT7V3WhszKrJ+QX wUUJ0wJ7ZVsKNUKsOsI0n4fFuCrAmrEjwmRZ1fvvi4Ou3dgP9Qy37M/HtK16K8EeITa5 9UQlzLxQ5Qsj4Z1HOqrTlKKYnB7/EykEFQ4FunKsIR+4CBkX6J6w0aEotHKQBSX1+s1k s/VOrWIuIltlFh/V8MNfxNVaX1yk0S179zMS6nTrCnbfYkR/1oNEjL3kHRztdRNGCdIV 0LnQ== X-Gm-Message-State: AOAM531Gx4pOGbKoSca5ynw/8PB/VuAl0qzaiFQptjMqy3ydN0/S1jIl D1STBe2zZ2xVJUN+v7IUoK788OGdg22ZWa/xw8PLpQ== X-Received: by 2002:a05:6902:154c:: with SMTP id r12mr454424ybu.432.1633656776620; Thu, 07 Oct 2021 18:32:56 -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:32:20 -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 6:24 PM Stephen Boyd wrote: > > Quoting Saravana Kannan (2021-10-07 18:10:24) > > 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 > > > > I'd rather not conflate component driver probe with component_add() > being called. It's simpler if that is the case, i.e. all component > drivers are calling component_add() in their driver probe routine, but I > don't know if that's always true. I did this poor audit of the kernel > > $ git grep -p \[^_]component_add | grep \.c= | grep -v probe > drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c=static int > amdgpu_dm_audio_init(struct amdgpu_device *adev) > drivers/gpu/drm/i915/display/intel_audio.c=static void > i915_audio_component_init(struct drm_i915_private *dev_priv) > drivers/gpu/drm/i915/display/intel_hdcp.c=void > intel_hdcp_component_init(struct drm_i915_private *dev_priv) > drivers/gpu/drm/nouveau/dispnv50/disp.c=nv50_audio_component_init(struct > nouveau_drm *drm) > drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c=static int > dw_mipi_dsi_rockchip_host_attach(void *priv_data, > drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c=static int > dw_mipi_dsi_dphy_init(struct phy *phy) > drivers/gpu/drm/vc4/vc4_dsi.c=static int vc4_dsi_host_attach(struct > mipi_dsi_host *host, > > and then peeking at rockchip above I see that component_add() is called > in the mipi dsi attach ops and then I got lost trying to figure out > where it ends up. Maybe it is still in some probe call? > > Anyway, I think we still have to do a rescan so that we can try to bind > the aggregate device. Is there a better API to use for that? If you know the exact device, you could call device_attach()? That's what bus_rescan_devices() eventually calls, but you skip the unnecessary looping over all the other devices. -Saravana