Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp848576pxb; Mon, 25 Oct 2021 20:31:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyyZA004OYrD1iItJVJBgVKoMaW1weQNdXLEjc7yc+M9hoQOjz8knKK4bdJVd1yps/hzIXF X-Received: by 2002:a17:902:9a94:b0:13f:dfc9:cebf with SMTP id w20-20020a1709029a9400b0013fdfc9cebfmr20382535plp.78.1635219073296; Mon, 25 Oct 2021 20:31:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635219073; cv=none; d=google.com; s=arc-20160816; b=s0Y9dD5GUrmK1YqtSumqYEip5NQXCKmGt1htg1apmQwaP6GOLhUtINprkC4mws+pwt bdV81tHOGNm7N5h+Em5Cb1RIF2w047jyCseGFXxLrlrF0kVL7hKWPRyBlVT/oCHzsWZf kKED0hWcuJzSsO0mdym3b1Or7rPcloASnon5ApHpyCCByKwaQFYEOOvOT3FO2ABPbuFk KpOFKhBxfiEPWp3w1PHPWJ+Zg85Wn/5N1vBxgzOPHguy9SZ1bSwW1LIvdj+tWAhX0kdr 7QQoui+Js3cMD61fTB3Z3k6UqfA2RqskFwuquBh7w3x1OTR1Fq2aw0sItY3+Ixdn44QO SvHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=NsjwfsQuiDMEQ+TXne3j17pwDv7xto97Rnhld6OcLgM=; b=YvlS3UDH/YbJH7ujSw7LHZLPtf7+vhyT6fvepa+Iii92WJ2WvaGwswephkLuLwAAHG UC130e2DJv2J1K6a3+BbZS9cNop+pyF/vC06r9N0KXOWUHYQmxcQDUyx/KHc7pOuclgN VkDzdk+gZYffPjVOnpMspm3143t5ETzIg3eTvjJ2MEh8H1kNFY1PMy/6dH5cX4T4ya3y 3jMItEvbcvdr8/50AYq1LiCCduiMoPuFoikVv/f+bvwFmvyT6h3SNWDbEKMn+B2jWbFx UVGTYivU/S6X5eakjDWWYepcG5YTYupfJH4Qxq7acsdyBfzwQOerNfwHjH9QN5oDK0Po MSTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=JsNKkygm; 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 o13si1109089pjp.107.2021.10.25.20.31.00; Mon, 25 Oct 2021 20:31:13 -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=JsNKkygm; 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 S236196AbhJZAEw (ORCPT + 99 others); Mon, 25 Oct 2021 20:04:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58354 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235643AbhJZADV (ORCPT ); Mon, 25 Oct 2021 20:03:21 -0400 Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6CF7CC061243 for ; Mon, 25 Oct 2021 17:00:57 -0700 (PDT) Received: by mail-pf1-x434.google.com with SMTP id t184so12517816pfd.0 for ; Mon, 25 Oct 2021 17:00:57 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=NsjwfsQuiDMEQ+TXne3j17pwDv7xto97Rnhld6OcLgM=; b=JsNKkygmeK7t9BKO6qrvtUSpxQse23oLtPi1Ud+f8iOJIEjnjJoQyjhNwQBsbe7Z9F M0+wkg4ZKQiVoMM8IoJFOjkU2VGe29j7CfYlRftUp21IthOYQqKKp5hC4GlQarR3MHWh iHXFOzHIMsAvr6cTyAlsNu12s72IGx7u09yis= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=NsjwfsQuiDMEQ+TXne3j17pwDv7xto97Rnhld6OcLgM=; b=iFumE9cUAF8PO4aQDZT0hwQvLZA/7RKqNuWJ76GlLAlEGxXKJN0kftVuFnFR2Zd71S EmQl+6GrPRzgAiSV+SG1MbI6qN/kB3GpfDkT+PDHz/RoeFWaiZDQBQOBqKlxEdevUyg9 qBl+X68HE7a3DNzzOl7MkRquGkL15BjcyHNksNatSKirUrolJNYI62wu0ozpxYdpLg1z cKkME2B1bAY69I8FzeY372W3lqzX9Uat9YCqO4zDy4HvdomY8iMftaImDMAaGqgacXsU z95NfxgzKK7V4Hkil5BaphhnU/AVaPliHijwzRGkPKfZog3E2nALbWGjjf4XVUWAbALh jOQg== X-Gm-Message-State: AOAM531oTu/RrHD3dbJbqYBvkWtBuvTCKsvUahYRcRS5BhxsAnf1Go9q x4JyQrzIYNIQYz1wR0uVdhWEgg== X-Received: by 2002:a05:6a00:2309:b0:47c:fb3:f127 with SMTP id h9-20020a056a00230900b0047c0fb3f127mr859661pfh.78.1635206456941; Mon, 25 Oct 2021 17:00:56 -0700 (PDT) Received: from smtp.gmail.com ([2620:15c:202:201:f5e3:5eb1:d5ee:6893]) by smtp.gmail.com with ESMTPSA id b7sm9900747pfm.28.2021.10.25.17.00.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Oct 2021 17:00:56 -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, Lucas Stach , Russell King , Christian Gmeiner , Daniel Vetter , "Rafael J. Wysocki" , Rob Clark , Saravana Kannan Subject: [PATCH v3 12/34] drm/etnaviv: Migrate to aggregate driver Date: Mon, 25 Oct 2021 17:00:22 -0700 Message-Id: <20211026000044.885195-13-swboyd@chromium.org> X-Mailer: git-send-email 2.33.0.1079.g6e70778dc9-goog In-Reply-To: <20211026000044.885195-1-swboyd@chromium.org> References: <20211026000044.885195-1-swboyd@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use an aggregate driver instead of component ops so that we can get proper driver probe ordering of the aggregate device with respect to all the component devices that make up the aggregate device. Cc: Lucas Stach Cc: Russell King Cc: Christian Gmeiner Cc: Daniel Vetter Cc: "Rafael J. Wysocki" Cc: Rob Clark Cc: Saravana Kannan Signed-off-by: Stephen Boyd --- drivers/gpu/drm/etnaviv/etnaviv_drv.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/etnaviv/etnaviv_drv.c b/drivers/gpu/drm/etnaviv/etnaviv_drv.c index 7dcc6392792d..95d1e518ff13 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_drv.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_drv.c @@ -494,8 +494,9 @@ static const struct drm_driver etnaviv_drm_driver = { /* * Platform driver: */ -static int etnaviv_bind(struct device *dev) +static int etnaviv_bind(struct aggregate_device *adev) { + struct device *dev = adev->parent; struct etnaviv_drm_private *priv; struct drm_device *drm; int ret; @@ -552,8 +553,9 @@ static int etnaviv_bind(struct device *dev) return ret; } -static void etnaviv_unbind(struct device *dev) +static void etnaviv_unbind(struct aggregate_device *adev) { + struct device *dev = adev->parent; struct drm_device *drm = dev_get_drvdata(dev); struct etnaviv_drm_private *priv = drm->dev_private; @@ -569,9 +571,13 @@ static void etnaviv_unbind(struct device *dev) drm_dev_put(drm); } -static const struct component_master_ops etnaviv_master_ops = { - .bind = etnaviv_bind, - .unbind = etnaviv_unbind, +static struct aggregate_driver etnaviv_aggregate_driver = { + .probe = etnaviv_bind, + .remove = etnaviv_unbind, + .driver = { + .name = "etnaviv_drm", + .owner = THIS_MODULE, + }, }; static int compare_of(struct device *dev, void *data) @@ -609,12 +615,12 @@ static int etnaviv_pdev_probe(struct platform_device *pdev) component_match_add(dev, &match, compare_str, names[i]); } - return component_master_add_with_match(dev, &etnaviv_master_ops, match); + return component_aggregate_register(dev, &etnaviv_aggregate_driver, match); } static int etnaviv_pdev_remove(struct platform_device *pdev) { - component_master_del(&pdev->dev, &etnaviv_master_ops); + component_aggregate_unregister(&pdev->dev, &etnaviv_aggregate_driver); return 0; } -- https://chromeos.dev