diff mbox series

[v3,8/9] interconnect: qcom: rpm: Add a way to always set QoS registers

Message ID 20230116132152.405535-9-konrad.dybcio@linaro.org
State New
Headers show
Series [v3,1/9] interconnect: qcom: rpm: make QoS INVALID default, separate out driver data | expand

Commit Message

Konrad Dybcio Jan. 16, 2023, 1:21 p.m. UTC
On newer SoCs (there's no clear boundary, but probably "new enough"
means every interconnect provider is either BIMC or QNoC and there
are no old-style NoC hosts) we're expected to set QoS registers
regardless of the ap_owned param. Add a bool in the qcom_icc_provider
and make the logic assume it's okay to set the registers when it's
set.

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
---
 drivers/interconnect/qcom/icc-rpm.c | 2 +-
 drivers/interconnect/qcom/icc-rpm.h | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

Comments

Bryan O'Donoghue Jan. 17, 2023, 1:27 p.m. UTC | #1
On 16/01/2023 13:21, Konrad Dybcio wrote:
> On newer SoCs (there's no clear boundary, but probably "new enough"
> means every interconnect provider is either BIMC or QNoC and there
> are no old-style NoC hosts) we're expected to set QoS registers
> regardless of the ap_owned param. Add a bool in the qcom_icc_provider
> and make the logic assume it's okay to set the registers when it's
> set.
> 
> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
> ---
>   drivers/interconnect/qcom/icc-rpm.c | 2 +-
>   drivers/interconnect/qcom/icc-rpm.h | 2 ++
>   2 files changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/interconnect/qcom/icc-rpm.c b/drivers/interconnect/qcom/icc-rpm.c
> index 509cadf398e9..343e6021a93a 100644

On next-20230116,

git am < 
~/Downloads/v3-1-9-interconnect-qcom-rpm-make-QoS-INVALID-default-separate-out-driver-data.patch
Applying: interconnect: qcom: rpm: make QoS INVALID default, separate 
out driver data
Applying: interconnect: qcom: rpm: Add support for specifying channel num
Applying: interconnect: qcom: rpm: Rename icc desc clocks to bus_blocks
Applying: interconnect: qcom: rpm: Add a way to always set QoS registers

error: patch failed: drivers/interconnect/qcom/icc-rpm.c:243
error: drivers/interconnect/qcom/icc-rpm.c: patch does not apply
error: patch failed: drivers/interconnect/qcom/icc-rpm.h:28
error: drivers/interconnect/qcom/icc-rpm.h: patch does not apply
Patch failed at 0004 interconnect: qcom: rpm: Add a way to always set 
QoS registers
hint: Use 'git am --show-current-patch=diff' to see the failed patch

Should I pick up another series from elsewhere to apply this ?

---
bod
Konrad Dybcio Jan. 18, 2023, 12:49 p.m. UTC | #2
On 17.01.2023 14:27, Bryan O'Donoghue wrote:
> On 16/01/2023 13:21, Konrad Dybcio wrote:
>> On newer SoCs (there's no clear boundary, but probably "new enough"
>> means every interconnect provider is either BIMC or QNoC and there
>> are no old-style NoC hosts) we're expected to set QoS registers
>> regardless of the ap_owned param. Add a bool in the qcom_icc_provider
>> and make the logic assume it's okay to set the registers when it's
>> set.
>>
>> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
>> ---
>>   drivers/interconnect/qcom/icc-rpm.c | 2 +-
>>   drivers/interconnect/qcom/icc-rpm.h | 2 ++
>>   2 files changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/interconnect/qcom/icc-rpm.c b/drivers/interconnect/qcom/icc-rpm.c
>> index 509cadf398e9..343e6021a93a 100644
> 
> On next-20230116,
g fetch linux-next next-20230116
gco FETCH_HEAD
b4 am 20230116132152.405535-1-konrad.dybcio@linaro.org
g am ./v3_20230116_konrad_dybcio_the_great_interconnecification_fixation.mbx

Stosowanie: interconnect: qcom: rpm: make QoS INVALID default, separate out driver data
Stosowanie: interconnect: qcom: rpm: Always set QoS params on QNoC
Stosowanie: interconnect: qcom: rpm: Add support for specifying channel num
Stosowanie: interconnect: qcom: Sort kerneldoc entries
Stosowanie: interconnect: qcom: rpm: Rename icc desc clocks to bus_blocks
Stosowanie: interconnect: qcom: rpm: Rename icc provider num_clocks to num_bus_clocks
Stosowanie: interconnect: qcom: rpm: Handle interface clocks
Stosowanie: interconnect: qcom: rpm: Add a way to always set QoS registers
Stosowanie: interconnect: qcom: rpm: Don't use clk_get_optional for bus clocks anymore
(no errors)

