linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] firmware: arm_scmi: Remove inappropriate error log.
@ 2023-11-01  8:10 xinglong.yang
  0 siblings, 0 replies; 7+ messages in thread
From: xinglong.yang @ 2023-11-01  8:10 UTC (permalink / raw)
  To: xinglong.yang, sudeep.holla, cristian.marussi; +Cc: linux-arm-kernel

The platform may not support fastchannel, but this is a legal
operation.

        -Before this patch, when the platform not support fastchannel,
        goto err_xfer  will print "Failed to ...". This log is misleading.

        -With this patch, when the fastchannel is not been supported,
        the "Failed to ..." log will be skipped.

Signed-off-by: xinglong.yang <xinglong.yang@cixtech.com>
---
 drivers/firmware/arm_scmi/driver.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c
index b5957cc12fee..2b990e50c8a5 100644
--- a/drivers/firmware/arm_scmi/driver.c
+++ b/drivers/firmware/arm_scmi/driver.c
@@ -1642,7 +1642,10 @@ scmi_common_fastchannel_init(const struct scmi_protocol_handle *ph,
 	 * fastchannels at all.
 	 */
 	ret = ph->xops->do_xfer(ph, t);
-	if (ret)
+	if (ret == -EOPNOTSUPP) {
+		ph->xops->xfer_put(ph, t);
+		goto return_normal;
+	} else if (ret)
 		goto err_xfer;
 
 	resp = t->rx.buf;
@@ -1695,6 +1698,7 @@ scmi_common_fastchannel_init(const struct scmi_protocol_handle *ph,
 		"Using valid FC for protocol %X [MSG_ID:%u / RES_ID:%u]\n",
 		pi->proto->id, message_id, domain);
 
+return_normal:
 	return;
 
 err_db_mem:
-- 
2.42.0


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

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

* [PATCH] firmware: arm_scmi: Remove inappropriate error log.
@ 2023-11-01  8:17 xinglong.yang
  2023-11-02  9:55 ` Fwd: " sean yang
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: xinglong.yang @ 2023-11-01  8:17 UTC (permalink / raw)
  To: xinglong.yang, sudeep.holla, cristian.marussi; +Cc: linux-arm-kernel

The platform may not support fastchannel, but this is a legal
operation.

        -Before this patch, when the platform not support fastchannel,
        goto err_xfer will print "Failed to ...". This log is misleading.

        -With this patch, when the fastchannel is not been supported,
        the "Failed to ..." log will be skipped.

Signed-off-by: xinglong.yang <xinglong.yang@cixtech.com>
---
 drivers/firmware/arm_scmi/driver.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c
index b5957cc12fee..2b990e50c8a5 100644
--- a/drivers/firmware/arm_scmi/driver.c
+++ b/drivers/firmware/arm_scmi/driver.c
@@ -1642,7 +1642,10 @@ scmi_common_fastchannel_init(const struct scmi_protocol_handle *ph,
 	 * fastchannels at all.
 	 */
 	ret = ph->xops->do_xfer(ph, t);
-	if (ret)
+	if (ret == -EOPNOTSUPP) {
+		ph->xops->xfer_put(ph, t);
+		goto return_normal;
+	} else if (ret)
 		goto err_xfer;
 
 	resp = t->rx.buf;
@@ -1695,6 +1698,7 @@ scmi_common_fastchannel_init(const struct scmi_protocol_handle *ph,
 		"Using valid FC for protocol %X [MSG_ID:%u / RES_ID:%u]\n",
 		pi->proto->id, message_id, domain);
 
+return_normal:
 	return;
 
 err_db_mem:
-- 
2.42.0


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

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

* Fwd: [PATCH] firmware: arm_scmi: Remove inappropriate error log.
  2023-11-01  8:17 [PATCH] firmware: arm_scmi: Remove inappropriate error log xinglong.yang
@ 2023-11-02  9:55 ` sean yang
  2023-11-02 11:08   ` Sudeep Holla
  2023-11-02 11:16 ` Sudeep Holla
  2023-11-02 11:25 ` Cristian Marussi
  2 siblings, 1 reply; 7+ messages in thread
From: sean yang @ 2023-11-02  9:55 UTC (permalink / raw)
  Cc: linux-kernel, linux-arm-kernel

---------- Forwarded message ---------
发件人: xinglong.yang <seanyang230@gmail.com>
Date: 2023年11月1日周三 16:17
Subject: [PATCH] firmware: arm_scmi: Remove inappropriate error log.
To: <xinglong.yang@cixtech.com>, <sudeep.holla@arm.com>,
<cristian.marussi@arm.com>
Cc: <linux-arm-kernel@lists.infradead.org>


The platform may not support fastchannel, but this is a legal
operation.

        -Before this patch, when the platform not support fastchannel,
        goto err_xfer will print "Failed to ...". This log is misleading.

        -With this patch, when the fastchannel is not been supported,
        the "Failed to ..." log will be skipped.

Signed-off-by: xinglong.yang <xinglong.yang@cixtech.com>
---
 drivers/firmware/arm_scmi/driver.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/firmware/arm_scmi/driver.c
b/drivers/firmware/arm_scmi/driver.c
index b5957cc12fee..2b990e50c8a5 100644
--- a/drivers/firmware/arm_scmi/driver.c
+++ b/drivers/firmware/arm_scmi/driver.c
@@ -1642,7 +1642,10 @@ scmi_common_fastchannel_init(const struct
scmi_protocol_handle *ph,
         * fastchannels at all.
         */
        ret = ph->xops->do_xfer(ph, t);
-       if (ret)
+       if (ret == -EOPNOTSUPP) {
+               ph->xops->xfer_put(ph, t);
+               goto return_normal;
+       } else if (ret)
                goto err_xfer;

        resp = t->rx.buf;
@@ -1695,6 +1698,7 @@ scmi_common_fastchannel_init(const struct
scmi_protocol_handle *ph,
                "Using valid FC for protocol %X [MSG_ID:%u / RES_ID:%u]\n",
                pi->proto->id, message_id, domain);

+return_normal:
        return;

 err_db_mem:
--
2.42.0

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

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

* Re: Fwd: [PATCH] firmware: arm_scmi: Remove inappropriate error log.
  2023-11-02  9:55 ` Fwd: " sean yang
@ 2023-11-02 11:08   ` Sudeep Holla
  0 siblings, 0 replies; 7+ messages in thread
From: Sudeep Holla @ 2023-11-02 11:08 UTC (permalink / raw)
  To: sean yang; +Cc: linux-kernel, linux-arm-kernel, sudeep.holla, cristian.marussi

On Thu, Nov 02, 2023 at 05:55:37PM +0800, sean yang wrote:
> ---------- Forwarded message ---------
> 发件人: xinglong.yang <seanyang230@gmail.com>
> Date: 2023年11月1日周三 16:17
> Subject: [PATCH] firmware: arm_scmi: Remove inappropriate error log.
> To: <xinglong.yang@cixtech.com>, <sudeep.holla@arm.com>,
> <cristian.marussi@arm.com>
> Cc: <linux-arm-kernel@lists.infradead.org>
> 

Same here, please avoid forwarding patches/emails on the list and wait
for couple of days to *resend*(not forward) the email/patch if you
suspect it wasn't delivered.

-- 
Regards,
Sudeep

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

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

* Re: [PATCH] firmware: arm_scmi: Remove inappropriate error log.
  2023-11-01  8:17 [PATCH] firmware: arm_scmi: Remove inappropriate error log xinglong.yang
  2023-11-02  9:55 ` Fwd: " sean yang
@ 2023-11-02 11:16 ` Sudeep Holla
  2023-11-02 11:25 ` Cristian Marussi
  2 siblings, 0 replies; 7+ messages in thread
From: Sudeep Holla @ 2023-11-02 11:16 UTC (permalink / raw)
  To: xinglong.yang
  Cc: xinglong.yang, cristian.marussi, Sudeep Holla, linux-arm-kernel

On Wed, Nov 01, 2023 at 04:17:26PM +0800, xinglong.yang wrote:
> The platform may not support fastchannel, but this is a legal
> operation.
> 
>         -Before this patch, when the platform not support fastchannel,
>         goto err_xfer will print "Failed to ...". This log is misleading.
> 
>         -With this patch, when the fastchannel is not been supported,
>         the "Failed to ..." log will be skipped.
>

In addition to your patch[1], I would just fix this by something like
below patch instead of this patch

Regards,
Sudeep

[1] https://lore.kernel.org/all/20231102075853.1320710-1-xinglong.yang@cixtech.com

-->8

diff --git i/drivers/firmware/arm_scmi/perf.c w/drivers/firmware/arm_scmi/perf.c
index f5a063b0b1ab..36cdcfaf4324 100644
--- i/drivers/firmware/arm_scmi/perf.c
+++ w/drivers/firmware/arm_scmi/perf.c
@@ -762,29 +762,36 @@ static void scmi_perf_domain_init_fc(const struct scmi_protocol_handle *ph,
 				     u32 domain, struct scmi_fc_info **p_fc)
 {
 	struct scmi_fc_info *fc;
+	struct perf_dom_info *dom;
+
+	dom = scmi_perf_domain_lookup(ph, domain);
+	if (IS_ERR(dom))
+		return;
 
 	fc = devm_kcalloc(ph->dev, PERF_FC_MAX, sizeof(*fc), GFP_KERNEL);
 	if (!fc)
 		return;
 
-	ph->hops->fastchannel_init(ph, PERF_DESCRIBE_FASTCHANNEL,
-				   PERF_LEVEL_SET, 4, domain,
-				   &fc[PERF_FC_LEVEL].set_addr,
-				   &fc[PERF_FC_LEVEL].set_db);
-
 	ph->hops->fastchannel_init(ph, PERF_DESCRIBE_FASTCHANNEL,
 				   PERF_LEVEL_GET, 4, domain,
 				   &fc[PERF_FC_LEVEL].get_addr, NULL);
 
-	ph->hops->fastchannel_init(ph, PERF_DESCRIBE_FASTCHANNEL,
-				   PERF_LIMITS_SET, 8, domain,
-				   &fc[PERF_FC_LIMIT].set_addr,
-				   &fc[PERF_FC_LIMIT].set_db);
-
 	ph->hops->fastchannel_init(ph, PERF_DESCRIBE_FASTCHANNEL,
 				   PERF_LIMITS_GET, 8, domain,
 				   &fc[PERF_FC_LIMIT].get_addr, NULL);
 
+	if (dom->info.set_perf)
+		ph->hops->fastchannel_init(ph, PERF_DESCRIBE_FASTCHANNEL,
+					   PERF_LEVEL_SET, 4, domain,
+					   &fc[PERF_FC_LEVEL].set_addr,
+					   &fc[PERF_FC_LEVEL].set_db);
+
+	if (dom->set_limits)
+		ph->hops->fastchannel_init(ph, PERF_DESCRIBE_FASTCHANNEL,
+					   PERF_LIMITS_SET, 8, domain,
+					   &fc[PERF_FC_LIMIT].set_addr,
+					   &fc[PERF_FC_LIMIT].set_db);
+
 	*p_fc = fc;
 }


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

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

* Re: [PATCH] firmware: arm_scmi: Remove inappropriate error log.
  2023-11-01  8:17 [PATCH] firmware: arm_scmi: Remove inappropriate error log xinglong.yang
  2023-11-02  9:55 ` Fwd: " sean yang
  2023-11-02 11:16 ` Sudeep Holla
@ 2023-11-02 11:25 ` Cristian Marussi
  2023-11-02 11:42   ` sean yang
  2 siblings, 1 reply; 7+ messages in thread
From: Cristian Marussi @ 2023-11-02 11:25 UTC (permalink / raw)
  To: xinglong.yang; +Cc: xinglong.yang, sudeep.holla, linux-arm-kernel

On Wed, Nov 01, 2023 at 04:17:26PM +0800, xinglong.yang wrote:
> The platform may not support fastchannel, but this is a legal
> operation.
> 
>         -Before this patch, when the platform not support fastchannel,
>         goto err_xfer will print "Failed to ...". This log is misleading.
> 
>         -With this patch, when the fastchannel is not been supported,
>         the "Failed to ..." log will be skipped.
> 

Hi,

the message that you are killing:

 dev_warn(ph->dev,
	  "Failed to get FC for protocol %X [MSG_ID:%u / RES_ID:%u] - ret:%d. Using regular messaging.\n",

despite not being an error indeed, informs the user that some FCs could not be
configured and we will revet to use full messaging...it can help detect an
anomaly IMO.

So I would NOT kill it at all and just drop this patch and instead change the
dev_warn to dev_info and used a different wording instead of "Failed..." like

	  "Cannot configure FC for protocol %X [MSG_ID:%u / RES_ID:%u] - ret:%d. Using regular messaging.\n",

Thanks,
Cristian

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

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

* Re: [PATCH] firmware: arm_scmi: Remove inappropriate error log.
  2023-11-02 11:25 ` Cristian Marussi
@ 2023-11-02 11:42   ` sean yang
  0 siblings, 0 replies; 7+ messages in thread
From: sean yang @ 2023-11-02 11:42 UTC (permalink / raw)
  To: Cristian Marussi; +Cc: xinglong.yang, sudeep.holla, linux-arm-kernel

Hi,

Cristian Marussi <cristian.marussi@arm.com> 于2023年11月2日周四 19:25写道:
>
> On Wed, Nov 01, 2023 at 04:17:26PM +0800, xinglong.yang wrote:
> > The platform may not support fastchannel, but this is a legal
> > operation.
> >
> >         -Before this patch, when the platform not support fastchannel,
> >         goto err_xfer will print "Failed to ...". This log is misleading.
> >
> >         -With this patch, when the fastchannel is not been supported,
> >         the "Failed to ..." log will be skipped.
> >
>
> Hi,
>
> the message that you are killing:
>
>  dev_warn(ph->dev,
>           "Failed to get FC for protocol %X [MSG_ID:%u / RES_ID:%u] - ret:%d. Using regular messaging.\n",
>
> despite not being an error indeed, informs the user that some FCs could not be
> configured and we will revet to use full messaging...it can help detect an
> anomaly IMO.
>
> So I would NOT kill it at all and just drop this patch and instead change the
> dev_warn to dev_info and used a different wording instead of "Failed..." like
Thanks for your advice.
>
>           "Cannot configure FC for protocol %X [MSG_ID:%u / RES_ID:%u] - ret:%d. Using regular messaging.\n",
>
> Thanks,
> Cristian

Regards,
Xinglong

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

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

end of thread, other threads:[~2023-11-02 11:43 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-01  8:17 [PATCH] firmware: arm_scmi: Remove inappropriate error log xinglong.yang
2023-11-02  9:55 ` Fwd: " sean yang
2023-11-02 11:08   ` Sudeep Holla
2023-11-02 11:16 ` Sudeep Holla
2023-11-02 11:25 ` Cristian Marussi
2023-11-02 11:42   ` sean yang
  -- strict thread matches above, loose matches on Subject: below --
2023-11-01  8:10 xinglong.yang

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 NNTP newsgroup(s).