soc.lore.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] soc: hisilicon: kunpeng_hccs: add dependency and enhance verification
@ 2024-04-03  8:19 Huisong Li
  2024-04-03  8:19 ` [PATCH 1/2] soc: hisilicon: kunpeng_hccs: Add the check for obtaining complete port attribute Huisong Li
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Huisong Li @ 2024-04-03  8:19 UTC (permalink / raw)
  To: xuwei5
  Cc: linux-kernel, soc, linux-arm-kernel, Jonathan.Cameron,
	liuyonglong, lihuisong

Add PCC dependency and enhance verification during the probe phase.

Huisong Li (2):
  soc: hisilicon: kunpeng_hccs: Add the check for obtaining complete
    port attribute
  soc: hisilicon: kunpeng_hccs: replace MAILBOX dependency with PCC

 drivers/soc/hisilicon/Kconfig        | 2 +-
 drivers/soc/hisilicon/kunpeng_hccs.c | 6 ++++++
 2 files changed, 7 insertions(+), 1 deletion(-)

-- 
2.22.0


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

* [PATCH 1/2] soc: hisilicon: kunpeng_hccs: Add the check for obtaining complete port attribute
  2024-04-03  8:19 [PATCH 0/2] soc: hisilicon: kunpeng_hccs: add dependency and enhance verification Huisong Li
@ 2024-04-03  8:19 ` Huisong Li
  2024-04-15  1:17   ` Wei Xu
  2024-04-03  8:19 ` [PATCH 2/2] soc: hisilicon: kunpeng_hccs: replace MAILBOX dependency with PCC Huisong Li
  2024-04-17  9:47 ` [PATCH v2 0/2] soc: hisilicon: kunpeng_hccs: add dependency and enhance verification Huisong Li
  2 siblings, 1 reply; 9+ messages in thread
From: Huisong Li @ 2024-04-03  8:19 UTC (permalink / raw)
  To: xuwei5
  Cc: linux-kernel, soc, linux-arm-kernel, Jonathan.Cameron,
	liuyonglong, lihuisong

The hccs_get_all_port_attr() is used to obtained the attribute of all
ports on a specified DIE from firmware. However, this interface doesn't
ensure whether firmware reports the complete attribute of all ports or not.
So this patch adds the check for this.

Signed-off-by: Huisong Li <lihuisong@huawei.com>
---
 drivers/soc/hisilicon/kunpeng_hccs.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/soc/hisilicon/kunpeng_hccs.c b/drivers/soc/hisilicon/kunpeng_hccs.c
index 9ff70b38e5e9..bb69a95b5f2d 100644
--- a/drivers/soc/hisilicon/kunpeng_hccs.c
+++ b/drivers/soc/hisilicon/kunpeng_hccs.c
@@ -556,6 +556,12 @@ static int hccs_get_all_port_attr(struct hccs_dev *hdev,
 		start_id = rsp_head.next_id;
 	}
 
+	if (left_buf_len != 0) {
+		dev_err(hdev->dev, "do not get the expected port number(%u) attribute.\n",
+			size);
+		return -EINVAL;
+	}
+
 	return 0;
 }
 
-- 
2.22.0


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

* [PATCH 2/2] soc: hisilicon: kunpeng_hccs: replace MAILBOX dependency with PCC
  2024-04-03  8:19 [PATCH 0/2] soc: hisilicon: kunpeng_hccs: add dependency and enhance verification Huisong Li
  2024-04-03  8:19 ` [PATCH 1/2] soc: hisilicon: kunpeng_hccs: Add the check for obtaining complete port attribute Huisong Li
@ 2024-04-03  8:19 ` Huisong Li
  2024-04-17  9:47 ` [PATCH v2 0/2] soc: hisilicon: kunpeng_hccs: add dependency and enhance verification Huisong Li
  2 siblings, 0 replies; 9+ messages in thread
From: Huisong Li @ 2024-04-03  8:19 UTC (permalink / raw)
  To: xuwei5
  Cc: linux-kernel, soc, linux-arm-kernel, Jonathan.Cameron,
	liuyonglong, lihuisong

The kunpeng_hccs driver depands on Platform Communication Channel Driver.
If PCC driver is not enabled, this driver fails to probe.
Seeing as how PCC driver depands on MAILBOX. so replace MAILBOX dependency
with PCC.

Signed-off-by: Huisong Li <lihuisong@huawei.com>
---
 drivers/soc/hisilicon/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/soc/hisilicon/Kconfig b/drivers/soc/hisilicon/Kconfig
