All of lore.kernel.org
 help / color / mirror / Atom feed
From: Huisong Li <lihuisong@huawei.com>
To: <xuwei5@hisilicon.com>
Cc: <linux-kernel@vger.kernel.org>, <soc@kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<Jonathan.Cameron@Huawei.com>, <liuyonglong@huawei.com>,
	<lihuisong@huawei.com>
Subject: [PATCH v2 1/2] soc: hisilicon: kunpeng_hccs: Add the check for obtaining complete port attribute
Date: Wed, 17 Apr 2024 17:48:00 +0800	[thread overview]
Message-ID: <20240417094801.25393-2-lihuisong@huawei.com> (raw)
In-Reply-To: <20240417094801.25393-1-lihuisong@huawei.com>

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


WARNING: multiple messages have this Message-ID (diff)
From: Huisong Li <lihuisong@huawei.com>
To: <xuwei5@hisilicon.com>
Cc: <linux-kernel@vger.kernel.org>, <soc@kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<Jonathan.Cameron@Huawei.com>, <liuyonglong@huawei.com>,
	<lihuisong@huawei.com>
Subject: [PATCH v2 1/2] soc: hisilicon: kunpeng_hccs: Add the check for obtaining complete port attribute
Date: Wed, 17 Apr 2024 17:48:00 +0800	[thread overview]
Message-ID: <20240417094801.25393-2-lihuisong@huawei.com> (raw)
In-Reply-To: <20240417094801.25393-1-lihuisong@huawei.com>

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


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2024-04-17  9:55 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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-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-15  1:17   ` Wei Xu
2024-04-15  1:17     ` Wei Xu
2024-04-16  1:17     ` lihuisong (C)
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-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
2024-04-17  9:47   ` Huisong Li
2024-04-17  9:48   ` Huisong Li [this message]
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-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
2024-04-25 11:16     ` Wei Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240417094801.25393-2-lihuisong@huawei.com \
    --to=lihuisong@huawei.com \
    --cc=Jonathan.Cameron@Huawei.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liuyonglong@huawei.com \
    --cc=soc@kernel.org \
    --cc=xuwei5@hisilicon.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.