Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp1344280pxb; Thu, 7 Oct 2021 06:03:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyXYZ1h8WPf9sRXNFX8bLxYAtk4xG92aIY8h9CDWkRxsTu36aMKagzAsa9/GztYqHKQ7K+A X-Received: by 2002:a05:6402:424a:: with SMTP id g10mr6321718edb.26.1633611824385; Thu, 07 Oct 2021 06:03:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633611824; cv=none; d=google.com; s=arc-20160816; b=qsf1QpjX/71bzcosi5J6bbv5pcYpi8OXxHZJUmpspPkEEQ+ZzA8y8/Tv0p2Fmowj4P ZCkbSOm6xUJz8en2TAr+oD+6lMf/i+xgkd+Hrc481tPkVLY0cKiXn9GudLCO4Lfb2DOG mwtNp7ak0RPiuPFvi0npq29lwPlUJ6ZvDrI6nlT0JiKdC2454BOZZC4tHLlF4auFnkXh LGUFr3zxGQ2fjBZWou3bStRJA/jfB4clvTDhpBMHln00G5Smb5E3mOOaeloIDKWYQW5X C3TR3j2PAHdOp/lecqA0Agk+/OHg62/c2JHiceQiS7UK1H5kU5yOwR43M/15aTEiedpB zd7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=pZ07eGpWJ0hQn3/cWkaB0IeqVUc4BwuUIeY0U15+mN0=; b=uRpCdHXD04wWdvX3HuClb/7KlAffxFr4if6hCpUNmwzYcF5Uyx4/bDFXf+WdwX0pJ6 bFennWAZ4iiXcdKQWSHfgu6qaN4ZVo/GDQe1GzHzfoj/jHsvIFNnsAvyqvRphLeD0QR+ JBvbWtK0uA5IWt0CF6nzRdIJj58IyznI52XnD+s5bs1MWEUKU3IHopfe+BD1b2NiyauI C+1QM5hq+/KK/vG6A4QlZaiiSKTlhGxVvwdPGdplJY4R36AJVrfGuDsfxUHamEPUjsMx c2LxJh/Fztu/fnKce81h0Dl1Lb8t9sCAZfBRVYghCDM73rN6EQTYihK+FqIuSkTsDPm9 A7aw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=nEvFA2+N; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id mp29si29711544ejc.290.2021.10.07.06.03.14; Thu, 07 Oct 2021 06:03:44 -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=@gmail.com header.s=20210112 header.b=nEvFA2+N; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241423AbhJGMfl (ORCPT + 99 others); Thu, 7 Oct 2021 08:35:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56918 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241308AbhJGMfk (ORCPT ); Thu, 7 Oct 2021 08:35:40 -0400 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 617DFC061746; Thu, 7 Oct 2021 05:33:46 -0700 (PDT) Received: by mail-wr1-x42d.google.com with SMTP id t2so18579437wrb.8; Thu, 07 Oct 2021 05:33:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=pZ07eGpWJ0hQn3/cWkaB0IeqVUc4BwuUIeY0U15+mN0=; b=nEvFA2+NzNcr9G91D5EW1/fXoyRI39D4XMDUz9KC7Eky7ZfBKiDPlzSqjtLvoshtvY fXwO6KfKb1ua5DH1d63qT/pItwgYrM8byhlD4gWBL49w2K6joYwcl5JrJuKNW9lDsXrl glsGO7bi11LAud3TlvXjyGhXuGe16jThhijzsQM0LFTEQ6MIj+w+zEFBR5/YEBfAzQQ2 KVTGLQTDoPn+83adllGVhXd+UlYZOEzCHjch6BMn3+0m2lGfTfqpv9Sny9iIj5x8/ezy gVSlbQ+5zC4avKg0hXirVU9wp/22TQeDhOkflfVRZONVUtpeAcA9rDKGW/YLG8VFy21u 3kTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=pZ07eGpWJ0hQn3/cWkaB0IeqVUc4BwuUIeY0U15+mN0=; b=dPIh5stv0/2jA5ZdTbumyOtmCErVvhGHDMCRCdJgRHeBhsgEWxTQLPvj7n7XD1KO7S qXkyhvi7Zg1BiCVUs3abJYD2jSh2TMI7A0aTxEUs17S6m8kio6qHIVG7MLg1eyzpVvo4 79eI6YGsF9xOKMVkbC+xCE8yTnRIh5GDJOnoIro7CrLSeeRxjJZ31kVZELirOAkjfhSj opRy7oNgScYdtQzvZxZ9YqBn5RaWSc3Dwm1LVFcuWHzPmxIzB0tmcV4+xwS06noO12y0 pvNsoCu1Sy01FuCINiMeIOtI8oiRUO6o+PFawy2j7AOTHRP3B/swXOCaXll411W0vyFD tFag== X-Gm-Message-State: AOAM530secJ25Uw2MCM9C7jYjpMIuIacQxrSb0bjmmq474i3UEvM/Bd2 gGHA+QH8BZrCVUksipCl7/w= X-Received: by 2002:a7b:cf24:: with SMTP id m4mr16291322wmg.133.1633610024028; Thu, 07 Oct 2021 05:33:44 -0700 (PDT) Received: from [192.168.0.14] (095160158079.dynamic-2-waw-k-4-2-0.vectranet.pl. [95.160.158.79]) by smtp.gmail.com with ESMTPSA id k8sm1636306wmr.32.2021.10.07.05.33.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 07 Oct 2021 05:33:43 -0700 (PDT) Subject: Re: [PATCH v2 00/34] component: Make into an aggregate bus To: Andy Shevchenko , 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" , Arnd Bergmann , Benjamin Gaignard , Chen Feng , Chen-Yu Tsai , Christian Gmeiner , Chun-Kuang Hu , Daniel Vetter , Emma Anholt , =?UTF-8?Q?Heiko_St=c3=bcbner?= , Inki Dae , James Qian Wang , Jaroslav Kysela , Joerg Roedel , John Stultz , Joonyoung Shim , Jyri Sarha , Kai Vehmanen , Kyungmin Park , Laurent Pinchart , "linux-fbdev@vger.kernel.org" , "linux-omap@vger.kernel.org" , "linux-pm@vger.kernel.org" , Liviu Dudau , Lucas Stach , Mark Brown , Maxime Ripard , Neil Armstrong , Paul Cercueil , Philipp Zabel , "Rafael J. Wysocki" , Rob Clark , Russell King , Russell King , Russell King , Sandy Huang , Saravana Kannan , Sebastian Reichel , Seung-Woo Kim , Takashi Iwai , Tian Tao , Tomas Winkler , Tomi Valkeinen , Will Deacon , Xinliang Liu , Xinwei Kong , Yong Wu References: <20211006193819.2654854-1-swboyd@chromium.org> From: Andrzej Hajda Message-ID: <3acc1195-379d-c767-c124-7912ad792d6d@gmail.com> Date: Thu, 7 Oct 2021 14:33:41 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07.10.2021 13:22, Andy Shevchenko wrote: > > > On Wednesday, October 6, 2021, Stephen Boyd > wrote: > > This series is from discussion we had on reordering the device lists for > drm shutdown paths[1]. I've introduced an 'aggregate' bus that we put > the aggregate device onto and then we probe the aggregate device once > all the components are probed and call component_add(). The probe/remove > hooks are where the bind/unbind calls go, and then a shutdown hook is > added that can be used to shutdown the drm display pipeline at the right > time. > > This works for me on my sc7180 board. I no longer get a warning from i2c > at shutdown that we're trying to make an i2c transaction after the i2c > bus has been shutdown. There's more work to do on the msm drm driver to > extract component device resources like clks, regulators, etc. out of > the component bind function into the driver probe but I wanted to move > everything over now in other component drivers before tackling that > problem. > > I'll definitely be sending a v3 so this is partially a request for > testing to shake out any more problems. Tested-by tags would be > appreciated, > and Acked-by/Reviewed-by tags too. I sent this to gregkh which may be > incorrect but I don't know what better tree to send it all through. > Maybe drm? > > I'll be faster at resending this next time, sorry for the long delay! > > > Yet another avoidance of mathematically proven device dependency graph... > > > Can we actually find and ask a mathematician to look into the problem > and suggest real solution instead of all these ugly hacks: deferred > probe (ugliest hack, how it even came into kernel?), component > framework, custom approaches on how to see if devices are in the system > (ASoC hack). Master of Science in Math is OK? :) The solution is simple - topological sort - this is what PM device list does, but it is possible only if there are no circular dependencies. And in this case we have circular dependency. In such case the solution in case of initialization is to split it to two phases - probe/bind (component framework), probe/attach (DSI bus) and it works. But PM still relies on topological sort. To make PM working with circular deps you can try to extend PM somehow (maybe replace list of devices with list of pairs (device, phase) ??? ), or to add notifiers to frameworks allowing providers to informs its consumers about state change. The latter approach I have advertised several times, even on OSS. [1]: https://static.sched.com/hosted_files/osseu18/0f/deferred_problem.pdf [2]: https://lwn.net/Articles/625454/ Regards Andrzej > > Changes since v1 > (https://lore.kernel.org/r/20210520002519.3538432-1-swboyd@chromium.org > ): >  - Use devlink to connect components to the aggregate device >  - Don't set the registering device as a parent of the aggregate device >  - New patch for bind_component/unbind_component ops that takes the >    aggregate device >  - Convert all drivers in the tree to use the aggregate driver approach >  - Allow one aggregate driver to be used for multiple aggregate devices > > [1] > https://lore.kernel.org/r/20210508074118.1621729-1-swboyd@chromium.org > > > Stephen Boyd (34): >   component: Introduce struct aggregate_device >   component: Introduce the aggregate bus_type >   component: Move struct aggregate_device out to header file >   drm/msm: Migrate to aggregate driver >   component: Add {bind,unbind}_component() ops that take aggregate >     device >   drm/of: Add a drm_of_aggregate_probe() API >   drm/komeda: Migrate to aggregate driver >   drm/arm/hdlcd: Migrate to aggregate driver >   drm/malidp: Migrate to aggregate driver >   drm/armada: Migrate to aggregate driver >   drm/etnaviv: Migrate to aggregate driver >   drm/kirin: Migrate to aggregate driver >   drm/exynos: Migrate to aggregate driver >   drm/imx: Migrate to aggregate driver >   drm/ingenic: Migrate to aggregate driver >   drm/mcde: Migrate to aggregate driver >   drm/mediatek: Migrate to aggregate driver >   drm/meson: Migrate to aggregate driver >   drm/omap: Migrate to aggregate driver >   drm/rockchip: Migrate to aggregate driver >   drm/sti: Migrate to aggregate driver >   drm/sun4i: Migrate to aggregate driver >   drm/tilcdc: Migrate to aggregate driver >   drm/vc4: Migrate to aggregate driver >   drm/zte: Migrate to aggregate driver >   iommu/mtk: Migrate to aggregate driver >   mei: Migrate to aggregate driver >   power: supply: ab8500: Migrate to aggregate driver >   fbdev: omap2: Migrate to aggregate driver >   sound: hdac: Migrate to aggregate driver >   ASoC: codecs: wcd938x: Migrate to aggregate driver >   component: Get rid of drm_of_component_probe() >   component: Remove component_master_ops and friends >   component: Remove all references to 'master' > > Cc: Arnd Bergmann > > Cc: Benjamin Gaignard > > Cc: Chen Feng > > Cc: Chen-Yu Tsai > > Cc: Christian Gmeiner > > Cc: Chun-Kuang Hu > > Cc: Daniel Vetter > > Cc: Emma Anholt > > Cc: Greg Kroah-Hartman > > Cc: "Heiko Stübner" > > Cc: Inki Dae > > Cc: James Qian Wang (Arm Technology China) > > Cc: Jaroslav Kysela > > Cc: Joerg Roedel > > Cc: John Stultz > > Cc: Joonyoung Shim > > Cc: Jyri Sarha > > Cc: Kai Vehmanen > > Cc: Kyungmin Park > > Cc: Laurent Pinchart > > Cc: > > Cc: > > Cc: > > Cc: Liviu Dudau > > Cc: Lucas Stach > > Cc: Mark Brown > > Cc: Maxime Ripard > > Cc: Neil Armstrong > > Cc: Paul Cercueil > > Cc: Philipp Zabel > > Cc: "Rafael J. Wysocki" > > Cc: Rob Clark > > Cc: Russell King > > Cc: Russell King > > Cc: Russell King > > Cc: Sandy Huang > > Cc: Saravana Kannan > > Cc: Sebastian Reichel > > Cc: Seung-Woo Kim > > Cc: Takashi Iwai > > Cc: Tian Tao > > Cc: Tomas Winkler > > Cc: Tomi Valkeinen > > Cc: Will Deacon > > Cc: Xinliang Liu > > Cc: Xinwei Kong > > Cc: Yong Wu > > >  drivers/base/component.c                      | 555 +++++++++++------- >  .../gpu/drm/arm/display/komeda/komeda_drv.c   |  20 +- >  drivers/gpu/drm/arm/hdlcd_drv.c               |  21 +- >  drivers/gpu/drm/arm/malidp_drv.c              |  21 +- >  drivers/gpu/drm/armada/armada_drv.c           |  23 +- >  drivers/gpu/drm/drm_drv.c                     |   2 +- >  drivers/gpu/drm/drm_of.c                      |  20 +- >  drivers/gpu/drm/etnaviv/etnaviv_drv.c         |  20 +- >  drivers/gpu/drm/exynos/exynos_drm_drv.c       |  21 +- >  .../gpu/drm/hisilicon/kirin/kirin_drm_drv.c   |  20 +- >  drivers/gpu/drm/imx/imx-drm-core.c            |  20 +- >  drivers/gpu/drm/ingenic/ingenic-drm-drv.c     |  24 +- >  drivers/gpu/drm/mcde/mcde_drv.c               |  23 +- >  drivers/gpu/drm/mediatek/mtk_drm_drv.c        |  20 +- >  drivers/gpu/drm/meson/meson_drv.c             |  21 +- >  drivers/gpu/drm/msm/msm_drv.c                 |  46 +- >  drivers/gpu/drm/omapdrm/dss/dss.c             |  17 +- >  drivers/gpu/drm/rockchip/rockchip_drm_drv.c   |  20 +- >  drivers/gpu/drm/sti/sti_drv.c                 |  20 +- >  drivers/gpu/drm/sun4i/sun4i_drv.c             |  26 +- >  drivers/gpu/drm/tilcdc/tilcdc_drv.c           |  28 +- >  drivers/gpu/drm/vc4/vc4_drv.c                 |  20 +- >  drivers/gpu/drm/zte/zx_drm_drv.c              |  20 +- >  drivers/iommu/mtk_iommu.c                     |  14 +- >  drivers/iommu/mtk_iommu.h                     |   6 +- >  drivers/iommu/mtk_iommu_v1.c                  |  14 +- >  drivers/misc/mei/hdcp/mei_hdcp.c              |  22 +- >  drivers/power/supply/ab8500_charger.c         |  22 +- >  drivers/video/fbdev/omap2/omapfb/dss/dss.c    |  20 +- >  include/drm/drm_of.h                          |   9 +- >  include/linux/component.h                     |  92 ++- >  sound/hda/hdac_component.c                    |  21 +- >  sound/soc/codecs/wcd938x.c                    |  20 +- >  33 files changed, 780 insertions(+), 488 deletions(-) > > > base-commit: e4e737bb5c170df6135a127739a9e6148ee3da82 > -- > https://chromeos.dev > > > > -- > With Best Regards, > Andy Shevchenko > >