From patchwork Thu Nov 3 19:52:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Marussi X-Patchwork-Id: 15142 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp737611wru; Thu, 3 Nov 2022 12:56:15 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6Qru1467/R2NcThtMTHXokGzQGnk2J7OpTlDrzgsuRmRrVcp0pgEoX32/xplYNDRhO8acS X-Received: by 2002:a05:6402:190f:b0:461:bd53:27c4 with SMTP id e15-20020a056402190f00b00461bd5327c4mr31423224edz.75.1667505375172; Thu, 03 Nov 2022 12:56:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667505375; cv=none; d=google.com; s=arc-20160816; b=QYf1D5fLO+7BhjCYBZ4km7aH4jSJoPQftK0iIJVa3/6fnY8fb4DeO5BhbYiOvlOyqh ziq5meSVPeapBXEYQUMsomAwGxJMtjAuSbp0o7R2GUH4ha1J3sOqcj1r4S78xlCk/Meq wctCwgeNFXWLclYo3JziJCdIf8EmMAuOffWfblEkq9lP47mBlyZ7mj1CKjmAzApB7mGC wF2l6dGR5WTyvuxBv9GPFAvMSSuctURDXuSwq2B06stDISGjcZOslugVCqLciUUxZCmQ bxd/0DYQjUa3JKaY/9ShvICEL3McLNO+GXb83LARvaZ0PUBYTHgneKDvs87CLd2Z7/Ye Lv9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=FJv7MvpFuNSwHV8XAwxcIF99jfJZoMH89GbWyaU98s4=; b=nby5MO4Xl2+U+fCMk2hHDTqj6DFWoKnbfMI19/XP/yIx0yxJQ1yznS7CbWK79wKkGo 99IIj19z5/NNVbxgY7CaUmiCpfaoADTyT3rxa2UrnwhM2ZaEWBViBGeUaqv/CjpYIEjU FZ/5g2k1rvNf1BQ+bq2X6BSFrwwLqf3JEJzE4Zwck9IrW6GWUibf+jp75pJ50JoerqOe RWqTlska3RzOjvX2/ftR/JugH1aRk9Q25N8eZiSYC3r3R2F5/76Z57orZt5AmvIX9Igg /XUvahMWsQYKXggMNXlwDeMXSWSjg+e9yqkqmdJb9lp+8e7nb662Gguwcc16zVFj5L4u /veQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ef5-20020a05640228c500b0045ca6518751si2153674edb.204.2022.11.03.12.55.44; Thu, 03 Nov 2022 12:56:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231364AbiKCTyU (ORCPT + 99 others); Thu, 3 Nov 2022 15:54:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231307AbiKCTxT (ORCPT ); Thu, 3 Nov 2022 15:53:19 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 06A7C201A8 for ; Thu, 3 Nov 2022 12:53:15 -0700 (PDT) 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 17F8C11FB; Thu, 3 Nov 2022 12:53:21 -0700 (PDT) Received: from e120937-lin.fritz.box (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id CB2073F534; Thu, 3 Nov 2022 12:53:12 -0700 (PDT) From: Cristian Marussi To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: sudeep.holla@arm.com, james.quinlan@broadcom.com, Jonathan.Cameron@Huawei.com, f.fainelli@gmail.com, etienne.carriere@linaro.org, vincent.guittot@linaro.org, souvik.chakravarty@arm.com, wleavitt@marvell.com, peter.hilber@opensynergy.com, nicola.mazzucato@arm.com, tarek.el-sherbiny@arm.com, quic_kshivnan@quicinc.com, cristian.marussi@arm.com Subject: [PATCH v5 11/14] firmware: arm_scmi: Reject SCMI drivers while in Raw mode Date: Thu, 3 Nov 2022 19:52:22 +0000 Message-Id: <20221103195225.1028864-12-cristian.marussi@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221103195225.1028864-1-cristian.marussi@arm.com> References: <20221103195225.1028864-1-cristian.marussi@arm.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748506116011797371?= X-GMAIL-MSGID: =?utf-8?q?1748506116011797371?= Reject SCMI driver registration when SCMI Raw mode support is configured, so as to avoid interferences between the SCMI Raw mode transactions and the normal SCMI stack operations. Signed-off-by: Cristian Marussi --- drivers/firmware/arm_scmi/driver.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c index 7c7f1a666d93..c5bc67a9c103 100644 --- a/drivers/firmware/arm_scmi/driver.c +++ b/drivers/firmware/arm_scmi/driver.c @@ -2380,6 +2380,12 @@ int scmi_protocol_device_request(const struct scmi_device_id *id_table) pr_debug("Requesting SCMI device (%s) for protocol %x\n", id_table->name, id_table->protocol_id); + if (IS_ENABLED(CONFIG_ARM_SCMI_RAW_MODE_SUPPORT)) { + pr_warn("SCMI Raw mode active. Rejecting '%s'/0x%02X\n", + id_table->name, id_table->protocol_id); + return -EINVAL; + } + /* * Search for the matching protocol rdev list and then search * of any existent equally named device...fails if any duplicate found.