Skip to content

Commit 112ffc7

Browse files
cris-masudeep-holla
authored andcommitted
firmware: arm_scmi: Relocate atomic_threshold to scmi_desc
Relocate the atomic_threshold field to scmi_desc and move the related code to scmi_transport_setup. No functional change. Signed-off-by: Cristian Marussi <[email protected]> Message-Id: <[email protected]> Signed-off-by: Sudeep Holla <[email protected]>
1 parent c091de2 commit 112ffc7

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

drivers/firmware/arm_scmi/common.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,12 @@ struct scmi_transport_ops {
229229
* be pending simultaneously in the system. May be overridden by the
230230
* get_max_msg op.
231231
* @max_msg_size: Maximum size of data payload per message that can be handled.
232+
* @atomic_threshold: Optional system wide DT-configured threshold, expressed
233+
* in microseconds, for atomic operations.
234+
* Only SCMI synchronous commands reported by the platform
235+
* to have an execution latency lesser-equal to the threshold
236+
* should be considered for atomic mode operation: such
237+
* decision is finally left up to the SCMI drivers.
232238
* @force_polling: Flag to force this whole transport to use SCMI core polling
233239
* mechanism instead of completion interrupts even if available.
234240
* @sync_cmds_completed_on_ret: Flag to indicate that the transport assures
@@ -247,6 +253,7 @@ struct scmi_desc {
247253
int max_rx_timeout_ms;
248254
int max_msg;
249255
int max_msg_size;
256+
unsigned int atomic_threshold;
250257
const bool force_polling;
251258
const bool sync_cmds_completed_on_ret;
252259
const bool atomic_enabled;

drivers/firmware/arm_scmi/driver.c

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -149,12 +149,6 @@ struct scmi_debug_info {
149149
* base protocol
150150
* @active_protocols: IDR storing device_nodes for protocols actually defined
151151
* in the DT and confirmed as implemented by fw.
152-
* @atomic_threshold: Optional system wide DT-configured threshold, expressed
153-
* in microseconds, for atomic operations.
154-
* Only SCMI synchronous commands reported by the platform
155-
* to have an execution latency lesser-equal to the threshold
156-
* should be considered for atomic mode operation: such
157-
* decision is finally left up to the SCMI drivers.
158152
* @notify_priv: Pointer to private data structure specific to notifications.
159153
* @node: List head
160154
* @users: Number of users of this instance
@@ -180,7 +174,6 @@ struct scmi_info {
180174
struct mutex protocols_mtx;
181175
u8 *protocols_imp;
182176
struct idr active_protocols;
183-
unsigned int atomic_threshold;
184177
void *notify_priv;
185178
struct list_head node;
186179
int users;
@@ -2445,7 +2438,7 @@ static bool scmi_is_transport_atomic(const struct scmi_handle *handle,
24452438
ret = info->desc->atomic_enabled &&
24462439
is_transport_polling_capable(info->desc);
24472440
if (ret && atomic_threshold)
2448-
*atomic_threshold = info->atomic_threshold;
2441+
*atomic_threshold = info->desc->atomic_threshold;
24492442

24502443
return ret;
24512444
}
@@ -2959,7 +2952,7 @@ static struct scmi_debug_info *scmi_debugfs_common_setup(struct scmi_info *info)
29592952
(char **)&dbg->name);
29602953

29612954
debugfs_create_u32("atomic_threshold_us", 0400, top_dentry,
2962-
&info->atomic_threshold);
2955+
(u32 *)&info->desc->atomic_threshold);
29632956

29642957
debugfs_create_str("type", 0400, trans, (char **)&dbg->type);
29652958

@@ -3069,6 +3062,13 @@ static const struct scmi_desc *scmi_transport_setup(struct device *dev)
30693062
trans->desc->max_rx_timeout_ms, trans->desc->max_msg_size,
30703063
trans->desc->max_msg);
30713064

3065+
/* System wide atomic threshold for atomic ops .. if any */
3066+
if (!of_property_read_u32(dev->of_node, "atomic-threshold-us",
3067+
&trans->desc->atomic_threshold))
3068+
dev_info(dev,
3069+
"SCMI System wide atomic threshold set to %u us\n",
3070+
trans->desc->atomic_threshold);
3071+
30723072
return trans->desc;
30733073
}
30743074

@@ -3118,13 +3118,6 @@ static int scmi_probe(struct platform_device *pdev)
31183118
handle->devm_protocol_acquire = scmi_devm_protocol_acquire;
31193119
handle->devm_protocol_get = scmi_devm_protocol_get;
31203120
handle->devm_protocol_put = scmi_devm_protocol_put;
3121-
3122-
/* System wide atomic threshold for atomic ops .. if any */
3123-
if (!of_property_read_u32(np, "atomic-threshold-us",
3124-
&info->atomic_threshold))
3125-
dev_info(dev,
3126-
"SCMI System wide atomic threshold set to %d us\n",
3127-
info->atomic_threshold);
31283121
handle->is_transport_atomic = scmi_is_transport_atomic;
31293122

31303123
/* Setup all channels described in the DT at first */

0 commit comments

Comments
 (0)