From mboxrd@z Thu Jan 1 00:00:00 1970 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 7300DC3DA4A for ; Fri, 26 Jul 2024 15:16:40 +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:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=rcq/Q/5aNNh61Us/ekbGnV0Iw1Q4UqoxuU1E6nwg4+I=; b=Kdk8B3sEgA3h9yxlOE8kw4xD59 siGBZGaWb1K3UC05MiCgGISUkzWsj+qprV2wvNzSZ6PaQjF+hT54BhI+6PtscQpoj7gb8uL8k8ko3 djQYsmDRv5AFmeFa5YadAu/DFLftpkyx3hdyrcuoLO9bF4N1Tdjf4gHtbAd4TmaVNT+GEi3iFrUtB Vic88ibaewgiCxYJPPN+O8iLKfZJ/TSgD2zR4PKjtfpZmH4929PV0VqO+Ys2lONhVjaIlZvnqZkXT 9agkyfZLRs11LtYx7Ok0t/9+RYUeKfJxujH1ZnJ8ouo9tz67EU1g83YGVCW4kIAP3uLsqmocLMccb 2cM7M5PQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sXMgK-00000004Gw2-2nN5; Fri, 26 Jul 2024 15:16:32 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sXMfv-00000004Gs4-1wrz for linux-arm-kernel@lists.infradead.org; Fri, 26 Jul 2024 15:16:08 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 54A7A1007; Fri, 26 Jul 2024 08:16:32 -0700 (PDT) Received: from bogus (e103737-lin.cambridge.arm.com [10.1.197.49]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 161E33F73F; Fri, 26 Jul 2024 08:16:05 -0700 (PDT) Date: Fri, 26 Jul 2024 16:16:03 +0100 From: Sudeep Holla To: Etienne Carriere Cc: , Cristian Marussi , , Subject: Re: [PATCH] firmware: arm_scmi: fix voltage description in failure cases Message-ID: References: <20240725065317.3758165-1-etienne.carriere@foss.st.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240725065317.3758165-1-etienne.carriere@foss.st.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240726_081607_574758_BE75047F X-CRM114-Status: GOOD ( 19.19 ) 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 On Thu, Jul 25, 2024 at 08:53:17AM +0200, Etienne Carriere wrote: > 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 > --- > 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); I am fine with this to keep it simple, but thought I will check my thoughts. We usually use reset_rx_to_maxsz in iterators as we don't know the expected size of the response, whereas here it must be max sizeof(*resp_dom). That said, we don't have any helpers and changing xfer->rx.len directly doesn't looks good ? Or may be it is OK ? Thoughts ? -- Regards, Sudeep