Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp851998pxb; Mon, 25 Oct 2021 20:36:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwV4XUMSjgZoPqbVaiU4gNLEMZeio4KFRDYo7xuWTB1N+LMHszzs6vPTryAoH5lTGeFnms2 X-Received: by 2002:a05:6a00:1794:b0:47b:e4c8:e4f8 with SMTP id s20-20020a056a00179400b0047be4c8e4f8mr14219076pfg.6.1635219415143; Mon, 25 Oct 2021 20:36:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635219415; cv=none; d=google.com; s=arc-20160816; b=rtE2gydPcVT40x8x7DGanvULYXLCqfoh1dybP+Rs0YwqStzudV34tcnCsxu5JzrPGd pb+HmIqo4nZjaq6p7kLTEr7qjlfVm3bKEYAPgaMurS2IxjdkDCLLdIOsQ/03oQ52JU0C kOPbaEDj/21xNCpPd8FX7jo+pLXZbph5SCI3xvbE2d2pSa2TzRHfx/yxq//QfiHlvzg7 U0RnkNAbHVE03UUMnaA4Y3fyVbqfPRFeoXQ+Pjtn9YlENTqUVGQTaqPMtp3KdmEBKVfa fnVWD7O9CzBJ6+/+Uhk4Y4dcE1XtrDvLtnYg76bfNwVVeeXd1WUKlgtVKPt4gDygo1Uk dL3w== 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=8fBlAXi6sFYrXtAp7S0GQqlwZRRttRb1KFYpoiMF4WI=; b=VzX3Mb98I8nvVxUPueW4E5aAyWZ57leRmyCkam/LReASM685MfZOBQwCGp6J/0KTVn LoSGOLwit/VarOdQpWORPwd9oudLnw2qq1lx3nYSNTyAq8CxiXCxfnDUt9iv+rkYH9QE wBAiGa6ixt7zrpsr2fJR/rbNpFg6fsPn5lD7K40sAtjUyNzm6WmYuc0gz0O3aGyJCoPW wHilRm//CT6HF9gHQYbr3KbjCyjMtlz22Q+SGScQLueHFU+iJdqvyJ4l7PjgUoPBpGFD J7QGYTbdsb/bgs3BGuN5K2qaVm00abdYCzudUxlgb8JkCAi5CjyRYj7Q6SrdaNtIWLaW qsXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=lsr8K2a0; 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 e27si26929845pgl.492.2021.10.25.20.36.41; Mon, 25 Oct 2021 20:36:55 -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=lsr8K2a0; 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 S234845AbhJZAFh (ORCPT + 99 others); Mon, 25 Oct 2021 20:05:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58448 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235745AbhJZADc (ORCPT ); Mon, 25 Oct 2021 20:03:32 -0400 Received: from mail-pf1-x42c.google.com (mail-pf1-x42c.google.com [IPv6:2607:f8b0:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E190C061348 for ; Mon, 25 Oct 2021 17:01:08 -0700 (PDT) Received: by mail-pf1-x42c.google.com with SMTP id 187so12450228pfc.10 for ; Mon, 25 Oct 2021 17:01:08 -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=8fBlAXi6sFYrXtAp7S0GQqlwZRRttRb1KFYpoiMF4WI=; b=lsr8K2a030rR0WfvezZcCFE1im2JtiNyOoBBVNT3ZzLz0QpGkEOgTqxRQLzMQySVcO 5z0MWMfaXteKDv1SCA424nO791h6lLbvMPSHVDDlk+MuE1qDtbIXl7u0HizxUv5q6PiV sT5ZngUKTpX+KCzmIzo7JdHpKMFIEhgOs54yU= 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=8fBlAXi6sFYrXtAp7S0GQqlwZRRttRb1KFYpoiMF4WI=; b=nkGUElmA9K9RyHelDRs7RZ/dBwkMrsnqTmrU0JjQw1Atp4i6b5zk/5IUuUw6jYF1FE kwqYYWmseGPqCkx63D0eZz69sUL/tLWSzCoDqucLnGu5sjqqKMpp2sGQ3Y556cDq2n8h IEayPH1JypIc8Apu8gQyKQABSDlWMqPMSjQAFvvj1RvAXMCgypsqVUiYKqrLqucwAjHs +OCSiaF2P0+B9H0Zhrldo3XMNrsUCdo+k42jKG/OKysk4v1i4ZlTFLUe1Iq+SeiOfXEt J/iKrv0KdufFnh5Zv9mDnSxwJagqVGxWEQ49Dhlw4Yrj0qk/y8LWnXqFP8Kc76oSWqV9 fZbw== X-Gm-Message-State: AOAM532pkuI52L//icwK3e3NSfDtf7+XLUEOV72Q70zR2+OmGujeqN3A LElAbC9ScZ0vx9RGDWNWbHzzEQ== X-Received: by 2002:a05:6a00:1681:b0:46f:6fc0:e515 with SMTP id k1-20020a056a00168100b0046f6fc0e515mr21771511pfc.11.1635206468058; Mon, 25 Oct 2021 17:01:08 -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.01.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Oct 2021 17:01:07 -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, Emma Anholt , Maxime Ripard , Daniel Vetter , "Rafael J. Wysocki" , Rob Clark , Russell King , Saravana Kannan Subject: [PATCH v3 25/34] drm/vc4: Migrate to aggregate driver Date: Mon, 25 Oct 2021 17:00:35 -0700 Message-Id: <20211026000044.885195-26-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: Emma Anholt Cc: Maxime Ripard Cc: Daniel Vetter Cc: "Rafael J. Wysocki" Cc: Rob Clark Cc: Russell King Cc: Saravana Kannan Signed-off-by: Stephen Boyd --- drivers/gpu/drm/vc4/vc4_drv.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c index f6c16c5aee68..bccbde7a2f59 100644 --- a/drivers/gpu/drm/vc4/vc4_drv.c +++ b/drivers/gpu/drm/vc4/vc4_drv.c @@ -214,8 +214,9 @@ static void vc4_match_add_drivers(struct device *dev, } } -static int vc4_drm_bind(struct device *dev) +static int vc4_drm_bind(struct aggregate_device *adev) { + struct device *dev = adev->parent; struct platform_device *pdev = to_platform_device(dev); struct drm_device *drm; struct vc4_dev *vc4; @@ -286,8 +287,9 @@ static int vc4_drm_bind(struct device *dev) return ret; } -static void vc4_drm_unbind(struct device *dev) +static void vc4_drm_unbind(struct aggregate_device *adev) { + struct device *dev = adev->parent; struct drm_device *drm = dev_get_drvdata(dev); drm_dev_unregister(drm); @@ -295,9 +297,13 @@ static void vc4_drm_unbind(struct device *dev) drm_atomic_helper_shutdown(drm); } -static const struct component_master_ops vc4_drm_ops = { - .bind = vc4_drm_bind, - .unbind = vc4_drm_unbind, +static struct aggregate_driver vc4_aggregate_driver = { + .probe = vc4_drm_bind, + .remove = vc4_drm_unbind, + .driver = { + .name = "vc4_drm", + .owner = THIS_MODULE, + }, }; /* @@ -328,12 +334,12 @@ static int vc4_platform_drm_probe(struct platform_device *pdev) vc4_match_add_drivers(dev, &match, component_drivers, ARRAY_SIZE(component_drivers)); - return component_master_add_with_match(dev, &vc4_drm_ops, match); + return component_aggregate_register(dev, &vc4_aggregate_driver, match); } static int vc4_platform_drm_remove(struct platform_device *pdev) { - component_master_del(&pdev->dev, &vc4_drm_ops); + component_aggregate_unregister(&pdev->dev, &vc4_aggregate_driver); return 0; } -- https://chromeos.dev