Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1737688rwi; Wed, 19 Oct 2022 14:53:10 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5XzkVmB3Stx23QrbnIfMexROMeHtTe3F7t9de4g6hceo8+I04xPKHJGaMahsDeUxRHei27 X-Received: by 2002:a17:907:2cd9:b0:78d:9e76:be26 with SMTP id hg25-20020a1709072cd900b0078d9e76be26mr8303119ejc.315.1666216390291; Wed, 19 Oct 2022 14:53:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666216390; cv=none; d=google.com; s=arc-20160816; b=UCVqFLZFFz5nXb6qsVHJq3k2in6GfZq5hZmLorpPpvfsS1NUYfMYxrUAz+ihv2s8NQ ODPlPA2253AQ2CG947/aqRT/1qfz88x20t8oDRZ8Nv77AIeHpZQLHLo4Xlq4LGngMO/I mWBsQ3iXa32530Mt8hb1AhpKoqzpVrHSAPSjWOz8nPMB+/XNNMx27oQxsD7KO0vBLICs 6x22xR9otCmKzAN0bsEsYb/t0LOCL9kt2KxGwvcH+88TFLQiFM+sA1vkruoSfMA7b/DE 7MkQ+0t5uYRnVN+2LGtYtEjcrCQWbDov+QL/tw1EVnj294O5ODzXBTEGtfCwmqhI0P/W bd5g== 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=+HQgqLmFWEA8RFbEhIt25agn4Qcnx+daroIfFpe90n0=; b=kL0FnbNeqloEslEZcg7FK1i8TQE6KV//KZord6JyQc0eZVs7aIRK6+R+X/jRzRoiCP EJswG6AzaXTqqS9nkISpxmnakT1m5Rl+FX9DW+T9kALErMfkEfFGnJxZsq+19ua/QqkD nQJNRoq/wfqmynkpYOg6sqn1OhZfNDx3IvBIroUYpz369Z8nWxWUsS8Vn1lbMpaGd3/P aPVJiA8ocDi2u9E7wusJ0W9sC4ZgJY2y2rNvanyzoXqP01M/wVekYos52vQYoCoYncbV TWMgf3CsVF2dh8hMsaHECK1u6RpLQgU5ld5JCJW47sUT+3XUnp9h2Zvqq43cuMG3+gFD zXJw== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y14-20020a50ce0e000000b0045745ecd5a1si12465571edi.304.2022.10.19.14.52.43; Wed, 19 Oct 2022 14:53:10 -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 S231587AbiJSUr1 (ORCPT + 99 others); Wed, 19 Oct 2022 16:47:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38022 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231509AbiJSUrI (ORCPT ); Wed, 19 Oct 2022 16:47:08 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 568161C7D7E for ; Wed, 19 Oct 2022 13:47:04 -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 164AC14BF; Wed, 19 Oct 2022 13:47:10 -0700 (PDT) Received: from e120937-lin.home (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id DF50D3F792; Wed, 19 Oct 2022 13:47:01 -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 v4 10/11] firmware: arm_scmi: Reject SCMI drivers while in Raw mode Date: Wed, 19 Oct 2022 21:46:25 +0100 Message-Id: <20221019204626.3813043-11-cristian.marussi@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221019204626.3813043-1-cristian.marussi@arm.com> References: <20221019204626.3813043-1-cristian.marussi@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, 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 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 b504b5cdc55f..3e5539987443 100644 --- a/drivers/firmware/arm_scmi/driver.c +++ b/drivers/firmware/arm_scmi/driver.c @@ -2365,6 +2365,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. -- 2.34.1