Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp2563642lqz; Wed, 3 Apr 2024 01:33:47 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWW8tcjaeKvhRJMTeyN+W+/aPjwff5I/TBn2C64b99/I2TQLk4dk+43fo97Bi+yY37oUhSpi3zglb9w8azvLcZwqHlhSS7WaR31vYfo4g== X-Google-Smtp-Source: AGHT+IHfM0GNCCmSsIwJbvop5F0cYW9EkWPr2MvgPVGgsXVJxJI1HnWyVhITx7aJDx/JdGoVsC/a X-Received: by 2002:a05:6808:190b:b0:3c3:d622:b46b with SMTP id bf11-20020a056808190b00b003c3d622b46bmr16888028oib.45.1712133226798; Wed, 03 Apr 2024 01:33:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712133226; cv=pass; d=google.com; s=arc-20160816; b=wKfIK+9BRFOoraEwZL0dg1TANsYqYrjESz+nwzj+D4VBN1QlD07CbEDaqeRjnfU+jR wbcQv/fdkE8X1uiLInTikQdHRZ1JzLpqqX0Mp6txa3s+u1kAVHYLtGlQneyfllbHNjMJ 7r76ljKQO//ZAOCe9Z2zlYxS00NlIA5q2ta0xT+pRWUDmKk4F+RwzdsFIP+oIZDRtPgq sJTnyiI/k7pqFnTLdMKMSmJDYCWqdg1z9kQMWUujr0mUMlG44bLB6TjIZyAjwD6oe9fE jy3sQjjHfMiQZXmdIZepAzhyacceP63PcbGpoxTy1JZ6TtTGsDDd+Rd7xkw5RvF5TzLS q0Sg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=PFzooKCfYVNU+9eILizrONLORwuARwuU2Cya0G6S2Jk=; fh=OXZ2XYuT5Hs+8h3FkBDuNli9CpdLAyYqRIfrrEObMz4=; b=sktp/0xqXq9ufkEt0f+xf1VazJgAay8yaVF2p8DHKt87lTEIzyowj1daBcT5pZuq8g PrVasdnhxvnBXP6ifDt1kWC40gXrAWv5m97g/tRd1eIY7Q36j4XjeStS3cZsLjMVw7dj 8FdTgHVsopr21jz2HQIhDh/8qdQbQCT9VTqVyzV7UhE6euazyUrrt7cRbMn1SpQG1GUl /styw0xODta9Hl06vixVG6twoEnmI4tfVHqiHZa9dA5muBl2IsksbHncAfs1DX3cr9eW 5voutF4hsFNX9wSB7RRaeETpEaQ3GhU7eV01StS8WUm960SKLpk9WlSs6Ur61Cm8Isj3 HEAQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-129331-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-129331-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 124-20020a630182000000b005f0a5131be5si7797770pgb.293.2024.04.03.01.33.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Apr 2024 01:33:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-129331-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-129331-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-129331-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 4557F2869F7 for ; Wed, 3 Apr 2024 08:30:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CDD3C71B4F; Wed, 3 Apr 2024 08:27:10 +0000 (UTC) Received: from szxga07-in.huawei.com (szxga07-in.huawei.com [45.249.212.35]) (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 3548C6CDC2 for ; Wed, 3 Apr 2024 08:27:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.35 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712132830; cv=none; b=EIEI4ElgnPzzOVBhRHIzWfDT/1o9nHExe2I4M4nAXxXDB+rF3apSaVTu9kjTwQqDpYIpiwTJjc3U10qrMOHuLz0vHwpcx3u3z13X3aHlGfkHVsXlCDORQzp6vbEE61NLLBDq8gzgS7xHAAhCjNL3xZ3VX/vvT/ESrun/Vry3JBc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712132830; c=relaxed/simple; bh=5Zgoa/lTop3pWi0GPKnDlpM7KZeP+t9NWazbbQD3v/k=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=BsCu8mI07c7xPQSiS6zSL9hYAZri+oRyV1KM/Qj1/FcteVrqELdgS/nOJc1U9+EytSEmaLaCBp9j4yTqx3hEw/KydbceaEZIWAM7Nnjdk1pwHn2rpsAXu73mOGe74a50aQbZ0f5tjcpjZ2jJiwsa9If+aV/Wv7tysbFCIQZG1co= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.35 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.88.163]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4V8d7y2YQxz1R8dx; Wed, 3 Apr 2024 16:24:14 +0800 (CST) Received: from kwepemm600004.china.huawei.com (unknown [7.193.23.242]) by mail.maildlp.com (Postfix) with ESMTPS id 52D0918001A; Wed, 3 Apr 2024 16:27:00 +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, 3 Apr 2024 16:26:59 +0800 From: Huisong Li To: CC: , , , , , Subject: [PATCH 1/2] soc: hisilicon: kunpeng_hccs: Add the check for obtaining complete port attribute Date: Wed, 3 Apr 2024 16:19:34 +0800 Message-ID: <20240403081935.24308-2-lihuisong@huawei.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20240403081935.24308-1-lihuisong@huawei.com> References: <20240403081935.24308-1-lihuisong@huawei.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To kwepemm600004.china.huawei.com (7.193.23.242) 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", + size); + return -EINVAL; + } + return 0; } -- 2.22.0