Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3373816pxb; Mon, 1 Nov 2021 12:37:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx46tdY0KkcZoe//b4xjbYUbx5LZx50H+WkzlWkQjhPwuNPySCa/RnsOCwmZ/3YRN4RMATF X-Received: by 2002:a92:c248:: with SMTP id k8mr989723ilo.192.1635795458768; Mon, 01 Nov 2021 12:37:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635795458; cv=none; d=google.com; s=arc-20160816; b=wKfm/3PpwxiLaiSFpYuSih3Ro5jAgQgXCahDVTC0N9UKLbE2gHIIk+d4BKmshlmcYd hBKsZOgr0GvEFfLkNyAr2ccKJPamjmG+lasfevcJ7pc09sQzZdC5arwBZbyxY4S3TYdg +aUquFwiXvPA9GjiWBUukKWiUUCliKWE/PIEk77G6Y0ukY5tNlWyt4MEjPFNobvt7Dl/ xh9etcaozYK+LYXGI740L2dodcGfBP3hed9oLGg4k9PCmm9ouEbCwXCbwviRvWaDnmQ8 RTKkWeYkQgl+1EevQWDWBBH4lOGsZSW57dTUSnX7nUqFxIuoQIdPLQvoxSRyQGwrB7GQ j1eQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:message-id:references :in-reply-to:subject:cc:to:from:date:mime-version:dkim-signature; bh=p5j38nD4C6JFRNTsNhzwvjuue/W06jEH6YlXaA0bpeU=; b=UcB7JmzOhqSLhlvMjWo9OqyZHtRBnouhj9w5NS51ybgUmzlPrT1SZpdM2C2iJZBBVG n+IoJUCBho9gqKWy1qaG3aV5anb0NPS3RZroij5dOIJYZ+gN5eqD+wczw+/CMHy0f4NM cPbIi4ei5URlMBc7Sh9WD6oVnA0WMCMtpQ1K/5x0wO24gPysII8hRRoYOgXFP0PlE42p ov8HXOGpPlzoZgApPGv7sJRRkyGLwOAbQYpBox/FrlpXQBaGTVA6Rw1PxwNq+dJWS1hd RILSt0LrvQuWmCgl34xbKZ/exMyIerXBlsqCxSJsFELy83sjE4oQK1aqQSsJ6Xi2xKwJ x0Fg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kapsi.fi header.s=20161220 header.b=jbLZtsyJ; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y10si13120759iow.26.2021.11.01.12.37.24; Mon, 01 Nov 2021 12:37:38 -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=fail header.i=@kapsi.fi header.s=20161220 header.b=jbLZtsyJ; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231228AbhKATib (ORCPT + 99 others); Mon, 1 Nov 2021 15:38:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41240 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230107AbhKATiP (ORCPT ); Mon, 1 Nov 2021 15:38:15 -0400 Received: from mail.kapsi.fi (mail.kapsi.fi [IPv6:2001:67c:1be8::25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 24F88C061714; Mon, 1 Nov 2021 12:35:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=kapsi.fi; s=20161220; h=Content-Transfer-Encoding:Content-Type:Message-ID:References: In-Reply-To:Subject:Cc:To:From:Date:MIME-Version:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=p5j38nD4C6JFRNTsNhzwvjuue/W06jEH6YlXaA0bpeU=; b=jbLZtsyJxM9oj7PQePkpXtK5kb mdV8zpactjaZuYEv7XKtLrdyChEfIsddeHZmX+saHhtRh1zMhukiG2cGhihHIl8Z8UjnYpqazgi2j G3ePggflvINuBVvN2eCr9T1rW0dtWweZvQsBCe8hWVN+P6rW1XD0lrJ60kTFeQsfD+R5rmFk6AcEp g3XRtTlrMWsFCxgx63tAQuWvV5+01JJcrfMq6IgR2tbhufHcGwh2NpJoNFXcIDu/FwonZiE7NG6Az nhFopVf6K+QEVodyZG7hO5dCIitxX13/iU3mPU3o2/puUu2cS3cP7L7hutsDVf+nVy6jSZ9VYmlQL E0ISl+bQ==; Received: from webng-gw.kapsi.fi ([91.232.154.200] helo=roundcube.kapsi.fi) by mail.kapsi.fi with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1mhd5b-000303-Us; Mon, 01 Nov 2021 21:35:27 +0200 MIME-Version: 1.0 Date: Mon, 01 Nov 2021 21:35:25 +0200 From: Jyri Sarha To: Stephen Boyd Cc: Greg Kroah-Hartman , linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, Tomi Valkeinen , Daniel Vetter , "Rafael J. Wysocki" , Rob Clark , Russell King , Saravana Kannan Subject: Re: [PATCH v3 24/34] drm/tilcdc: Migrate to aggregate driver In-Reply-To: <20211026000044.885195-25-swboyd@chromium.org> References: <20211026000044.885195-1-swboyd@chromium.org> <20211026000044.885195-25-swboyd@chromium.org> Message-ID: X-Sender: jyri.sarha@iki.fi Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 91.232.154.200 X-SA-Exim-Mail-From: jyri.sarha@iki.fi X-SA-Exim-Scanned: No (on mail.kapsi.fi); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021-10-26 3:00, Stephen Boyd wrote: > 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: Jyri Sarha > Cc: Tomi Valkeinen > Cc: Daniel Vetter > Cc: "Rafael J. Wysocki" > Cc: Rob Clark > Cc: Russell King > Cc: Saravana Kannan > Signed-off-by: Stephen Boyd > --- Tested-by: Jyri Sarha Thanks, Jyri > drivers/gpu/drm/tilcdc/tilcdc_drv.c | 28 ++++++++++++++++------------ > 1 file changed, 16 insertions(+), 12 deletions(-) > > diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c > b/drivers/gpu/drm/tilcdc/tilcdc_drv.c > index 6b03f89a98d4..d5c6567eec8d 100644 > --- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c > +++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c > @@ -531,13 +531,16 @@ static const struct dev_pm_ops tilcdc_pm_ops = { > /* > * Platform driver: > */ > -static int tilcdc_bind(struct device *dev) > +static int tilcdc_bind(struct aggregate_device *adev) > { > + struct device *dev = adev->parent; > + > return tilcdc_init(&tilcdc_driver, dev); > } > > -static void tilcdc_unbind(struct device *dev) > +static void tilcdc_unbind(struct aggregate_device *adev) > { > + struct device *dev = adev->parent; > struct drm_device *ddev = dev_get_drvdata(dev); > > /* Check if a subcomponent has already triggered the unloading. */ > @@ -547,9 +550,13 @@ static void tilcdc_unbind(struct device *dev) > tilcdc_fini(dev_get_drvdata(dev)); > } > > -static const struct component_master_ops tilcdc_comp_ops = { > - .bind = tilcdc_bind, > - .unbind = tilcdc_unbind, > +static struct aggregate_driver tilcdc_aggregate_driver = { > + .probe = tilcdc_bind, > + .remove = tilcdc_unbind, > + .driver = { > + .name = "tilcdc_drm", > + .owner = THIS_MODULE, > + }, > }; > > static int tilcdc_pdev_probe(struct platform_device *pdev) > @@ -566,12 +573,9 @@ static int tilcdc_pdev_probe(struct > platform_device *pdev) > ret = tilcdc_get_external_components(&pdev->dev, &match); > if (ret < 0) > return ret; > - else if (ret == 0) > + if (ret == 0) > return tilcdc_init(&tilcdc_driver, &pdev->dev); > - else > - return component_master_add_with_match(&pdev->dev, > - &tilcdc_comp_ops, > - match); > + return component_aggregate_register(&pdev->dev, > &tilcdc_aggregate_driver, match); > } > > static int tilcdc_pdev_remove(struct platform_device *pdev) > @@ -581,10 +585,10 @@ static int tilcdc_pdev_remove(struct > platform_device *pdev) > ret = tilcdc_get_external_components(&pdev->dev, NULL); > if (ret < 0) > return ret; > - else if (ret == 0) > + if (ret == 0) > tilcdc_fini(platform_get_drvdata(pdev)); > else > - component_master_del(&pdev->dev, &tilcdc_comp_ops); > + component_aggregate_unregister(&pdev->dev, > &tilcdc_aggregate_driver); > > return 0; > }