From patchwork Wed Oct 6 19:37:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 12540381 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 DEEBAC433EF for ; Wed, 6 Oct 2021 19:38:25 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 91903611C3 for ; Wed, 6 Oct 2021 19:38:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 91903611C3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B6D8E6EE1F; Wed, 6 Oct 2021 19:38:24 +0000 (UTC) Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9AF086EE1C for ; Wed, 6 Oct 2021 19:38:23 +0000 (UTC) Received: by mail-pj1-x1031.google.com with SMTP id d13-20020a17090ad3cd00b0019e746f7bd4so5227116pjw.0 for ; Wed, 06 Oct 2021 12:38:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=LOPyAAlgkloGBvBKaHv+rjO0uew1lLPS4TPvNQXgGpg=; b=NfRXDAjZ56Sp834gnEHgLwuXxQVUtsJkT2wga3+6IgC06j+y5bTeXit8d+59Vzb3EB d5z8MUC2yTrMyl/REWDz7Xj7y4VryHU2ACdz7TdMZ2sEy74M46zyTFe14HUcaaYbxfCK nRCyGp7GzMSIaj6tmAg4lxzSmurSmmRsCLgRk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=LOPyAAlgkloGBvBKaHv+rjO0uew1lLPS4TPvNQXgGpg=; b=Q1zvp+cSj37TziAyCO5dCQ2OaMjGZ/BidyzaLdx3AgMerAF/iERH5xDdV/HN5vIg73 an7X2uYsOzU3bnTU9eg0J8K1svWBfvH1r+yBFLKv1IW2o4zuyIjx3g5bO77g/pLbQ5mY iWVRjp4VzH8OEcxXNQrmezmY6nhc8jfAL/QpTYz9CShD2BZ4VIlYq1I8Gs/Sd5x/AcZq 5p5znrG3/bPUhIt4QSyricWsJQTnutu/xeYaSoKXCuicOgp4FzSL3naUX6vXWXcOzpPX sbj2dbrGIxnQekq7s/uSyJl29iXA/dRYPgC6MXzTGuQ0zQwtHKWcJnrHbuT4auPnWE2x wHeQ== X-Gm-Message-State: AOAM533N58Q31cvA0YHKHcDb7U34jwoGWaHY5PnQeu4k6X6b79QPrq2o fTXHlgHHZKYP/STf7SWjimvEXw== X-Google-Smtp-Source: ABdhPJyOSP9eTH58O4sZphYJfqDacdQGshqo1a+GgIDJL6zusxu34JwQnPr+XtN/rdjjr7tkocXkfA== X-Received: by 2002:a17:902:6b0b:b0:13a:18bf:1ece with SMTP id o11-20020a1709026b0b00b0013a18bf1ecemr12512498plk.49.1633549103194; Wed, 06 Oct 2021 12:38:23 -0700 (PDT) Received: from smtp.gmail.com ([2620:15c:202:201:d412:c5eb:4aca:4738]) by smtp.gmail.com with ESMTPSA id o14sm22011296pfh.84.2021.10.06.12.38.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Oct 2021 12:38:22 -0700 (PDT) From: Stephen Boyd 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, 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 Subject: [PATCH v2 00/34] component: Make into an aggregate bus Date: Wed, 6 Oct 2021 12:37:45 -0700 Message-Id: <20211006193819.2654854-1-swboyd@chromium.org> X-Mailer: git-send-email 2.33.0.800.g4c38ced690-goog MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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! 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