Skip to content

Commit 397f802

Browse files
jhovoldsudeep-holla
authored andcommitted
firmware: arm_scmi: quirk: Force perf level get fastchannel
The Qualcomm SCP firmware in X1E machines like the Lenovo ThinkPad T14s does not set the FastChannel supported attribute bit for PERF_LEVEL_GET but crashes when falling back to regular messaging. Use the new SCMI quirk framework to force FastChannel initialisation for this implementation. Note that we can add an upper bound on the version matching when we learn which version has a fix (or limit matching using a SoC compatible string in the unlikely event that always enabling FC causes trouble somewhere). Link: https://lore.kernel.org/lkml/[email protected]/ Signed-off-by: Johan Hovold <[email protected]> Message-Id: <[email protected]> Signed-off-by: Sudeep Holla <[email protected]>
1 parent 7b487be commit 397f802

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

drivers/firmware/arm_scmi/driver.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1895,6 +1895,13 @@ struct scmi_msg_resp_desc_fc {
18951895
__le32 db_preserve_hmask;
18961896
};
18971897

1898+
#define QUIRK_PERF_FC_FORCE \
1899+
({ \
1900+
if (pi->proto->id == SCMI_PROTOCOL_PERF && \
1901+
message_id == 0x8 /* PERF_LEVEL_GET */) \
1902+
attributes |= BIT(0); \
1903+
})
1904+
18981905
static void
18991906
scmi_common_fastchannel_init(const struct scmi_protocol_handle *ph,
19001907
u8 describe_id, u32 message_id, u32 valid_size,
@@ -1915,6 +1922,7 @@ scmi_common_fastchannel_init(const struct scmi_protocol_handle *ph,
19151922

19161923
/* Check if the MSG_ID supports fastchannel */
19171924
ret = scmi_protocol_msg_check(ph, message_id, &attributes);
1925+
SCMI_QUIRK(perf_level_get_fc_force, QUIRK_PERF_FC_FORCE);
19181926
if (ret || !MSG_SUPPORTS_FASTCHANNEL(attributes)) {
19191927
dev_dbg(ph->dev,
19201928
"Skip FC init for 0x%02X/%d domain:%d - ret:%d\n",

drivers/firmware/arm_scmi/quirks.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ struct scmi_quirk {
170170

171171
/* Global Quirks Definitions */
172172
DEFINE_SCMI_QUIRK(clock_rates_triplet_out_of_spec, NULL, NULL, NULL);
173+
DEFINE_SCMI_QUIRK(perf_level_get_fc_force, "Qualcomm", NULL, "0x20000-");
173174

174175
/*
175176
* Quirks Pointers Array
@@ -179,6 +180,7 @@ DEFINE_SCMI_QUIRK(clock_rates_triplet_out_of_spec, NULL, NULL, NULL);
179180
*/
180181
static struct scmi_quirk *scmi_quirks_table[] = {
181182
__DECLARE_SCMI_QUIRK_ENTRY(clock_rates_triplet_out_of_spec),
183+
__DECLARE_SCMI_QUIRK_ENTRY(perf_level_get_fc_force),
182184
NULL
183185
};
184186

drivers/firmware/arm_scmi/quirks.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,6 @@ static inline void scmi_quirks_enable(struct device *dev, const char *vend,
4747

4848
/* Quirk delarations */
4949
DECLARE_SCMI_QUIRK(clock_rates_triplet_out_of_spec);
50+
DECLARE_SCMI_QUIRK(perf_level_get_fc_force);
5051

5152
#endif /* _SCMI_QUIRKS_H */

0 commit comments

Comments
 (0)