linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V5 0/6] firmware: arm_scmi: Misc Fixes
@ 2024-10-30 12:55 Sibi Sankar
  2024-10-30 12:55 ` [PATCH V5 1/6] firmware: arm_scmi: Ensure that the message-id supports fastchannel Sibi Sankar
                   ` (6 more replies)
  0 siblings, 7 replies; 21+ messages in thread
From: Sibi Sankar @ 2024-10-30 12:55 UTC (permalink / raw)
  To: sudeep.holla, cristian.marussi, johan, ulf.hansson,
	jassisinghbrar, dmitry.baryshkov
  Cc: linux-kernel, arm-scmi, linux-arm-kernel, linux-arm-msm,
	quic_sibis, konradybcio, linux-pm, tstrudel, rafael

The series addresses the kernel warnings reported by Johan at [1] and are
are required to X1E cpufreq device tree changes to land.

[1] - https://lore.kernel.org/lkml/ZoQjAWse2YxwyRJv@hovoldconsulting.com/

Duplicate levels:
arm-scmi arm-scmi.0.auto: Level 2976000 Power 218062 Latency 30us Ifreq 2976000 Index 10
arm-scmi arm-scmi.0.auto: Level 3206400 Power 264356 Latency 30us Ifreq 3206400 Index 11
arm-scmi arm-scmi.0.auto: Level 3417600 Power 314966 Latency 30us Ifreq 3417600 Index 12
arm-scmi arm-scmi.0.auto: Failed to add opps_by_lvl at 3417600 for NCC - ret:-16
arm-scmi arm-scmi.0.auto: Failed to add opps_by_lvl at 3417600 for NCC - ret:-16
arm-scmi arm-scmi.0.auto: Level 4012800 Power 528848 Latency 30us Ifreq 4012800 Index 15

^^ exist because SCP reports duplicate values for the highest sustainable
freq for perf domains 1 and 2. These are the only freqs that appear as
duplicates and will be fixed with a firmware update. FWIW the warnings
that we are addressing in this series will also get fixed by a firmware
update but they still have to land for devices already out in the wild.

V4:
* Rework debugfs node creation patch [Ulf/Dmitry]
* Reduce report level to dev_info and tag it with FW_BUG [Johan/Dmitry]
* Add cc stable and err logs to patch 1 commit message [Johan]

V3:
* Pick up R-b, T-b from the list.
* Pick up the updated patch from Cristian for skipping opps.
* Update device names only when a name collision occurs [Dmitry/Ulf]
* Drop Johan's T-b from "fix debugfs node creation failure"
* Move scmi_protocol_msg_check to the top [Sudeep]

V2:
* Include the fix for do_xfer timeout
* Include the fix debugfs node creation failure
* Include Cristian's fix for skipping opp duplication

V1:
* add missing MSG_SUPPORTS_FASTCHANNEL definition.

base: next-20241029

Cristian Marussi (1):
  firmware: arm_scmi: Skip opp duplicates

Sibi Sankar (5):
  firmware: arm_scmi: Ensure that the message-id supports fastchannel
  firmware: arm_scmi: Report duplicate opps as firmware bugs
  pmdomain: core: Add GENPD_FLAG_DEV_NAME_FW flag
  pmdomain: arm: Use FLAG_DEV_NAME_FW to ensure unique names
  mailbox: qcom-cpucp: Mark the irq with IRQF_NO_SUSPEND flag

 drivers/firmware/arm_scmi/driver.c      | 72 +++++++++++++------------
 drivers/firmware/arm_scmi/perf.c        | 44 ++++++++++-----
 drivers/firmware/arm_scmi/protocols.h   |  2 +
 drivers/mailbox/qcom-cpucp-mbox.c       |  2 +-
 drivers/pmdomain/arm/scmi_perf_domain.c |  3 +-
 drivers/pmdomain/core.c                 | 49 +++++++++++------
 include/linux/pm_domain.h               |  6 +++
 7 files changed, 116 insertions(+), 62 deletions(-)

-- 
2.34.1



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

* [PATCH V5 1/6] firmware: arm_scmi: Ensure that the message-id supports fastchannel
  2024-10-30 12:55 [PATCH V5 0/6] firmware: arm_scmi: Misc Fixes Sibi Sankar
@ 2024-10-30 12:55 ` Sibi Sankar
  2024-10-30 12:55 ` [PATCH V5 2/6] firmware: arm_scmi: Skip opp duplicates Sibi Sankar
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 21+ messages in thread
From: Sibi Sankar @ 2024-10-30 12:55 UTC (permalink / raw)
  To: sudeep.holla, cristian.marussi, johan, ulf.hansson,
	jassisinghbrar, dmitry.baryshkov
  Cc: linux-kernel, arm-scmi, linux-arm-kernel, linux-arm-msm,
	quic_sibis, konradybcio, linux-pm, tstrudel, rafael, stable,
	Johan Hovold

Currently the perf and powercap protocol relies on the protocol domain
attributes, which just ensures that one fastchannel per domain, before
instantiating fastchannels for all possible message-ids. Fix this by
ensuring that each message-id supports fastchannel before initialization.

Logs:
scmi: Failed to get FC for protocol 13 [MSG_ID:6 / RES_ID:0] - ret:-95. Using regular messaging.
scmi: Failed to get FC for protocol 13 [MSG_ID:6 / RES_ID:1] - ret:-95. Using regular messaging.
scmi: Failed to get FC for protocol 13 [MSG_ID:6 / RES_ID:2] - ret:-95. Using regular messaging.

CC: stable@vger.kernel.org
Reported-by: Johan Hovold <johan+linaro@kernel.org>
Closes: https://lore.kernel.org/lkml/ZoQjAWse2YxwyRJv@hovoldconsulting.com/
Fixes: 6f9ea4dabd2d ("firmware: arm_scmi: Generalize the fast channel support")
Signed-off-by: Sibi Sankar <quic_sibis@quicinc.com>
Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>
Tested-by: Johan Hovold <johan+linaro@kernel.org>
---

v4:
* Add cc stable and err logs to patch 1 commit message [Johan]

 drivers/firmware/arm_scmi/driver.c    | 72 +++++++++++++++------------
 drivers/firmware/arm_scmi/protocols.h |  2 +
 2 files changed, 41 insertions(+), 33 deletions(-)

diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c
index 1f53ca1f87e3..55e496e78403 100644
--- a/drivers/firmware/arm_scmi/driver.c
+++ b/drivers/firmware/arm_scmi/driver.c
@@ -1698,6 +1698,39 @@ static int scmi_common_get_max_msg_size(const struct scmi_protocol_handle *ph)
 	return info->desc->max_msg_size;
 }
 
+/**
+ * scmi_protocol_msg_check  - Check protocol message attributes
+ *
+ * @ph: A reference to the protocol handle.
+ * @message_id: The ID of the message to check.
+ * @attributes: A parameter to optionally return the retrieved message
+ *		attributes, in case of Success.
+ *
+ * An helper to check protocol message attributes for a specific protocol
+ * and message pair.
+ *
+ * Return: 0 on SUCCESS
+ */
+static int scmi_protocol_msg_check(const struct scmi_protocol_handle *ph,
+				   u32 message_id, u32 *attributes)
+{
+	int ret;
+	struct scmi_xfer *t;
+
+	ret = xfer_get_init(ph, PROTOCOL_MESSAGE_ATTRIBUTES,
+			    sizeof(__le32), 0, &t);
+	if (ret)
+		return ret;
+
+	put_unaligned_le32(message_id, t->tx.buf);
+	ret = do_xfer(ph, t);
+	if (!ret && attributes)
+		*attributes = get_unaligned_le32(t->rx.buf);
+	xfer_put(ph, t);
+
+	return ret;
+}
+
 /**
  * struct scmi_iterator  - Iterator descriptor
  * @msg: A reference to the message TX buffer; filled by @prepare_message with
@@ -1839,6 +1872,7 @@ scmi_common_fastchannel_init(const struct scmi_protocol_handle *ph,
 	int ret;
 	u32 flags;
 	u64 phys_addr;
+	u32 attributes;
 	u8 size;
 	void __iomem *addr;
 	struct scmi_xfer *t;
@@ -1847,6 +1881,11 @@ scmi_common_fastchannel_init(const struct scmi_protocol_handle *ph,
 	struct scmi_msg_resp_desc_fc *resp;
 	const struct scmi_protocol_instance *pi = ph_to_pi(ph);
 
+	/* Check if the MSG_ID supports fastchannel */
+	ret = scmi_protocol_msg_check(ph, message_id, &attributes);
+	if (!ret && !MSG_SUPPORTS_FASTCHANNEL(attributes))
+		return;
+
 	if (!p_addr) {
 		ret = -EINVAL;
 		goto err_out;
@@ -1974,39 +2013,6 @@ static void scmi_common_fastchannel_db_ring(struct scmi_fc_db_info *db)
 #endif
 }
 
