History log of /linux-master/drivers/firmware/arm_scmi/powercap.c
Revision Date Author Comments
# 17f243ad 11-Mar-2024 Pierre Gondois <pierre.gondois@arm.com>

firmware: arm_scmi: Fix wrong fastchannel initialization

Fastchannels are initialized with an incorrect index(POWERCAP_PAI_GET) in:
commit 2441caa84aac ("firmware: arm_scmi: Populate fast channel rate_limit")

Fix this and provide a correct index(POWERCAP_FC_PAI)

Fixes: 2441caa84aac ("firmware: arm_scmi: Populate fast channel rate_limit")
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/r/202403100744.7Op3PI8L-lkp@intel.com/
Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
Link: https://lore.kernel.org/r/20240311090413.1710725-1-pierre.gondois@arm.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>


# 2441caa8 22-Feb-2024 Pierre Gondois <pierre.gondois@arm.com>

firmware: arm_scmi: Populate fast channel rate_limit

Arm SCMI spec. v3.2, s4.5.3.12 PERFORMANCE_DESCRIBE_FASTCHANNEL
defines a per-domain rate_limit for performance requests:
"""
Rate Limit in microseconds, indicating the minimum time
required between successive requests. A value of 0
indicates that this field is not applicable or supported
on the platform.
""""
The field is first defined in SCMI v2.0.

Add support to fetch this value and advertise it through
a fast_switch_rate_limit() callback.

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
Reviewed-by: Cristian Marussi <cristian.marussi@arm.com>
Acked-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>


# e85beaf7 11-Feb-2024 Cristian Marussi <cristian.marussi@arm.com>

firmware: arm_scmi: Implement is_notify_supported callback in powercap protocol

Add a preliminary check to verify if the powercap protocol related notify
enable commands are supported at all by the SCMI platform, and then
provide the callback needed to allow the core SCMI notification
subsytem to do a fine-grain check if a specific resource domain
supports notifications.

Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Link: https://lore.kernel.org/r/20240212123233.1230090-10-cristian.marussi@arm.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>


# b5efc28a 01-Dec-2023 Cristian Marussi <cristian.marussi@arm.com>

firmware: arm_scmi: Add protocol versioning checks

Platform and agent supported protocols versions do not necessarily match.

When talking to an older SCMI platform, supporting only older protocol
versions, the kernel SCMI agent will downgrade the version of the used
protocol to match the platform and avoid compatibility issues.

In the case where the kernel/OSPM agent happens to communicate with a
newer platform which can support newer protocol versions unknown to
the agent, and potentially backward incompatible, the agent currently
carries on, silently, in a best-effort approach.

Note that the SCMI specification doesn't provide means to explicitly
detect the protocol versions used by the agents, neither it is required
to support multiple, older, protocol versions.

Add an explicit protocol version check to let the agent detect when this
version mismatch happens and warn the user about this condition.

Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Link: https://lore.kernel.org/r/20231201135858.2367651-1-cristian.marussi@arm.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>


# e4e6e8f1 14-Nov-2023 Cristian Marussi <cristian.marussi@arm.com>

firmware: arm_scmi: Add optional flags to extended names helper

Some recently added SCMI protocols needs an additional flags parameter to
be able to properly configure the command used to query the extended name
of a resource.

Modify extended_name_get helper accordingly.

Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Link: https://lore.kernel.org/r/20231114145449.3136412-1-cristian.marussi@arm.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>


# a10aa258 21-Sep-2023 Sudeep Holla <sudeep.holla@arm.com>

firmware: arm_scmi: Do not use !! on boolean when setting msg->flags

Both pc->async_powercap_cap_set and ignore_dresp are already boolean.
Use of !! on them is obviously dubious.

Sparse reports:
drivers/firmware/arm_scmi/powercap.c:363:17: warning: dubious: x & !y
drivers/firmware/arm_scmi/powercap.c:363:17: warning: dubious: x & !y

Remove the unnecessary !! and get rid of the warning.

Reviewed-by: Cristian Marussi <cristian.marussi@arm.com>
Link: https://lore.kernel.org/r/20230921085257.3125744-1-sudeep.holla@arm.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>


# 758cd5fc 31-May-2023 Cristian Marussi <cristian.marussi@arm.com>

firmware: arm_scmi: Add Powercap protocol enable support

SCMI powercap protocol v3.2 supports disabling the powercap on a zone
by zone basis by providing a zero valued powercap.

Expose new operations to enable/disable powercapping on a per-zone base.

Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Link: https://lore.kernel.org/r/20230531152039.2363181-3-cristian.marussi@arm.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>


# 4e1a53b4 31-May-2023 Cristian Marussi <cristian.marussi@arm.com>

firmware: arm_scmi: Refactor the internal powercap get/set helpers

Refactor the SCMI powercap internal get/set helpers in preparation to
adding the powercap protocol enable/disable support.

Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Link: https://lore.kernel.org/r/20230531152039.2363181-2-cristian.marussi@arm.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>


# b27d04d5 04-Jul-2022 Cristian Marussi <cristian.marussi@arm.com>

firmware: arm_scmi: Use fast channel tracing

Make use of SCMI fast channel event tracing.

Link: https://lore.kernel.org/r/20220704102241.2988447-7-cristian.marussi@arm.com
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>


# 855aa26e 04-Jul-2022 Cristian Marussi <cristian.marussi@arm.com>

firmware: arm_scmi: Add SCMI v3.1 powercap fast channels support

Add SCMIv3.1 powercap protocol fast channel support using common helpers
provided by the SCMI core with scmi_proto_helpers_ops operations.

Link: https://lore.kernel.org/r/20220704102241.2988447-5-cristian.marussi@arm.com
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>


# 0316f99c 04-Jul-2022 Cristian Marussi <cristian.marussi@arm.com>

firmware: arm_scmi: Add SCMI v3.1 powercap protocol basic support

Add support for SCMI v3.1 powercap protocol, with the exception of powercap
fast channels, exposing all the new related powercap protocol operations as
usual in include/linux/scmi_protocol.h.

Link: https://lore.kernel.org/r/20220704102241.2988447-3-cristian.marussi@arm.com
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>