Received: by 2002:a05:7412:3290:b0:fa:6e18:a558 with SMTP id ev16csp750806rdb; Fri, 26 Jan 2024 09:28:52 -0800 (PST) X-Google-Smtp-Source: AGHT+IF/3rlaBnXWAhTXH/a2rlL9JJJoAB1DHxkmgPEMBqS2uR+EF1ziBvO8JQ1EuJtWdhr0Fdln X-Received: by 2002:a05:600c:4654:b0:40e:b29c:7103 with SMTP id n20-20020a05600c465400b0040eb29c7103mr103013wmo.8.1706290132280; Fri, 26 Jan 2024 09:28:52 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706290132; cv=pass; d=google.com; s=arc-20160816; b=Bcwco7G5FdWqZ8uYKLENghQacnQrdW93Aq7aAN/rA5xJ/X3YrJgi7bDOfJv3ZqeiwP PjLeT86MJXSW1zY8tE/E8rNJXI2hAg04XFq8DZv0prLl4tsl11Izgw5vDkGZDe5fJqUd fZ/DWBtcnse29sOZM0hTkEbsOg2foH5vuqeO1a/g+6J6e4WuciKrmhh3UdP4ydnz9wrv owDRen7S45/LS05d9QcKHBuQSDy3gNnBHGWF4kuOMWGsdK82iQGxGoBRhWxOuR2MPuHU BlAzbATu3W3U8hcHxzgMLNSkwiMCoXqrY9qSc/KbOwHhKTUwUx1Xgm9qKEHRD+yFQQ94 P+2Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=26Y5PAoysgDuN9FySea8VmC6RHq4skNt97uvGOBFdxM=; fh=khSZp0wo48MpvSrOG8FUVTv/HQ8Z7Ae6m2I2ieijEiM=; b=lqqAWHmgdsiiRDiSle1Bl8ECC8NARYklOc5MD7YqrJuj2O21luqGuCoBKgQNNbkizq otzMpKREVMA2aQ6enZnypmgZgsLdh1NMPCWMkyjSVe1N7tZF1s6bwLy4BnXHvfi4NBVx DZMscEWr51kWpct9hIo3KIJo5UVfvIx1N7GQznfy24Co/iYJAq1r97Hos11Bk57QKON3 plQ+IF1m4+jsnomnKASNNSZrR7CUXxZGyUXZnLsETJZ9Vw+f8wSV6bQeYkpPgTf/xUpq NV6d57UHlVuliidPVfi+UtKPf0hxsqWUbVMRK7Qb2Bi+BRUFTbjC/45JL/hXz1+/NgGp Af0w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PkjUO1wI; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-40430-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-40430-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id f14-20020a170906494e00b00a349dc9c0a7si785345ejt.205.2024.01.26.09.28.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jan 2024 09:28:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-40430-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PkjUO1wI; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-40430-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-40430-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 0E8A61F24F3D for ; Fri, 26 Jan 2024 17:28:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1FE9420317; Fri, 26 Jan 2024 17:28:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="PkjUO1wI" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 435B61EB5C; Fri, 26 Jan 2024 17:28:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706290121; cv=none; b=hdH3OsG7eYdEiocAAOcO2yRBmCQz3uutr1hVo9J7hJ7jzVGvy9ik9vS3ROBzNy+4buEMK/mI4eHVgAwlCk85D+2ju6XENzycCuzGek+pAUs/jwzUAzWlLajEDJYyqkrJo7tywChWvzEQZf/DWYyezgqt/8flMaNUQgTyewdDFaA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706290121; c=relaxed/simple; bh=yvFNWEbhdJcYieMLRciY5V8W+w9c/qsqKUENofx8bB4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=VyzZhcTBmGt9GlFMWS4F8Gelfw3ChMah8WF8T+FY+odSIqUMbw8jUZC5LDyCNr1fPPFlqcZGaj70XSbGaErcYQWLs+gBx6cjpgf7FpNI9Fidij9J6IrNu9xVSFWoZvQ6jlcevpH5mFyVE+jiRzLuIKipd3Djcq2hzjw3+Z0SLZ4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=PkjUO1wI; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 69DEBC43390; Fri, 26 Jan 2024 17:28:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706290120; bh=yvFNWEbhdJcYieMLRciY5V8W+w9c/qsqKUENofx8bB4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=PkjUO1wIgXb7IyEIcrXnYoa7pMzPaRB7gDKLWuLUO9CyNj93ZsqmLwpg9su2kJRYX xd3QoEAsTRT3ANfcYY/4WW1sK9P2SAQFUBIEd21uS/ysswm3NnS+ob63co2mwKtcVM xLi698RbtWMMtHM1ZSd3TpQnQwEvQE40rhasPZBJA5IR4+g6qb6dGB7WSN5Qwj6aD7 6TGu20o5yRJmqsDL902uqw1xQsouwe2Sgx5hkjJkO0dwb5jM8tXBtG0i7tVR9XQhlo oFe8MHFPPAkrPFNqKy2gtU7Nxw7GLP0+J5JSg/dR9EcVKAh2g2kyXPOvFRan/6rQw4 Bhz2mWnBZtsfA== Date: Fri, 26 Jan 2024 09:33:27 -0800 From: Bjorn Andersson To: Tanmay Shah Cc: mathieu.poirier@linaro.org, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, Ben Levinsky Subject: Re: [PATCH v4 1/2] remoteproc: Make rproc_get_by_phandle() work for clusters Message-ID: <4zq5hvxmvwzk6opqggennih5zq7rsznm2omdrrow3zsy2n6rzi@yqxtogh6jz3u> References: <20240103221124.3063683-1-tanmay.shah@amd.com> <20240103221124.3063683-2-tanmay.shah@amd.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240103221124.3063683-2-tanmay.shah@amd.com> On Wed, Jan 03, 2024 at 02:11:24PM -0800, Tanmay Shah wrote: > From: Mathieu Poirier > > Multi-cluster remoteproc designs typically have the following DT > declaration: > > remoteproc_cluster { > compatible = "soc,remoteproc-cluster"; > > core0: core0 { > compatible = "soc,remoteproc-core" > memory-region; > sram; > }; > > core1: core1 { > compatible = "soc,remoteproc-core" > memory-region; > sram; > } > }; The indention of this snippet looks weird in my client, because it contains a mixture of tabs and spaces. Please clean that up, and while at it, '_' is not a valid character in DT node names... > > A driver exists for the cluster rather than the individual cores > themselves so that operation mode and HW specific configurations > applicable to the cluster can be made. > > Because the driver exists at the cluster level and not the individual > core level, function rproc_get_by_phandle() fails to return the > remoteproc associated with the phandled it is called for. > > This patch enhances rproc_get_by_phandle() by looking for the cluster's > driver when the driver for the immediate remoteproc's parent is not > found. > > Reported-by: Ben Levinsky > Signed-off-by: Mathieu Poirier The s-o-b is used to certify the origin of the patch, Mathieu provided his signature here, then as you handle the patch you need to append your s-o-b to provide the same certification. The for appropriate tracking of reality, Mathieu should append his s-o-b when/if he applies the patch. TL;DR please add your S-o-b after Mathieu's. Change itself looks good to me. Regards, Bjorn > --- > drivers/remoteproc/remoteproc_core.c | 23 ++++++++++++++++++++++- > 1 file changed, 22 insertions(+), 1 deletion(-) > > diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c > index 695cce218e8c..0b3b34085e2f 100644 > --- a/drivers/remoteproc/remoteproc_core.c > +++ b/drivers/remoteproc/remoteproc_core.c > @@ -33,6 +33,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -2112,6 +2113,7 @@ EXPORT_SYMBOL(rproc_detach); > struct rproc *rproc_get_by_phandle(phandle phandle) > { > struct rproc *rproc = NULL, *r; > + struct device_driver *driver; > struct device_node *np; > > np = of_find_node_by_phandle(phandle); > @@ -2122,7 +2124,26 @@ struct rproc *rproc_get_by_phandle(phandle phandle) > list_for_each_entry_rcu(r, &rproc_list, node) { > if (r->dev.parent && device_match_of_node(r->dev.parent, np)) { > /* prevent underlying implementation from being removed */ > - if (!try_module_get(r->dev.parent->driver->owner)) { > + > + /* > + * If the remoteproc's parent has a driver, the > + * remoteproc is not part of a cluster and we can use > + * that driver. > + */ > + driver = r->dev.parent->driver; > + > + /* > + * If the remoteproc's parent does not have a driver, > + * look for the driver associated with the cluster. > + */ > + if (!driver) { > + if (r->dev.parent->parent) > + driver = r->dev.parent->parent->driver; > + if (!driver) > + break; > + } > + > + if (!try_module_get(driver->owner)) { > dev_err(&r->dev, "can't get owner\n"); > break; > } > -- > 2.25.1 >