From patchwork Thu Dec 29 18:22:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Marussi X-Patchwork-Id: 37478 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp2533831wrt; Thu, 29 Dec 2022 10:26:24 -0800 (PST) X-Google-Smtp-Source: AMrXdXs1nTHME6dFR0lboBJ31PatO4kip6T6nUA+NT18E0rWOpSvTxklfGxxgBhskelgmSgILOio X-Received: by 2002:a50:ef11:0:b0:462:8a68:139f with SMTP id m17-20020a50ef11000000b004628a68139fmr25646666eds.3.1672338384008; Thu, 29 Dec 2022 10:26:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672338383; cv=none; d=google.com; s=arc-20160816; b=AGBr4cVziAZ/Y4mZo6nUQ3kPXBFEofRQz5OJH2tvGQU0Cvu9FBFgutl1Mi823IiG+Q eW5PcdIj/PVX2kbcLx7Lgh20R0PKheIRU7+ZOpXL3SsTA0DxlZVMyhh8XHFbMJ0el9lT 2v0HxqqpdNSvtbl/V1WNO+DYdgulmLBIBBstGb7oqxqyghe60Xvah9I7vzE8XRSaBKSJ nUvbj9QyfMZx1xh6IfSDA3Qnb1Rn4FoNjwtfdVmgmyIpVZBKzopPj330us6AXQ9umxrc 6ygPLIqi3FVWkqhSbEpwHRpslvJjNT3KzmwRSos7KG38Rvqnm59K7FXKWgfDZ1wVB7AP PHzQ== 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=LBV5NBG6/lMP37R7XNK/o0aFp5u9Y5iQ8q1aX+VZOK0=; b=koL3dJFjuO2iTuSHlJ9QA10kEPpQ43oUMSVAeYm0CxOiFvLkj7ooYMDw9949FtXcb1 ALO9TkIbszNorlLqFNud9OHNw3cigaRby/2cQsm9THoKdh9Ivu4jR//msySs7YAZ/+9X UqlFqQ8KlX+x1VcggjOww+KI0ol+d9ewU53biP2XFzB6d/gvcymnG22TYuV00M6TQwbk lBFmesV/+7kU0xptDmWZEF7q23jCNlK430sobKWR0rfNFYf4DtoJEXVMhsPnNAu50mJQ 0CcFWL3TvYg2n4RD3EejbSeeDn7EhnOUsRj5r6pW/uNQw9kFuRYD/72gUYWo+vZRaHFZ IHSQ== 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 dy9-20020a05640231e900b00469af6681b1si14595016edb.183.2022.12.29.10.26.00; Thu, 29 Dec 2022 10:26:23 -0800 (PST) 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 S234051AbiL2SY4 (ORCPT + 99 others); Thu, 29 Dec 2022 13:24:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44916 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233966AbiL2SYW (ORCPT ); Thu, 29 Dec 2022 13:24:22 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 793981582D for ; Thu, 29 Dec 2022 10:24:21 -0800 (PST) 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 B44A61042; Thu, 29 Dec 2022 10:25:02 -0800 (PST) Received: from e120937-lin.. (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4F5163F71A; Thu, 29 Dec 2022 10:24:19 -0800 (PST) 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 v6 14/17] firmware: arm_scmi: Reject SCMI drivers while in Raw mode Date: Thu, 29 Dec 2022 18:22:50 +0000 Message-Id: <20221229182253.948175-15-cristian.marussi@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221229182253.948175-1-cristian.marussi@arm.com> References: <20221229182253.948175-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?1753573893710055297?= X-GMAIL-MSGID: =?utf-8?q?1753573893710055297?= 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/bus.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/firmware/arm_scmi/bus.c b/drivers/firmware/arm_scmi/bus.c index 6228f1581fe3..8601d75f5b9b 100644 --- a/drivers/firmware/arm_scmi/bus.c +++ b/drivers/firmware/arm_scmi/bus.c @@ -59,6 +59,12 @@ static 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.