[<prev] [next>] [day] [month] [year] [list]
Message-ID: <3acc1195-379d-c767-c124-7912ad792d6d@gmail.com>
Date: Thu, 7 Oct 2021 14:33:41 +0200
From: Andrzej Hajda <andrzej.hajda@...il.com>
To: Andy Shevchenko <andy.shevchenko@...il.com>,
Stephen Boyd <swboyd@...omium.org>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-arm-msm@...r.kernel.org" <linux-arm-msm@...r.kernel.org>,
"dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>,
"freedreno@...ts.freedesktop.org" <freedreno@...ts.freedesktop.org>,
Arnd Bergmann <arnd@...db.de>,
Benjamin Gaignard <benjamin.gaignard@...aro.org>,
Chen Feng <puck.chen@...ilicon.com>,
Chen-Yu Tsai <wens@...e.org>,
Christian Gmeiner <christian.gmeiner@...il.com>,
Chun-Kuang Hu <chunkuang.hu@...nel.org>,
Daniel Vetter <daniel.vetter@...ll.ch>,
Emma Anholt <emma@...olt.net>,
Heiko Stübner <heiko@...ech.de>,
Inki Dae <inki.dae@...sung.com>,
James Qian Wang <james.qian.wang@....com>,
Jaroslav Kysela <perex@...ex.cz>,
Joerg Roedel <joro@...tes.org>,
John Stultz <john.stultz@...aro.org>,
Joonyoung Shim <jy0922.shim@...sung.com>,
Jyri Sarha <jyri.sarha@....fi>,
Kai Vehmanen <kai.vehmanen@...ux.intel.com>,
Kyungmin Park <kyungmin.park@...sung.com>,
Laurent Pinchart <laurent.pinchart@...asonboard.com>,
"linux-fbdev@...r.kernel.org" <linux-fbdev@...r.kernel.org>,
"linux-omap@...r.kernel.org" <linux-omap@...r.kernel.org>,
"linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>,
Liviu Dudau <liviu.dudau@....com>,
Lucas Stach <l.stach@...gutronix.de>,
Mark Brown <broonie@...nel.org>,
Maxime Ripard <mripard@...nel.org>,
Neil Armstrong <narmstrong@...libre.com>,
Paul Cercueil <paul@...pouillou.net>,
Philipp Zabel <p.zabel@...gutronix.de>,
"Rafael J. Wysocki" <rafael@...nel.org>,
Rob Clark <robdclark@...il.com>,
Russell King <linux@...linux.org.uk>,
Russell King <linux+etnaviv@...linux.org.uk>,
Russell King <rmk+kernel@....linux.org.uk>,
Sandy Huang <hjc@...k-chips.com>,
Saravana Kannan <saravanak@...gle.com>,
Sebastian Reichel <sre@...nel.org>,
Seung-Woo Kim <sw0312.kim@...sung.com>,
Takashi Iwai <tiwai@...e.com>,
Tian Tao <tiantao6@...ilicon.com>,
Tomas Winkler <tomas.winkler@...el.com>,
Tomi Valkeinen <tomba@...nel.org>,
Will Deacon <will@...nel.org>,
Xinliang Liu <xinliang.liu@...aro.org>,
Xinwei Kong <kong.kongxinwei@...ilicon.com>,
Yong Wu <yong.wu@...iatek.com>
Subject: Re: [PATCH v2 00/34] component: Make into an aggregate bus
On 07.10.2021 13:22, Andy Shevchenko wrote:
>
>
> On Wednesday, October 6, 2021, Stephen Boyd <swboyd@...omium.org
> <mailto:swboyd@...omium.org>> 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
> <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
> <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 <arnd@...db.de <mailto:arnd@...db.de>>
> Cc: Benjamin Gaignard <benjamin.gaignard@...aro.org
> <mailto:benjamin.gaignard@...aro.org>>
> Cc: Chen Feng <puck.chen@...ilicon.com <mailto:puck.chen@...ilicon.com>>
> Cc: Chen-Yu Tsai <wens@...e.org <mailto:wens@...e.org>>
> Cc: Christian Gmeiner <christian.gmeiner@...il.com
> <mailto:christian.gmeiner@...il.com>>
> Cc: Chun-Kuang Hu <chunkuang.hu@...nel.org
> <mailto:chunkuang.hu@...nel.org>>
> Cc: Daniel Vetter <daniel.vetter@...ll.ch
> <mailto:daniel.vetter@...ll.ch>>
> Cc: Emma Anholt <emma@...olt.net <mailto:emma@...olt.net>>
> Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org
> <mailto:gregkh@...uxfoundation.org>>
> Cc: "Heiko Stübner" <heiko@...ech.de <mailto:heiko@...ech.de>>
> Cc: Inki Dae <inki.dae@...sung.com <mailto:inki.dae@...sung.com>>
> Cc: James Qian Wang (Arm Technology China) <james.qian.wang@....com
> <mailto:james.qian.wang@....com>>
> Cc: Jaroslav Kysela <perex@...ex.cz <mailto:perex@...ex.cz>>
> Cc: Joerg Roedel <joro@...tes.org <mailto:joro@...tes.org>>
> Cc: John Stultz <john.stultz@...aro.org <mailto:john.stultz@...aro.org>>
> Cc: Joonyoung Shim <jy0922.shim@...sung.com
> <mailto:jy0922.shim@...sung.com>>
> Cc: Jyri Sarha <jyri.sarha@....fi <mailto:jyri.sarha@....fi>>
> Cc: Kai Vehmanen <kai.vehmanen@...ux.intel.com
> <mailto:kai.vehmanen@...ux.intel.com>>
> Cc: Kyungmin Park <kyungmin.park@...sung.com
> <mailto:kyungmin.park@...sung.com>>
> Cc: Laurent Pinchart <laurent.pinchart@...asonboard.com
> <mailto:laurent.pinchart@...asonboard.com>>
> Cc: <linux-fbdev@...r.kernel.org <mailto:linux-fbdev@...r.kernel.org>>
> Cc: <linux-omap@...r.kernel.org <mailto:linux-omap@...r.kernel.org>>
> Cc: <linux-pm@...r.kernel.org <mailto:linux-pm@...r.kernel.org>>
> Cc: Liviu Dudau <liviu.dudau@....com <mailto:liviu.dudau@....com>>
> Cc: Lucas Stach <l.stach@...gutronix.de <mailto:l.stach@...gutronix.de>>
> Cc: Mark Brown <broonie@...nel.org <mailto:broonie@...nel.org>>
> Cc: Maxime Ripard <mripard@...nel.org <mailto:mripard@...nel.org>>
> Cc: Neil Armstrong <narmstrong@...libre.com
> <mailto:narmstrong@...libre.com>>
> Cc: Paul Cercueil <paul@...pouillou.net <mailto:paul@...pouillou.net>>
> Cc: Philipp Zabel <p.zabel@...gutronix.de
> <mailto:p.zabel@...gutronix.de>>
> Cc: "Rafael J. Wysocki" <rafael@...nel.org <mailto:rafael@...nel.org>>
> Cc: Rob Clark <robdclark@...il.com <mailto:robdclark@...il.com>>
> Cc: Russell King <linux@...linux.org.uk <mailto:linux@...linux.org.uk>>
> Cc: Russell King <linux+etnaviv@...linux.org.uk
> <mailto:linux+etnaviv@...linux.org.uk>>
> Cc: Russell King <rmk+kernel@....linux.org.uk
> <mailto:rmk+kernel@....linux.org.uk>>
> Cc: Sandy Huang <hjc@...k-chips.com <mailto:hjc@...k-chips.com>>
> Cc: Saravana Kannan <saravanak@...gle.com <mailto:saravanak@...gle.com>>
> Cc: Sebastian Reichel <sre@...nel.org <mailto:sre@...nel.org>>
> Cc: Seung-Woo Kim <sw0312.kim@...sung.com
> <mailto:sw0312.kim@...sung.com>>
> Cc: Takashi Iwai <tiwai@...e.com <mailto:tiwai@...e.com>>
> Cc: Tian Tao <tiantao6@...ilicon.com <mailto:tiantao6@...ilicon.com>>
> Cc: Tomas Winkler <tomas.winkler@...el.com
> <mailto:tomas.winkler@...el.com>>
> Cc: Tomi Valkeinen <tomba@...nel.org <mailto:tomba@...nel.org>>
> Cc: Will Deacon <will@...nel.org <mailto:will@...nel.org>>
> Cc: Xinliang Liu <xinliang.liu@...aro.org
> <mailto:xinliang.liu@...aro.org>>
> Cc: Xinwei Kong <kong.kongxinwei@...ilicon.com
> <mailto:kong.kongxinwei@...ilicon.com>>
> Cc: Yong Wu <yong.wu@...iatek.com <mailto:yong.wu@...iatek.com>>
>
> 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 <https://chromeos.dev>
>
>
>
> --
> With Best Regards,
> Andy Shevchenko
>
>
Powered by blists - more mailing lists