Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp5073160rwb; Wed, 17 Aug 2022 10:31:47 -0700 (PDT) X-Google-Smtp-Source: AA6agR40RFOFJ5nVFACjUursWoZQyzDgezBMcMc1BOSSpr3gY0vW4YHgt4Jv9RNDcXVa9Ayr0UIr X-Received: by 2002:a17:906:cc5a:b0:730:8374:7ba5 with SMTP id mm26-20020a170906cc5a00b0073083747ba5mr17504316ejb.144.1660757507758; Wed, 17 Aug 2022 10:31:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660757507; cv=none; d=google.com; s=arc-20160816; b=vbWfjydKk9xm12aKUdcJWYA0MjY4m+XHEtcS9wxdde4AwoQ4h1SZQmlfyWH12648z7 rCrFkkCtNhZAzctXuRy6WLRShQuCGxtjRZdDZVxSaNkCaIZfhKIOFvVezsdhYH67DnZx QQHDmIaTGF/GjgCo5uTNDm7fYI2/G9ouinF+wPJRpmhpTZKu6DkIQuvc16YRMP1jlP4b 3T1RB7SeTabNZ2uXLKev0QEAiGmq8nE9JaFFUmAw5fMtRWU8rVqLAyrwIHl69PjjRORd FlkglU+JUFEQ7Mh93z/K3+MKgJHvnT3bBxJZbfnSOws2wq4xfimRNReQrfEjHiA2GzeR UzDQ== 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=MkwPNa4MbY2QYjgC6PdAxVDEXS94u6SZfUgaQcXgY38=; b=TICaWZGQ7xxcQJQGWKxc3mm3pAEctxxXgEOIS6tTBjnQJZ7Oz2EVRnAHy6uaPzJUbw jaJsUzeXxc76JbR9lGrTzqjtU9s3cvrp6tfRMAxEB36Knyx44ky6y9gdn12j1lCmH0BB 0r6SeqmzNbuxQWvrcMerrpoywpYH/wSfKJEWQbcAV+EgZTB81Sn60tIcVz9mj2D8BHEQ 4XTXx0nx9HXxblsJwAAmmd+SOcj2zbTKniGK84f5ZnVXBzv4j8B3RkjgTEFls6Pa7rs2 EgDpIR5o6RVymF1JzVUnrQ9Kkj/ErSes5T9RL0g0LXLXGYNRn2Q/CcT1pyGsRx2UBTGN G1LQ== 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 ht9-20020a170907608900b006ff21423705si13090910ejc.323.2022.08.17.10.31.21; Wed, 17 Aug 2022 10:31:47 -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 S241204AbiHQR2O (ORCPT + 99 others); Wed, 17 Aug 2022 13:28:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241077AbiHQR17 (ORCPT ); Wed, 17 Aug 2022 13:27:59 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A0F6AA1D3D for ; Wed, 17 Aug 2022 10:27:57 -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 44FFF1595; Wed, 17 Aug 2022 10:27:58 -0700 (PDT) Received: from e120937-lin.home (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id AA02D3F66F; Wed, 17 Aug 2022 10:27:56 -0700 (PDT) From: Cristian Marussi To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: sudeep.holla@arm.com, cristian.marussi@arm.com Subject: [PATCH 5/6] firmware: arm_scmi: Fix asynchronous reset requests Date: Wed, 17 Aug 2022 18:27:30 +0100 Message-Id: <20220817172731.1185305-6-cristian.marussi@arm.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220817172731.1185305-1-cristian.marussi@arm.com> References: <20220817172731.1185305-1-cristian.marussi@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 SCMI Reset protocol specification allows for asynchronous reset request only when an Autonomous Reset action is specified: reset requests based on explicit assert/deassert of signals should not be served asynchronously. Current implementation will instead issue an asynchronous request in any case, as long as the reset domain had advertised to support asynchronous resets. Avoid requesting asynchronous resets when the reset action is not of the Autonomous type, even if the target reset-domain does, in general, support asynchronous requests. Fixes: 95a15d80aa0d ("firmware: arm_scmi: Add RESET protocol in SCMI v2.0") Signed-off-by: Cristian Marussi --- drivers/firmware/arm_scmi/reset.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/firmware/arm_scmi/reset.c b/drivers/firmware/arm_scmi/reset.c index b0494165b1cb..e9afa8cab730 100644 --- a/drivers/firmware/arm_scmi/reset.c +++ b/drivers/firmware/arm_scmi/reset.c @@ -172,7 +172,7 @@ static int scmi_domain_reset(const struct scmi_protocol_handle *ph, u32 domain, return -EINVAL; rdom = pi->dom_info + domain; - if (rdom->async_reset) + if (rdom->async_reset && flags & AUTONOMOUS_RESET) flags |= ASYNCHRONOUS_RESET; ret = ph->xops->xfer_get_init(ph, RESET, sizeof(*dom), 0, &t); @@ -184,7 +184,7 @@ static int scmi_domain_reset(const struct scmi_protocol_handle *ph, u32 domain, dom->flags = cpu_to_le32(flags); dom->reset_state = cpu_to_le32(state); - if (rdom->async_reset) + if (flags & ASYNCHRONOUS_RESET) ret = ph->xops->do_xfer_with_response(ph, t); else ret = ph->xops->do_xfer(ph, t); -- 2.32.0