* [PATCH] firmware: xilinx: add a warning print for unsupported feature
@ 2024-09-20 5:54 Ronak Jain
2024-10-02 10:54 ` Michal Simek
0 siblings, 1 reply; 2+ messages in thread
From: Ronak Jain @ 2024-09-20 5:54 UTC (permalink / raw)
To: michal.simek; +Cc: linux-arm-kernel, linux-kernel
As per the current code base, feature check API is used to check the
version in zynqmp_pm_pinctrl_set_config() before requesting the
firmware, and if the expected version is not found then it will
return an error. So now when the latest kernel tries to access the
tri-state functionality with older firmware, observe failure prints
during booting.
The failure prints,
[ 1.204850] zynqmp-pinctrl firmware:zynqmp-firmware:pinctrl: failed to set: pin 37 param 2 value 0
[ 2.699455] zynqmp-pinctrl firmware:zynqmp-firmware:pinctrl: failed to set: pin 44 param 2 value 0
[ 2.708424] zynqmp-pinctrl firmware:zynqmp-firmware:pinctrl: failed to set: pin 46 param 2 value 0
[ 2.717387] zynqmp-pinctrl firmware:zynqmp-firmware:pinctrl: failed to set: pin 48 param 2 value 0
Now, these error prints mislead the user whether it is an actual
failure or the feature itself is not there in the firmware. So, just
to avoid confusion around this, add some debug prints before
returning an error code. With that, it is easier to know whether it is
an actual failure or the feature is unsupported.
Signed-off-by: Ronak Jain <ronak.jain@amd.com>
---
drivers/firmware/xilinx/zynqmp.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c
index 0b2ad46c8bce..cdb565c41119 100644
--- a/drivers/firmware/xilinx/zynqmp.c
+++ b/drivers/firmware/xilinx/zynqmp.c
@@ -1245,8 +1245,11 @@ int zynqmp_pm_pinctrl_set_config(const u32 pin, const u32 param,
if (pm_family_code == ZYNQMP_FAMILY_CODE &&
param == PM_PINCTRL_CONFIG_TRI_STATE) {
ret = zynqmp_pm_feature(PM_PINCTRL_CONFIG_PARAM_SET);
- if (ret < PM_PINCTRL_PARAM_SET_VERSION)
+ if (ret < PM_PINCTRL_PARAM_SET_VERSION) {
+ pr_warn("The requested pinctrl feature is not supported in the current firmware.\n"
+ "Expected firmware version is 2023.1 and above for this feature to work.\r\n");
return -EOPNOTSUPP;
+ }
}
return zynqmp_pm_invoke_fn(PM_PINCTRL_CONFIG_PARAM_SET, NULL, 3, pin, param, value);
--
2.25.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] firmware: xilinx: add a warning print for unsupported feature
2024-09-20 5:54 [PATCH] firmware: xilinx: add a warning print for unsupported feature Ronak Jain
@ 2024-10-02 10:54 ` Michal Simek
0 siblings, 0 replies; 2+ messages in thread
From: Michal Simek @ 2024-10-02 10:54 UTC (permalink / raw)
To: Ronak Jain; +Cc: linux-arm-kernel, linux-kernel
On 9/20/24 07:54, Ronak Jain wrote:
> As per the current code base, feature check API is used to check the
> version in zynqmp_pm_pinctrl_set_config() before requesting the
> firmware, and if the expected version is not found then it will
> return an error. So now when the latest kernel tries to access the
> tri-state functionality with older firmware, observe failure prints
> during booting.
>
> The failure prints,
> [ 1.204850] zynqmp-pinctrl firmware:zynqmp-firmware:pinctrl: failed to set: pin 37 param 2 value 0
> [ 2.699455] zynqmp-pinctrl firmware:zynqmp-firmware:pinctrl: failed to set: pin 44 param 2 value 0
> [ 2.708424] zynqmp-pinctrl firmware:zynqmp-firmware:pinctrl: failed to set: pin 46 param 2 value 0
> [ 2.717387] zynqmp-pinctrl firmware:zynqmp-firmware:pinctrl: failed to set: pin 48 param 2 value 0
>
> Now, these error prints mislead the user whether it is an actual
> failure or the feature itself is not there in the firmware. So, just
> to avoid confusion around this, add some debug prints before
> returning an error code. With that, it is easier to know whether it is
> an actual failure or the feature is unsupported.
>
> Signed-off-by: Ronak Jain <ronak.jain@amd.com>
> ---
> drivers/firmware/xilinx/zynqmp.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c
> index 0b2ad46c8bce..cdb565c41119 100644
> --- a/drivers/firmware/xilinx/zynqmp.c
> +++ b/drivers/firmware/xilinx/zynqmp.c
> @@ -1245,8 +1245,11 @@ int zynqmp_pm_pinctrl_set_config(const u32 pin, const u32 param,
> if (pm_family_code == ZYNQMP_FAMILY_CODE &&
> param == PM_PINCTRL_CONFIG_TRI_STATE) {
> ret = zynqmp_pm_feature(PM_PINCTRL_CONFIG_PARAM_SET);
> - if (ret < PM_PINCTRL_PARAM_SET_VERSION)
> + if (ret < PM_PINCTRL_PARAM_SET_VERSION) {
> + pr_warn("The requested pinctrl feature is not supported in the current firmware.\n"
> + "Expected firmware version is 2023.1 and above for this feature to work.\r\n");
> return -EOPNOTSUPP;
> + }
> }
>
> return zynqmp_pm_invoke_fn(PM_PINCTRL_CONFIG_PARAM_SET, NULL, 3, pin, param, value);
Applied.
M
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-10-02 10:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-09-20 5:54 [PATCH] firmware: xilinx: add a warning print for unsupported feature Ronak Jain
2024-10-02 10:54 ` Michal Simek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®