-/**
- * scmi_protocol_msg_check  - Check protocol message attributes
- *
- * @ph: A reference to the protocol handle.
- * @message_id: The ID of the message to check.
- * @attributes: A parameter to optionally return the retrieved message
- *		attributes, in case of Success.
- *
- * An helper to check protocol message attributes for a specific protocol
- * and message pair.
- *
- * Return: 0 on SUCCESS
- */
-static int scmi_protocol_msg_check(const struct scmi_protocol_handle *ph,
-				   u32 message_id, u32 *attributes)
-{
-	int ret;
-	struct scmi_xfer *t;
-
-	ret = xfer_get_init(ph, PROTOCOL_MESSAGE_ATTRIBUTES,
-			    sizeof(__le32), 0, &t);
-	if (ret)
-		return ret;
-
-	put_unaligned_le32(message_id, t->tx.buf);
-	ret = do_xfer(ph, t);
-	if (!ret && attributes)
-		*attributes = get_unaligned_le32(t->rx.buf);
-	xfer_put(ph, t);
-
-	return ret;
-}
-
 static const struct scmi_proto_helpers_ops helpers_ops = {
 	.extended_name_get = scmi_common_extended_name_get,
 	.get_max_msg_size = scmi_common_get_max_msg_size,
diff --git a/drivers/firmware/arm_scmi/protocols.h b/drivers/firmware/arm_scmi/protocols.h
index aaee57cdcd55..d62c4469d1fd 100644
--- a/drivers/firmware/arm_scmi/protocols.h
+++ b/drivers/firmware/arm_scmi/protocols.h
@@ -31,6 +31,8 @@
 
 #define SCMI_PROTOCOL_VENDOR_BASE	0x80
 
+#define MSG_SUPPORTS_FASTCHANNEL(x)	((x) & BIT(0))
+
 enum scmi_common_cmd {
 	PROTOCOL_VERSION = 0x0,
 	PROTOCOL_ATTRIBUTES = 0x1,
-- 
2.34.1



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

* [PATCH V5 2/6] firmware: arm_scmi: Skip opp duplicates
  2024-10-30 12:55 [PATCH V5 0/6] firmware: arm_scmi: Misc Fixes Sibi Sankar
  2024-10-30 12:55 ` [PATCH V5 1/6] firmware: arm_scmi: Ensure that the message-id supports fastchannel Sibi Sankar
@ 2024-10-30 12:55 ` Sibi Sankar
  2024-10-30 12:55 ` [PATCH V5 3/6] firmware: arm_scmi: Report duplicate opps as firmware bugs Sibi Sankar
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 21+ messages in thread
From: Sibi Sankar @ 2024-10-30 12:55 UTC (permalink / raw)
  To: sudeep.holla, cristian.marussi, johan, ulf.hansson,
	jassisinghbrar, dmitry.baryshkov
  Cc: linux-kernel, arm-scmi, linux-arm-kernel, linux-arm-msm,
	quic_sibis, konradybcio, linux-pm, tstrudel, rafael, Johan Hovold

From: Cristian Marussi <cristian.marussi@arm.com>

Buggy firmware can reply with duplicated PERF opps descriptors.

Ensure that the bad duplicates reported by the platform firmware doesn't
get added to the opp-tables.

Reported-by: Johan Hovold <johan+linaro@kernel.org>
Closes: https://lore.kernel.org/lkml/ZoQjAWse2YxwyRJv@hovoldconsulting.com/
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Tested-by: Johan Hovold <johan+linaro@kernel.org>
Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>
---
 drivers/firmware/arm_scmi/perf.c | 40 ++++++++++++++++++++++++--------
 1 file changed, 30 insertions(+), 10 deletions(-)

diff --git a/drivers/firmware/arm_scmi/perf.c b/drivers/firmware/arm_scmi/perf.c
index 2d77b5f40ca7..32f9a9acd3e9 100644
--- a/drivers/firmware/arm_scmi/perf.c
+++ b/drivers/firmware/arm_scmi/perf.c
@@ -373,7 +373,7 @@ static int iter_perf_levels_update_state(struct scmi_iterator_state *st,
 	return 0;
 }
 
-static inline void
+static inline int
 process_response_opp(struct device *dev, struct perf_dom_info *dom,
 		     struct scmi_opp *opp, unsigned int loop_idx,
 		     const struct scmi_msg_resp_perf_describe_levels *r)
@@ -386,12 +386,16 @@ process_response_opp(struct device *dev, struct perf_dom_info *dom,
 		le16_to_cpu(r->opp[loop_idx].transition_latency_us);
 
 	ret = xa_insert(&dom->opps_by_lvl, opp->perf, opp, GFP_KERNEL);
-	if (ret)
+	if (ret) {
 		dev_warn(dev, "Failed to add opps_by_lvl at %d for %s - ret:%d\n",
 			 opp->perf, dom->info.name, ret);
+		return ret;
+	}
+
+	return 0;
 }
 
-static inline void
+static inline int
 process_response_opp_v4(struct device *dev, struct perf_dom_info *dom,
 			struct scmi_opp *opp, unsigned int loop_idx,
 			const struct scmi_msg_resp_perf_describe_levels_v4 *r)
@@ -404,9 +408,11 @@ process_response_opp_v4(struct device *dev, struct perf_dom_info *dom,
 		le16_to_cpu(r->opp[loop_idx].transition_latency_us);
 
 	ret = xa_insert(&dom->opps_by_lvl, opp->perf, opp, GFP_KERNEL);
-	if (ret)
+	if (ret) {
 		dev_warn(dev, "Failed to add opps_by_lvl at %d for %s - ret:%d\n",
 			 opp->perf, dom->info.name, ret);
+		return ret;
+	}
 
 	/* Note that PERF v4 reports always five 32-bit words */
 	opp->indicative_freq = le32_to_cpu(r->opp[loop_idx].indicative_freq);
@@ -415,13 +421,21 @@ process_response_opp_v4(struct device *dev, struct perf_dom_info *dom,
 
 		ret = xa_insert(&dom->opps_by_idx, opp->level_index, opp,
 				GFP_KERNEL);
-		if (ret)
+		if (ret) {
 			dev_warn(dev,
 				 "Failed to add opps_by_idx at %d for %s - ret:%d\n",
 				 opp->level_index, dom->info.name, ret);
 
+			/* Cleanup by_lvl too */
+			xa_erase(&dom->opps_by_lvl, opp->perf);
+
+			return ret;
+		}
+
 		hash_add(dom->opps_by_freq, &opp->hash, opp->indicative_freq);
 	}
+
+	return 0;
 }
 
 static int
@@ -429,16 +443,22 @@ iter_perf_levels_process_response(const struct scmi_protocol_handle *ph,
 				  const void *response,
 				  struct scmi_iterator_state *st, void *priv)
 {
+	int ret;
 	struct scmi_opp *opp;
 	struct scmi_perf_ipriv *p = priv;
 
-	opp = &p->perf_dom->opp[st->desc_index + st->loop_idx];
+	opp = &p->perf_dom->opp[p->perf_dom->opp_count];
 	if (PROTOCOL_REV_MAJOR(p->version) <= 0x3)
-		process_response_opp(ph->dev, p->perf_dom, opp, st->loop_idx,
-				     response);
+		ret = process_response_opp(ph->dev, p->perf_dom, opp,
+					   st->loop_idx, response);
 	else
-		process_response_opp_v4(ph->dev, p->perf_dom, opp, st->loop_idx,
-					response);
+		ret = process_response_opp_v4(ph->dev, p->perf_dom, opp,
+					      st->loop_idx, response);
+
+	/* Skip BAD duplicates received from firmware */
+	if (ret)
+		return ret == -EBUSY ? 0 : ret;
+
 	p->perf_dom->opp_count++;
 
 	dev_dbg(ph->dev, "Level %d Power %d Latency %dus Ifreq %d Index %d\n",
-- 
2.34.1



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

* [PATCH V5 3/6] firmware: arm_scmi: Report duplicate opps as firmware bugs
  2024-10-30 12:55 [PATCH V5 0/6] firmware: arm_scmi: Misc Fixes Sibi Sankar
  2024-10-30 12:55 ` [PATCH V5 1/6] firmware: arm_scmi: Ensure that the message-id supports fastchannel Sibi Sankar
  2024-10-30 12:55 ` [PATCH V5 2/6] firmware: arm_scmi: Skip opp duplicates Sibi Sankar
@ 2024-10-30 12:55 ` Sibi Sankar
  2024-10-30 14:39   ` Cristian Marussi
                     ` (3 more replies)
  2024-10-30 12:55 ` [PATCH V5 4/6] pmdomain: core: Add GENPD_FLAG_DEV_NAME_FW flag Sibi Sankar
                   ` (3 subsequent siblings)
  6 siblings, 4 replies; 21+ messages in thread
From: Sibi Sankar @ 2024-10-30 12:55 UTC (permalink / raw)
  To: sudeep.holla, cristian.marussi, johan, ulf.hansson,
	jassisinghbrar, dmitry.baryshkov
  Cc: linux-kernel, arm-scmi, linux-arm-kernel, linux-arm-msm,
	quic_sibis, konradybcio, linux-pm, tstrudel, rafael, Johan Hovold

Duplicate opps reported by buggy SCP firmware currently show up
as warnings even though the only functional impact is that the
level/index remain inaccessible. Make it less scary for the end
user by using dev_info instead, along with FW_BUG tag.

Suggested-by: Johan Hovold <johan+linaro@kernel.org>
Signed-off-by: Sibi Sankar <quic_sibis@quicinc.com>
---
 drivers/firmware/arm_scmi/perf.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/firmware/arm_scmi/perf.c b/drivers/firmware/arm_scmi/perf.c
index 32f9a9acd3e9..c7e5a34b254b 100644
--- a/drivers/firmware/arm_scmi/perf.c
+++ b/drivers/firmware/arm_scmi/perf.c
@@ -387,7 +387,7 @@ 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 for %s - ret:%d\n",
+		dev_info(dev, FW_BUG "Failed to add opps_by_lvl at %d for %s - ret:%d\n",
 			 opp->perf, dom->info.name, ret);
 		return ret;
 	}
@@ -409,7 +409,7 @@ 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 for %s - ret:%d\n",
+		dev_info(dev, FW_BUG "Failed to add opps_by_lvl at %d for %s - ret:%d\n",
 			 opp->perf, dom->info.name, ret);
 		return ret;
 	}
-- 
2.34.1



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

* [PATCH V5 4/6] pmdomain: core: Add GENPD_FLAG_DEV_NAME_FW flag
  2024-10-30 12:55 [PATCH V5 0/6] firmware: arm_scmi: Misc Fixes Sibi Sankar
                   ` (2 preceding siblings ...)
  2024-10-30 12:55 ` [PATCH V5 3/6] firmware: arm_scmi: Report duplicate opps as firmware bugs Sibi Sankar
