Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp428846pxk; Thu, 3 Sep 2020 03:38:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzdIGbCT0w1diptQPIj74vr8vv7b0Bmc7UHjVUg4XYLwSn3Y8lycmmt/q5fgTAUor/QlBow X-Received: by 2002:a17:906:2659:: with SMTP id i25mr1402590ejc.16.1599129523347; Thu, 03 Sep 2020 03:38:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599129523; cv=none; d=google.com; s=arc-20160816; b=FYCzn0tyVslJ080z5rZk0rHkxe+54ucD2jrlhKsJPvGVOfynZwmt61C1/OzbxkjJ5R P/II//YxpMP15AUQUX6rcVgbO07hqrp717GdXTyxXrRt60/EgCX90RgeYcpsGc9OwsXe 8NcjqYeY5k6tNSqX0PYSRpl2X2chza5u5CRjGV/PgJGS/V6gqaKnADJmfXHla8rOWZr4 78+uub79y637Eq1gAQCYe8l3Mqz1mqL7W+2oTGBI2uDzv4+93dDPrvWXMu4ulJiYGCBU PnVOE8g1ZUG0cvrYbaBCFikwRPkhqfAFQvQCxA0/o4o0L+5RRl0vakUy3mjZGNRPEQ16 gL3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from; bh=fN6ul2gFh8gkpaMpPlOUQuwKhBwIK81u9dxtWkANv3k=; b=mjOJaQhXNn/DVOI4jesR6duJeUryuVkLAPBSoJJGUA/+6YcBY9CAYobZMvjtRX1ega VZMOFcjKFu/Ppocmz/dLDQMOGQPeujhIruBlIaPb3beIP/Z1wrIrZX/w0xmGdstY3+za 1L4qbKXITGBZIHpUjv6EJuwrlcJUogjLoKXL6kSowcsFC9VkHJ/BAZqIW9PbH0UaGunn FihN1pWIFodSLyfETm1WHdwT2cXNhzKpBgMU5jzeIclxOwYAibXfFb3Pet5DMPYsweUN RTcbu1mhu1fUnJ4fzrMQTx2OJ8nZs6RfN/bMJoDyuSzMNayFsSCNyWWZF24okFglctAm xppg== 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=toshiba.co.jp Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o25si1597257edz.124.2020.09.03.03.38.20; Thu, 03 Sep 2020 03:38:43 -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=toshiba.co.jp Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726891AbgICKhO (ORCPT + 99 others); Thu, 3 Sep 2020 06:37:14 -0400 Received: from mo-csw1516.securemx.jp ([210.130.202.155]:34272 "EHLO mo-csw.securemx.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726293AbgICKhL (ORCPT ); Thu, 3 Sep 2020 06:37:11 -0400 Received: by mo-csw.securemx.jp (mx-mo-csw1516) id 083AanZf025005; Thu, 3 Sep 2020 19:36:50 +0900 X-Iguazu-Qid: 34tMd2lTh3bNiiFngA X-Iguazu-QSIG: v=2; s=0; t=1599129409; q=34tMd2lTh3bNiiFngA; m=yfx5tZuaGPpIcb54aw33BqY59ofmVGV8uHIvgpiLVes= Received: from imx12.toshiba.co.jp (imx12.toshiba.co.jp [61.202.160.132]) by relay.securemx.jp (mx-mr1513) id 083AampL037729; Thu, 3 Sep 2020 19:36:48 +0900 Received: from enc02.toshiba.co.jp ([61.202.160.51]) by imx12.toshiba.co.jp with ESMTP id 083AamnJ018789; Thu, 3 Sep 2020 19:36:48 +0900 (JST) Received: from hop101.toshiba.co.jp ([133.199.85.107]) by enc02.toshiba.co.jp with ESMTP id 083AaltQ027249; Thu, 3 Sep 2020 19:36:47 +0900 From: Punit Agrawal To: Ben Levinsky Cc: stefanos@xilinx.com, michals@xilinx.com, michael.auchter@ni.com, devicetree@vger.kernel.org, emooring@xilinx.com, mathieu.poirier@linaro.org, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, jliang@xilinx.com, robh+dt@kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v11 3/5] firmware: xilinx: Add RPU configuration APIs References: <20200902165846.3366-1-ben.levinsky@xilinx.com> <20200902165846.3366-4-ben.levinsky@xilinx.com> Date: Thu, 03 Sep 2020 19:36:46 +0900 In-Reply-To: <20200902165846.3366-4-ben.levinsky@xilinx.com> (Ben Levinsky's message of "Wed, 2 Sep 2020 09:58:44 -0700") X-TSB-HOP: ON Message-ID: <87zh67p2o1.fsf@kokedama.swc.toshiba.co.jp> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Ben, Noticed some issues while going through the code. A couple of queries below. Ben Levinsky writes: > This patch adds APIs to access to configure RPU and its > processor-specific memory. > > That is query the run-time mode of RPU as either split or lockstep as well > as API to set this mode. In addition add APIs to access configuration of > the RPUs' tightly coupled memory (TCM). > > Signed-off-by: Ben Levinsky > --- > v3: > - add xilinx-related platform mgmt fn's instead of wrapping around > function pointer in xilinx eemi ops struct > v4: > - add default values for enums > v9: > - update commit message > - for zynqmp_pm_set_tcm_config and zynqmp_pm_get_rpu_mode update docs for > expected output, arguments as well removing unused args > - remove unused fn zynqmp_pm_get_node_status > v11: > - update usage of zynqmp_pm_get_rpu_mode to return rpu mode in enum > - update zynqmp_pm_set_tcm_config and zynqmp_pm_set_rpu_mode arguments to remove unused args > --- > drivers/firmware/xilinx/zynqmp.c | 59 ++++++++++++++++++++++++++++ > include/linux/firmware/xlnx-zynqmp.h | 18 +++++++++ > 2 files changed, 77 insertions(+) > > diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c > index a966ee956573..807e404589f8 100644 > --- a/drivers/firmware/xilinx/zynqmp.c > +++ b/drivers/firmware/xilinx/zynqmp.c > @@ -846,6 +846,65 @@ int zynqmp_pm_release_node(const u32 node) > } > EXPORT_SYMBOL_GPL(zynqmp_pm_release_node); > > +/** > + * zynqmp_pm_get_rpu_mode() - Get RPU mode > + * @node_id: Node ID of the device > + * @rpu_mode: return by reference value > + * either split or lockstep > + * > + * Return: return 0 on success or error+reason. > + * if success, then rpu_mode will be set > + * to current rpu mode. > + */ > +int zynqmp_pm_get_rpu_mode(u32 node_id, enum rpu_oper_mode *rpu_mode) > +{ > + u32 ret_payload[PAYLOAD_ARG_CNT]; > + int ret; > + > + ret = zynqmp_pm_invoke_fn(PM_IOCTL, node_id, > + IOCTL_GET_RPU_OPER_MODE, 0, 0, ret_payload); > + if (ret < 0) > + (void)rpu_mode; There seems to be something missing from this statement. What is expected from "(void)rpu_mode" here. > + else > + *rpu_mode = ret_payload[0]; > + > + return ret; > +} > +EXPORT_SYMBOL_GPL(zynqmp_pm_get_rpu_mode); > + > +/** > + * zynqmp_pm_set_rpu_mode() - Set RPU mode > + * @node_id: Node ID of the device > + * @arg1: Argument 1 to requested IOCTL call. This is expeted to > + * to be value from enum rpu_oper_mode > + * > + * This function is used to set RPU mode to split or lockstep > + * > + * Return: Returns status, either success or error+reason > + */ > +int zynqmp_pm_set_rpu_mode(u32 node_id, u32 arg1) If arg1 is expected to be "enum rpu_oper_mode" please have the function argument reflect that and do any conversion needed inside the function. > +{ > + return zynqmp_pm_invoke_fn(PM_IOCTL, node_id, > + IOCTL_SET_RPU_OPER_MODE, arg1, 0, NULL); > +} > +EXPORT_SYMBOL_GPL(zynqmp_pm_set_rpu_mode); > + > +/** > + * zynqmp_pm_set_tcm_config - configure TCM > + * @arg1: Argument 1 to requested IOCTL call > + * either PM_RPU_TCM_COMB or PM_RPU_TCM_SPLIT > + * > + * This function is used to set RPU mode to split or combined > + * > + * Return: status: 0 for success, else failure > + */ > +int zynqmp_pm_set_tcm_config(u32 node_id, u32 arg1) Same comment as above - with the appropriate enum ofcourse. Thanks, Punit > +{ > + return zynqmp_pm_invoke_fn(PM_IOCTL, node_id, > + IOCTL_TCM_COMB_CONFIG, arg1, 0, NULL); > +} > +EXPORT_SYMBOL_GPL(zynqmp_pm_set_tcm_config); > + > /** > * zynqmp_pm_force_pwrdwn - PM call to request for another PU or subsystem to > * be powered down forcefully [...]