From patchwork Thu Jul 25 06:53:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Etienne CARRIERE - foss X-Patchwork-Id: 13741585 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 722B8C3DA5D for ; Thu, 25 Jul 2024 06:55:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type: Content-Transfer-Encoding:MIME-Version: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:In-Reply-To:References:List-Owner; bh=uy8sxC4oTjR1r4dO0TK3MjoSgbNjM8fJGUvA9y13SGY=; b=4zuWXKJIabVwZ8mX62bwr0XVum q70NAxf47Pk2f3C1kd99p95bzDnaeDv4xUJVp50i6DCLzs4HWEJB0zG02ZLulfhzqVL2g4xCxpocQ D7aBUuZFR9VROHRpQpAIXvZe8jBbkzpc4+475SQzBU+/FHmPFmi5Dckig7cxO7/EY2KYf+9cG5fll r/LCezigYH4frF2ZHQbUTfpSRGy+eW6muMCXuEuhhoji4/Te3xJ38ZcGwp0QSZmDwYwcubIgW/9+p MMjMVXgXWL8WLQRyesCi+ZVRzfYuAVd0sMc/TrQZNKx2eRIM+wc44GxG5pMT3DT7gsaZgV96zk1W8 FXlpCBAA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sWsNW-000000006Qo-0Fpl; Thu, 25 Jul 2024 06:55:06 +0000 Received: from mx08-00178001.pphosted.com ([91.207.212.93]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sWsMq-000000006Fe-3lGv for linux-arm-kernel@lists.infradead.org; Thu, 25 Jul 2024 06:54:27 +0000 Received: from pps.filterd (m0369457.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 46OM0vpw025594; Thu, 25 Jul 2024 08:54:18 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h= cc:content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to; s=selector1; bh=uy8sxC4oTjR1r4dO0TK3Mj oSgbNjM8fJGUvA9y13SGY=; b=fSsFS/jxZ1vE/5Yyk7+buXW4jM1BOQxWpc+RCC SXHzYiFijOaSGIwYBTy3q4998c6xuk4TX4FjgNJj3pkPkyZDtKgZ0kSsB0dMRvo3 Jlw5g5iNFsD+mzEodNkgjOCAUFGoPNNu3yJqKNxYLM9dBDdrzUPq59jevs9q1M5e zbAv2HxbM2hNxi+ZhJuYF4bHbTmCcJUDQ1mxRWWRp3SO4o/kM1VSWgce/B9nNk0u eQU63TNWRipBTf+5mSb548i+Umuk2TByv9W3/5TJVlKr7UUfZr6w3AfxGgoiVXlr fOWIBCcCs8udodonB28hDXXCNAHQSxR4/ddKurHjCNaejNPQ== Received: from beta.dmz-ap.st.com (beta.dmz-ap.st.com [138.198.100.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 40gr6j85wb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 25 Jul 2024 08:54:18 +0200 (MEST) Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id E806440049; Thu, 25 Jul 2024 08:53:44 +0200 (CEST) Received: from Webmail-eu.st.com (shfdag1node1.st.com [10.75.129.69]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id BB239210721; Thu, 25 Jul 2024 08:53:21 +0200 (CEST) Received: from localhost (10.48.86.128) by SHFDAG1NODE1.st.com (10.75.129.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.37; Thu, 25 Jul 2024 08:53:21 +0200 From: Etienne Carriere To: CC: Sudeep Holla , Cristian Marussi , , , Etienne Carriere Subject: [PATCH] firmware: arm_scmi: fix voltage description in failure cases Date: Thu, 25 Jul 2024 08:53:17 +0200 Message-ID: <20240725065317.3758165-1-etienne.carriere@foss.st.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [10.48.86.128] X-ClientProxiedBy: SHFCAS1NODE1.st.com (10.75.129.72) To SHFDAG1NODE1.st.com (10.75.129.69) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-07-25_07,2024-07-25_02,2024-05-17_01 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240724_235425_469684_8759E9C6 X-CRM114-Status: GOOD ( 12.32 ) 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 Reset the reception buffer max size when a voltage domain description request fails, for example when the voltage domain returns an access permission error (SCMI_ERR_ACCESS) unless what only a single 32bit word is read back for the remaining voltage description requests responses leading to invalid information. The side effect of this issue is that the voltage regulators registered from those remaining SCMI voltage domain were assigned a wrong regulator name. Signed-off-by: Etienne Carriere Reviewed-by: Cristian Marussi --- drivers/firmware/arm_scmi/voltage.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/firmware/arm_scmi/voltage.c b/drivers/firmware/arm_scmi/voltage.c index 2175ffd6cef5..f1a7c04ae820 100644 --- a/drivers/firmware/arm_scmi/voltage.c +++ b/drivers/firmware/arm_scmi/voltage.c @@ -229,8 +229,10 @@ static int scmi_voltage_descriptors_get(const struct scmi_protocol_handle *ph, /* Retrieve domain attributes at first ... */ put_unaligned_le32(dom, td->tx.buf); /* Skip domain on comms error */ - if (ph->xops->do_xfer(ph, td)) + if (ph->xops->do_xfer(ph, td)) { + ph->xops->reset_rx_to_maxsz(ph, td); continue; + } v = vinfo->domains + dom; v->id = dom;