LKML Archive mirror
 help / color / mirror / Atom feed
* [PATCH] firmware: arm_scmi: perf: print domain name in error path
@ 2024-03-20  7:42 Peng Fan (OSS)
  2024-03-20 11:33 ` Sudeep Holla
  0 siblings, 1 reply; 3+ messages in thread
From: Peng Fan (OSS) @ 2024-03-20  7:42 UTC (permalink / raw
  To: sudeep.holla, cristian.marussi; +Cc: linux-arm-kernel, linux-kernel, Peng Fan

From: Peng Fan <peng.fan@nxp.com>

It would be easier to locate the problem if domain name is printed out.
And including a coding style update.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 drivers/firmware/arm_scmi/perf.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/firmware/arm_scmi/perf.c b/drivers/firmware/arm_scmi/perf.c
index 345fff167b52..e98ca6d15b0c 100644
--- a/drivers/firmware/arm_scmi/perf.c
+++ b/drivers/firmware/arm_scmi/perf.c
@@ -79,7 +79,7 @@ struct scmi_msg_resp_perf_domain_attributes {
 	__le32 rate_limit_us;
 	__le32 sustained_freq_khz;
 	__le32 sustained_perf_level;
-	    u8 name[SCMI_SHORT_NAME_MAX_SIZE];
+	u8 name[SCMI_SHORT_NAME_MAX_SIZE];
 };
 
 struct scmi_msg_perf_describe_levels {
@@ -387,8 +387,8 @@ process_response_opp(struct device *dev, struct perf_dom_info *dom,
 
 	ret = xa_insert(&dom->opps_by_lvl, opp->perf, opp, GFP_KERNEL);
 	if (ret)
-		dev_warn(dev, "Failed to add opps_by_lvl at %d - ret:%d\n",
-			 opp->perf, ret);
+		dev_warn(dev, "Failed to add opps_by_lvl at %d for %s- ret:%d\n",
+			 opp->perf, dom->info.name, ret);
 }
 
 static inline void
@@ -405,8 +405,8 @@ process_response_opp_v4(struct device *dev, struct perf_dom_info *dom,
 
 	ret = xa_insert(&dom->opps_by_lvl, opp->perf, opp, GFP_KERNEL);
 	if (ret)
-		dev_warn(dev, "Failed to add opps_by_lvl at %d - ret:%d\n",
-			 opp->perf, ret);
+		dev_warn(dev, "Failed to add opps_by_lvl at %d for %s - ret:%d\n",
+			 opp->perf, dom->info.name, ret);
 
 	/* Note that PERF v4 reports always five 32-bit words */
 	opp->indicative_freq = le32_to_cpu(r->opp[loop_idx].indicative_freq);
-- 
2.37.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] firmware: arm_scmi: perf: print domain name in error path
  2024-03-20  7:42 [PATCH] firmware: arm_scmi: perf: print domain name in error path Peng Fan (OSS)
@ 2024-03-20 11:33 ` Sudeep Holla
  2024-03-20 23:48   ` Peng Fan
  0 siblings, 1 reply; 3+ messages in thread
From: Sudeep Holla @ 2024-03-20 11:33 UTC (permalink / raw
  To: Peng Fan (OSS)
  Cc: cristian.marussi, linux-arm-kernel, Sudeep Holla, linux-kernel,
	Peng Fan

On Wed, Mar 20, 2024 at 03:42:13PM +0800, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan@nxp.com>
> 
> It would be easier to locate the problem if domain name is printed out.
> And including a coding style update.
> 
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
>  drivers/firmware/arm_scmi/perf.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/firmware/arm_scmi/perf.c b/drivers/firmware/arm_scmi/perf.c
> index 345fff167b52..e98ca6d15b0c 100644
> --- a/drivers/firmware/arm_scmi/perf.c
> +++ b/drivers/firmware/arm_scmi/perf.c
> @@ -79,7 +79,7 @@ struct scmi_msg_resp_perf_domain_attributes {
>  	__le32 rate_limit_us;
>  	__le32 sustained_freq_khz;
>  	__le32 sustained_perf_level;
> -	    u8 name[SCMI_SHORT_NAME_MAX_SIZE];
> +	u8 name[SCMI_SHORT_NAME_MAX_SIZE];

Spurious change ?

>  };
>  
>  struct scmi_msg_perf_describe_levels {
> @@ -387,8 +387,8 @@ process_response_opp(struct device *dev, struct perf_dom_info *dom,
>  
>  	ret = xa_insert(&dom->opps_by_lvl, opp->perf, opp, GFP_KERNEL);
>  	if (ret)
> -		dev_warn(dev, "Failed to add opps_by_lvl at %d - ret:%d\n",
> -			 opp->perf, ret);
> +		dev_warn(dev, "Failed to add opps_by_lvl at %d for %s- ret:%d\n",
> +			 opp->perf, dom->info.name, ret);
>  }
>  
>  static inline void
> @@ -405,8 +405,8 @@ process_response_opp_v4(struct device *dev, struct perf_dom_info *dom,
>  
>  	ret = xa_insert(&dom->opps_by_lvl, opp->perf, opp, GFP_KERNEL);
>  	if (ret)
> -		dev_warn(dev, "Failed to add opps_by_lvl at %d - ret:%d\n",
> -			 opp->perf, ret);
> +		dev_warn(dev, "Failed to add opps_by_lvl at %d for %s - ret:%d\n",
> +			 opp->perf, dom->info.name, ret);
> 

Are you really hitting these issues ? Or is it just code
observation/improvements ?

It looks good otherwise. You can also add the below change when you respin.

-- 
Regards,
Sudeep

diff --git i/drivers/firmware/arm_scmi/perf.c w/drivers/firmware/arm_scmi/perf.c
index 211e8e0aef2c..ef1c27a65552 100644
--- i/drivers/firmware/arm_scmi/perf.c
+++ w/drivers/firmware/arm_scmi/perf.c
@@ -830,7 +830,8 @@ static int scmi_dvfs_device_opps_add(const struct scmi_protocol_handle *ph,

                ret = dev_pm_opp_add_dynamic(dev, &data);
                if (ret) {
-                       dev_warn(dev, "failed to add opp %luHz\n", freq);
+                       dev_warn(dev, "[%d][%s]: Failed to add OPP[%d] %lu\n",
+                                domain, dom->info.name, idx, freq);
                        dev_pm_opp_remove_all_dynamic(dev);
                        return ret;
                }

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* RE: [PATCH] firmware: arm_scmi: perf: print domain name in error path
  2024-03-20 11:33 ` Sudeep Holla