@ 2024-10-30 12:55 ` Sibi Sankar
  2024-10-30 12:55 ` [PATCH V5 5/6] pmdomain: arm: Use FLAG_DEV_NAME_FW to ensure unique names Sibi Sankar
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 21+ messages in thread
From: Sibi Sankar @ 2024-10-30 12:55 UTC (permalink / raw)
  To: sudeep.holla, cristian.marussi, johan, ulf.hansson,
	jassisinghbrar, dmitry.baryshkov
  Cc: linux-kernel, arm-scmi, linux-arm-kernel, linux-arm-msm,
	quic_sibis, konradybcio, linux-pm, tstrudel, rafael, Johan Hovold

Introduce GENPD_FLAG_DEV_NAME_FW flag which instructs genpd to generate
an unique device name using ida. It is aimed to be used by genpd providers
which derive their names directly from FW making them susceptible to
debugfs node creation failures.

Reported-by: Johan Hovold <johan+linaro@kernel.org>
Closes: https://lore.kernel.org/lkml/ZoQjAWse2YxwyRJv@hovoldconsulting.com/
Fixes: 718072ceb211 ("PM: domains: create debugfs nodes when adding power domains")
Suggested-by: Ulf Hansson <ulf.hansson@linaro.org>
Suggested-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Sibi Sankar <quic_sibis@quicinc.com>
---

v4:
* Rework debugfs node creation patch [Ulf/Dmitry]

 drivers/pmdomain/core.c   | 49 +++++++++++++++++++++++++++------------
 include/linux/pm_domain.h |  6 +++++
 2 files changed, 40 insertions(+), 15 deletions(-)

diff --git a/drivers/pmdomain/core.c b/drivers/pmdomain/core.c
index 76490f0bf1e2..a6c8b85dd024 100644
--- a/drivers/pmdomain/core.c
+++ b/drivers/pmdomain/core.c
@@ -7,6 +7,7 @@
 #define pr_fmt(fmt) "PM: " fmt
 
 #include <linux/delay.h>
+#include <linux/idr.h>
 #include <linux/kernel.h>
 #include <linux/io.h>
 #include <linux/platform_device.h>
@@ -23,6 +24,9 @@
 #include <linux/cpu.h>
 #include <linux/debugfs.h>
 
+/* Provides a unique ID for each genpd device */
+static DEFINE_IDA(genpd_ida);
+
 #define GENPD_RETRY_MAX_MS	250		/* Approximate */
 
 #define GENPD_DEV_CALLBACK(genpd, type, callback, dev)		\
@@ -171,6 +175,7 @@ static const struct genpd_lock_ops genpd_raw_spin_ops = {
 #define genpd_is_cpu_domain(genpd)	(genpd->flags & GENPD_FLAG_CPU_DOMAIN)
 #define genpd_is_rpm_always_on(genpd)	(genpd->flags & GENPD_FLAG_RPM_ALWAYS_ON)
 #define genpd_is_opp_table_fw(genpd)	(genpd->flags & GENPD_FLAG_OPP_TABLE_FW)
+#define genpd_is_dev_name_fw(genpd)	(genpd->flags & GENPD_FLAG_DEV_NAME_FW)
 
 static inline bool irq_safe_dev_in_sleep_domain(struct device *dev,
 		const struct generic_pm_domain *genpd)
@@ -189,7 +194,7 @@ static inline bool irq_safe_dev_in_sleep_domain(struct device *dev,
 
 	if (ret)
 		dev_warn_once(dev, "PM domain %s will not be powered off\n",
-				genpd->name);
+			      dev_name(&genpd->dev));
 
 	return ret;
 }
@@ -274,7 +279,7 @@ static void genpd_debug_remove(struct generic_pm_domain *genpd)
 	if (!genpd_debugfs_dir)
 		return;
 
-	debugfs_lookup_and_remove(genpd->name, genpd_debugfs_dir);
+	debugfs_lookup_and_remove(dev_name(&genpd->dev), genpd_debugfs_dir);
 }
 
 static void genpd_update_accounting(struct generic_pm_domain *genpd)
@@ -731,7 +736,7 @@ static int _genpd_power_on(struct generic_pm_domain *genpd, bool timed)
 	genpd->states[state_idx].power_on_latency_ns = elapsed_ns;
 	genpd->gd->max_off_time_changed = true;
 	pr_debug("%s: Power-%s latency exceeded, new value %lld ns\n",
-		 genpd->name, "on", elapsed_ns);
+		 dev_name(&genpd->dev), "on", elapsed_ns);
 
 out:
 	raw_notifier_call_chain(&genpd->power_notifiers, GENPD_NOTIFY_ON, NULL);
@@ -782,7 +787,7 @@ static int _genpd_power_off(struct generic_pm_domain *genpd, bool timed)
 	genpd->states[state_idx].power_off_latency_ns = elapsed_ns;
 	genpd->gd->max_off_time_changed = true;
 	pr_debug("%s: Power-%s latency exceeded, new value %lld ns\n",
-		 genpd->name, "off", elapsed_ns);
+		 dev_name(&genpd->dev), "off", elapsed_ns);
 
 out:
 	raw_notifier_call_chain(&genpd->power_notifiers, GENPD_NOTIFY_OFF,
@@ -1941,7 +1946,7 @@ int dev_pm_genpd_add_notifier(struct device *dev, struct notifier_block *nb)
 
 	if (ret) {
 		dev_warn(dev, "failed to add notifier for PM domain %s\n",
-			 genpd->name);
+			 dev_name(&genpd->dev));
 		return ret;
 	}
 
@@ -1988,7 +1993,7 @@ int dev_pm_genpd_remove_notifier(struct device *dev)
 
 	if (ret) {
 		dev_warn(dev, "failed to remove notifier for PM domain %s\n",
-			 genpd->name);
+			 dev_name(&genpd->dev));
 		return ret;
 	}
 
@@ -2014,7 +2019,7 @@ static int genpd_add_subdomain(struct generic_pm_domain *genpd,
 	 */
 	if (!genpd_is_irq_safe(genpd) && genpd_is_irq_safe(subdomain)) {
 		WARN(1, "Parent %s of subdomain %s must be IRQ safe\n",
-				genpd->name, subdomain->name);
+		     dev_name(&genpd->dev), subdomain->name);
 		return -EINVAL;
 	}
 
@@ -2089,7 +2094,7 @@ int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd,
 
 	if (!list_empty(&subdomain->parent_links) || subdomain->device_count) {
 		pr_warn("%s: unable to remove subdomain %s\n",
-			genpd->name, subdomain->name);
+			dev_name(&genpd->dev), subdomain->name);
 		ret = -EBUSY;
 		goto out;
 	}
