Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp1729265pxb; Thu, 7 Oct 2021 13:57:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyed36tPI73+RPk6JGIlu3KWS6Vcrd5kQ5ZI07u1RlIc2nmLwpuAZDXAPk3/c+AIIy6H6tJ X-Received: by 2002:a17:906:f2cd:: with SMTP id gz13mr8457420ejb.278.1633640223377; Thu, 07 Oct 2021 13:57:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633640223; cv=none; d=google.com; s=arc-20160816; b=D89xTgupTMTVHm6fvp35oU1w72SPrcIwCQSA4Z3vgT5wDBDBjjqEV/n8SxbeKFUco1 bIeMfxh0qmcAaSXLhwBDrilr84av3vMXRPlvwv7yZhmAlDQv/bGhlZjQGA1sgfj1HSu0 ONM/7zPgBJU2YaE6UqdgJSKyC8sdJYsnMU9jTnC8kiKFjgnmf7JaOZvPvaBEmQGBysMV UOwAJKYAEykH+XivfNZQ1KqhSY1AqG4c1nqi0Ttl92g1bA1kFj0/xPRI0xy9Im31xaP4 ApCNX63rCGwNW1MJYfPGmQWSqtz+3yNPTBpQ8Pw8fgpA+KifJMEsJkEj7XRs+Wmd+C/k h3ow== 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:user-agent:from :references:in-reply-to:mime-version:dkim-signature; bh=R7AOnGenRS0rd8ADOa6GfVMtI/YOuyOV/MLd+Be+R0c=; b=Zfl8uI4JMiWyLAcnHoXuN3tcBfAIotSVBIpIP3lrs2qBrrBDf+AtM2FvecR/nhvAqB 29mSX0P2VaYbugVkFU/rpRveS/t5NxBEsPiTpZB/HlEM2zxLn4qCGqLV8t3VybCA6ghK Y1IX0ZpjBGhx4EIrt6q7Mz06MVLgI0t8JCDXmL2MdHgvpZ8lDGSTxC//EYlCcK5bVtsN hxoPiN42gQ7iW2162g9ahscB2oGdnw9HK7x20Vl11orCfwN9zbA2pXAeubVlh06sfJBl ljm6YGNpkQqlsInhBXkyhgNYIEP7clELLDowi3XJikpBJpkaAIm1aIjhPFEySpr0e0Lb JEQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=D0ql250i; 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=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p15si646224edj.83.2021.10.07.13.56.40; Thu, 07 Oct 2021 13:57:03 -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=@chromium.org header.s=google header.b=D0ql250i; 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=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240647AbhJGUoo (ORCPT + 99 others); Thu, 7 Oct 2021 16:44:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232894AbhJGUon (ORCPT ); Thu, 7 Oct 2021 16:44:43 -0400 Received: from mail-oi1-x231.google.com (mail-oi1-x231.google.com [IPv6:2607:f8b0:4864:20::231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 30DECC061755 for ; Thu, 7 Oct 2021 13:42:49 -0700 (PDT) Received: by mail-oi1-x231.google.com with SMTP id o4so10706562oia.10 for ; Thu, 07 Oct 2021 13:42:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:in-reply-to:references:from:user-agent:date:message-id :subject:to:cc; bh=R7AOnGenRS0rd8ADOa6GfVMtI/YOuyOV/MLd+Be+R0c=; b=D0ql250itKs6b5jrU81lvPM5X4iXeo7I9h26xSPtMefkgAlPF7I5umHv65/NP3yNET b0NTmolKOqSzrVsBQMH5Cb0HAzMxWG3/HW06IWM89UgZ+mASnj6G8Gni3zNzGK992nmq ivPuMqeAbYsiBP7FC+7ojnurKEmxx2+GpYgk8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:in-reply-to:references:from :user-agent:date:message-id:subject:to:cc; bh=R7AOnGenRS0rd8ADOa6GfVMtI/YOuyOV/MLd+Be+R0c=; b=QCUdJ40pytVKJaqiRyND66rdfAFJliLMQss6bo0qfPfbYoi0l//sZw2FGtpNBvbFo5 1l5dY2iTV4OAUjN3jehPDSCJpXkK4oQnWExPkdsbwUtQYOALxOq3feM8XCmTjAfUbvU5 Ask60jhzlYAkGLIXpJGTOXtQDw5fhgBiR8z4JJIkn/Hv9BEYLO7uyfH4PBUujJnQiuNB Um6nJFmiqkuJHHjNlfke7O3MioYu1TnHlBA2/olicPAX1OclgPkbJfpX3vcVEZhzLRsC LVMPfko53Oec3c9Fz79CJ3cywi8h8uvdqFqRwgpj7EpgJQ8SsTeZS6kCwwzyPxpv7x6u HYZw== X-Gm-Message-State: AOAM5322aQ4l4aS/IVL5Td8A49VyGOeCVSQILuxpDYBSA8pXBasl9Q4x e9NwsDpjMwee7xCLjM1pagPecEi6+1seCp86MscFhA== X-Received: by 2002:a05:6808:f8f:: with SMTP id o15mr13381417oiw.164.1633639368453; Thu, 07 Oct 2021 13:42:48 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Thu, 7 Oct 2021 16:42:48 -0400 MIME-Version: 1.0 In-Reply-To: References: <20211006193819.2654854-1-swboyd@chromium.org> <20211006193819.2654854-3-swboyd@chromium.org> From: Stephen Boyd User-Agent: alot/0.9.1 Date: Thu, 7 Oct 2021 16:42:48 -0400 Message-ID: Subject: Re: [PATCH v2 02/34] component: Introduce the aggregate bus_type To: Greg Kroah-Hartman Cc: 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 , Saravana Kannan Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Greg Kroah-Hartman (2021-10-06 22:37:40) > On Wed, Oct 06, 2021 at 12:37:47PM -0700, Stephen Boyd wrote: > > > > Let's make the component driver into an actual device driver that has > > probe/remove/shutdown functions. The driver will only be bound to the > > aggregate device once all component drivers have called component_add() > > to indicate they're ready to assemble the aggregate driver. This allows > > us to attach shutdown logic (and in the future runtime PM logic) to the > > aggregate driver so that it runs the hooks in the correct order. > > Why are you creating a new bus type and not using the auxiliary bus > instead? > > You have seen Documentation/driver-api/auxiliary_bus.rst, right? > Nope, but I read it now. Thanks for the pointer. My read of it is that the auxiliary bus is a way to slice up a single IP block into multiple devices and then have drivers attach to those different "pieces" of the IP. It avoids polluting the platform bus with devices that don't belong on the platform bus because they are sub components of a larger IP block that sits on the platform bus. The aggregate bus is solving the reverse problem. It is rounding up a collection of IP blocks that live on some bus (platform, i2c, spi, whatever) and presenting them as a single aggregate device (sound card, display card, whatever) whenever all the component devices call component_add(). For example, we don't want to do operations on the entire display pipeline until all the devices that make up the display are probed and drivers are attached. I suppose the aggregate_device in this patch series has a 1:1 relationship with the drm class_type that makes up /sys/class/drm/cardN but there's also a couple sound users and a power_supply user so I don't know the equivalent there. Long term, maybe all of this component code could be placed directly into the driver core? That's probably even more invasive of a change but I imagine we could make device links with component_add() as we're already doing with these patches and then have driver core call some class function pointer when all the links are probed. That would handle the 'bind/probe' callback for the aggregate device but it won't handle the component_bind_all() path where we call bind_component() for each component device that makes up the aggregate device. Maybe we can add even more devices for the components and then call probe there too. Sorry that's a long-winded non-answer. I don't think they're solving the same problem so using the same bus type looks wrong. We'd have to take two different paths depending on what type of device it is (aggregate vs. auxiliary) so there's not much of anything that is shared code-wise.