From patchwork Tue Jun 14 10:00:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sudeep Holla X-Patchwork-Id: 1643213 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=JLd3+FII; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org; receiver=) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LMkTZ5gx4z9sGJ for ; Tue, 14 Jun 2022 20:00:50 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id: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=RkUorSUTFkY14pRNS7vNIsiV/2vDhKjjSwyUYelnSdk=; b=JLd3+FIIKJ0a4z BWY7DLH2Mvb+ztTw44J1f2EzGUrea0WLJrxSVLx05oouyQ73nlzoqjIplODo4KwQnsTdI/E3Ulo8Y 23Koi5rG0EoBE7TjyFBQDD7u75MqSjZYniGozhIEkrlinPlQUTOAgOBOWSycF9Hg/dXzGjLXUOGvu R24qQno+IK3vtqpYDiEFOmoI1TIxfygDdRC4vwNkYxSlNqOmHPSTQGhfy1VWQcLFY22D6+AY8Af/9 zHaWyheruLWQge9r/Za1ALjytVXhMvfF3gRIOuRJCHPETe06tDIYUC33ad+RcT6yGUiBQaZRLZJU8 TXZRChn6iBRhhZxzk0qA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o13LX-008vYL-Tm; Tue, 14 Jun 2022 10:00:27 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o13LU-008vXO-9a for linux-arm-kernel@lists.infradead.org; Tue, 14 Jun 2022 10:00:26 +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 2974923A; Tue, 14 Jun 2022 03:00:18 -0700 (PDT) Received: from usa.arm.com (e103737-lin.cambridge.arm.com [10.1.197.49]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 118A83F792; Tue, 14 Jun 2022 03:00:16 -0700 (PDT) From: Sudeep Holla To: ARM SoC Team , SoC Team , ALKML Cc: Sudeep Holla , Arnd Bergmann , Cristian Marussi , Olof Johansson Subject: [GIT PULL] firmware: arm_scmi: Fixes for v5.19 Date: Tue, 14 Jun 2022 11:00:07 +0100 Message-Id: <20220614100007.1029881-1-sudeep.holla@arm.com> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220614_030024_418846_E613CAB9 X-CRM114-Status: GOOD ( 13.72 ) X-Spam-Score: -5.0 (-----) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hi ARM SoC Team, Please pull ! Regards, Sudeep Content analysis details: (-5.0 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at https://www.dnswl.org/, high trust [217.140.110.172 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 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+incoming-imx=patchwork.ozlabs.org@lists.infradead.org Hi ARM SoC Team, Please pull ! Regards, Sudeep -->8 The following changes since commit f2906aa863381afb0015a9eb7fefad885d4e5a56: Linux 5.19-rc1 (2022-06-05 17:18:54 -0700) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux.git tags/scmi-fixes-5.19 for you to fetch changes up to 44dbdf3bb3f44bf08897ed5f22eb262edcf3d926: firmware: arm_scmi: Fix incorrect error propagation in scmi_voltage_descriptors_get (2022-06-12 19:59:55 +0100) ---------------------------------------------------------------- Arm SCMI firmware driver fixes for v5.19 Bunch of fixes to address: 1. Issues reported on RK3568 EVB1 and BPI-R2 pro platforms using SCMI. More checks were added to validate the firmware response but that resulted in breaking above platforms, so the checks are relaxed when for cases where there is no potential memory corruption issues. 2. Possible data leak by reading more than required length from the firmware. Recent addition of support for v3.1 extended names used larger buffers in the kernel and used their size to read response from the firmware even for cases where shorter formats are used. While that is mostly harmless except when firmware sends malformed non-NULL terminated buffers. 3. Possible issues sending unsupported commands to the firmware. SENSOR_AXIS_NAME_GET added in v3.1 needs to be used only if the firmware supports it. While the firmware conformant to the spec must return not supported error for any unsupported features, it is always safer to avoid issuing commands that are known to be unsupported. 4. Incorrect error propagation in scmi_voltage_descriptors_get. Since the return value is not reset for each iteration of the loop, the error value in the previous iteration will be carried for the current one. Fix that by not saving the return values into local variable. 5. Some warnings reported by cppcheck ---------------------------------------------------------------- Cristian Marussi (4): firmware: arm_scmi: Relax base protocol sanity checks on the protocol list firmware: arm_scmi: Remove all the unused local variables firmware: arm_scmi: Fix SENSOR_AXIS_NAME_GET behaviour when unsupported firmware: arm_scmi: Avoid using extended string-buffers sizes if not necessary Ludvig Pärsson (1): firmware: arm_scmi: Fix incorrect error propagation in scmi_voltage_descriptors_get drivers/firmware/arm_scmi/base.c | 24 ++++++++----- drivers/firmware/arm_scmi/clock.c | 7 ++-- drivers/firmware/arm_scmi/perf.c | 6 ++-- drivers/firmware/arm_scmi/power.c | 2 +- drivers/firmware/arm_scmi/protocols.h | 2 -- drivers/firmware/arm_scmi/reset.c | 2 +- drivers/firmware/arm_scmi/sensors.c | 68 ++++++++++++++++++++++++++--------- drivers/firmware/arm_scmi/voltage.c | 15 +++----- include/linux/scmi_protocol.h | 9 ++--- 9 files changed, 85 insertions(+), 50 deletions(-)