Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2552514lqp; Mon, 25 Mar 2024 02:18:15 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUStNOgpzsF8+hzjls2QpxQwkOBp3un4XhajmJfYmpZ2ZTa0CmNI4Ve18IeKFYXbLFFyAz50EkURohECwiYOD+Pc48EzpQeaCRoGt/RZA== X-Google-Smtp-Source: AGHT+IGDJpZ8LCjAiLNImmiFCnX3NbROjj4zVN0uzBAWJPmJ5+NSntLZztqdLNXePXYypYYfbvq9 X-Received: by 2002:a17:902:c948:b0:1e0:a819:c02 with SMTP id i8-20020a170902c94800b001e0a8190c02mr8772496pla.17.1711358294902; Mon, 25 Mar 2024 02:18:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711358294; cv=pass; d=google.com; s=arc-20160816; b=OznAoh8VLd7+fKk1AW2qTRD8n46i35c8d3rdnBd8bGskmozUvj9DImBcf++6aRO3C/ u4Il9PejxDPVe7p5AyBR3IgEAgb67O0uH4AgV7BFQHQnmiFZWB4kgYhsLlff6nLhpIZ2 cVsd54j4Rf8qpRTO6TULKk8Dm3+YDDiXnQFyYRZfNiHyp19dP0bSldNyOW8OCtMXttQ+ QQMfl12umTL/RRQ3PgLFdV/SxyK+NCFRNCEssACVsAMwRb/H8mF3Jw3a0J8qcGFnKSi5 GGtt9fHzulH3ylL3uQvorKc5m2RM6YKoH/3rCea2pfvTv+bkIzbS8Oyk2rlEb9N1NaiJ 0wjg== 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=JVYTVL31okL/Fc/hryyNuwR5LPA9b7YfLJccHHO6zdbMmrS4fzqNV2PM8ibxSLPjUu EoRxjmdK3sByaZb6ozFd4EmxRwuKSb2DiD2je9Z7N1ft8dKnWogqcR1RzThp1OdzLE42 2PpqfUKy7iK5G+psTCEnywc2mZ8VBpSTmpvIPAMPCtI0FzY4xbAAjt261t2svIqoZh0Q LO/uTWtzwqKq1UjsmKKyfr4Sj2C6LQ1DX7b05iJamxbvJo1b0RWCZvTysR2dualkpYYl 6xnChwELU+yhyC6azo8URnp2LzYNQz2WWM1Y7+xQkAv7/D5qeg/aDPSxcJsneS3sLeF4 wHfQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YAVnxxGX; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-115950-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-115950-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id z6-20020a170902ccc600b001e00aebedbasi5029016ple.70.2024.03.25.02.18.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 02:18:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-115950-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YAVnxxGX; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-115950-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-115950-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 6B4BFB3525D for ; Mon, 25 Mar 2024 08:11:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 74B293913F3; Mon, 25 Mar 2024 03:04:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="YAVnxxGX" 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 3012A5466D; Sun, 24 Mar 2024 23:16:33 +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=1711322195; cv=none; b=jHX1yc5nCETp7m1XjEWWezRYG6raslx/z4VbleVhdeE8/aSbODfdCylJh3YapswoS4xtfsfz/AsW/kZ5A3XKA+GsZn/ZV0htGssWJHujqZBMQ4akGSK3333xQyUkOhl4XmgXkl1ublyLI7L9mUnq2ee/zIxU1vS+GbJl4rVz8sg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711322195; c=relaxed/simple; bh=pCc5yRqiW7zrM8WJbTTAP0OTtZg+beqdp63g2hcZTaQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=r3hKuZOvX/p0b4FJ0gYWWlMPbTjtWYcVJHnU2RNjf+vMcAZma94e10736Ty/EKX5oAEZle5n3FdMsLz9bM8sctSFVTBNO2+YXcS3/KoOxKymQ7IfZWDGx+Kukn6s+zzAhzERiRAwcaFfWyBMrFLda7YetbnPhF8YgpATsJ84Mj4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=YAVnxxGX; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id E8A2DC433A6; Sun, 24 Mar 2024 23:16:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711322193; bh=pCc5yRqiW7zrM8WJbTTAP0OTtZg+beqdp63g2hcZTaQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YAVnxxGXLmGiAvB9vCTw2Lakgc/kS14lECgcRL7o1E+O25EoDOmXnMVaqGifNEt+u znQnx23rrlJFX8S+MfgsQzit4Ko/ntRIfJXN2wERRlu5ufUHNUOZVZEQqO3XwvQC0M 8+z9gy+WQ6z0XxlJcD3RV0aWrly1cF/L4f9xvrIi0yCYL+flcNqQkq+UVQRoDfN93X 0VDEwaAPoi1lR7m4FI2oWoVrsJOCkPt+33Z17n/wbE7Bcqr5gQnsQlAyGKg7CKKd8E KZD7D2khfne1GEtrcJroINTn0cq0VE7tHkGvVnR/p95F3p/zXaLFG/MPzioJig7hpo ADjz2moBuc9Kg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Konrad Dybcio , Bjorn Andersson , Sasha Levin Subject: [PATCH 6.1 272/451] clk: qcom: reset: Ensure write completion on reset de/assertion Date: Sun, 24 Mar 2024 19:09:08 -0400 Message-ID: <20240324231207.1351418-273-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324231207.1351418-1-sashal@kernel.org> References: <20240324231207.1351418-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