All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] soc: qcom: llcc: Move struct llcc_slice_config to header
@ 2022-09-17  3:06 Guru Das Srinagesh
  2022-09-19 20:56 ` Bjorn Andersson
  0 siblings, 1 reply; 3+ messages in thread
From: Guru Das Srinagesh @ 2022-09-17  3:06 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson
  Cc: Konrad Dybcio, linux-arm-msm, linux-kernel, Guru Das Srinagesh

Move struct llcc_slice_config to header so that it can be reused by
other kernel modules.

Signed-off-by: Guru Das Srinagesh <quic_gurus@quicinc.com>
---
 drivers/soc/qcom/llcc-qcom.c       | 44 --------------------------------------
 include/linux/soc/qcom/llcc-qcom.h | 44 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 44 insertions(+), 44 deletions(-)

diff --git a/drivers/soc/qcom/llcc-qcom.c b/drivers/soc/qcom/llcc-qcom.c
index 38d7296..3e7326f 100644
--- a/drivers/soc/qcom/llcc-qcom.c
+++ b/drivers/soc/qcom/llcc-qcom.c
@@ -55,50 +55,6 @@
 #define LLCC_VERSION_2_0_0_0          0x02000000
 #define LLCC_VERSION_2_1_0_0          0x02010000
 
-/**
- * struct llcc_slice_config - Data associated with the llcc slice
- * @usecase_id: Unique id for the client's use case
- * @slice_id: llcc slice id for each client
- * @max_cap: The maximum capacity of the cache slice provided in KB
- * @priority: Priority of the client used to select victim line for replacement
- * @fixed_size: Boolean indicating if the slice has a fixed capacity
- * @bonus_ways: Bonus ways are additional ways to be used for any slice,
- *		if client ends up using more than reserved cache ways. Bonus
- *		ways are allocated only if they are not reserved for some
- *		other client.
- * @res_ways: Reserved ways for the cache slice, the reserved ways cannot
- *		be used by any other client than the one its assigned to.
- * @cache_mode: Each slice operates as a cache, this controls the mode of the
- *             slice: normal or TCM(Tightly Coupled Memory)
- * @probe_target_ways: Determines what ways to probe for access hit. When
- *                    configured to 1 only bonus and reserved ways are probed.
- *                    When configured to 0 all ways in llcc are probed.
- * @dis_cap_alloc: Disable capacity based allocation for a client
- * @retain_on_pc: If this bit is set and client has maintained active vote
- *               then the ways assigned to this client are not flushed on power
- *               collapse.
- * @activate_on_init: Activate the slice immediately after it is programmed
- * @write_scid_en: Bit enables write cache support for a given scid.
- * @write_scid_cacheable_en: Enables write cache cacheable support for a
- *			     given scid (not supported on v2 or older hardware).
- */
-struct llcc_slice_config {
-	u32 usecase_id;
-	u32 slice_id;
-	u32 max_cap;
-	u32 priority;
-	bool fixed_size;
-	u32 bonus_ways;
-	u32 res_ways;
-	u32 cache_mode;
-	u32 probe_target_ways;
-	bool dis_cap_alloc;
-	bool retain_on_pc;
-	bool activate_on_init;
-	bool write_scid_en;
-	bool write_scid_cacheable_en;
-};
-
 struct qcom_llcc_config {
 	const struct llcc_slice_config *sct_data;
 	int size;
diff --git a/include/linux/soc/qcom/llcc-qcom.h b/include/linux/soc/qcom/llcc-qcom.h
index 9ed5384..e84cd87 100644
--- a/include/linux/soc/qcom/llcc-qcom.h
+++ b/include/linux/soc/qcom/llcc-qcom.h
@@ -106,6 +106,50 @@ struct llcc_drv_data {
 	u32 version;
 };
 
+/**
+ * struct llcc_slice_config - Data associated with the llcc slice
+ * @usecase_id: Unique id for the client's use case
+ * @slice_id: llcc slice id for each client
+ * @max_cap: The maximum capacity of the cache slice provided in KB
+ * @priority: Priority of the client used to select victim line for replacement
+ * @fixed_size: Boolean indicating if the slice has a fixed capacity
+ * @bonus_ways: Bonus ways are additional ways to be used for any slice,
+ *		if client ends up using more than reserved cache ways. Bonus
+ *		ways are allocated only if they are not reserved for some
+ *		other client.
+ * @res_ways: Reserved ways for the cache slice, the reserved ways cannot
+ *		be used by any other client than the one its assigned to.
+ * @cache_mode: Each slice operates as a cache, this controls the mode of the
+ *             slice: normal or TCM(Tightly Coupled Memory)
+ * @probe_target_ways: Determines what ways to probe for access hit. When
+ *                    configured to 1 only bonus and reserved ways are probed.
+ *                    When configured to 0 all ways in llcc are probed.
+ * @dis_cap_alloc: Disable capacity based allocation for a client
+ * @retain_on_pc: If this bit is set and client has maintained active vote
+ *               then the ways assigned to this client are not flushed on power
+ *               collapse.
+ * @activate_on_init: Activate the slice immediately after it is programmed
+ * @write_scid_en: Bit enables write cache support for a given scid.
+ * @write_scid_cacheable_en: Enables write cache cacheable support for a
+ *			     given scid (not supported on v2 or older hardware).
+ */
+struct llcc_slice_config {
+	u32 usecase_id;
+	u32 slice_id;
+	u32 max_cap;
+	u32 priority;
+	bool fixed_size;
+	u32 bonus_ways;
+	u32 res_ways;
+	u32 cache_mode;
+	u32 probe_target_ways;
+	bool dis_cap_alloc;
+	bool retain_on_pc;
+	bool activate_on_init;
+	bool write_scid_en;
+	bool write_scid_cacheable_en;
+};
+
 #if IS_ENABLED(CONFIG_QCOM_LLCC)
 /**
  * llcc_slice_getd - get llcc slice descriptor
-- 
2.7.4


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

* Re: [PATCH 1/1] soc: qcom: llcc: Move struct llcc_slice_config to header
  2022-09-17  3:06 [PATCH 1/1] soc: qcom: llcc: Move struct llcc_slice_config to header Guru Das Srinagesh
@ 2022-09-19 20:56 ` Bjorn Andersson
  2022-09-20 16:28   ` Guru Das Srinagesh
  0 siblings, 1 reply; 3+ messages in thread
From: Bjorn Andersson @ 2022-09-19 20:56 UTC (permalink / raw)
  To: Guru Das Srinagesh; +Cc: Andy Gross, Konrad Dybcio, linux-arm-msm, linux-kernel

On Fri, Sep 16, 2022 at 08:06:40PM -0700, Guru Das Srinagesh wrote:
> Move struct llcc_slice_config to header so that it can be reused by
> other kernel modules.

Can you please continue this sentence to provide some concrete examples?
Will we see those other users posted upstream?

Thanks,
Bjorn

> 
> Signed-off-by: Guru Das Srinagesh <quic_gurus@quicinc.com>
> ---
>  drivers/soc/qcom/llcc-qcom.c       | 44 --------------------------------------
>  include/linux/soc/qcom/llcc-qcom.h | 44 ++++++++++++++++++++++++++++++++++++++
>  2 files changed, 44 insertions(+), 44 deletions(-)
> 
> diff --git a/drivers/soc/qcom/llcc-qcom.c b/drivers/soc/qcom/llcc-qcom.c
> index 38d7296..3e7326f 100644
> --- a/drivers/soc/qcom/llcc-qcom.c
> +++ b/drivers/soc/qcom/llcc-qcom.c
> @@ -55,50 +55,6 @@
>  #define LLCC_VERSION_2_0_0_0          0x02000000
>  #define LLCC_VERSION_2_1_0_0          0x02010000
>  
> -/**
> - * struct llcc_slice_config - Data associated with the llcc slice
> - * @usecase_id: Unique id for the client's use case
> - * @slice_id: llcc slice id for each client
> - * @max_cap: The maximum capacity of the cache slice provided in KB
> - * @priority: Priority of the client used to select victim line for replacement
> - * @fixed_size: Boolean indicating if the slice has a fixed capacity
> - * @bonus_ways: Bonus ways are additional ways to be used for any slice,
> - *		if client ends up using more than reserved cache ways. Bonus
> - *		ways are allocated only if they are not reserved for some
> - *		other client.
> - * @res_ways: Reserved ways for the cache slice, the reserved ways cannot
> - *		be used by any other client than the one its assigned to.
> - * @cache_mode: Each slice operates as a cache, this controls the mode of the
> - *             slice: normal or TCM(Tightly Coupled Memory)
> - * @probe_target_ways: Determines what ways to probe for access hit. When
> - *                    configured to 1 only bonus and reserved ways are probed.
> - *                    When configured to 0 all ways in llcc are probed.
> - * @dis_cap_alloc: Disable capacity based allocation for a client
> - * @retain_on_pc: If this bit is set and client has maintained active vote
> - *               then the ways assigned to this client are not flushed on power
> - *               collapse.
> - * @activate_on_init: Activate the slice immediately after it is programmed
> - * @write_scid_en: Bit enables write cache support for a given scid.
> - * @write_scid_cacheable_en: Enables write cache cacheable support for a
> - *			     given scid (not supported on v2 or older hardware).
> - */
> -struct llcc_slice_config {
> -	u32 usecase_id;
> -	u32 slice_id;
> -	u32 max_cap;
> -	u32 priority;
> -	bool fixed_size;
> -	u32 bonus_ways;
> -	u32 res_ways;
> -	u32 cache_mode;
> -	u32 probe_target_ways;
> -	bool dis_cap_alloc;
> -	bool retain_on_pc;
> -	bool activate_on_init;
> -	bool write_scid_en;
> -	bool write_scid_cacheable_en;
> -};
> -
>  struct qcom_llcc_config {
>  	const struct llcc_slice_config *sct_data;
>  	int size;
> diff --git a/include/linux/soc/qcom/llcc-qcom.h b/include/linux/soc/qcom/llcc-qcom.h
> index 9ed5384..e84cd87 100644
> --- a/include/linux/soc/qcom/llcc-qcom.h
> +++ b/include/linux/soc/qcom/llcc-qcom.h
> @@ -106,6 +106,50 @@ struct llcc_drv_data {
>  	u32 version;
>  };
>  
> +/**
> + * struct llcc_slice_config - Data associated with the llcc slice
> + * @usecase_id: Unique id for the client's use case
> + * @slice_id: llcc slice id for each client
> + * @max_cap: The maximum capacity of the cache slice provided in KB
> + * @priority: Priority of the client used to select victim line for replacement
> + * @fixed_size: Boolean indicating if the slice has a fixed capacity
> + * @bonus_ways: Bonus ways are additional ways to be used for any slice,
> + *		if client ends up using more than reserved cache ways. Bonus
> + *		ways are allocated only if they are not reserved for some
> + *		other client.
> + * @res_ways: Reserved ways for the cache slice, the reserved ways cannot
> + *		be used by any other client than the one its assigned to.
> + * @cache_mode: Each slice operates as a cache, this controls the mode of the
> + *             slice: normal or TCM(Tightly Coupled Memory)
> + * @probe_target_ways: Determines what ways to probe for access hit. When
> + *                    configured to 1 only bonus and reserved ways are probed.
> + *                    When configured to 0 all ways in llcc are probed.
> + * @dis_cap_alloc: Disable capacity based allocation for a client
> + * @retain_on_pc: If this bit is set and client has maintained active vote
> + *               then the ways assigned to this client are not flushed on power
> + *               collapse.
> + * @activate_on_init: Activate the slice immediately after it is programmed
> + * @write_scid_en: Bit enables write cache support for a given scid.
> + * @write_scid_cacheable_en: Enables write cache cacheable support for a
> + *			     given scid (not supported on v2 or older hardware).
> + */
> +struct llcc_slice_config {
> +	u32 usecase_id;
> +	u32 slice_id;
> +	u32 max_cap;
> +	u32 priority;
> +	bool fixed_size;
> +	u32 bonus_ways;
> +	u32 res_ways;
> +	u32 cache_mode;
> +	u32 probe_target_ways;
> +	bool dis_cap_alloc;
> +	bool retain_on_pc;
> +	bool activate_on_init;
> +	bool write_scid_en;
> +	bool write_scid_cacheable_en;
> +};
> +
>  #if IS_ENABLED(CONFIG_QCOM_LLCC)
>  /**
>   * llcc_slice_getd - get llcc slice descriptor
> -- 
> 2.7.4
> 

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

* Re: [PATCH 1/1] soc: qcom: llcc: Move struct llcc_slice_config to header
  2022-09-19 20:56 ` Bjorn Andersson
@ 2022-09-20 16:28   ` Guru Das Srinagesh
  0 siblings, 0 replies; 3+ messages in thread
From: Guru Das Srinagesh @ 2022-09-20 16:28 UTC (permalink / raw)
  To: Bjorn Andersson; +Cc: Andy Gross, Konrad Dybcio, linux-arm-msm, linux-kernel

On Sep 19 2022 15:56, Bjorn Andersson wrote:
> On Fri, Sep 16, 2022 at 08:06:40PM -0700, Guru Das Srinagesh wrote:
> > Move struct llcc_slice_config to header so that it can be reused by
> > other kernel modules.
> 
> Can you please continue this sentence to provide some concrete examples?
> Will we see those other users posted upstream?

There is an llcc debug module downstream that we're currently using to test the
llcc driver that uses this struct and has to copy the struct definition because
it's not in the header. I can check with the team about their plans to upstream
this driver.

Thank you.

Guru Das.

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

end of thread, other threads:[~2022-09-20 16:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-17  3:06 [PATCH 1/1] soc: qcom: llcc: Move struct llcc_slice_config to header Guru Das Srinagesh
2022-09-19 20:56 ` Bjorn Andersson
2022-09-20 16:28   ` Guru Das Srinagesh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.