All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Simek <michal.simek@xilinx.com>
To: Ronak Jain <ronak.jain@xilinx.com>, <michal.simek@xilinx.com>,
	<linux-kernel@vger.kernel.org>
Cc: <gregkh@linuxfoundation.org>, <corbet@lwn.net>,
	<linux-arm-kernel@lists.infradead.org>, <arnd@arndb.de>,
	<lakshmi.sai.krishna.potthuri@xilinx.com>, <radheys@xilinx.com>
Subject: Re: [PATCH 2/4] firmware: xilinx: add new function for do_feature_check_call
Date: Fri, 29 Apr 2022 10:35:21 +0200	[thread overview]
Message-ID: <a5736830-2e25-252e-6811-9ec37bd052d9@xilinx.com> (raw)
In-Reply-To: <1649242526-17493-3-git-send-email-ronak.jain@xilinx.com>



On 4/6/22 12:55, Ronak Jain wrote:
> Add new function for sending feature check request to firmware and
> call it from zynqmp_pm_feature().
> 
> Signed-off-by: Ronak Jain <ronak.jain@xilinx.com>
> ---
>   drivers/firmware/xilinx/zynqmp.c | 27 ++++++++++++++++++---------
>   1 file changed, 18 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c
> index 41ca41697790..d27a3b20227b 100644
> --- a/drivers/firmware/xilinx/zynqmp.c
> +++ b/drivers/firmware/xilinx/zynqmp.c
> @@ -175,6 +175,23 @@ static noinline int do_fw_call_hvc(u64 arg0, u64 arg1, u64 arg2,
>   	return zynqmp_pm_ret_code((enum pm_ret_status)res.a0);
>   }
>   
> +static int do_feature_check_call(const u32 api_id, u32 *ret_payload)
> +{
> +	int ret;
> +	u64 smc_arg[2];
> +
> +	smc_arg[0] = PM_SIP_SVC | PM_FEATURE_CHECK;
> +	smc_arg[1] = api_id;
> +
> +	ret = do_fw_call(smc_arg[0], smc_arg[1], 0, ret_payload);
> +	if (ret)
> +		ret = -EOPNOTSUPP;
> +	else
> +		ret = ret_payload[1];
> +
> +	return ret;
> +}
> +
>   /**
>    * zynqmp_pm_feature() - Check whether given feature is supported or not and
>    *			 store supported IOCTL/QUERY ID mask
> @@ -186,7 +203,6 @@ int zynqmp_pm_feature(const u32 api_id)
>   {
>   	int ret;
>   	u32 ret_payload[PAYLOAD_ARG_CNT];
> -	u64 smc_arg[2];
>   	struct pm_api_feature_data *feature_data;
>   
>   	if (!feature_check_enabled)
> @@ -205,14 +221,7 @@ int zynqmp_pm_feature(const u32 api_id)
>   		return -ENOMEM;
>   
>   	feature_data->pm_api_id = api_id;
> -	smc_arg[0] = PM_SIP_SVC | PM_FEATURE_CHECK;
> -	smc_arg[1] = api_id;
> -
> -	ret = do_fw_call(smc_arg[0], smc_arg[1], 0, ret_payload);
> -	if (ret)
> -		ret = -EOPNOTSUPP;
> -	else
> -		ret = ret_payload[1];
> +	ret = do_feature_check_call(api_id, ret_payload);
>   
>   	feature_data->feature_status = ret;
>   	hash_add(pm_api_features_map, &feature_data->hentry, api_id);

Acked-by: Michal Simek <michal.simek@xilinx.com>

Thanks,
Michal


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

WARNING: multiple messages have this Message-ID (diff)
From: Michal Simek <michal.simek@xilinx.com>
To: Ronak Jain <ronak.jain@xilinx.com>, <michal.simek@xilinx.com>,
	<linux-kernel@vger.kernel.org>
Cc: <gregkh@linuxfoundation.org>, <corbet@lwn.net>,
	<linux-arm-kernel@lists.infradead.org>, <arnd@arndb.de>,
	<lakshmi.sai.krishna.potthuri@xilinx.com>, <radheys@xilinx.com>
Subject: Re: [PATCH 2/4] firmware: xilinx: add new function for do_feature_check_call
Date: Fri, 29 Apr 2022 10:35:21 +0200	[thread overview]
Message-ID: <a5736830-2e25-252e-6811-9ec37bd052d9@xilinx.com> (raw)
In-Reply-To: <1649242526-17493-3-git-send-email-ronak.jain@xilinx.com>



On 4/6/22 12:55, Ronak Jain wrote:
> Add new function for sending feature check request to firmware and
> call it from zynqmp_pm_feature().
> 
> Signed-off-by: Ronak Jain <ronak.jain@xilinx.com>
> ---
>   drivers/firmware/xilinx/zynqmp.c | 27 ++++++++++++++++++---------
>   1 file changed, 18 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c
> index 41ca41697790..d27a3b20227b 100644
> --- a/drivers/firmware/xilinx/zynqmp.c
> +++ b/drivers/firmware/xilinx/zynqmp.c
> @@ -175,6 +175,23 @@ static noinline int do_fw_call_hvc(u64 arg0, u64 arg1, u64 arg2,
>   	return zynqmp_pm_ret_code((enum pm_ret_status)res.a0);
>   }
>   
> +static int do_feature_check_call(const u32 api_id, u32 *ret_payload)
> +{
> +	int ret;
> +	u64 smc_arg[2];
> +
> +	smc_arg[0] = PM_SIP_SVC | PM_FEATURE_CHECK;
> +	smc_arg[1] = api_id;
> +
> +	ret = do_fw_call(smc_arg[0], smc_arg[1], 0, ret_payload);
> +	if (ret)
> +		ret = -EOPNOTSUPP;
> +	else
> +		ret = ret_payload[1];
> +
> +	return ret;
> +}
> +
>   /**
>    * zynqmp_pm_feature() - Check whether given feature is supported or not and
>    *			 store supported IOCTL/QUERY ID mask
> @@ -186,7 +203,6 @@ int zynqmp_pm_feature(const u32 api_id)
>   {
>   	int ret;
>   	u32 ret_payload[PAYLOAD_ARG_CNT];
> -	u64 smc_arg[2];
>   	struct pm_api_feature_data *feature_data;
>   
>   	if (!feature_check_enabled)
> @@ -205,14 +221,7 @@ int zynqmp_pm_feature(const u32 api_id)
>   		return -ENOMEM;
>   
>   	feature_data->pm_api_id = api_id;
> -	smc_arg[0] = PM_SIP_SVC | PM_FEATURE_CHECK;
> -	smc_arg[1] = api_id;
> -
> -	ret = do_fw_call(smc_arg[0], smc_arg[1], 0, ret_payload);
> -	if (ret)
> -		ret = -EOPNOTSUPP;
> -	else
> -		ret = ret_payload[1];
> +	ret = do_feature_check_call(api_id, ret_payload);
>   
>   	feature_data->feature_status = ret;
>   	hash_add(pm_api_features_map, &feature_data->hentry, api_id);

Acked-by: Michal Simek <michal.simek@xilinx.com>

Thanks,
Michal


  reply	other threads:[~2022-04-29  8:37 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-06 10:55 [PATCH 0/4] Add feature check support in ZU+ Ronak Jain
2022-04-06 10:55 ` Ronak Jain
2022-04-06 10:55 ` [PATCH 1/4] firmware: xilinx: add support for IOCTL and QUERY ID feature check Ronak Jain
2022-04-06 10:55   ` Ronak Jain
2022-04-29  8:35   ` Michal Simek
2022-04-29  8:35     ` Michal Simek
2022-04-06 10:55 ` [PATCH 2/4] firmware: xilinx: add new function for do_feature_check_call Ronak Jain
2022-04-06 10:55   ` Ronak Jain
2022-04-29  8:35   ` Michal Simek [this message]
2022-04-29  8:35     ` Michal Simek
2022-04-06 10:55 ` [PATCH 3/4] firmware: xilinx: always check API version for IOCTL/QUERY Ronak Jain
2022-04-06 10:55   ` Ronak Jain
2022-04-29  8:35   ` Michal Simek
2022-04-29  8:35     ` Michal Simek
2022-04-06 10:55 ` [PATCH 4/4] firmware: xilinx: enable feature check for ZynqMP Ronak Jain
2022-04-06 10:55   ` Ronak Jain
2022-04-29  8:36   ` Michal Simek
2022-04-29  8:36     ` Michal Simek
2022-04-22  6:10 ` [PATCH 0/4] Add feature check support in ZU+ Ronak Jain
2022-04-22  6:10   ` Ronak Jain

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a5736830-2e25-252e-6811-9ec37bd052d9@xilinx.com \
    --to=michal.simek@xilinx.com \
    --cc=arnd@arndb.de \
    --cc=corbet@lwn.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=lakshmi.sai.krishna.potthuri@xilinx.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=radheys@xilinx.com \
    --cc=ronak.jain@xilinx.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.