@@ -2226,6 +2231,7 @@ int pm_genpd_init(struct generic_pm_domain *genpd,
 	genpd->status = is_off ? GENPD_STATE_OFF : GENPD_STATE_ON;
 	genpd->device_count = 0;
 	genpd->provider = NULL;
+	genpd->device_id = -ENXIO;
 	genpd->has_provider = false;
 	genpd->accounting_time = ktime_get_mono_fast_ns();
 	genpd->domain.ops.runtime_suspend = genpd_runtime_suspend;
@@ -2266,7 +2272,18 @@ int pm_genpd_init(struct generic_pm_domain *genpd,
 		return ret;
 
 	device_initialize(&genpd->dev);
-	dev_set_name(&genpd->dev, "%s", genpd->name);
+
+	if (!genpd_is_dev_name_fw(genpd)) {
+		dev_set_name(&genpd->dev, "%s", genpd->name);
+	} else {
+		ret = ida_alloc(&genpd_ida, GFP_KERNEL);
+		if (ret < 0) {
+			put_device(&genpd->dev);
+			return ret;
+		}
+		genpd->device_id = ret;
+		dev_set_name(&genpd->dev, "%s_%u", genpd->name, genpd->device_id);
+	}
 
 	mutex_lock(&gpd_list_lock);
 	list_add(&genpd->gpd_list_node, &gpd_list);
@@ -2288,13 +2305,13 @@ static int genpd_remove(struct generic_pm_domain *genpd)
 
 	if (genpd->has_provider) {
 		genpd_unlock(genpd);
-		pr_err("Provider present, unable to remove %s\n", genpd->name);
+		pr_err("Provider present, unable to remove %s\n", dev_name(&genpd->dev));
 		return -EBUSY;
 	}
 
 	if (!list_empty(&genpd->parent_links) || genpd->device_count) {
 		genpd_unlock(genpd);
-		pr_err("%s: unable to remove %s\n", __func__, genpd->name);
+		pr_err("%s: unable to remove %s\n", __func__, dev_name(&genpd->dev));
 		return -EBUSY;
 	}
 
@@ -2308,9 +2325,11 @@ static int genpd_remove(struct generic_pm_domain *genpd)
 	genpd_unlock(genpd);
 	genpd_debug_remove(genpd);
 	cancel_work_sync(&genpd->power_off_work);
+	if (genpd->device_id != -ENXIO)
+		ida_free(&genpd_ida, genpd->device_id);
 	genpd_free_data(genpd);
 
-	pr_debug("%s: removed %s\n", __func__, genpd->name);
+	pr_debug("%s: removed %s\n", __func__, dev_name(&genpd->dev));
 
 	return 0;
 }
@@ -3320,12 +3339,12 @@ static int genpd_summary_one(struct seq_file *s,
 	else
 		snprintf(state, sizeof(state), "%s",
 			 status_lookup[genpd->status]);
-	seq_printf(s, "%-30s  %-30s  %u", genpd->name, state, genpd->performance_state);
+	seq_printf(s, "%-30s  %-30s  %u", dev_name(&genpd->dev), state, genpd->performance_state);
 
 	/*
 	 * Modifications on the list require holding locks on both
 	 * parent and child, so we are safe.
-	 * Also genpd->name is immutable.
+	 * Also the device name is immutable.
 	 */
 	list_for_each_entry(link, &genpd->parent_links, parent_node) {
 		if (list_is_first(&link->parent_node, &genpd->parent_links))
@@ -3550,7 +3569,7 @@ static void genpd_debug_add(struct generic_pm_domain *genpd)
 	if (!genpd_debugfs_dir)
 		return;
 
-	d = debugfs_create_dir(genpd->name, genpd_debugfs_dir);
+	d = debugfs_create_dir(dev_name(&genpd->dev), genpd_debugfs_dir);
 
 	debugfs_create_file("current_state", 0444,
 			    d, genpd, &status_fops);
diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
index 76775ab38898..45646bfcaf1a 100644
--- a/include/linux/pm_domain.h
+++ b/include/linux/pm_domain.h
@@ -100,6 +100,10 @@ struct dev_pm_domain_list {
  * GENPD_FLAG_OPP_TABLE_FW:	The genpd provider supports performance states,
  *				but its corresponding OPP tables are not
  *				described in DT, but are given directly by FW.
+ *
+ * GENPD_FLAG_DEV_NAME_FW:	Instructs genpd to generate an unique device name
+ *				using ida. It is used by genpd providers which
+ *				get their genpd-names directly from FW.
  */
 #define GENPD_FLAG_PM_CLK	 (1U << 0)
 #define GENPD_FLAG_IRQ_SAFE	 (1U << 1)
@@ -109,6 +113,7 @@ struct dev_pm_domain_list {
 #define GENPD_FLAG_RPM_ALWAYS_ON (1U << 5)
 #define GENPD_FLAG_MIN_RESIDENCY (1U << 6)
 #define GENPD_FLAG_OPP_TABLE_FW	 (1U << 7)
+#define GENPD_FLAG_DEV_NAME_FW	 (1U << 8)
 
 enum gpd_status {
 	GENPD_STATE_ON = 0,	/* PM domain is on */
@@ -171,6 +176,7 @@ struct generic_pm_domain {
 	atomic_t sd_count;	/* Number of subdomains with power "on" */
 	enum gpd_status status;	/* Current state of the domain */
 	unsigned int device_count;	/* Number of devices */
+	unsigned int device_id;		/* unique device id */
 	unsigned int suspended_count;	/* System suspend device counter */
 	unsigned int prepared_count;	/* Suspend counter of prepared devices */
 	unsigned int performance_state;	/* Aggregated max performance state */
-- 
2.34.1



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

* [PATCH V5 5/6] pmdomain: arm: Use FLAG_DEV_NAME_FW to ensure unique names
  2024-10-30 12:55 [PATCH V5 0/6] firmware: arm_scmi: Misc Fixes Sibi Sankar
                   ` (3 preceding siblings ...)
  2024-10-30 12:55 ` [PATCH V5 4/6] pmdomain: core: Add GENPD_FLAG_DEV_NAME_FW flag Sibi Sankar
@ 2024-10-30 12:55 ` Sibi Sankar
  2024-10-30 12:55 ` [PATCH V5 6/6] mailbox: qcom-cpucp: Mark the irq with IRQF_NO_SUSPEND flag Sibi Sankar
  2024-10-30 16:19 ` [PATCH V5 0/6] firmware: arm_scmi: Misc Fixes Ulf Hansson
  6 siblings, 0 replies; 21+ messages in thread
From: Sibi Sankar @ 2024-10-30 12:55 UTC (permalink / raw)
  To: sudeep.holla, cristian.marussi, johan, ulf.hansson,
	jassisinghbrar, dmitry.baryshkov
  Cc: linux-kernel, arm-scmi, linux-arm-kernel, linux-arm-msm,
	quic_sibis, konradybcio, linux-pm, tstrudel, rafael, Johan Hovold

The domain attributes returned by the perf protocol can end up reporting
identical names across domains, resulting in debugfs node creation failure.
Use the GENPD_FLAG_DEV_NAME_FW to ensure the genpd providers end up with an
unique name.

Logs: [X1E reports 'NCC' for all its scmi perf domains]
debugfs: Directory 'NCC' with parent 'pm_genpd' already present!
debugfs: Directory 'NCC' with parent 'pm_genpd' already present!

Reported-by: Johan Hovold <johan+linaro@kernel.org>
Closes: https://lore.kernel.org/lkml/ZoQjAWse2YxwyRJv@hovoldconsulting.com/
Suggested-by: Ulf Hansson <ulf.hansson@linaro.org>
Suggested-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Sibi Sankar <quic_sibis@quicinc.com>
---
 drivers/pmdomain/arm/scmi_perf_domain.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/pmdomain/arm/scmi_perf_domain.c b/drivers/pmdomain/arm/scmi_perf_domain.c
index d7ef46ccd9b8..3693423459c9 100644
--- a/drivers/pmdomain/arm/scmi_perf_domain.c
+++ b/drivers/pmdomain/arm/scmi_perf_domain.c
@@ -125,7 +125,8 @@ static int scmi_perf_domain_probe(struct scmi_device *sdev)
 		scmi_pd->ph = ph;
 		scmi_pd->genpd.name = scmi_pd->info->name;
 		scmi_pd->genpd.flags = GENPD_FLAG_ALWAYS_ON |
-				       GENPD_FLAG_OPP_TABLE_FW;
+				       GENPD_FLAG_OPP_TABLE_FW |
+				       GENPD_FLAG_DEV_NAME_FW;
 		scmi_pd->genpd.set_performance_state = scmi_pd_set_perf_state;
 		scmi_pd->genpd.attach_dev = scmi_pd_attach_dev;
 		scmi_pd->genpd.detach_dev = scmi_pd_detach_dev;
-- 
2.34.1



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

* [PATCH V5 6/6] mailbox: qcom-cpucp: Mark the irq with IRQF_NO_SUSPEND flag
  2024-10-30 12:55 [PATCH V5 0/6] firmware: arm_scmi: Misc Fixes Sibi Sankar
                   ` (4 preceding siblings ...)
  2024-10-30 12:55 ` [PATCH V5 5/6] pmdomain: arm: Use FLAG_DEV_NAME_FW to ensure unique names Sibi Sankar
@ 2024-10-30 12:55 ` Sibi Sankar
  2024-10-30 16:19 ` [PATCH V5 0/6] firmware: arm_scmi: Misc Fixes Ulf Hansson
  6 siblings, 0 replies; 21+ messages in thread
From: Sibi Sankar @ 2024-10-30 12:55 UTC (permalink / raw)
  To: sudeep.holla, cristian.marussi, johan, ulf.hansson,
	jassisinghbrar, dmitry.baryshkov
  Cc: linux-kernel, arm-scmi, linux-arm-kernel, linux-arm-msm,
	quic_sibis, konradybcio, linux-pm, tstrudel, rafael, Johan Hovold,
	Konrad Dybcio

The qcom-cpucp mailbox irq is expected to function during suspend-resume
cycle particularly when the scmi cpufreq driver can query the current
frequency using the get_level message after the cpus are brought up during
resume. Hence mark the irq with IRQF_NO_SUSPEND flag to fix the do_xfer
failures we see during resume.

Err Logs:
arm-scmi firmware:scmi: timed out in resp(caller:do_xfer+0x164/0x568)
cpufreq: cpufreq_online: ->get() failed

Reported-by: Johan Hovold <johan+linaro@kernel.org>
Closes: https://lore.kernel.org/lkml/ZtgFj1y5ggipgEOS@hovoldconsulting.com/
Fixes: 0e2a9a03106c ("mailbox: Add support for QTI CPUCP mailbox controller")
Signed-off-by: Sibi Sankar <quic_sibis@quicinc.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Tested-by: Johan Hovold <johan+linaro@kernel.org>
---
 drivers/mailbox/qcom-cpucp-mbox.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mailbox/qcom-cpucp-mbox.c b/drivers/mailbox/qcom-cpucp-mbox.c
index e5437c294803..44f4ed15f818 100644
--- a/drivers/mailbox/qcom-cpucp-mbox.c
+++ b/drivers/mailbox/qcom-cpucp-mbox.c
@@ -138,7 +138,7 @@ static int qcom_cpucp_mbox_probe(struct platform_device *pdev)
 		return irq;
 
 	ret = devm_request_irq(dev, irq, qcom_cpucp_mbox_irq_fn,
-			       IRQF_TRIGGER_HIGH, "apss_cpucp_mbox", cpucp);
+			       IRQF_TRIGGER_HIGH | IRQF_NO_SUSPEND, "apss_cpucp_mbox", cpucp);
 	if (ret < 0)
 		return dev_err_probe(dev, ret, "Failed to register irq: %d\n", irq);
 
-- 
2.34.1



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

* Re: [PATCH V5 3/6] firmware: arm_scmi: Report duplicate opps as firmware bugs
  2024-10-30 12:55 ` [PATCH V5 3/6] firmware: arm_scmi: Report duplicate opps as firmware bugs Sibi Sankar
@ 2024-10-30 14:39   ` Cristian Marussi
  2024-10-30 16:42   ` Florian Fainelli
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 21+ messages in thread
From: Cristian Marussi @ 2024-10-30 14:39 UTC (permalink / raw)
  To: Sibi Sankar
  Cc: sudeep.holla, cristian.marussi, johan, ulf.hansson,
	jassisinghbrar, dmitry.baryshkov, linux-kernel, arm-scmi,
	linux-arm-kernel, linux-arm-msm, konradybcio, linux-pm, tstrudel,
	rafael, Johan Hovold

On Wed, Oct 30, 2024 at 06:25:09PM +0530, Sibi Sankar wrote:
> Duplicate opps reported by buggy SCP firmware currently show up
> as warnings even though the only functional impact is that the
> level/index remain inaccessible. Make it less scary for the end
> user by using dev_info instead, along with FW_BUG tag.

Thanks for this.

LGTM.
Reviewed-by: Cristian Marussi <cristian.marussi@arm.com>

Thanks,
Cristian


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

* Re: [PATCH V5 0/6] firmware: arm_scmi: Misc Fixes
  2024-10-30 12:55 [PATCH V5 0/6] firmware: arm_scmi: Misc Fixes Sibi Sankar
                   ` (5 preceding siblings ...)
  2024-10-30 12:55 ` [PATCH V5 6/6] mailbox: qcom-cpucp: Mark the irq with IRQF_NO_SUSPEND flag Sibi Sankar
@ 2024-10-30 16:19 ` Ulf Hansson
  2024-10-30 16:28   ` Cristian Marussi
  6 siblings, 1 reply; 21+ messages in thread
From: Ulf Hansson @ 2024-10-30 16:19 UTC (permalink / raw)
  To: Sibi Sankar
  Cc: sudeep.holla, cristian.marussi, johan, jassisinghbrar,
	dmitry.baryshkov, linux-kernel, arm-scmi, linux-arm-kernel,
	linux-arm-msm, konradybcio, linux-pm, tstrudel, rafael

On Wed, 30 Oct 2024 at 13:55, Sibi Sankar <quic_sibis@quicinc.com> wrote:
>
> The series addresses the kernel warnings reported by Johan at [1] and are
> are required to X1E cpufreq device tree changes to land.
>
> [1] - https://lore.kernel.org/lkml/ZoQjAWse2YxwyRJv@hovoldconsulting.com/
>
> Duplicate levels:
> arm-scmi arm-scmi.0.auto: Level 2976000 Power 218062 Latency 30us Ifreq 2976000 Index 10
> arm-scmi arm-scmi.0.auto: Level 3206400 Power 264356 Latency 30us Ifreq 3206400 Index 11
> arm-scmi arm-scmi.0.auto: Level 3417600 Power 314966 Latency 30us Ifreq 3417600 Index 12
> arm-scmi arm-scmi.0.auto: Failed to add opps_by_lvl at 3417600 for NCC - ret:-16
> arm-scmi arm-scmi.0.auto: Failed to add opps_by_lvl at 3417600 for NCC - ret:-16
> arm-scmi arm-scmi.0.auto: Level 4012800 Power 528848 Latency 30us Ifreq 4012800 Index 15
>
> ^^ exist because SCP reports duplicate values for the highest sustainable
> freq for perf domains 1 and 2. These are the only freqs that appear as
> duplicates and will be fixed with a firmware update. FWIW the warnings
> that we are addressing in this series will also get fixed by a firmware
> update but they still have to land for devices already out in the wild.
>
> V4:
> * Rework debugfs node creation patch [Ulf/Dmitry]
> * Reduce report level to dev_info and tag it with FW_BUG [Johan/Dmitry]
> * Add cc stable and err logs to patch 1 commit message [Johan]

Patch4 and patch5 applied for fixes to my pmdomain tree - and by
adding a stable tag to them, thanks!

Potentially I could help to take the other patches too, to keep things
together, but in that case I need confirmation that's okay to do so.

[...]

Kind regards
Uffe


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

* Re: [PATCH V5 0/6] firmware: arm_scmi: Misc Fixes
  2024-10-30 16:19 ` [PATCH V5 0/6] firmware: arm_scmi: Misc Fixes Ulf Hansson
@ 2024-10-30 16:28   ` Cristian Marussi
  2024-11-06  7:12     ` Sudeep Holla
  0 siblings, 1 reply; 21+ messages in thread
From: Cristian Marussi @ 2024-10-30 16:28 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: Sibi Sankar, sudeep.holla, cristian.marussi, johan,
	jassisinghbrar, dmitry.baryshkov, linux-kernel, arm-scmi,
	linux-arm-kernel, linux-arm-msm, konradybcio, linux-pm, tstrudel,
	rafael

On Wed, Oct 30, 2024 at 05:19:39PM +0100, Ulf Hansson wrote:
> On Wed, 30 Oct 2024 at 13:55, Sibi Sankar <quic_sibis@quicinc.com> wrote:
> >
> > The series addresses the kernel warnings reported by Johan at [1] and are
> > are required to X1E cpufreq device tree changes to land.
> >
> > [1] - https://lore.kernel.org/lkml/ZoQjAWse2YxwyRJv@hovoldconsulting.com/
> >
> > Duplicate levels:
> > arm-scmi arm-scmi.0.auto: Level 2976000 Power 218062 Latency 30us Ifreq 2976000 Index 10
> > arm-scmi arm-scmi.0.auto: Level 3206400 Power 264356 Latency 30us Ifreq 3206400 Index 11
> > arm-scmi arm-scmi.0.auto: Level 3417600 Power 314966 Latency 30us Ifreq 3417600 Index 12
> > arm-scmi arm-scmi.0.auto: Failed to add opps_by_lvl at 3417600 for NCC - ret:-16
> > arm-scmi arm-scmi.0.auto: Failed to add opps_by_lvl at 3417600 for NCC - ret:-16
> > arm-scmi arm-scmi.0.auto: Level 4012800 Power 528848 Latency 30us Ifreq 4012800 Index 15
> >
> > ^^ exist because SCP reports duplicate values for the highest sustainable
> > freq for perf domains 1 and 2. These are the only freqs that appear as
> > duplicates and will be fixed with a firmware update. FWIW the warnings
> > that we are addressing in this series will also get fixed by a firmware
> > update but they still have to land for devices already out in the wild.
> >
> > V4:
> > * Rework debugfs node creation patch [Ulf/Dmitry]
> > * Reduce report level to dev_info and tag it with FW_BUG [Johan/Dmitry]
> > * Add cc stable and err logs to patch 1 commit message [Johan]
> 
> Patch4 and patch5 applied for fixes to my pmdomain tree - and by
> adding a stable tag to them, thanks!
> 
> Potentially I could help to take the other patches too, to keep things
> together, but in that case I need confirmation that's okay to do so.

SCMI patches in these series are all reviewed (all but one even by Sudeep)
so it is really up to Sudeep preference...(who is travelling now so it could
take a bit to reply)...moreover I am not sure if the SCMI patches in this
series could end up with wome trivial conflicts against the scmi patches
already queued at

	sudeep/for-next/scmi/updates

(at least the perf related ones 2 and 3 probably not)

Thanks,
Cristian


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

* Re: [PATCH V5 3/6] firmware: arm_scmi: Report duplicate opps as firmware bugs
  2024-10-30 12:55 ` [PATCH V5 3/6] firmware: arm_scmi: Report duplicate opps as firmware bugs Sibi Sankar
  2024-10-30 14:39   ` Cristian Marussi
@ 2024-10-30 16:42   ` Florian Fainelli
  2024-11-01 14:09   ` Johan Hovold
  2024-11-06  7:07   ` Sudeep Holla
  3 siblings, 0 replies; 21+ messages in thread
From: Florian Fainelli @ 2024-10-30 16:42 UTC (permalink / raw)
  To: Sibi Sankar, sudeep.holla, cristian.marussi, johan, ulf.hansson,
	jassisinghbrar, dmitry.baryshkov
  Cc: linux-kernel, arm-scmi, linux-arm-kernel, linux-arm-msm,
	konradybcio, linux-pm, tstrudel, rafael, Johan Hovold

On 10/30/24 05:55, Sibi Sankar wrote:
> Duplicate opps reported by buggy SCP firmware currently show up
> as warnings even though the only functional impact is that the
> level/index remain inaccessible. Make it less scary for the end
> user by using dev_info instead, along with FW_BUG tag.
> 
> Suggested-by: Johan Hovold <johan+linaro@kernel.org>
> Signed-off-by: Sibi Sankar <quic_sibis@quicinc.com>

Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
-- 
Florian


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

* Re: [PATCH V5 3/6] firmware: arm_scmi: Report duplicate opps as firmware bugs
  2024-10-30 12:55 ` [PATCH V5 3/6] firmware: arm_scmi: Report duplicate opps as firmware bugs Sibi Sankar
  2024-10-30 14:39   ` Cristian Marussi
  2024-10-30 16:42   ` Florian Fainelli
@ 2024-11-01 14:09   ` Johan Hovold
  2024-11-04 13:50     ` Sibi Sankar
  2024-11-06  7:07   ` Sudeep Holla
  3 siblings, 1 reply; 21+ messages in thread
From: Johan Hovold @ 2024-11-01 14:09 UTC (permalink / raw)
  To: Sibi Sankar
  Cc: sudeep.holla, cristian.marussi, ulf.hansson, jassisinghbrar,
	dmitry.baryshkov, linux-kernel, arm-scmi, linux-arm-kernel,
	linux-arm-msm, konradybcio, linux-pm, tstrudel, rafael,
	Johan Hovold

On Wed, Oct 30, 2024 at 06:25:09PM +0530, Sibi Sankar wrote:
> Duplicate opps reported by buggy SCP firmware currently show up
> as warnings even though the only functional impact is that the
> level/index remain inaccessible. Make it less scary for the end
> user by using dev_info instead, along with FW_BUG tag.
> 
> Suggested-by: Johan Hovold <johan+linaro@kernel.org>
> Signed-off-by: Sibi Sankar <quic_sibis@quicinc.com>
> ---
>  drivers/firmware/arm_scmi/perf.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/firmware/arm_scmi/perf.c b/drivers/firmware/arm_scmi/perf.c
> index 32f9a9acd3e9..c7e5a34b254b 100644
> --- a/drivers/firmware/arm_scmi/perf.c
> +++ b/drivers/firmware/arm_scmi/perf.c
> @@ -387,7 +387,7 @@ 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 for %s - ret:%d\n",
> +		dev_info(dev, FW_BUG "Failed to add opps_by_lvl at %d for %s - ret:%d\n",
>  			 opp->perf, dom->info.name, ret);

I was hoping you could make the error message a bit more informative as
well, for example, by saying that a duplicate opp level was ignored:

	arm-scmi arm-scmi.0.auto: [Firmware Bug]: Ignoring duplicate OPP 3417600 for NCC

or similar (e.g. as the current message looks like an error, with errno
and all, that indeed warrants warning level).

Perhaps with such a message you could even keep the warning level to
make it stand out more (if that's desirable) without the risk of scaring
users.

Johan


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

* Re: [PATCH V5 3/6] firmware: arm_scmi: Report duplicate opps as firmware bugs
  2024-11-01 14:09   ` Johan Hovold
@ 2024-11-04 13:50     ` Sibi Sankar
  2024-11-04 14:07       ` Cristian Marussi
  2024-11-04 14:09       ` Johan Hovold
  0 siblings, 2 replies; 21+ messages in thread
From: Sibi Sankar @ 2024-11-04 13:50 UTC (permalink / raw)
  To: Johan Hovold
  Cc: sudeep.holla, cristian.marussi, ulf.hansson, jassisinghbrar,
	dmitry.baryshkov, linux-kernel, arm-scmi, linux-arm-kernel,
	linux-arm-msm, konradybcio, linux-pm, tstrudel, rafael,
	Johan Hovold



On 11/1/24 19:39, Johan Hovold wrote:
> On Wed, Oct 30, 2024 at 06:25:09PM +0530, Sibi Sankar wrote:
>> Duplicate opps reported by buggy SCP firmware currently show up
>> as warnings even though the only functional impact is that the
>> level/index remain inaccessible. Make it less scary for the end
>> user by using dev_info instead, along with FW_BUG tag.
>>
>> Suggested-by: Johan Hovold <johan+linaro@kernel.org>
>> Signed-off-by: Sibi Sankar <quic_sibis@quicinc.com>
>> ---
>>   drivers/firmware/arm_scmi/perf.c | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/firmware/arm_scmi/perf.c b/drivers/firmware/arm_scmi/perf.c
>> index 32f9a9acd3e9..c7e5a34b254b 100644
>> --- a/drivers/firmware/arm_scmi/perf.c
>> +++ b/drivers/firmware/arm_scmi/perf.c
>> @@ -387,7 +387,7 @@ 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 for %s - ret:%d\n",
>> +		dev_info(dev, FW_BUG "Failed to add opps_by_lvl at %d for %s - ret:%d\n",
>>   			 opp->perf, dom->info.name, ret);
> 
> I was hoping you could make the error message a bit more informative as
> well, for example, by saying that a duplicate opp level was ignored:
> 
> 	arm-scmi arm-scmi.0.auto: [Firmware Bug]: Ignoring duplicate OPP 3417600 for NCC

I did think about doing something similar but xa_insert can fail
with both -EXIST (duplicate) and -ENOMEM, so the we can't really
use term duplicate when insert fails. I can add the perf level
though to the message though.

-Sibi

> 
> or similar (e.g. as the current message looks like an error, with errno
> and all, that indeed warrants warning level).
> 
> Perhaps with such a message you could even keep the warning level to
> make it stand out more (if that's desirable) without the risk of scaring
> users.
> 
> Johan


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

* Re: [PATCH V5 3/6] firmware: arm_scmi: Report duplicate opps as firmware bugs
  2024-11-04 13:50     ` Sibi Sankar
@ 2024-11-04 14:07       ` Cristian Marussi
  2024-11-04 14:09       ` Johan Hovold
  1 sibling, 0 replies; 21+ messages in thread
From: Cristian Marussi @ 2024-11-04 14:07 UTC (permalink / raw)
  To: Sibi Sankar
  Cc: Johan Hovold, sudeep.holla, cristian.marussi, ulf.hansson,
	jassisinghbrar, dmitry.baryshkov, linux-kernel, arm-scmi,
	linux-arm-kernel, linux-arm-msm, konradybcio, linux-pm, tstrudel,
	rafael, Johan Hovold

On Mon, Nov 04, 2024 at 07:20:01PM +0530, Sibi Sankar wrote:
> 
> 
> On 11/1/24 19:39, Johan Hovold wrote:
> > On Wed, Oct 30, 2024 at 06:25:09PM +0530, Sibi Sankar wrote:
> > > Duplicate opps reported by buggy SCP firmware currently show up
> > > as warnings even though the only functional impact is that the
> > > level/index remain inaccessible. Make it less scary for the end
> > > user by using dev_info instead, along with FW_BUG tag.
> > > 
> > > Suggested-by: Johan Hovold <johan+linaro@kernel.org>
> > > Signed-off-by: Sibi Sankar <quic_sibis@quicinc.com>
> > > ---
> > >   drivers/firmware/arm_scmi/perf.c | 4 ++--
> > >   1 file changed, 2 insertions(+), 2 deletions(-)
> > > 
> > > diff --git a/drivers/firmware/arm_scmi/perf.c b/drivers/firmware/arm_scmi/perf.c
> > > index 32f9a9acd3e9..c7e5a34b254b 100644
> > > --- a/drivers/firmware/arm_scmi/perf.c
> > > +++ b/drivers/firmware/arm_scmi/perf.c
> > > @@ -387,7 +387,7 @@ 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 for %s - ret:%d\n",
> > > +		dev_info(dev, FW_BUG "Failed to add opps_by_lvl at %d for %s - ret:%d\n",
> > >   			 opp->perf, dom->info.name, ret);
> > 
> > I was hoping you could make the error message a bit more informative as
> > well, for example, by saying that a duplicate opp level was ignored:
> > 
> > 	arm-scmi arm-scmi.0.auto: [Firmware Bug]: Ignoring duplicate OPP 3417600 for NCC
> 
> I did think about doing something similar but xa_insert can fail
> with both -EXIST (duplicate) and -ENOMEM, so the we can't really
> use term duplicate when insert fails. I can add the perf level
> though to the message though.
> 

It is the caller iter_perf_levels_process_response() of the above
helpers that is in charge to check the retval and decide what to do:
if it is a -EBUSY it just bails out returning 0 (SKIP) otherwise returns
the error... (and anyway the warn/info had already been given)

Originally the message was generic exactly for this reason...making some
noise to have fw/guys fix it and carry on...or fail completely the otehr
way...

I suppose you should move the error message in the caller if you want
to attain this level of information for the user...if not you are also
making noise potentially for nothing by saying FW_BUG on an -ENOMEM...

....anyway, on the otehr side, on the -ENOMEM path there is probably
really no need to say anything in any case...things are going terribly
wrong and you will notice soon in the form of a total failure of the stack,
most probably.

Thanks,
Cristian


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

* Re: [PATCH V5 3/6] firmware: arm_scmi: Report duplicate opps as firmware bugs
  2024-11-04 13:50     ` Sibi Sankar
  2024-11-04 14:07       ` Cristian Marussi
@ 2024-11-04 14:09       ` Johan Hovold
  2024-11-06  7:20         ` Sudeep Holla
  1 sibling, 1 reply; 21+ messages in thread
From: Johan Hovold @ 2024-11-04 14:09 UTC (permalink / raw)
  To: Sibi Sankar
  Cc: sudeep.holla, cristian.marussi, ulf.hansson, jassisinghbrar,
	dmitry.baryshkov, linux-kernel, arm-scmi, linux-arm-kernel,
	linux-arm-msm, konradybcio, linux-pm, tstrudel, rafael,
	Johan Hovold

On Mon, Nov 04, 2024 at 07:20:01PM +0530, Sibi Sankar wrote:
> On 11/1/24 19:39, Johan Hovold wrote:
> > On Wed, Oct 30, 2024 at 06:25:09PM +0530, Sibi Sankar wrote:

> >> @@ -387,7 +387,7 @@ 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 for %s - ret:%d\n",
> >> +		dev_info(dev, FW_BUG "Failed to add opps_by_lvl at %d for %s - ret:%d\n",
> >>   			 opp->perf, dom->info.name, ret);
> > 
> > I was hoping you could make the error message a bit more informative as
> > well, for example, by saying that a duplicate opp level was ignored:
> > 
> > 	arm-scmi arm-scmi.0.auto: [Firmware Bug]: Ignoring duplicate OPP 3417600 for NCC
> 
> I did think about doing something similar but xa_insert can fail
> with both -EXIST (duplicate) and -ENOMEM, so the we can't really
> use term duplicate when insert fails. I can add the perf level
> though to the message though.

We generally don't log errors for memory allocation failures (e.g. as
that would already have been taken care of by the allocators, if that is
the source of the -ENOMEM).

But either way you should be able to check the errno to determine if
this is due to a duplicate entry or not.

Johan


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

* Re: [PATCH V5 3/6] firmware: arm_scmi: Report duplicate opps as firmware bugs
  2024-10-30 12:55 ` [PATCH V5 3/6] firmware: arm_scmi: Report duplicate opps as firmware bugs Sibi Sankar
                     ` (2 preceding siblings ...)
  2024-11-01 14:09   ` Johan Hovold
@ 2024-11-06  7:07   ` Sudeep Holla
  3 siblings, 0 replies; 21+ messages in thread
From: Sudeep Holla @ 2024-11-06  7:07 UTC (permalink / raw)
  To: Sibi Sankar
  Cc: cristian.marussi, johan, ulf.hansson, jassisinghbrar,
	dmitry.baryshkov, linux-kernel, arm-scmi, linux-arm-kernel,
	linux-arm-msm, konradybcio, linux-pm, tstrudel, rafael,
	Johan Hovold

On Wed, Oct 30, 2024 at 06:25:09PM +0530, Sibi Sankar wrote:
> Duplicate opps reported by buggy SCP firmware currently show up
> as warnings even though the only functional impact is that the
> level/index remain inaccessible. Make it less scary for the end
> user by using dev_info instead, along with FW_BUG tag.
> 
> Suggested-by: Johan Hovold <johan+linaro@kernel.org>

Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>

-- 
Regards,
Sudeep


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

* Re: [PATCH V5 0/6] firmware: arm_scmi: Misc Fixes
  2024-10-30 16:28   ` Cristian Marussi
@ 2024-11-06  7:12     ` Sudeep Holla
  2024-11-12 15:56       ` Ulf Hansson
  0 siblings, 1 reply; 21+ messages in thread
From: Sudeep Holla @ 2024-11-06  7:12 UTC (permalink / raw)
  To: Cristian Marussi
  Cc: Ulf Hansson, Sibi Sankar, johan, jassisinghbrar, dmitry.baryshkov,
	linux-kernel, arm-scmi, linux-arm-kernel, linux-arm-msm,
	konradybcio, linux-pm, tstrudel, rafael

On Wed, Oct 30, 2024 at 04:28:41PM +0000, Cristian Marussi wrote:
> On Wed, Oct 30, 2024 at 05:19:39PM +0100, Ulf Hansson wrote:
> > On Wed, 30 Oct 2024 at 13:55, Sibi Sankar <quic_sibis@quicinc.com> wrote:
> > >
> > > The series addresses the kernel warnings reported by Johan at [1] and are
> > > are required to X1E cpufreq device tree changes to land.
> > >
> > > [1] - https://lore.kernel.org/lkml/ZoQjAWse2YxwyRJv@hovoldconsulting.com/
> > >
> > > Duplicate levels:
> > > arm-scmi arm-scmi.0.auto: Level 2976000 Power 218062 Latency 30us Ifreq 2976000 Index 10
> > > arm-scmi arm-scmi.0.auto: Level 3206400 Power 264356 Latency 30us Ifreq 3206400 Index 11
> > > arm-scmi arm-scmi.0.auto: Level 3417600 Power 314966 Latency 30us Ifreq 3417600 Index 12
> > > arm-scmi arm-scmi.0.auto: Failed to add opps_by_lvl at 3417600 for NCC - ret:-16
> > > arm-scmi arm-scmi.0.auto: Failed to add opps_by_lvl at 3417600 for NCC - ret:-16
> > > arm-scmi arm-scmi.0.auto: Level 4012800 Power 528848 Latency 30us Ifreq 4012800 Index 15
> > >
> > > ^^ exist because SCP reports duplicate values for the highest sustainable
> > > freq for perf domains 1 and 2. These are the only freqs that appear as
> > > duplicates and will be fixed with a firmware update. FWIW the warnings
> > > that we are addressing in this series will also get fixed by a firmware
> > > update but they still have to land for devices already out in the wild.
> > >
> > > V4:
> > > * Rework debugfs node creation patch [Ulf/Dmitry]
> > > * Reduce report level to dev_info and tag it with FW_BUG [Johan/Dmitry]
> > > * Add cc stable and err logs to patch 1 commit message [Johan]
> > 
> > Patch4 and patch5 applied for fixes to my pmdomain tree - and by
> > adding a stable tag to them, thanks!
> > 
> > Potentially I could help to take the other patches too, to keep things
> > together, but in that case I need confirmation that's okay to do so.
> 
> SCMI patches in these series are all reviewed (all but one even by Sudeep)
> so it is really up to Sudeep preference...(who is travelling now so it could
> take a bit to reply)

I have added my reviewed by now.

> ...moreover I am not sure if the SCMI patches in this
> series could end up with wome trivial conflicts against the scmi patches
> already queued at
> 
> 	sudeep/for-next/scmi/updates
> 
> (at least the perf related ones 2 and 3 probably not)
>

I did a quick check and no conflicts were observed. Let me know if you need
a branch with first 3 patches, but I need to do that today or after Sunday
as I will away from my computer for few more days again from tomorrow.

Let me know ASAP.

-- 
Regards,
Sudeep


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

* Re: [PATCH V5 3/6] firmware: arm_scmi: Report duplicate opps as firmware bugs
  2024-11-04 14:09       ` Johan Hovold
@ 2024-11-06  7:20         ` Sudeep Holla
  0 siblings, 0 replies; 21+ messages in thread
From: Sudeep Holla @ 2024-11-06  7:20 UTC (permalink / raw)
  To: Johan Hovold
  Cc: Sibi Sankar, cristian.marussi, ulf.hansson, jassisinghbrar,
	dmitry.baryshkov, linux-kernel, arm-scmi, linux-arm-kernel,
	linux-arm-msm, konradybcio, linux-pm, tstrudel, rafael,
	Johan Hovold

On Mon, Nov 04, 2024 at 03:09:12PM +0100, Johan Hovold wrote:
> On Mon, Nov 04, 2024 at 07:20:01PM +0530, Sibi Sankar wrote:
> > On 11/1/24 19:39, Johan Hovold wrote:
> > > On Wed, Oct 30, 2024 at 06:25:09PM +0530, Sibi Sankar wrote:
> 
> > >> @@ -387,7 +387,7 @@ 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 for %s - ret:%d\n",
> > >> +		dev_info(dev, FW_BUG "Failed to add opps_by_lvl at %d for %s - ret:%d\n",
> > >>   			 opp->perf, dom->info.name, ret);
> > > 
> > > I was hoping you could make the error message a bit more informative as
> > > well, for example, by saying that a duplicate opp level was ignored:
> > > 
> > > 	arm-scmi arm-scmi.0.auto: [Firmware Bug]: Ignoring duplicate OPP 3417600 for NCC
> > 
> > I did think about doing something similar but xa_insert can fail
> > with both -EXIST (duplicate) and -ENOMEM, so the we can't really
> > use term duplicate when insert fails. I can add the perf level
> > though to the message though.
> 
> We generally don't log errors for memory allocation failures (e.g. as
> that would already have been taken care of by the allocators, if that is
> the source of the -ENOMEM).
> 
> But either way you should be able to check the errno to determine if
> this is due to a duplicate entry or not.

Everyone has valid reasons for their argument here, so we need to find
a safe middle ground. Will stating it as [Possible Firmware Bug] be any
useful ? If there is -ENOMEM, other error messages will be seen before
this and user can ignore this error until that memory issue is fixed ?

-- 
Regards,
Sudeep


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

* Re: [PATCH V5 0/6] firmware: arm_scmi: Misc Fixes
  2024-11-06  7:12     ` Sudeep Holla
@ 2024-11-12 15:56       ` Ulf Hansson
  2024-11-12 17:19         ` Johan Hovold
  0 siblings, 1 reply; 21+ messages in thread
From: Ulf Hansson @ 2024-11-12 15:56 UTC (permalink / raw)
  To: Sudeep Holla, Sibi Sankar
  Cc: Cristian Marussi, johan, jassisinghbrar, dmitry.baryshkov,
	linux-kernel, arm-scmi, linux-arm-kernel, linux-arm-msm,
	konradybcio, linux-pm, tstrudel, rafael

On Wed, 6 Nov 2024 at 08:12, Sudeep Holla <sudeep.holla@arm.com> wrote:
>
> On Wed, Oct 30, 2024 at 04:28:41PM +0000, Cristian Marussi wrote:
> > On Wed, Oct 30, 2024 at 05:19:39PM +0100, Ulf Hansson wrote:
> > > On Wed, 30 Oct 2024 at 13:55, Sibi Sankar <quic_sibis@quicinc.com> wrote:
> > > >
> > > > The series addresses the kernel warnings reported by Johan at [1] and are
> > > > are required to X1E cpufreq device tree changes to land.
> > > >
> > > > [1] - https://lore.kernel.org/lkml/ZoQjAWse2YxwyRJv@hovoldconsulting.com/
> > > >
> > > > Duplicate levels:
> > > > arm-scmi arm-scmi.0.auto: Level 2976000 Power 218062 Latency 30us Ifreq 2976000 Index 10
> > > > arm-scmi arm-scmi.0.auto: Level 3206400 Power 264356 Latency 30us Ifreq 3206400 Index 11
> > > > arm-scmi arm-scmi.0.auto: Level 3417600 Power 314966 Latency 30us Ifreq 3417600 Index 12
> > > > arm-scmi arm-scmi.0.auto: Failed to add opps_by_lvl at 3417600 for NCC - ret:-16
> > > > arm-scmi arm-scmi.0.auto: Failed to add opps_by_lvl at 3417600 for NCC - ret:-16
> > > > arm-scmi arm-scmi.0.auto: Level 4012800 Power 528848 Latency 30us Ifreq 4012800 Index 15
> > > >
> > > > ^^ exist because SCP reports duplicate values for the highest sustainable
> > > > freq for perf domains 1 and 2. These are the only freqs that appear as
> > > > duplicates and will be fixed with a firmware update. FWIW the warnings
> > > > that we are addressing in this series will also get fixed by a firmware
> > > > update but they still have to land for devices already out in the wild.
> > > >
> > > > V4:
> > > > * Rework debugfs node creation patch [Ulf/Dmitry]
> > > > * Reduce report level to dev_info and tag it with FW_BUG [Johan/Dmitry]
> > > > * Add cc stable and err logs to patch 1 commit message [Johan]
> > >
> > > Patch4 and patch5 applied for fixes to my pmdomain tree - and by
> > > adding a stable tag to them, thanks!
> > >
> > > Potentially I could help to take the other patches too, to keep things
> > > together, but in that case I need confirmation that's okay to do so.
> >
> > SCMI patches in these series are all reviewed (all but one even by Sudeep)
> > so it is really up to Sudeep preference...(who is travelling now so it could
> > take a bit to reply)
>
> I have added my reviewed by now.
>
> > ...moreover I am not sure if the SCMI patches in this
> > series could end up with wome trivial conflicts against the scmi patches
> > already queued at
> >
> >       sudeep/for-next/scmi/updates
> >
> > (at least the perf related ones 2 and 3 probably not)
> >
>
> I did a quick check and no conflicts were observed. Let me know if you need
> a branch with first 3 patches, but I need to do that today or after Sunday
> as I will away from my computer for few more days again from tomorrow.
>
> Let me know ASAP.
>
> --
> Regards,
> Sudeep

Sorry for the delay. I have picked up the remaining patches from this
series. All applied for fixes and by adding stable tags to them,
thanks!

Kind regards
Uffe


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

* Re: [PATCH V5 0/6] firmware: arm_scmi: Misc Fixes
  2024-11-12 15:56       ` Ulf Hansson
@ 2024-11-12 17:19         ` Johan Hovold
  2024-11-12 18:48           ` Ulf Hansson
  0 siblings, 1 reply; 21+ messages in thread
From: Johan Hovold @ 2024-11-12 17:19 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: Sudeep Holla, Sibi Sankar, Cristian Marussi, jassisinghbrar,
	dmitry.baryshkov, linux-kernel, arm-scmi, linux-arm-kernel,
	linux-arm-msm, konradybcio, linux-pm, tstrudel, rafael

On Tue, Nov 12, 2024 at 04:56:26PM +0100, Ulf Hansson wrote:
> On Wed, 6 Nov 2024 at 08:12, Sudeep Holla <sudeep.holla@arm.com> wrote:
> > On Wed, Oct 30, 2024 at 04:28:41PM +0000, Cristian Marussi wrote:
> > > On Wed, Oct 30, 2024 at 05:19:39PM +0100, Ulf Hansson wrote:
> > > > On Wed, 30 Oct 2024 at 13:55, Sibi Sankar <quic_sibis@quicinc.com> wrote:
> > > > >
> > > > > The series addresses the kernel warnings reported by Johan at [1] and are
> > > > > are required to X1E cpufreq device tree changes to land.
> > > > >
> > > > > [1] - https://lore.kernel.org/lkml/ZoQjAWse2YxwyRJv@hovoldconsulting.com/
> > > > >
> > > > > Duplicate levels:
> > > > > arm-scmi arm-scmi.0.auto: Level 2976000 Power 218062 Latency 30us Ifreq 2976000 Index 10
> > > > > arm-scmi arm-scmi.0.auto: Level 3206400 Power 264356 Latency 30us Ifreq 3206400 Index 11
> > > > > arm-scmi arm-scmi.0.auto: Level 3417600 Power 314966 Latency 30us Ifreq 3417600 Index 12
> > > > > arm-scmi arm-scmi.0.auto: Failed to add opps_by_lvl at 3417600 for NCC - ret:-16
> > > > > arm-scmi arm-scmi.0.auto: Failed to add opps_by_lvl at 3417600 for NCC - ret:-16
> > > > > arm-scmi arm-scmi.0.auto: Level 4012800 Power 528848 Latency 30us Ifreq 4012800 Index 15
> > > > >
> > > > > ^^ exist because SCP reports duplicate values for the highest sustainable
> > > > > freq for perf domains 1 and 2. These are the only freqs that appear as
> > > > > duplicates and will be fixed with a firmware update. FWIW the warnings
> > > > > that we are addressing in this series will also get fixed by a firmware
> > > > > update but they still have to land for devices already out in the wild.
> > > > >
> > > > > V4:
> > > > > * Rework debugfs node creation patch [Ulf/Dmitry]
> > > > > * Reduce report level to dev_info and tag it with FW_BUG [Johan/Dmitry]
> > > > > * Add cc stable and err logs to patch 1 commit message [Johan]

> Sorry for the delay. I have picked up the remaining patches from this
> series. All applied for fixes and by adding stable tags to them,
> thanks!

As I reported here:

	https://lore.kernel.org/lkml/ZyTQ9QD1tEkhQ9eu@hovoldconsulting.com/

I'm seeing a hard reset on the x1e80100 CRD and Lenovo ThinkPad T14s
when accessing the cpufreq sysfs attributes.

Sibi tracked it down to the first patch in this series ("firmware:
arm_scmi: Ensure that the message-id supports fastchannel") and
reverting that one indeed fixes the reset.

Unfortunately this was only discussed on IRC and was never reported in
this thread.

Ulf, could you please drop the first patch again until we've figured out
how best to handle this?

Johan


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

* Re: [PATCH V5 0/6] firmware: arm_scmi: Misc Fixes
  2024-11-12 17:19         ` Johan Hovold
@ 2024-11-12 18:48           ` Ulf Hansson
  0 siblings, 0 replies; 21+ messages in thread
From: Ulf Hansson @ 2024-11-12 18:48 UTC (permalink / raw)
  To: Johan Hovold
  Cc: Sudeep Holla, Sibi Sankar, Cristian Marussi, jassisinghbrar,
	dmitry.baryshkov, linux-kernel, arm-scmi, linux-arm-kernel,
	linux-arm-msm, konradybcio, linux-pm, tstrudel, rafael

On Tue, 12 Nov 2024 at 18:20, Johan Hovold <johan@kernel.org> wrote:
>
> On Tue, Nov 12, 2024 at 04:56:26PM +0100, Ulf Hansson wrote:
> > On Wed, 6 Nov 2024 at 08:12, Sudeep Holla <sudeep.holla@arm.com> wrote:
> > > On Wed, Oct 30, 2024 at 04:28:41PM +0000, Cristian Marussi wrote:
> > > > On Wed, Oct 30, 2024 at 05:19:39PM +0100, Ulf Hansson wrote:
> > > > > On Wed, 30 Oct 2024 at 13:55, Sibi Sankar <quic_sibis@quicinc.com> wrote:
> > > > > >
> > > > > > The series addresses the kernel warnings reported by Johan at [1] and are
> > > > > > are required to X1E cpufreq device tree changes to land.
> > > > > >
> > > > > > [1] - https://lore.kernel.org/lkml/ZoQjAWse2YxwyRJv@hovoldconsulting.com/
> > > > > >
> > > > > > Duplicate levels:
> > > > > > arm-scmi arm-scmi.0.auto: Level 2976000 Power 218062 Latency 30us Ifreq 2976000 Index 10
> > > > > > arm-scmi arm-scmi.0.auto: Level 3206400 Power 264356 Latency 30us Ifreq 3206400 Index 11
> > > > > > arm-scmi arm-scmi.0.auto: Level 3417600 Power 314966 Latency 30us Ifreq 3417600 Index 12
> > > > > > arm-scmi arm-scmi.0.auto: Failed to add opps_by_lvl at 3417600 for NCC - ret:-16
> > > > > > arm-scmi arm-scmi.0.auto: Failed to add opps_by_lvl at 3417600 for NCC - ret:-16
> > > > > > arm-scmi arm-scmi.0.auto: Level 4012800 Power 528848 Latency 30us Ifreq 4012800 Index 15
> > > > > >
> > > > > > ^^ exist because SCP reports duplicate values for the highest sustainable
> > > > > > freq for perf domains 1 and 2. These are the only freqs that appear as
> > > > > > duplicates and will be fixed with a firmware update. FWIW the warnings
> > > > > > that we are addressing in this series will also get fixed by a firmware
> > > > > > update but they still have to land for devices already out in the wild.
> > > > > >
> > > > > > V4:
> > > > > > * Rework debugfs node creation patch [Ulf/Dmitry]
> > > > > > * Reduce report level to dev_info and tag it with FW_BUG [Johan/Dmitry]
> > > > > > * Add cc stable and err logs to patch 1 commit message [Johan]
>
> > Sorry for the delay. I have picked up the remaining patches from this
> > series. All applied for fixes and by adding stable tags to them,
> > thanks!
>
> As I reported here:
>
>         https://lore.kernel.org/lkml/ZyTQ9QD1tEkhQ9eu@hovoldconsulting.com/
>
> I'm seeing a hard reset on the x1e80100 CRD and Lenovo ThinkPad T14s
> when accessing the cpufreq sysfs attributes.
>
> Sibi tracked it down to the first patch in this series ("firmware:
> arm_scmi: Ensure that the message-id supports fastchannel") and
> reverting that one indeed fixes the reset.
>
> Unfortunately this was only discussed on IRC and was never reported in
> this thread.
>
> Ulf, could you please drop the first patch again until we've figured out
> how best to handle this?

Done, thanks!

Kind regards
Uffe


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

end of thread, other threads:[~2024-11-12 18:56 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-30 12:55 [PATCH V5 0/6] firmware: arm_scmi: Misc Fixes Sibi Sankar
2024-10-30 12:55 ` [PATCH V5 1/6] firmware: arm_scmi: Ensure that the message-id supports fastchannel Sibi Sankar
2024-10-30 12:55 ` [PATCH V5 2/6] firmware: arm_scmi: Skip opp duplicates Sibi Sankar
2024-10-30 12:55 ` [PATCH V5 3/6] firmware: arm_scmi: Report duplicate opps as firmware bugs Sibi Sankar
2024-10-30 14:39   ` Cristian Marussi
2024-10-30 16:42   ` Florian Fainelli
2024-11-01 14:09   ` Johan Hovold
2024-11-04 13:50     ` Sibi Sankar
2024-11-04 14:07       ` Cristian Marussi
2024-11-04 14:09       ` Johan Hovold
2024-11-06  7:20         ` Sudeep Holla
2024-11-06  7:07   ` Sudeep Holla
2024-10-30 12:55 ` [PATCH V5 4/6] pmdomain: core: Add GENPD_FLAG_DEV_NAME_FW flag Sibi Sankar
2024-10-30 12:55 ` [PATCH V5 5/6] pmdomain: arm: Use FLAG_DEV_NAME_FW to ensure unique names Sibi Sankar
2024-10-30 12:55 ` [PATCH V5 6/6] mailbox: qcom-cpucp: Mark the irq with IRQF_NO_SUSPEND flag Sibi Sankar
2024-10-30 16:19 ` [PATCH V5 0/6] firmware: arm_scmi: Misc Fixes Ulf Hansson
2024-10-30 16:28   ` Cristian Marussi
2024-11-06  7:12     ` Sudeep Holla
2024-11-12 15:56       ` Ulf Hansson
2024-11-12 17:19         ` Johan Hovold
2024-11-12 18:48           ` Ulf Hansson

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).