Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp503052lqb; Wed, 17 Apr 2024 02:56:06 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW8/MVO1jhrmY4EX5ZLzSwGUXQPNRnWrbD6e8Uua9jG4DAnZZZRVgph2BqRo1jBoOQFeyyC46NQNX1qFcbgOfdUvo2VnsDtI0WKdA6giA== X-Google-Smtp-Source: AGHT+IEp149yvUw7l3EO/+hASPWijCdnUfqHcmLSBm2ZX0TSfFCq7Z3k35I2U9sVoZIMlYMzf9/9 X-Received: by 2002:a17:902:e743:b0:1e3:cf2b:7151 with SMTP id p3-20020a170902e74300b001e3cf2b7151mr17786983plf.59.1713347766197; Wed, 17 Apr 2024 02:56:06 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713347766; cv=pass; d=google.com; s=arc-20160816; b=q8h8qx7mqaH1EhWlkOjWthQbcTtBe3kwE8EkfHkNA02VxgoPjnwYbJgh6QWb/uAfnn I77ywJvy9X2hHscPUVGJEWdQhehijq00gtE+le6DD2bz8lKieeaugTEuY9HMTSeT+rOe /mXv1UeWRyRiExFMLlR/E1Av7MHqqecVAAwtnrKMXzcqIlxzTx39TXDBXyoIk2vec0xI nwF3+RHaZW9OzoaZZotvzayinG0XOv4k044vVlH3hp4ZDiZkR/nfB351GOZMMLENMbng xqUc7+bmaTrPz2HD2axyFE3kuLk5l3pTk5msdLv+DQV/KPP7cFFGpfkGI1DfRJi8B5KZ sRHg== 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=twM9zNmF5KpkKQFoHChHr4rGlbCznt49gonQww24QKs=; fh=OXZ2XYuT5Hs+8h3FkBDuNli9CpdLAyYqRIfrrEObMz4=; b=I+P8e3NVHd84ZxtIli9I0V0U63RhMBSKPbO9G4lcAgxAURtpccH3v7wFqf6fFWSBEz h/2p835Nuc/OxoV7Oc53mbwjCPkL2jz8a64s+aBS6LV/SbGLQqJ45jhgdshRWs8K/9pN 5ttq+OCvy3mz5/iZGKdEfeMNIWJxvqSkG6Wmyh+n2Htd7xs3tvAXJwLSMSl3lCkDxCbe ccGy4ZulGk/2CITlrjjYEG4+JnCH6U3oUqmENJrKq8wV8Dkm7QCq9aIwp78Uyk7n7tjv 6vIWSeoW2xqjxJ9n5OLBMQrm33vxAA1aYCVvHSTQ6nNdNPWv8apSgD37gRnm+AYHAopS yx4Q==; 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-148280-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-148280-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. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id be1-20020a170902aa0100b001e5281d9639si10752030plb.520.2024.04.17.02.56.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Apr 2024 02:56:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-148280-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; 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-148280-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-148280-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 6D64F283734 for ; Wed, 17 Apr 2024 09:56:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EE5F413AD25; Wed, 17 Apr 2024 09:55:46 +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 A8CB1135A63 for ; Wed, 17 Apr 2024 09:55:43 +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=1713347746; cv=none; b=WCZC0FjI4LgA+hL6OBmdTa+b0mAJIJ147JhFVzJGUEA5GB/ztzk8lfw0gN+IdKfsqsNgBsvAdX3Evm1K5KLPfmLVJlMpWblxmVBc6JKaqzTILi7fFFryDDbE5Us5YY53AQgD2Z66lcyLsQYroApDFNw6GXpnS5vPY1yATex82zU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713347746; c=relaxed/simple; bh=/lXpYci1tMW5JPozoAh8F16UEmu1MI3zcs1be5M7z4s=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=AjcDMlJEUwffp8tv7ixDyot+f98xZLT6BAhF+rHgtwS5wki9RjftQ8OZhoFj6COQ6v9C7+LP4XPlkIEQrUr4o+hU0AY+nEbO9WWGEqgepAgB92ibC1qO7+7/6kIAez0ZLW777eG4BnVFzInKUX+dw5LMknVJwqscTrigdV/GoPY= 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.191 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 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> 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..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; } -- 2.22.0