From patchwork Wed Apr 17 09:48:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Huisong Li X-Patchwork-Id: 13633124 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 796CFC4345F for ; Wed, 17 Apr 2024 09:56:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=bWizKkLVxxx6GnzzULcxqNKXNBKgLDSEEYvNjVVJ0BA=; b=ZGwh3TsodcpCJc F6PW9WallZ0WY5HtvF5dWXXlYN4jutHrE65Sl8Ky19tNVCMet/evVcUCJQUVUnwqsh4NS8+hLsIKh u6fmZzkU4rMNqmD6EAzt2AtLT4TDPyXMu2Fwj45FvKNsd5irjkv7t0Gbk4KWnZlFLcQdVUb5eBWmS MNrlPQJ0CIdvRRx1J2wfEAzvOslRuAnEu1MB/BvI6AhQATB7Hz8rfKjxMb0/cpX66OoxZaQodiwBP 1WMLg/izDEq2tmvVI1Kq+Z0aSAu6bEp7Ikjiy2pu8txjg1Oco3JaOYTrHaNN1QQJomtlsSHRqC5ba cgm8Mk4gz0996QQ8P8wQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rx21C-0000000FUhP-3UAE; Wed, 17 Apr 2024 09:55:54 +0000 Received: from szxga05-in.huawei.com ([45.249.212.191]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rx218-0000000FUee-2yT2 for linux-arm-kernel@lists.infradead.org; Wed, 17 Apr 2024 09:55:52 +0000 Received: from mail.maildlp.com (unknown [172.19.88.163]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4VKGTz3GdHz1HCDN; Wed, 17 Apr 2024 17:54:47 +0800 (CST) Received: from kwepemm600004.china.huawei.com (unknown [7.193.23.242]) by mail.maildlp.com (Postfix) with ESMTPS id 21341180063; Wed, 17 Apr 2024 17:55:41 +0800 (CST) Received: from localhost.localdomain (10.28.79.22) by kwepemm600004.china.huawei.com (7.193.23.242) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Wed, 17 Apr 2024 17:55:40 +0800 From: Huisong Li To: CC: , , , , , 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 Message-ID: <20240417094801.25393-2-lihuisong@huawei.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20240417094801.25393-1-lihuisong@huawei.com> References: <20240403081935.24308-1-lihuisong@huawei.com> <20240417094801.25393-1-lihuisong@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.28.79.22] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To kwepemm600004.china.huawei.com (7.193.23.242) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240417_025550_929666_571572DC X-CRM114-Status: GOOD ( 10.98 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 --- 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; } From patchwork Wed Apr 17 09:48:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Huisong Li X-Patchwork-Id: 13633125 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7C98DC4345F for ; Wed, 17 Apr 2024 09:56:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=GkECT0ueDufIEBoc3wo3aq/7eDhuaMyd+IsIc8cHMDc=; b=3Avy4dxsyb+zqW 8kxJQLtshAdcSPLEXNA2c7oODTBvs36VudTj7EIl4QLhWRfRdVjVrURpD9GobfPxyYfBVbYgaFYpY OwfXJ/DmZd5rUl+nKwiwBUrwXultgSSaMFx/Lm/rndmeXJPBjKJEjZT81rw7nR8Rpwi3oiLIdl0iK xAg57mHq5g7BIeYIuKfcQ8sgGuaWvXKNYsiwf3BogLTOMrm8GuAAB6JAyrb3UuABpeMnGy34pJXGD i+TOMBkHN2X6qHz8rGlI0kWj6ZmKgVjg/ZkYzGviGNTnXU5Cx5looh6zuCJnE/La4qzpwGGNXKCVu 8yflsVLdXTDOrUGFo4mQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rx21o-0000000FUvC-3Kga; Wed, 17 Apr 2024 09:56:32 +0000 Received: from szxga03-in.huawei.com ([45.249.212.189]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rx219-0000000FUeg-1fOB for linux-arm-kernel@lists.infradead.org; Wed, 17 Apr 2024 09:55:54 +0000 Received: from mail.maildlp.com (unknown [172.19.88.105]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4VKGSF5T5nzNp2s; Wed, 17 Apr 2024 17:53:17 +0800 (CST) Received: from kwepemm600004.china.huawei.com (unknown [7.193.23.242]) by mail.maildlp.com (Postfix) with ESMTPS id 74D391403D3; Wed, 17 Apr 2024 17:55:41 +0800 (CST) Received: from localhost.localdomain (10.28.79.22) by kwepemm600004.china.huawei.com (7.193.23.242) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Wed, 17 Apr 2024 17:55:40 +0800 From: Huisong Li To: CC: , , , , , Subject: [PATCH v2 2/2] soc: hisilicon: kunpeng_hccs: replace MAILBOX dependency with PCC Date: Wed, 17 Apr 2024 17:48:01 +0800 Message-ID: <20240417094801.25393-3-lihuisong@huawei.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20240417094801.25393-1-lihuisong@huawei.com> References: <20240403081935.24308-1-lihuisong@huawei.com> <20240417094801.25393-1-lihuisong@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.28.79.22] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To kwepemm600004.china.huawei.com (7.193.23.242) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240417_025551_640790_832F3844 X-CRM114-Status: GOOD ( 10.30 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 --- 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