index 0ab688af308f..4b0a099b28cc 100644
--- a/drivers/soc/hisilicon/Kconfig
+++ b/drivers/soc/hisilicon/Kconfig
@@ -6,7 +6,7 @@ menu "Hisilicon SoC drivers"
 config KUNPENG_HCCS
 	tristate "HCCS driver on Kunpeng SoC"
 	depends on ACPI
-	depends on MAILBOX
+	depends on PCC
 	depends on ARM64 || COMPILE_TEST
 	help
 	  The Huawei Cache Coherence System (HCCS) is a multi-chip
-- 
2.22.0


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

* Re: [PATCH 1/2] soc: hisilicon: kunpeng_hccs: Add the check for obtaining complete port attribute
  2024-04-03  8:19 ` [PATCH 1/2] soc: hisilicon: kunpeng_hccs: Add the check for obtaining complete port attribute Huisong Li
@ 2024-04-15  1:17   ` Wei Xu
  2024-04-16  1:17     ` lihuisong (C)
  0 siblings, 1 reply; 9+ messages in thread
From: Wei Xu @ 2024-04-15  1:17 UTC (permalink / raw)
  To: Huisong Li
  Cc: linux-kernel, soc, linux-arm-kernel, Jonathan.Cameron,
	liuyonglong, xuwei5

Hi Huisong,

On 2024/4/3 16:19, Huisong Li wrote:
> The hccs_get_all_port_attr() is used to obtained the attribute of all
> ports on a specified DIE from firmware. However, this interface doesn't
> ensure whether firmware reports the complete attribute of all ports or not.
> So this patch adds the check for this.
> 
> Signed-off-by: Huisong Li <lihuisong@huawei.com>
> ---
>  drivers/soc/hisilicon/kunpeng_hccs.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/soc/hisilicon/kunpeng_hccs.c b/drivers/soc/hisilicon/kunpeng_hccs.c
> index 9ff70b38e5e9..bb69a95b5f2d 100644
> --- a/drivers/soc/hisilicon/kunpeng_hccs.c
> +++ b/drivers/soc/hisilicon/kunpeng_hccs.c
> @@ -556,6 +556,12 @@ static int hccs_get_all_port_attr(struct hccs_dev *hdev,
>  		start_id = rsp_head.next_id;
>  	}
>  
> +	if (left_buf_len != 0) {
> +		dev_err(hdev->dev, "do not get the expected port number(%u) attribute.\n",

How about changing to "failed to get the expected port number(%u) attribute.\n"?

Best Regards,
Wei

> +			size);
> +		return -EINVAL;
> +	}
> +
>  	return 0;
>  }
>  
> 

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

* Re: [PATCH 1/2] soc: hisilicon: kunpeng_hccs: Add the check for obtaining complete port attribute
  2024-04-15  1:17   ` Wei Xu
@ 2024-04-16  1:17     ` lihuisong (C)
  0 siblings, 0 replies; 9+ messages in thread
From: lihuisong (C) @ 2024-04-16  1:17 UTC (permalink / raw)
  To: Wei Xu; +Cc: linux-kernel, soc, linux-arm-kernel, Jonathan.Cameron, liuyonglong


在 2024/4/15 9:17, Wei Xu 写道:
> Hi Huisong,
>
> On 2024/4/3 16:19, Huisong Li wrote:
>> The hccs_get_all_port_attr() is used to obtained the attribute of all
>> ports on a specified DIE from firmware. However, this interface doesn't
>> ensure whether firmware reports the complete attribute of all ports or not.
>> So this patch adds the check for this.
>>
>> Signed-off-by: Huisong Li <lihuisong@huawei.com>
>> ---
>>   drivers/soc/hisilicon/kunpeng_hccs.c | 6 ++++++
>>   1 file changed, 6 insertions(+)
>>
>> diff --git a/drivers/soc/hisilicon/kunpeng_hccs.c b/drivers/soc/hisilicon/kunpeng_hccs.c
>> index 9ff70b38e5e9..bb69a95b5f2d 100644
>> --- a/drivers/soc/hisilicon/kunpeng_hccs.c
>> +++ b/drivers/soc/hisilicon/kunpeng_hccs.c
>> @@ -556,6 +556,12 @@ static int hccs_get_all_port_attr(struct hccs_dev *hdev,
>>   		start_id = rsp_head.next_id;
>>   	}
>>   
>> +	if (left_buf_len != 0) {
>> +		dev_err(hdev->dev, "do not get the expected port number(%u) attribute.\n",
> How about changing to "failed to get the expected port number(%u) attribute.\n"?
ok, I will fix it in next version.
>
> Best Regards,
> Wei
>
>> +			size);
>> +		return -EINVAL;
>> +	}
>> +
>>   	return 0;
>>   }
>>   
>>
> .

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

* [PATCH v2 0/2] soc: hisilicon: kunpeng_hccs: add dependency and enhance verification
  2024-04-03  8:19 [PATCH 0/2] soc: hisilicon: kunpeng_hccs: add dependency and enhance verification Huisong Li
  2024-04-03  8:19 ` [PATCH 1/2] soc: hisilicon: kunpeng_hccs: Add the check for obtaining complete port attribute Huisong Li
  2024-04-03  8:19 ` [PATCH 2/2] soc: hisilicon: kunpeng_hccs: replace MAILBOX dependency with PCC Huisong Li
@ 2024-04-17  9:47 ` Huisong Li
  2024-04-17  9:48   ` [PATCH v2 1/2] soc: hisilicon: kunpeng_hccs: Add the check for obtaining complete port attribute Huisong Li
                     ` (2 more replies)
  2 siblings, 3 replies; 9+ messages in thread
