Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2384407lqp; Sun, 24 Mar 2024 17:03:24 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW3JIAnQd050r84WELaK5VCypSXWjWk+vNUo0v7Cv8AUv+Syu83H7Fnikb5rE2XuBNgBZPmdLdo4sFegy+Cs9S7Z+Wz2re3fufd2IneNw== X-Google-Smtp-Source: AGHT+IHftgY/h7URSMeUI8ywufMZQtulI9IKx+PT+qjIvSd+dATb0gzZ8c9vXEs0brM5qJxr8M0f X-Received: by 2002:a05:6870:8a20:b0:220:c50e:9133 with SMTP id p32-20020a0568708a2000b00220c50e9133mr7025651oaq.45.1711325004366; Sun, 24 Mar 2024 17:03:24 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711325004; cv=pass; d=google.com; s=arc-20160816; b=lhmeTPIAC4W0x79OK8OBmZOcmrKF4ERLp5A1vzhzby1ag2PSyr2JGk7cADrDXduKl4 znu8IMx5VPsli83hvW00TYFx5Y4rHo768Eu1c1ToY9rVtnyQee0kLbyMXczsluerEkLU HgWoi91Gc7ysoHkPuuzJS3TUvS6qQBLpuGF/bKVDZc5A5/27tBwBGYMZK1005euaeMBF JYFw86nrkZCaimm/nxjHpmUWObZgZuX7bbV3rayfrrVg3i+HvdgjLQY/cpYT5zgUKYoZ w0p2aEMniiIuBe2Tdi525abJCxklrnNvjl0c8Ax0dDhGLbVYgzvUf06NOPNFSucRcHGx 2c/w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=Es4RgneZPqQBkMI9e8gpAuOBitVejHvWkPL+MaRx1NQ=; fh=L5Dehiwb5F2xsbEFxQM7IYK0VfY2q843apUnamSEidI=; b=BSx/LVPyY7rz+OxJp4WouspdlfgWy5uGyv5Q55ltIrAHcfbzNgjZwnR5BQ4b2bkz+y GY1W8lB8SFNtynnKKmTcMLv7tgFedlAqMZ9iG1yUgwiPuT7QNkp8cQNnnlT7/hfTLJ2Z H3iB4jJi5ShMEkesANs7agOqWIAiko3puLKonAtxX24HCOYD8zFil8xEP+UFMAD1RL3d gKxF1+hWXPHX5sudsvtrSpzBQxZgEha3+PxQCOACzdOmf1AnOeYYwJ9pdKmPeZmjis3w Kv4/8UcVeZqISsoYer4zHufjM44Pi3C9a44MRwFVNeDr/3swWeX58Wq/PjG6HRN1GxOl aDCA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fFpr9L4z; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113295-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113295-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id l13-20020a05622a050d00b004311e4bf906si4239947qtx.28.2024.03.24.17.03.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Mar 2024 17:03:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-113295-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fFpr9L4z; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113295-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113295-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 176551C23400 for ; Mon, 25 Mar 2024 00:03:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 36D5B6BFA6; Sun, 24 Mar 2024 22:41:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="fFpr9L4z" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3670813CD62; Sun, 24 Mar 2024 22:41:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711320096; cv=none; b=HuC6n91nmgqOk/U4wgyd9zOqMAOkNU5P6z21BYyLApdayM64UMYHx7bmem4K4qKTIqiaAXLhVvqiI5ViWz26y0TXdLjNyXrwB+crJBkzNaxOsbDiiYokSJBUNQyezz1zmegJuzp1IX0Klw4JnfjVXdjTto/G0BnQfksDg4K2j3c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711320096; c=relaxed/simple; bh=pCc5yRqiW7zrM8WJbTTAP0OTtZg+beqdp63g2hcZTaQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mLypyTdQxO9fUoeqegz230WeqbxYqDfDMGhQCB2+VF+SiFId9HsnN8CeJDOmBVcgl9EmWxiJxnRQTCpBFC2bqKomphG8UzF1SUb+sq5Bvuhj0l+HRluZXBEImu5bi+PozMLb4AMUbSJ6lZuO+uRmy9rZBTO4xb/ydVzWRSio1qM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=fFpr9L4z; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0A651C433A6; Sun, 24 Mar 2024 22:41:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711320095; bh=pCc5yRqiW7zrM8WJbTTAP0OTtZg+beqdp63g2hcZTaQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fFpr9L4zdcGREvzwDtMfzHUrpnDhIbFWq31PrdKeJApzNp1A4WpZcnHi0oHPPwPzh QCFnq4tGdKLUtGztkp5ikNz/cehOhDFOZbLaaSvIUPyn/uybX2CVJaw7yMUc6A/m+a FYWUTo/zXZqClNlUQBVz94+EzEM0bAnJAvPW30gZubBRmg++G8JEb2dBQV+Joo4wv/ Re3zovD7tyN0YTYxAcDKTK+BF9QohX622Z02nxrnonGv0VL11iJreFWg9CFMNVE0iv WX/M8EMj2hBf+oGASoaVA59zY3eRSy59y82nnmBufDR6QkuDfVQQTZ0CxdFTbO1/Rn Vd66j6E/LTkxw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Konrad Dybcio , Bjorn Andersson , Sasha Levin Subject: [PATCH 6.8 404/715] clk: qcom: reset: Ensure write completion on reset de/assertion Date: Sun, 24 Mar 2024 18:29:43 -0400 Message-ID: <20240324223455.1342824-405-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324223455.1342824-1-sashal@kernel.org> References: <20240324223455.1342824-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Konrad Dybcio [ Upstream commit 2f8cf2c3f3e3f7ef61bd19abb4b0bb797ad50aaf ] Trying to toggle the resets in a rapid fashion can lead to the changes not actually arriving at the clock controller block when we expect them to. This was observed at least on SM8250. Read back the value after regmap_update_bits to ensure write completion. Fixes: b36ba30c8ac6 ("clk: qcom: Add reset controller support") Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20240105-topic-venus_reset-v2-3-c37eba13b5ce@linaro.org Signed-off-by: Bjorn Andersson Signed-off-by: Sasha Levin --- drivers/clk/qcom/reset.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/clk/qcom/reset.c b/drivers/clk/qcom/reset.c index 20d1d35aaf229..d96c96a9089f4 100644 --- a/drivers/clk/qcom/reset.c +++ b/drivers/clk/qcom/reset.c @@ -33,7 +33,12 @@ static int qcom_reset_set_assert(struct reset_controller_dev *rcdev, map = &rst->reset_map[id]; mask = map->bitmask ? map->bitmask : BIT(map->bit); - return regmap_update_bits(rst->regmap, map->reg, mask, assert ? mask : 0); + regmap_update_bits(rst->regmap, map->reg, mask, assert ? mask : 0); + + /* Read back the register to ensure write completion, ignore the value */ + regmap_read(rst->regmap, map->reg, &mask); + + return 0; } static int qcom_reset_assert(struct reset_controller_dev *rcdev, unsigned long id) -- 2.43.0