Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1162883lqp; Sun, 14 Apr 2024 18:17:31 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVyIPYfc9No/VPhquhNfiJ275HZQePvtceDXppwSizoMQsGdKnzdE6YurCtVkXIvurxmxezLc7sE+jPfkjRzwiPsT4F00xef7ScOUHgrA== X-Google-Smtp-Source: AGHT+IEyhwv/GksHuCSg05Pk6eBFFHHbuoolWomEPfJ7wWo+2Q9X9N/dbJttXVhVdP7xM/o2XpQl X-Received: by 2002:a17:906:f116:b0:a52:5250:c044 with SMTP id gv22-20020a170906f11600b00a525250c044mr2353001ejb.2.1713143851526; Sun, 14 Apr 2024 18:17:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713143851; cv=pass; d=google.com; s=arc-20160816; b=tQfwkLrM1Ryvd9L90/cdMuesLz4tup2Y3kTLQDWZ/KSLyxaK7htLqegCj4RdSt0/Kj FxQrKaSVw2mC27uZinrn5VW1nDdLYlKP6WB2zzVHt8hA5J9v+s+Uu2YVu3p7f83YK6Kz fJJD6b6z+mRmDJG2crcIl3CdTPcJ+E4/APEKuFpVEJQQyZdjkGH/AocqUEL+pgL1ui7H VEU3yuDziyx4XdlpMaKUPOQXVuY6KqxoR/sO1oIFkiLpiD4TtCGqKEvSYyeJfrPtarvd ro+sllIpKUrRpMvWWm/Tv0VOF0h5oqA34DFtat5AAOCkLprZlmrSYMfaFF9SZvKfgR1e SA8w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:references:subject:cc:to :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:from:date:message-id; bh=NaW6pjaxPRAc02ZP0uXp5GqhhhYG80tZNLR1o4678F8=; fh=Wi7R6DLAhB63w2I9VGeQ4borXszwOIehuYHbL8+MN2k=; b=Rgjc0tLiGR0Wf+2Sj9dRaBS+WzeVdbvXbi02pAyVp0dyCgg8tz6np55X2H69V1VA8z IInizCXp/AH4MBjQgcOvDqdqjmLyZmRJo5PJUP76rMCRxKxnZ+nL9N32501tLAmrw5K9 N89uyVpZzkGpwcc7aooJ1UTq1xcPqdUznBElgijJKvYNKxwpp+WPy+DrZv5Kk9qCACfe c5nHSHA9iITdZZTXBxdYud5g5Cfd8GrumgkmwhbV0ziwTtJ3r4bpVbXERZXXt62lOr+8 tpnd68LjmQOQZcm9wtob2HbR+TDBhblUMOmVQyr3Zxq3t3M9E5Ot5wqyrzwehNBlhBMQ Xp0w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-144444-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-144444-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=hisilicon.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id i23-20020a1709061cd700b00a51df618f0bsi4104072ejh.117.2024.04.14.18.17.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Apr 2024 18:17:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-144444-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-144444-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-144444-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=hisilicon.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 39C2D1F21EC6 for ; Mon, 15 Apr 2024 01:17:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 44FA25695; Mon, 15 Apr 2024 01:17:25 +0000 (UTC) Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C4DEF33CA for ; Mon, 15 Apr 2024 01:17:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.191 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713143844; cv=none; b=p9C7JLodS2g7K4gMHpETz2DHyi73kURMI9IrlZd+ZWU0t6YPYtjQAJAINCqcUEWb6odWmOIIAWLYEtCc5sMeCthaHUoYSUL6Qn3+1vue/1Dq30iIb/Z+nt1NEAV7nHKMfiIINWCA7qndPLJpFMGKsAYMsZZRjaNNtzTGmY5O5Tw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713143844; c=relaxed/simple; bh=U9JG8TZM3FnZ06qQJ0sxIT4Cybxdc176DamOpSNqkwo=; h=Message-ID:Date:From:MIME-Version:To:CC:Subject:References: In-Reply-To:Content-Type; b=jTzvzEHQa5A/4KmimaCWVXcsUh2H+TgCSVKO0AhGNbLPHgmWhv7K71EIQK48V4u8YeIWnTqgmcCmXqzapRh0owJXeNFvQKz9sCIIkFGemZwplRAHaTeH1C4NO4uAm34xCU+8VQrAa3GKjI2U5YvMKheFjzdwc6ZpyWrpbiCked0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=hisilicon.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.191 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=hisilicon.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.17]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4VHq2J4Zr6z1hwMy; Mon, 15 Apr 2024 09:14:16 +0800 (CST) Received: from kwepemd500014.china.huawei.com (unknown [7.221.188.63]) by mail.maildlp.com (Postfix) with ESMTPS id 66AAD1A0172; Mon, 15 Apr 2024 09:17:12 +0800 (CST) Received: from [10.67.121.2] (10.67.121.2) by kwepemd500014.china.huawei.com (7.221.188.63) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.28; Mon, 15 Apr 2024 09:17:11 +0800 Message-ID: <661C8017.1070203@hisilicon.com> Date: Mon, 15 Apr 2024 09:17:11 +0800 From: Wei Xu User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 To: Huisong Li CC: , , , , , Subject: Re: [PATCH 1/2] soc: hisilicon: kunpeng_hccs: Add the check for obtaining complete port attribute References: <20240403081935.24308-1-lihuisong@huawei.com> <20240403081935.24308-2-lihuisong@huawei.com> In-Reply-To: <20240403081935.24308-2-lihuisong@huawei.com> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To kwepemd500014.china.huawei.com (7.221.188.63) 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 > --- > 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; > } > >