@ 2024-03-20 23:48   ` Peng Fan
  0 siblings, 0 replies; 3+ messages in thread
From: Peng Fan @ 2024-03-20 23:48 UTC (permalink / raw
  To: Sudeep Holla, Peng Fan (OSS)
  Cc: cristian.marussi@arm.com, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org

> Subject: Re: [PATCH] firmware: arm_scmi: perf: print domain name in error
> path
> 
> On Wed, Mar 20, 2024 at 03:42:13PM +0800, Peng Fan (OSS) wrote:
> > From: Peng Fan <peng.fan@nxp.com>
> >
> > It would be easier to locate the problem if domain name is printed out.
> > And including a coding style update.
> >
> > Signed-off-by: Peng Fan <peng.fan@nxp.com>
> > ---
> >  drivers/firmware/arm_scmi/perf.c | 10 +++++-----
> >  1 file changed, 5 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/firmware/arm_scmi/perf.c
> > b/drivers/firmware/arm_scmi/perf.c
> > index 345fff167b52..e98ca6d15b0c 100644
> > --- a/drivers/firmware/arm_scmi/perf.c
> > +++ b/drivers/firmware/arm_scmi/perf.c
> > @@ -79,7 +79,7 @@ struct scmi_msg_resp_perf_domain_attributes {
> >  	__le32 rate_limit_us;
> >  	__le32 sustained_freq_khz;
> >  	__le32 sustained_perf_level;
> > -	    u8 name[SCMI_SHORT_NAME_MAX_SIZE];
> > +	u8 name[SCMI_SHORT_NAME_MAX_SIZE];
> 
> Spurious change ?

I just think this is a coding style cleanup, I could drop it in v2.

> 
> >  };
> >
> >  struct scmi_msg_perf_describe_levels { @@ -387,8 +387,8 @@
> > process_response_opp(struct device *dev, struct perf_dom_info *dom,
> >
> >  	ret = xa_insert(&dom->opps_by_lvl, opp->perf, opp, GFP_KERNEL);
> >  	if (ret)
> > -		dev_warn(dev, "Failed to add opps_by_lvl at %d - ret:%d\n",
> > -			 opp->perf, ret);
> > +		dev_warn(dev, "Failed to add opps_by_lvl at %d for %s-
> ret:%d\n",
> > +			 opp->perf, dom->info.name, ret);
> >  }
> >
> >  static inline void
> > @@ -405,8 +405,8 @@ process_response_opp_v4(struct device *dev,
> struct
> > perf_dom_info *dom,
> >
> >  	ret = xa_insert(&dom->opps_by_lvl, opp->perf, opp, GFP_KERNEL);
> >  	if (ret)
> > -		dev_warn(dev, "Failed to add opps_by_lvl at %d - ret:%d\n",
> > -			 opp->perf, ret);
> > +		dev_warn(dev, "Failed to add opps_by_lvl at %d for %s -
> ret:%d\n",
> > +			 opp->perf, dom->info.name, ret);
> >
> 
> Are you really hitting these issues ? 

Yes. two levels had same freq on i.MX95, but we fixed.

Or is it just code
> observation/improvements ?
> 
> It looks good otherwise. You can also add the below change when you respin.

ok, will include in v2.

Thanks,
Peng.
> 
> --
> Regards,
> Sudeep
> 
> diff --git i/drivers/firmware/arm_scmi/perf.c
> w/drivers/firmware/arm_scmi/perf.c
> index 211e8e0aef2c..ef1c27a65552 100644
> --- i/drivers/firmware/arm_scmi/perf.c
> +++ w/drivers/firmware/arm_scmi/perf.c
> @@ -830,7 +830,8 @@ static int scmi_dvfs_device_opps_add(const struct
> scmi_protocol_handle *ph,
> 
>                 ret = dev_pm_opp_add_dynamic(dev, &data);
>                 if (ret) {
> -                       dev_warn(dev, "failed to add opp %luHz\n", freq);
> +                       dev_warn(dev, "[%d][%s]: Failed to add OPP[%d] %lu\n",
> +                                domain, dom->info.name, idx, freq);
>                         dev_pm_opp_remove_all_dynamic(dev);
>                         return ret;
>                 }

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-03-20 23:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-20  7:42 [PATCH] firmware: arm_scmi: perf: print domain name in error path Peng Fan (OSS)
2024-03-20 11:33 ` Sudeep Holla
2024-03-20 23:48   ` Peng Fan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).