Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp758189pxb; Fri, 28 Jan 2022 09:19:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJyY2OTf06qkjyG3p6oEnY8gvJRDd5kwo62jtAvUGJdnxU2LkAkZIySOgPRWcXkUyaVwt63h X-Received: by 2002:a17:902:c652:: with SMTP id s18mr9706647pls.5.1643390368180; Fri, 28 Jan 2022 09:19:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643390368; cv=none; d=google.com; s=arc-20160816; b=LZGzpH3m3Ards2yUWemvdrt1vxeQLugBQYpN1qPwfJollj4s9eH1J6DM2K3iIo86ls 5sTLc9R8YK7HLTgVgmqIq1cwe9yO+Oa9exv5Oy9oQblWTa0LV/gmwpeHU2nIHCT+iik8 bz3YU+mucX2vFHRAqJJ/M8HDrFj38f6Q4RWZv/LE3zEpWJlG6QUE+k7NdT+kWdKXNjOk f7b/jyA5oweefvOwEL5DE3UrHvFuuSXmCk8VuMMO2VWTXwIJS4t4BhUV/fE3X/4d3nQo Lj1OJoo9pqqctYlnCDwyIJOhgNVr/pPLMjGAIJrziq0jCVn5PTZjNsiNRq223US6Hq84 b6Lw== 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=g623/C18UKVOGP0jeG3P9XoZ0hRTRdI8bxCTdme+ZDc=; b=NmtUbAbVhw3pQcn/Y3rEIOzBJwRly9I0Q/5kFGj3o6/ogF4bzeUgAGEbONaqB1iwyM crdQLC0GvYX8dX5KzkpFu/FGdxfoBRRXO7xwmuIbh1PQinBksLnQrzLe0MwuWvLSg9mQ hmYtdTOHWWUrZjyjGI27iJ9Al15Uulz2epbq54UkvD6HJOFb0gLguL2Z10i/a8rBRaVC yk32BhXdwcYLLTfcfAAtiy3HjkTp8kp95ChZVZ9vSheCin8Ty7h3k6R+LYQqf+o99MGy 2y/Q0eS0x416SZaEKZo3+CjFHdonHY8IWMml5iYuuqmEuLyiUKtMYHKC3pErbuRxzI3M XmKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=UjXyKQ27; 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 o13si2985900pjh.89.2022.01.28.09.19.15; Fri, 28 Jan 2022 09:19:28 -0800 (PST) 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=UjXyKQ27; 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 S1343817AbiA0UDl (ORCPT + 99 others); Thu, 27 Jan 2022 15:03:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43388 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343735AbiA0UCe (ORCPT ); Thu, 27 Jan 2022 15:02:34 -0500 Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EAFD8C061776 for ; Thu, 27 Jan 2022 12:02:29 -0800 (PST) Received: by mail-pl1-x634.google.com with SMTP id h14so3719145plf.1 for ; Thu, 27 Jan 2022 12:02:29 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=g623/C18UKVOGP0jeG3P9XoZ0hRTRdI8bxCTdme+ZDc=; b=UjXyKQ27u9ktmyUhlabtrzpM184jAnjXIW63DCf85unRcMTX6v/Xs4Fw8lX6VtLkrG 0i0Rpg4QPjonKcYKL/d7xYdgHlEeoHJrADQdyIWZWCeqxWps1f0ssg+phw6p/LB4XTD9 1x4mXefiju1VsB+cP1wQ3Ej679uZCdIZ8uomc= 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=g623/C18UKVOGP0jeG3P9XoZ0hRTRdI8bxCTdme+ZDc=; b=rFy8HhYP+bAdXmOrkDi6/uZcUXAcTwgjKWI5NlX+jxiE7Q90Zcxc3LiylnPeitXTHl WvZx1fNT672xPVM8Gy6SX0L8C1rJTI9+ok5QbRFLZqALkMEZHA72SqrlKpBTeuqmhSte R/+yOGm0lcmPsHfWqdWVpzX7T3wad7lhsZ9K4DVZIUh9jJ6iB9RemLD3KDC87JoFpIBT +D8Fc6TXTD41pyT5Dzs3Gr/FHtm9qpJ/7WZxGr9UghJu2BEciZrId5zqrpBNJEwOL6TY VZ2aWUFB6xedB7e+cesQd1lCNNpX+ZBj8Is1dSPu42yTWrTouZfM0BKdMJVxm6Id0Pum cFXA== X-Gm-Message-State: AOAM530yi1bU5KyxhzUTzm4mK0YL/HF+DRPTjNd8msEIMYNZYqL1UpuI KLcR5/LTSIPCBZlHCRAnMLjgyA== X-Received: by 2002:a17:902:b40b:: with SMTP id x11mr296131plr.75.1643313749462; Thu, 27 Jan 2022 12:02:29 -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.02.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Jan 2022 12:02:29 -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, Tomas Winkler , Vitaly Lubart , Daniele Ceraolo Spurio , Rodrigo Vivi , Arnd Bergmann , Daniel Vetter , "Rafael J. Wysocki" , Rob Clark , Russell King , Saravana Kannan , Alexander Usyskin Subject: [PATCH v6 26/35] mei: Migrate to aggregate driver Date: Thu, 27 Jan 2022 12:01:32 -0800 Message-Id: <20220127200141.1295328-27-swboyd@chromium.org> X-Mailer: git-send-email 2.35.0.rc0.227.g00780c9af4-goog In-Reply-To: <20220127200141.1295328-1-swboyd@chromium.org> References: <20220127200141.1295328-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: Tomas Winkler Cc: Vitaly Lubart Cc: Daniele Ceraolo Spurio Cc: Rodrigo Vivi Cc: Arnd Bergmann Cc: Greg Kroah-Hartman Cc: Daniel Vetter Cc: "Rafael J. Wysocki" Cc: Rob Clark Cc: Russell King Cc: Saravana Kannan Cc: Alexander Usyskin Signed-off-by: Stephen Boyd --- drivers/misc/mei/hdcp/mei_hdcp.c | 22 +++++++++++++--------- drivers/misc/mei/pxp/mei_pxp.c | 22 +++++++++++++--------- 2 files changed, 26 insertions(+), 18 deletions(-) diff --git a/drivers/misc/mei/hdcp/mei_hdcp.c b/drivers/misc/mei/hdcp/mei_hdcp.c index ec2a4fce8581..3c6e4e3bf212 100644 --- a/drivers/misc/mei/hdcp/mei_hdcp.c +++ b/drivers/misc/mei/hdcp/mei_hdcp.c @@ -732,8 +732,9 @@ static const struct i915_hdcp_component_ops mei_hdcp_ops = { .close_hdcp_session = mei_hdcp_close_session, }; -static int mei_component_master_bind(struct device *dev) +static int mei_hdcp_aggregate_bind(struct aggregate_device *adev) { + struct device *dev = aggregate_device_parent(adev); struct mei_cl_device *cldev = to_mei_cl_device(dev); struct i915_hdcp_comp_master *comp_master = mei_cldev_get_drvdata(cldev); @@ -749,8 +750,9 @@ static int mei_component_master_bind(struct device *dev) return 0; } -static void mei_component_master_unbind(struct device *dev) +static void mei_hdcp_aggregate_unbind(struct aggregate_device *adev) { + struct device *dev = aggregate_device_parent(adev); struct mei_cl_device *cldev = to_mei_cl_device(dev); struct i915_hdcp_comp_master *comp_master = mei_cldev_get_drvdata(cldev); @@ -759,9 +761,13 @@ static void mei_component_master_unbind(struct device *dev) component_unbind_all(dev, comp_master); } -static const struct component_master_ops mei_component_master_ops = { - .bind = mei_component_master_bind, - .unbind = mei_component_master_unbind, +static struct aggregate_driver mei_aggregate_driver = { + .probe = mei_hdcp_aggregate_bind, + .remove = mei_hdcp_aggregate_unbind, + .driver = { + .name = "mei_hdcp_agg", + .owner = THIS_MODULE, + }, }; /** @@ -826,9 +832,7 @@ static int mei_hdcp_probe(struct mei_cl_device *cldev, } mei_cldev_set_drvdata(cldev, comp_master); - ret = component_master_add_with_match(&cldev->dev, - &mei_component_master_ops, - master_match); + ret = component_aggregate_register(&cldev->dev, &mei_aggregate_driver, master_match); if (ret < 0) { dev_err(&cldev->dev, "Master comp add failed %d\n", ret); goto err_exit; @@ -850,7 +854,7 @@ static void mei_hdcp_remove(struct mei_cl_device *cldev) mei_cldev_get_drvdata(cldev); int ret; - component_master_del(&cldev->dev, &mei_component_master_ops); + component_aggregate_unregister(&cldev->dev, &mei_aggregate_driver); kfree(comp_master); mei_cldev_set_drvdata(cldev, NULL); diff --git a/drivers/misc/mei/pxp/mei_pxp.c b/drivers/misc/mei/pxp/mei_pxp.c index f7380d387bab..887e43e6ba5f 100644 --- a/drivers/misc/mei/pxp/mei_pxp.c +++ b/drivers/misc/mei/pxp/mei_pxp.c @@ -83,8 +83,9 @@ static const struct i915_pxp_component_ops mei_pxp_ops = { .recv = mei_pxp_receive_message, }; -static int mei_component_master_bind(struct device *dev) +static int mei_pxp_aggregate_bind(struct aggregate_device *adev) { + struct device *dev = aggregate_device_parent(adev); struct mei_cl_device *cldev = to_mei_cl_device(dev); struct i915_pxp_component *comp_master = mei_cldev_get_drvdata(cldev); int ret; @@ -98,17 +99,22 @@ static int mei_component_master_bind(struct device *dev) return 0; } -static void mei_component_master_unbind(struct device *dev) +static void mei_pxp_aggregate_unbind(struct aggregate_device *adev) { + struct device *dev = aggregate_device_parent(adev); struct mei_cl_device *cldev = to_mei_cl_device(dev); struct i915_pxp_component *comp_master = mei_cldev_get_drvdata(cldev); component_unbind_all(dev, comp_master); } -static const struct component_master_ops mei_component_master_ops = { - .bind = mei_component_master_bind, - .unbind = mei_component_master_unbind, +static struct aggregate_driver mei_aggregate_driver = { + .probe = mei_pxp_aggregate_bind, + .remove = mei_pxp_aggregate_unbind, + .driver = { + .name = "mei_pxp_agg", + .owner = THIS_MODULE, + } }; /** @@ -173,9 +179,7 @@ static int mei_pxp_probe(struct mei_cl_device *cldev, } mei_cldev_set_drvdata(cldev, comp_master); - ret = component_master_add_with_match(&cldev->dev, - &mei_component_master_ops, - master_match); + ret = component_aggregate_register(&cldev->dev, &mei_aggregate_driver, master_match); if (ret < 0) { dev_err(&cldev->dev, "Master comp add failed %d\n", ret); goto err_exit; @@ -196,7 +200,7 @@ static void mei_pxp_remove(struct mei_cl_device *cldev) struct i915_pxp_component *comp_master = mei_cldev_get_drvdata(cldev); int ret; - component_master_del(&cldev->dev, &mei_component_master_ops); + component_aggregate_unregister(&cldev->dev, &mei_aggregate_driver); kfree(comp_master); mei_cldev_set_drvdata(cldev, NULL); -- https://chromeos.dev