Konrad
> 
> git am < ~/Downloads/v3-1-9-interconnect-qcom-rpm-make-QoS-INVALID-default-separate-out-driver-data.patch
> Applying: interconnect: qcom: rpm: make QoS INVALID default, separate out driver data
> Applying: interconnect: qcom: rpm: Add support for specifying channel num
> Applying: interconnect: qcom: rpm: Rename icc desc clocks to bus_blocks
> Applying: interconnect: qcom: rpm: Add a way to always set QoS registers
> 
> error: patch failed: drivers/interconnect/qcom/icc-rpm.c:243
> error: drivers/interconnect/qcom/icc-rpm.c: patch does not apply
> error: patch failed: drivers/interconnect/qcom/icc-rpm.h:28
> error: drivers/interconnect/qcom/icc-rpm.h: patch does not apply
> Patch failed at 0004 interconnect: qcom: rpm: Add a way to always set QoS registers
> hint: Use 'git am --show-current-patch=diff' to see the failed patch
> 
> Should I pick up another series from elsewhere to apply this ?
> 
> ---
> bod
Konrad Dybcio Jan. 18, 2023, 7:54 p.m. UTC | #3
On 16.01.2023 14:21, Konrad Dybcio wrote:
> On newer SoCs (there's no clear boundary, but probably "new enough"
> means every interconnect provider is either BIMC or QNoC and there
> are no old-style NoC hosts) we're expected to set QoS registers
> regardless of the ap_owned param. Add a bool in the qcom_icc_provider
> and make the logic assume it's okay to set the registers when it's
> set.
> 
> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
> ---
Argh, I only noticed now that this patch is incomplete,
missing setting the value in qnoc_probe() and adding a
similar struct member to qcom_icc_desc..

Konrad
>  drivers/interconnect/qcom/icc-rpm.c | 2 +-
>  drivers/interconnect/qcom/icc-rpm.h | 2 ++
>  2 files changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/interconnect/qcom/icc-rpm.c b/drivers/interconnect/qcom/icc-rpm.c
> index 509cadf398e9..343e6021a93a 100644
> --- a/drivers/interconnect/qcom/icc-rpm.c
> +++ b/drivers/interconnect/qcom/icc-rpm.c
> @@ -243,7 +243,7 @@ static int __qcom_icc_set(struct icc_node *n, struct qcom_icc_node *qn,
>  	bool vote_ap, vote_rpm;
>  	int ret;
>  
> -	if (qp->type == QCOM_ICC_QNOC) {
> +	if (qp->type == QCOM_ICC_QNOC || qp->always_set_qos) {
>  		vote_ap = true;
>  		vote_rpm = true;
>  	} else {
> diff --git a/drivers/interconnect/qcom/icc-rpm.h b/drivers/interconnect/qcom/icc-rpm.h
> index 729573f0d9fe..3c8888482a39 100644
> --- a/drivers/interconnect/qcom/icc-rpm.h
> +++ b/drivers/interconnect/qcom/icc-rpm.h
> @@ -28,6 +28,7 @@ enum qcom_icc_type {
>   * @type: the ICC provider type
>   * @regmap: regmap for QoS registers read/write access
>   * @qos_offset: offset to QoS registers
> + * @always_set_qos: whether to always set QoS registers regardless of bus type
>   * @bus_clk_rate: bus clock rate in Hz
>   * @bus_clks: the clk_bulk_data table of bus clocks
>   * @intf_clks: the clk_bulk_data table of interface clocks
> @@ -39,6 +40,7 @@ struct qcom_icc_provider {
>  	enum qcom_icc_type type;
>  	struct regmap *regmap;
>  	unsigned int qos_offset;
> +	bool always_set_qos;
>  	u64 bus_clk_rate[2];
>  	struct clk_bulk_data bus_clks[2];
>  	struct clk_bulk_data intf_clks[];
diff mbox series

Patch

diff --git a/drivers/interconnect/qcom/icc-rpm.c b/drivers/interconnect/qcom/icc-rpm.c
index 509cadf398e9..343e6021a93a 100644
--- a/drivers/interconnect/qcom/icc-rpm.c
+++ b/drivers/interconnect/qcom/icc-rpm.c
@@ -243,7 +243,7 @@  static int __qcom_icc_set(struct icc_node *n, struct qcom_icc_node *qn,
 	bool vote_ap, vote_rpm;
 	int ret;
 
-	if (qp->type == QCOM_ICC_QNOC) {
+	if (qp->type == QCOM_ICC_QNOC || qp->always_set_qos) {
 		vote_ap = true;
 		vote_rpm = true;
 	} else {
diff --git a/drivers/interconnect/qcom/icc-rpm.h b/drivers/interconnect/qcom/icc-rpm.h
index 729573f0d9fe..3c8888482a39 100644
--- a/drivers/interconnect/qcom/icc-rpm.h
+++ b/drivers/interconnect/qcom/icc-rpm.h
@@ -28,6 +28,7 @@  enum qcom_icc_type {
  * @type: the ICC provider type
  * @regmap: regmap for QoS registers read/write access
  * @qos_offset: offset to QoS registers
+ * @always_set_qos: whether to always set QoS registers regardless of bus type
  * @bus_clk_rate: bus clock rate in Hz
  * @bus_clks: the clk_bulk_data table of bus clocks
  * @intf_clks: the clk_bulk_data table of interface clocks
@@ -39,6 +40,7 @@  struct qcom_icc_provider {
 	enum qcom_icc_type type;
 	struct regmap *regmap;
 	unsigned int qos_offset;
+	bool always_set_qos;
 	u64 bus_clk_rate[2];
 	struct clk_bulk_data bus_clks[2];
 	struct clk_bulk_data intf_clks[];