From: Huisong Li @ 2024-04-17  9:47 UTC (permalink / raw)
  To: xuwei5
  Cc: linux-kernel, soc, linux-arm-kernel, Jonathan.Cameron,
	liuyonglong, lihuisong

Add PCC dependency and enhance verification during the probe phase.

---
 v2: fix the log on failure.

Huisong Li (2):
  soc: hisilicon: kunpeng_hccs: Add the check for obtaining complete
    port attribute
  soc: hisilicon: kunpeng_hccs: replace MAILBOX dependency with PCC

 drivers/soc/hisilicon/Kconfig        | 2 +-
 drivers/soc/hisilicon/kunpeng_hccs.c | 6 ++++++
 2 files changed, 7 insertions(+), 1 deletion(-)

-- 
2.22.0


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

* [PATCH v2 1/2] soc: hisilicon: kunpeng_hccs: Add the check for obtaining complete port attribute
  2024-04-17  9:47 ` [PATCH v2 0/2] soc: hisilicon: kunpeng_hccs: add dependency and enhance verification Huisong Li
@ 2024-04-17  9:48   ` Huisong Li
  2024-04-17  9:48   ` [PATCH v2 2/2] soc: hisilicon: kunpeng_hccs: replace MAILBOX dependency with PCC Huisong Li
  2024-04-25 11:16   ` [PATCH v2 0/2] soc: hisilicon: kunpeng_hccs: add dependency and enhance verification Wei Xu
  2 siblings, 0 replies; 9+ messages in thread
From: Huisong Li @ 2024-04-17  9:48 UTC (permalink / raw)
  To: xuwei5
  Cc: linux-kernel, soc, linux-arm-kernel, Jonathan.Cameron,
	liuyonglong, lihuisong

The hccs_get_all_port_attr() is used to obtained the attribute of all
ports on a specified DIE from firmware. However, this interface doesn't
ensure whether firmware reports the complete attribute of all ports or not.
So this patch adds the check for this.

Signed-off-by: Huisong Li <lihuisong@huawei.com>
---
 drivers/soc/hisilicon/kunpeng_hccs.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/soc/hisilicon/kunpeng_hccs.c b/drivers/soc/hisilicon/kunpeng_hccs.c
index 9ff70b38e5e9..e882a61636ec 100644
--- a/drivers/soc/hisilicon/kunpeng_hccs.c
+++ b/drivers/soc/hisilicon/kunpeng_hccs.c
@@ -556,6 +556,12 @@ static int hccs_get_all_port_attr(struct hccs_dev *hdev,
 		start_id = rsp_head.next_id;
 	}
 
+	if (left_buf_len != 0) {
+		dev_err(hdev->dev, "failed to get the expected port number(%u) attribute.\n",
+			size);
+		return -EINVAL;
+	}
+
 	return 0;
 }
 
-- 
2.22.0


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

* [PATCH v2 2/2] soc: hisilicon: kunpeng_hccs: replace MAILBOX dependency with PCC
  2024-04-17  9:47 ` [PATCH v2 0/2] soc: hisilicon: kunpeng_hccs: add dependency and enhance verification Huisong Li
  2024-04-17  9:48   ` [PATCH v2 1/2] soc: hisilicon: kunpeng_hccs: Add the check for obtaining complete port attribute Huisong Li
