From patchwork Thu Jan 27 20:01:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 12727239 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7C048C433FE for ; Thu, 27 Jan 2022 20:01:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239771AbiA0UBq (ORCPT ); Thu, 27 Jan 2022 15:01:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43070 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229667AbiA0UBq (ORCPT ); Thu, 27 Jan 2022 15:01:46 -0500 Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com [IPv6:2607:f8b0:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1DFA1C06173B for ; Thu, 27 Jan 2022 12:01:46 -0800 (PST) Received: by mail-pf1-x435.google.com with SMTP id i186so1319726pfe.0 for ; Thu, 27 Jan 2022 12:01:46 -0800 (PST) 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=dU8ab7ulGqymjJ/fLv1o7Map/AivRDGDSe5tyGb8CYs=; b=dMt2MuVVZzz0MVHLj7Y8Ti36l/TTs9CqSuVCH9G6LHKs/GVCplLR7HLOlzkzBR2BJ9 h9hQiFWB4QfTAOHua+56ytSxWBQjxYed3S1k6sG1Z+6MdNygxbqIczylQvQMEpqdoNog VNfQJQ1AEtQ2ytliUK3+/sb8RPwkeYE3NhL/w= 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=dU8ab7ulGqymjJ/fLv1o7Map/AivRDGDSe5tyGb8CYs=; b=zTdfCRKhagfUXOcqZzug8WFnH/Oj5G7j7MchXn2H1ULDX+LwL565tvrIYph69vVNRj rrSqq1b2QsKuGS+NzHlxrF3dOnCTalrJf0VSvDZEZwCImVTnYNLHmdEvdqvYDseWcFCf CBZxzMnxOZ+mrUmXN54pZ5z+HlSt6GRguaG16TZ3KcgxgZDgMuUxO4SYK/4TtaInwKB5 hczGLALWr8zT8Z2tZV2hQTE1Zxs6JJ5uSVvs2OFHI8OGiSgN1PFsk2sK7Cgm9WPzNQXU j5kPnE2Fs+AaqmXvfqKagFUMKEewXqVOmH2UjkJxZ8Vqw5nNGDKaSFiFyrLJt0r3yHgK ud8g== X-Gm-Message-State: AOAM533gjG8naMt7AIcxZVKn51HVxAZt2+zHIYRla/FP+Fe4YXcMLGz8 zPAuOj9W58MOdgfxsOlK2NE02Q== X-Google-Smtp-Source: ABdhPJxosLIV/FhwZ+Cv5kqs3lcLG2k3nd5MBXD1irDAfPHg4ect1HNpLG+hDpqmwHJ50umpGmdFGA== X-Received: by 2002:a63:5f13:: with SMTP id t19mr3977476pgb.440.1643313705559; Thu, 27 Jan 2022 12:01:45 -0800 (PST) Received: from smtp.gmail.com ([2620:15c:202:201:9246:1838:3243:3071]) by smtp.gmail.com with ESMTPSA id k21sm6561190pff.33.2022.01.27.12.01.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Jan 2022 12:01:45 -0800 (PST) From: Stephen Boyd To: Greg Kroah-Hartman , Douglas Anderson Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, Arnd Bergmann , Baolin Wang , Chen Feng , Chen-Yu Tsai , Christian Gmeiner , Chun-Kuang Hu , Chunyan Zhang , Daniel Vetter , Emma Anholt , Heikki Krogerus , =?utf-8?q?Heiko_St=C3=BC?= =?utf-8?q?bner?= , Inki Dae , James Qian Wang , Jaroslav Kysela , Joerg Roedel , John Stultz , Joonyoung Shim , Jyri Sarha , Kai Vehmanen , Kevin Tang , Kyungmin Park , Laurent Pinchart , linux-fbdev@vger.kernel.org, linux-omap@vger.kernel.org, linux-pm@vger.kernel.org, Linus Walleij , Liviu Dudau , Lucas Stach , Lucas Tanure , Maarten Lankhorst , Mark Brown , Maxime Ripard , Neil Armstrong , Orson Zhai , Paul Cercueil , Philipp Zabel , "Rafael J. Wysocki" , Rob Clark , Russell King , Russell King , Russell King , Sandy Huang , Saravana Kannan , Sebastian Reichel , Seung-Woo Kim , Stefan Binding , Takashi Iwai , Tian Tao , Tomas Winkler , Tomi Valkeinen , Will Deacon , Xinliang Liu , Xinwei Kong , Yong Wu , Vitaly Lubart , Daniele Ceraolo Spurio , Rodrigo Vivi Subject: [PATCH v6 00/35] component: Make into an aggregate bus Date: Thu, 27 Jan 2022 12:01:06 -0800 Message-Id: <20220127200141.1295328-1-swboyd@chromium.org> X-Mailer: git-send-email 2.35.0.rc0.227.g00780c9af4-goog MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org 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. Tested-by tags would be appreciated, and Acked-by/Reviewed-by tags too. Per Daniel, I've resent this to collect Acks or Review tags from gregkh and once Greg is happy with the driver core bits it can be merged through drm-misc tree via dianders (both are on the To line). Changes since v5 (https://lore.kernel.org/r/20220106214556.2461363-1-swboyd@chromium.org): - Refcount the driver registration to support multiple device usage - Fix runtime PM in MediaTek iommu patch - Rebased to v5.17-rc1 and converted new component uses - No longer expose struct aggregate_device in component.h header Changes since v4 (https://lore.kernel.org/r/20211202222732.2453851-1-swboyd@chromium.org): - Picked up tags - Moved rename patch to first in the series - Squashed device and bus type patch together Changes since v3 (https://lore.kernel.org/r/20211026000044.885195-1-swboyd@chromium.org): - Picked up tags - Rebased to v5.16-rc2 - Updated component.c for a few new patches there - Dropped a conversion patch - Added a conversion patch Changes since v2 (https://lore.kernel.org/r/20211006193819.2654854-1-swboyd@chromium.org): - Picked up acks - Fixed build warnings/errors - Reworked patch series to rename 'master' in a different patch 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 (35): component: Replace most references to 'master' with 'aggregate device' component: Introduce the aggregate bus_type component: Add aggregate_device_parent() for driver use component: Add {bind,unbind}_component() ops that take aggregate device drm/of: Add a drm_of_aggregate_probe() API drm/msm: Migrate to aggregate driver 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 iommu/mediatek: 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 drm/sprd: Migrate to aggregate driver usb: typec: port-mapper: Migrate to aggregate driver ALSA: hda/realtek: Migrate to aggregate driver component: Get rid of drm_of_component_probe() component: Remove component_master_ops and friends drivers/base/component.c | 571 +++++++++++------- .../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 | 18 +- 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 | 25 +- 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 | 48 +- drivers/gpu/drm/omapdrm/dss/dss.c | 20 +- drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 20 +- drivers/gpu/drm/sprd/sprd_drm.c | 48 +- 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/iommu/mtk_iommu.c | 14 +- drivers/iommu/mtk_iommu.h | 6 +- drivers/iommu/mtk_iommu_v1.c | 14 +- drivers/memory/mtk-smi.c | 10 +- drivers/misc/mei/hdcp/mei_hdcp.c | 22 +- drivers/misc/mei/pxp/mei_pxp.c | 22 +- drivers/power/supply/ab8500_charger.c | 22 +- drivers/usb/typec/port-mapper.c | 22 +- drivers/video/fbdev/omap2/omapfb/dss/dss.c | 20 +- include/drm/drm_of.h | 10 +- include/linux/component.h | 96 ++- sound/hda/hdac_component.c | 21 +- sound/pci/hda/patch_realtek.c | 20 +- sound/soc/codecs/wcd938x.c | 20 +- 37 files changed, 863 insertions(+), 532 deletions(-) Cc: Arnd Bergmann Cc: Baolin Wang Cc: Chen Feng Cc: Chen-Yu Tsai Cc: Christian Gmeiner Cc: Chun-Kuang Hu Cc: Chunyan Zhang Cc: Daniel Vetter Cc: Emma Anholt Cc: Greg Kroah-Hartman Cc: Heikki Krogerus 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: Kevin Tang Cc: Kyungmin Park Cc: Laurent Pinchart Cc: Cc: Cc: Cc: Linus Walleij Cc: Liviu Dudau Cc: Lucas Stach Cc: Lucas Tanure Cc: Maarten Lankhorst Cc: Mark Brown Cc: Maxime Ripard Cc: Neil Armstrong Cc: Orson Zhai 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: Stefan Binding Cc: Takashi Iwai Cc: Tian Tao Cc: Tomas Winkler Cc: Tomi Valkeinen Cc: Will Deacon Cc: Xinliang Liu Cc: Xinwei Kong Cc: Yong Wu Cc: Vitaly Lubart Cc: Daniele Ceraolo Spurio Cc: Rodrigo Vivi Cc: Kai Vehmanen base-commit: e783362eb54cd99b2cac8b3a9aeac942e6f6ac07