Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp1755078pxb; Thu, 7 Oct 2021 14:34:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy4Irxjx9Zb5LQm7LsSZhVtc3WaI6OPV8DtzWwis0zwQW754c7x6uAVhSmNMA1/zT/Y5Se7 X-Received: by 2002:a50:d8c7:: with SMTP id y7mr9445122edj.133.1633642443149; Thu, 07 Oct 2021 14:34:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633642443; cv=none; d=google.com; s=arc-20160816; b=BKwWAD14LNKRWMOwTlq43Ocf8VFNov3NPq2bvgtx4H7jSs6F02g8j+rjyCDF1GRWbz 3KOmm8g6kz6vMKtM/ZForyUJIzqsyBQAhf1rbgD81Fw3enV98G2i9uyEcXYUsKFVvH6X y7oKMn0JOOJ/UjUZ1QXdJUpxWZxSrMqWa29KDN4fhYMJP5lhq/utUbDPQRDUlvjF6s+g VuyHVVrkR5TvZQqiUIDQCMRk7IUEGvgVmnmMjrw8RViQBBxOBOYX31EzrUoVePP5Jgup 8Bw5DrWfYsfnegzTUIQOKXs4Rnj/RK5cpl0StZllGyn9sXhsDuc0Y2Vev/oWSi9Xau3V TRVg== 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:cc:to:subject:from:date; bh=l7opk95O7rqNboBHq/TqGjkf/2qIDPuo+fF62ywW4to=; b=K/0CvGKedVORZxz6BYw8hyi3EwuxOib3TQpq0AhiDl/Qu5dz9cby9vfdCbKsDc+BzQ JAJGeFs6Vz4/QB7ZlZ+pxmYScVKPJu6M7/EDr/ytvQXkXMc+ZhWAlOqIEO4SSngvbO1H xX+3MhgQrr4YmiNL6fQUod5BhRnPDwV7hhx8UEe03EZCBMv1Rlx8hF8cTSOmlf/hxefG u7ir2niCBOdCX0N+yOeRYlvgaswQYhdjSUWbSAh1Nse7649VVc5nYuDq+0+s5dTrwicb ppfgoexQQ1hxG5AzKgXFKYqyGAZdrnSf69Y/yvt9KXOBTGZBqyIMM/M6Ce22JC8VZAAM uYWQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id nd21si821333ejc.580.2021.10.07.14.33.39; Thu, 07 Oct 2021 14:34:03 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234032AbhJGVbt convert rfc822-to-8bit (ORCPT + 99 others); Thu, 7 Oct 2021 17:31:49 -0400 Received: from aposti.net ([89.234.176.197]:46020 "EHLO aposti.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230120AbhJGVbs (ORCPT ); Thu, 7 Oct 2021 17:31:48 -0400 Date: Thu, 07 Oct 2021 22:29:42 +0100 From: Paul Cercueil Subject: Re: [PATCH v2 15/34] drm/ingenic: Migrate to aggregate driver 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, Daniel Vetter , "Rafael J. Wysocki" , Rob Clark , Russell King , Saravana Kannan Message-Id: In-Reply-To: <20211006193819.2654854-16-swboyd@chromium.org> References: <20211006193819.2654854-1-swboyd@chromium.org> <20211006193819.2654854-16-swboyd@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Stephen, Le mer., oct. 6 2021 at 12:38:00 -0700, Stephen Boyd a ?crit : > 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. > > TODO: Move the helpers to PM in aggregate driver hooks. > > Cc: Paul Cercueil > Cc: Daniel Vetter > Cc: "Rafael J. Wysocki" > Cc: Rob Clark > Cc: Russell King > Cc: Saravana Kannan > Signed-off-by: Stephen Boyd > --- > drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 24 > +++++++++++++++++------ > 1 file changed, 18 insertions(+), 6 deletions(-) > > diff --git a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c > b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c > index a5df1c8d34cd..058b7bfe5610 100644 > --- a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c > +++ b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c > @@ -1150,8 +1150,10 @@ static int ingenic_drm_bind(struct device > *dev, bool has_components) > return ret; > } > > -static int ingenic_drm_bind_with_components(struct device *dev) > +static int ingenic_drm_bind_with_components(struct aggregate_device > *adev) > { > + struct device *dev = adev->parent; > + > return ingenic_drm_bind(dev, true); > } > > @@ -1174,9 +1176,19 @@ static void ingenic_drm_unbind(struct device > *dev) > drm_atomic_helper_shutdown(&priv->drm); > } > > -static const struct component_master_ops ingenic_master_ops = { > - .bind = ingenic_drm_bind_with_components, > - .unbind = ingenic_drm_unbind, > +static void ingenic_aggregate_remove(struct aggregate_device *adev) > +{ > + struct device *dev = adev->parent; Space here. With that: Acked-by: Paul Cercueil Cheers, -Paul > + ingenic_drm_unbind(dev); > +} > + > +static struct aggregate_driver ingenic_aggregate_driver = { > + .probe = ingenic_drm_bind_with_components, > + .remove = ingenic_aggregate_remove, > + .driver = { > + .name = "ingenic_drm", > + .owner = THIS_MODULE, > + }, > }; > > static int ingenic_drm_probe(struct platform_device *pdev) > @@ -1196,7 +1208,7 @@ static int ingenic_drm_probe(struct > platform_device *pdev) > drm_of_component_match_add(dev, &match, compare_of, np); > of_node_put(np); > > - return component_master_add_with_match(dev, &ingenic_master_ops, > match); > + return component_aggregate_register(dev, &ingenic_aggregate_driver, > match); > } > > static int ingenic_drm_remove(struct platform_device *pdev) > @@ -1206,7 +1218,7 @@ static int ingenic_drm_remove(struct > platform_device *pdev) > if (!IS_ENABLED(CONFIG_DRM_INGENIC_IPU)) > ingenic_drm_unbind(dev); > else > - component_master_del(dev, &ingenic_master_ops); > + component_aggregate_unregister(dev, &ingenic_aggregate_driver); > > return 0; > } > -- > https://chromeos.dev >