Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp887966rwb; Mon, 26 Sep 2022 07:08:21 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6Bz0NYeRmPJSh3GyKey6hrGJjNdudrNaBZ2xBXuPzm2ZqPNGHCgjpm0g1vRVTRBYBSZevw X-Received: by 2002:a17:907:d9e:b0:782:28a4:8ced with SMTP id go30-20020a1709070d9e00b0078228a48cedmr17752617ejc.542.1664201301471; Mon, 26 Sep 2022 07:08:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664201301; cv=none; d=google.com; s=arc-20160816; b=spOqFk2znIhHkDVCvFuvsnJeiXgNeGNoE8EVV0ko+NFrg14HNq8XdkuPPQKJ/AKFp1 gd541J3bw9INcF+V75rX2Gl3tmqEFfiCI4O4C2l2z/bwF9fVFlJVdTpjbYl8Qj8vlciF ENzeyzyse2NGlZ8/1UMJyLj6jhgjFTtz4y7q7p95yGO9hFMitXeQy/jiovSwWuXK+Ypm g/QWAW92OtToMDBcMwa3u9ecv/dKL7lh5FNoWzPySZuUG1aRemwqw6eyK3y4nrNL2LQU uObRExWZ/hvtZKk7ZMhdZJqIhd6maTgk+Dj2RtDFnopOBaS/SvLE1xopn3cqKd92grI4 DeOQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=TJiCVFhBQGVUm9QZwmmhhufj1Uf424xzInRjzj8tILk=; b=hztIFTnThz6ICP20LSbfwsmp+r05pdS5A0D3RYKAiybBlb7ZXYsmJWrZVaK+KpHtcu gCB7pxPU1WcWXz9cq2jM81XM0uEa6tBHnDQj0b44ytmw+gsw4N0JNR8P9iwUBVbKix84 IhZXYrTOVimS6bojd3mYmgUqWaXU2FzPkhVIDGnpYkdUv5KUpVIAY41Q0xbi7Q6OnAQR co46KvfMzWuUvqrVt2WQD33Ga2QC+ySSbZMRw5trE0mWtsAoRO+8ItnUhpllM9XhvSCu 93Wk+fQhfVzXZNGBVXNbjQcZip1rRjDnR9ZEC4PVOZE+sN9avV9O6Maz3pxw7dt+YRZ6 3YPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=EnCIi6UR; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f11-20020a056402194b00b0044eae9b2c48si16807984edz.273.2022.09.26.07.07.20; Mon, 26 Sep 2022 07:08:21 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=EnCIi6UR; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238702AbiIZLq7 (ORCPT + 99 others); Mon, 26 Sep 2022 07:46:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53474 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238581AbiIZLoE (ORCPT ); Mon, 26 Sep 2022 07:44:04 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D426472B5D; Mon, 26 Sep 2022 03:46:33 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 54D90B802C5; Mon, 26 Sep 2022 10:46:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 94D88C433D7; Mon, 26 Sep 2022 10:46:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1664189192; bh=+H+3e6MavXuunQEspWLbj9AiqmKe3ZMHaTE84jFSCDM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EnCIi6URDlBnYO1VALuZUGVmWoe97NcCm1tt/yA4a6OE7wIwGhch9RTDZf1XJFH+B NXB5Ij6irR8d29jSDOVhg4Y8H+X/GRw1RE6TXFPnL6VdOHtReHI9/kZrP5QTO7/Y6D 1kkdf0+Oijd1VH5mRbfh7SOdgCdZJw1LVIq9NOpI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Cristian Marussi , Sudeep Holla , Sasha Levin Subject: [PATCH 5.19 072/207] firmware: arm_scmi: Fix the asynchronous reset requests Date: Mon, 26 Sep 2022 12:11:01 +0200 Message-Id: <20220926100809.810922623@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220926100806.522017616@linuxfoundation.org> References: <20220926100806.522017616@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 From: Cristian Marussi [ Upstream commit b75c83d9b961fd3abf7310f8d36d5e6e9f573efb ] SCMI Reset protocol specification allows the 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 the asynchronous resets when the reset action is not of the autonomous type, even if the target reset domain does, in general, support the asynchronous requests. Link: https://lore.kernel.org/r/20220817172731.1185305-6-cristian.marussi@arm.com Fixes: 95a15d80aa0d ("firmware: arm_scmi: Add RESET protocol in SCMI v2.0") Signed-off-by: Cristian Marussi Signed-off-by: Sudeep Holla Signed-off-by: Sasha Levin --- 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.35.1