@ 2024-04-17  9:48   ` Huisong Li
  2024-04-25 11:16   ` [PATCH v2 0/2] soc: hisilicon: kunpeng_hccs: add dependency and enhance verification Wei Xu
  2 siblings, 0 replies; 9+ messages in thread
From: Huisong Li @ 2024-04-17  9:48 UTC (permalink / raw)
  To: xuwei5
  Cc: linux-kernel, soc, linux-arm-kernel, Jonathan.Cameron,
	liuyonglong, lihuisong

The kunpeng_hccs driver depands on Platform Communication Channel Driver.
If PCC driver is not enabled, this driver fails to probe.
Seeing as how PCC driver depands on MAILBOX. so replace MAILBOX dependency
with PCC.

Signed-off-by: Huisong Li <lihuisong@huawei.com>
---
 drivers/soc/hisilicon/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/soc/hisilicon/Kconfig b/drivers/soc/hisilicon/Kconfig
index 0ab688af308f..4b0a099b28cc 100644
--- a/drivers/soc/hisilicon/Kconfig
+++ b/drivers/soc/hisilicon/Kconfig
@@ -6,7 +6,7 @@ menu "Hisilicon SoC drivers"
 config KUNPENG_HCCS
 	tristate "HCCS driver on Kunpeng SoC"
 	depends on ACPI
-	depends on MAILBOX
+	depends on PCC
 	depends on ARM64 || COMPILE_TEST
 	help
 	  The Huawei Cache Coherence System (HCCS) is a multi-chip
-- 
2.22.0


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

* Re: [PATCH v2 0/2] soc: hisilicon: kunpeng_hccs: add dependency and enhance verification
  2024-04-17  9:47 ` [PATCH v2 0/2] soc: hisilicon: kunpeng_hccs: add dependency and enhance verification Huisong Li
  2024-04-17  9:48   ` [PATCH v2 1/2] soc: hisilicon: kunpeng_hccs: Add the check for obtaining complete port attribute Huisong Li
  2024-04-17  9:48   ` [PATCH v2 2/2] soc: hisilicon: kunpeng_hccs: replace MAILBOX dependency with PCC Huisong Li
@ 2024-04-25 11:16   ` Wei Xu
  2 siblings, 0 replies; 9+ messages in thread
From: Wei Xu @ 2024-04-25 11:16 UTC (permalink / raw)
  To: Huisong Li
  Cc: linux-kernel, soc, linux-arm-kernel, Jonathan.Cameron, liuyonglong

Hi Huisong,

On 2024/4/17 17:47, Huisong Li wrote:
> Add PCC dependency and enhance verification during the probe phase.
> 
> ---
>  v2: fix the log on failure.
> 
> Huisong Li (2):
>   soc: hisilicon: kunpeng_hccs: Add the check for obtaining complete
>     port attribute
>   soc: hisilicon: kunpeng_hccs: replace MAILBOX dependency with PCC
> 
>  drivers/soc/hisilicon/Kconfig        | 2 +-
>  drivers/soc/hisilicon/kunpeng_hccs.c | 6 ++++++
>  2 files changed, 7 insertions(+), 1 deletion(-)
> 

Thanks!
Series applied to the HiSilicon driver tree with minor changes in the commit msg:
https://github.com/hisilicon/linux-hisi/tree/next/drivers

Best Regards,
Wei

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

end of thread, other threads:[~2024-04-25 11:16 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-03  8:19 [PATCH 0/2] soc: hisilicon: kunpeng_hccs: add dependency and enhance verification Huisong Li
2024-04-03  8:19 ` [PATCH 1/2] soc: hisilicon: kunpeng_hccs: Add the check for obtaining complete port attribute Huisong Li
2024-04-15  1:17   ` Wei Xu
2024-04-16  1:17     ` lihuisong (C)
2024-04-03  8:19 ` [PATCH 2/2] soc: hisilicon: kunpeng_hccs: replace MAILBOX dependency with PCC Huisong Li
2024-04-17  9:47 ` [PATCH v2 0/2] soc: hisilicon: kunpeng_hccs: add dependency and enhance verification Huisong Li
2024-04-17  9:48   ` [PATCH v2 1/2] soc: hisilicon: kunpeng_hccs: Add the check for obtaining complete port attribute Huisong Li
2024-04-17  9:48   ` [PATCH v2 2/2] soc: hisilicon: kunpeng_hccs: replace MAILBOX dependency with PCC Huisong Li
2024-04-25 11:16   ` [PATCH v2 0/2] soc: hisilicon: kunpeng_hccs: add dependency and enhance verification Wei Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).