From: Zenghui Yu <zenghui.yu@linux.dev>
To: Huisong Li <lihuisong@huawei.com>,
xuwei5@hisilicon.com, arnd@arndb.de, krzk@kernel.org,
sudeep.holla@arm.com, rdunlap@infradead.org
Cc: linux-kernel@vger.kernel.org, soc@kernel.org,
linux-arm-kernel@lists.infradead.org, wanghuiqiang@huawei.com,
tanxiaofei@huawei.com, liuyonglong@huawei.com
Subject: Re: [PATCH v6 1/2] soc: hisilicon: Support HCCS driver on Kunpeng SoC
Date: Sun, 6 Aug 2023 23:09:36 +0800 [thread overview]
Message-ID: <b8512626-2174-ff08-5b6d-4256d9e59093@linux.dev> (raw)
In-Reply-To: <20230801024119.37215-2-lihuisong@huawei.com>
A few trivial comments inline.
On 2023/8/1 10:41, Huisong Li wrote:
> The Huawei Cache Coherence System (HCCS) is a multi-chip interconnection
> bus protocol. The performance of the application may be affected if some
> HCCS ports on platform are not in full lane status, have a large number
> of CRC errors and so on.
>
> This driver provides the query interface of the health status and
> port information of HCCS on Kunpeng SoC.
>
> Signed-off-by: Huisong Li <lihuisong@huawei.com>
[...]
> +static int hccs_query_all_port_info_on_platform(struct hccs_dev *hdev)
> +{
> +
> + struct device *dev = hdev->dev;
> + struct hccs_chip_info *chip;
> + struct hccs_die_info *die;
> + u8 i, j;
> + int ret;
> +
> + for (i = 0; i < hdev->chip_num; i++) {
> + chip = &hdev->chips[i];
> + for (j = 0; j < chip->die_num; j++) {
> + die = &chip->dies[j];
> + if (!die->port_num)
> + continue;
> +
> + die->ports = devm_kzalloc(dev,
> + die->port_num * sizeof(struct hccs_port_info),
> + GFP_KERNEL);
> + if (!die->ports) {
> + dev_err(dev, "allocate ports memory on chip%u/die%u failed.\n",
> + i, die->die_id);
> + return -ENOMEM;
> + }
> +
> + ret = hccs_get_all_port_info_on_die(hdev, die);
> + if (ret) {
> + dev_err(dev, "get die(%u) info on chip%u failed, ret = %d.\n",
"get *port* info failed"?
> +static int hccs_get_die_all_link_status(struct hccs_dev *hdev,
> + const struct hccs_die_info *die,
> + u8 *all_linked)
> +{
> + struct hccs_die_comm_req_param *req_param;
> + struct hccs_desc desc;
> + int ret;
> +
> + if (die->port_num == 0) {
> + *all_linked = 1;
> + return 0;
> + }
> +
> + hccs_init_req_desc(&desc);
> + req_param = (struct hccs_die_comm_req_param *)desc.req.data;
> + req_param->chip_id = die->chip->chip_id;
> + req_param->die_id = die->die_id;
> + ret = hccs_pcc_cmd_send(hdev, HCCS_GET_DIE_PORTS_LANE_STA, &desc);
Typo? Looks like we intend to send a HCCS_GET_DIE_PORTS_LINK_STA
command.
> +/*
> + * This value cannot be 255, otherwise the loop of the multi-BD communication
> + * case cannot end.
> + */
> +#define HCCS_DIE_MAX_PORT_ID 254
This looks weird. Isn't the "max port id" depends on your HW
implementation?
> +#define hccs_get_field(origin, mask, shift) \
> + (((origin) & (mask)) >> (shift))
> +#define hccs_get_bit(origin, shift) \
> + hccs_get_field((origin), (0x1UL << (shift)), (shift))
Unused macroes.
P.S., I'd personally prefer splitting this patch in 2 to ease other
reviewer's work:
- deal with the HCCS HW (chip/die/port) probing
- focus on the sysfs/query things
Zenghui
next prev parent reply other threads:[~2023-08-06 15:17 UTC|newest]
Thread overview: 76+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-24 7:30 [PATCH] soc: hisilicon: Support HCCS driver on Kunpeng SoC Huisong Li
2023-04-24 8:09 ` Arnd Bergmann
2023-04-25 3:04 ` lihuisong (C)
2023-04-25 6:08 ` Arnd Bergmann
2023-04-25 9:42 ` lihuisong (C)
2023-04-25 10:30 ` Sudeep Holla
2023-04-25 13:00 ` lihuisong (C)
2023-04-25 13:19 ` Sudeep Holla
2023-04-26 12:12 ` lihuisong (C)
2023-05-04 13:16 ` lihuisong (C)
2023-05-15 3:37 ` lihuisong (C)
2023-05-15 13:08 ` Sudeep Holla
2023-05-16 7:35 ` lihuisong (C)
2023-05-16 12:29 ` Sudeep Holla
2023-05-16 14:13 ` lihuisong (C)
2023-05-16 14:35 ` Sudeep Holla
2023-05-17 7:16 ` lihuisong (C)
2023-05-17 9:30 ` Sudeep Holla
2023-05-17 11:35 ` lihuisong (C)
2023-05-17 13:16 ` Sudeep Holla
2023-05-18 8:24 ` lihuisong (C)
2023-05-18 8:38 ` Sudeep Holla
2023-05-18 12:29 ` lihuisong (C)
[not found] ` <faa32ce0-00cd-d24c-f505-beb637904af1@kernel.org>
2023-04-25 3:16 ` lihuisong (C)
2023-04-25 11:24 ` Sudeep Holla
2023-05-22 7:22 ` [PATCH v2 0/2] " Huisong Li
2023-05-22 7:22 ` [PATCH v2 1/2] " Huisong Li
2023-05-23 9:39 ` Sudeep Holla
2023-05-23 11:57 ` lihuisong (C)
2023-05-23 13:41 ` Sudeep Holla
2023-05-24 9:36 ` lihuisong (C)
2023-05-25 2:41 ` lihuisong (C)
2023-05-25 7:35 ` Sudeep Holla
2023-05-25 8:12 ` lihuisong (C)
2023-05-30 2:53 ` lihuisong (C)
2023-05-30 8:43 ` Sudeep Holla
2023-05-30 10:57 ` lihuisong (C)
2023-05-22 7:22 ` [PATCH v2 2/2] doc: soc: hisilicon: Add Kunpeng HCCS driver documentation Huisong Li
2023-05-30 11:27 ` [PATCH v3 0/2] soc: hisilicon: Support HCCS driver on Kunpeng SoC Huisong Li
2023-05-30 11:27 ` [PATCH v3 1/2] " Huisong Li
2023-05-30 11:27 ` [PATCH v3 2/2] doc: soc: hisilicon: Add Kunpeng HCCS driver documentation Huisong Li
2023-06-19 6:32 ` [PATCH v3 0/2] soc: hisilicon: Support HCCS driver on Kunpeng SoC lihuisong (C)
2023-07-14 6:17 ` lihuisong (C)
[not found] ` <3e106062-9ceb-eb51-70ba-32734c769bd5@kernel.org>
2023-07-18 8:07 ` lihuisong (C)
2023-07-18 11:01 ` Wei Xu
[not found] ` <c71ae185-d0e8-75df-1d4b-caab4bdc95a7@kernel.org>
2023-07-18 14:00 ` lihuisong (C)
2023-07-20 12:43 ` lihuisong (C)
2023-07-25 7:57 ` [PATCH RESEND " Huisong Li
2023-07-25 7:57 ` [PATCH RESEND v3 1/2] " Huisong Li
2023-07-25 8:55 ` Wei Xu
2023-07-26 9:54 ` lihuisong (C)
2023-07-27 3:51 ` lihuisong (C)
2023-07-25 15:28 ` Randy Dunlap
2023-07-26 9:48 ` lihuisong (C)
2023-07-25 7:57 ` [PATCH RESEND v3 2/2] doc: soc: hisilicon: Add Kunpeng HCCS driver documentation Huisong Li
2023-07-25 8:59 ` Wei Xu
2023-07-26 9:56 ` lihuisong (C)
2023-07-28 3:03 ` [PATCH v4 0/2] soc: hisilicon: Support HCCS driver on Kunpeng SoC Huisong Li
2023-07-28 3:03 ` [PATCH v4 1/2] " Huisong Li
2023-07-28 3:03 ` [PATCH v4 2/2] doc: soc: hisilicon: Add Kunpeng HCCS driver documentation Huisong Li
2023-07-29 8:26 ` [PATCH v5 0/2] soc: hisilicon: Support HCCS driver on Kunpeng SoC Huisong Li
2023-07-29 8:26 ` [PATCH v5 1/2] " Huisong Li
2023-07-29 22:43 ` Randy Dunlap
2023-08-01 1:30 ` lihuisong (C)
2023-07-29 8:26 ` [PATCH v5 2/2] doc: soc: hisilicon: Add Kunpeng HCCS driver documentation Huisong Li
2023-08-01 2:41 ` [PATCH v6 0/2] soc: hisilicon: Support HCCS driver on Kunpeng SoC Huisong Li
2023-08-01 2:41 ` [PATCH v6 1/2] " Huisong Li
2023-08-06 15:09 ` Zenghui Yu [this message]
2023-08-07 1:14 ` lihuisong (C)
2023-08-07 1:41 ` lihuisong (C)
2023-08-01 2:41 ` [PATCH v6 2/2] doc: soc: hisilicon: Add Kunpeng HCCS driver documentation Huisong Li
2023-08-08 2:36 ` [PATCH v7 0/3] soc: hisilicon: Support HCCS driver on Kunpeng SoC Huisong Li
2023-08-08 2:36 ` [PATCH v7 1/3] " Huisong Li
2023-08-08 2:36 ` [PATCH v7 2/3] soc: hisilicon: add sysfs entry to query information of HCCS Huisong Li
2023-08-08 2:36 ` [PATCH v7 3/3] doc: soc: hisilicon: Add Kunpeng HCCS driver documentation Huisong Li
2023-08-11 9:30 ` [PATCH v7 0/3] soc: hisilicon: Support HCCS driver on Kunpeng SoC 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=b8512626-2174-ff08-5b6d-4256d9e59093@linux.dev \
--to=zenghui.yu@linux.dev \
--cc=arnd@arndb.de \
--cc=krzk@kernel.org \
--cc=lihuisong@huawei.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=liuyonglong@huawei.com \
--cc=rdunlap@infradead.org \
--cc=soc@kernel.org \
--cc=sudeep.holla@arm.com \
--cc=tanxiaofei@huawei.com \
--cc=wanghuiqiang@huawei.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox