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
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2023-08-06 15:10 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20230424073020.4039-1-lihuisong@huawei.com>
[not found] ` <20230530112746.2767-1-lihuisong@huawei.com>
[not found] ` <02f74b25-2ade-5b87-b316-ab902f08ead2@huawei.com>
[not found] ` <3e106062-9ceb-eb51-70ba-32734c769bd5@kernel.org>
2023-07-18 8:07 ` [PATCH v3 0/2] soc: hisilicon: Support HCCS driver on Kunpeng SoC lihuisong (C)
2023-07-18 10:59 ` Krzysztof Kozlowski
2023-07-18 14:00 ` lihuisong (C)
2023-07-18 11:01 ` Wei Xu
[not found] ` <20230725075706.48939-1-lihuisong@huawei.com>
[not found] ` <20230725075706.48939-2-lihuisong@huawei.com>
[not found] ` <64BF8E10.70301@hisilicon.com>
[not found] ` <55efb8ed-58ea-0de5-4f7f-f2984e326852@huawei.com>
2023-07-27 3:51 ` [PATCH RESEND v3 1/2] " lihuisong (C)
2023-07-28 3:03 ` [PATCH v4 0/2] " 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;
as well as URLs for NNTP newsgroup(s).