Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp3228183rdb; Tue, 6 Feb 2024 10:44:34 -0800 (PST) X-Google-Smtp-Source: AGHT+IHJfBCc2ZeUhSXVR5lxSG8zZEuKEmE890EXLZvxAbF6I81u3C654Efpb/KjQr6wDfqLrl37 X-Received: by 2002:a17:906:aac2:b0:a37:4a04:fd12 with SMTP id kt2-20020a170906aac200b00a374a04fd12mr2934194ejb.9.1707245074125; Tue, 06 Feb 2024 10:44:34 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707245074; cv=pass; d=google.com; s=arc-20160816; b=FwvcEGsV/+d7OyJDmqSF86HT5Pkbx8ztxAAvowXPaGQobta56C1MWE/OjqbjtBVkMv Km2++c0PItu91d53JtN0RlK3EqnKVPF/r9ZgoyaAdy1Pk//acLlm1XXMwcmpe6dDhhh5 n3BrvPhOzgnOtOcsULHrcufOl+WPWx7obRLBKknyYV+8lmtog0bFf6R25UJYGkiN7x+T rN5WFQCpSvet6TNZO1nDLQ4t4Vqc6OKtpyvo7iQf/fgJ+QVofHS3pnPX4cnibVbGX6Mr rv8lTxz5XMrR/xjLqGyCheCT8hWq4M0YtJBsrZDVW3Zb04TsW0n9jfWSDVxL/pljepnv kr7g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=hvL5qVc53pRM2ItjtrWEvKCgIea1KTM6jFEXiD2pTIk=; fh=KgbW6zppDDKLzkJLX0sY8f+D+FBb1WwF2CxhhMzLqPU=; b=cbKArZGdAJq8+t0aIXqYiYjZLeCi5JOkDNk8fhynQObnqpcT0z6gKC23M/i5uH6sGB dPd/RVKLMeqZdZCFmYAsOIvmlSGmOFeaPxmnPV3RL4id0Hf70dkgUIGUhu7cTlG/ECIg tWKGXaav3Woz74dldTOKdgkguvIlLOoz6F9frhQvX+RrET6hnwFrwZ0FfiEZ/6O/u+qc hqOdujSyuXDE0dq2+Th5iO5f7oyuR9uztBTCgJ+sJrpHgwpFGMc0PGKbLgJAZNcVVDOL LPmwlDvvywSsZkZFPgJckO32dKmPPA4YtpVC/32YuD/78PFE8WFt1gptDfwiO20Zu0KI J79Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=n88zmfA1; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-55472-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55472-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org X-Forwarded-Encrypted: i=1; AJvYcCUIIQjj/yZSw091t1rXuwG9S9Ugcd8aeHQwgnhEze+i4e62TeLDwgxEb+PDvg+AdXuVPrdVJcQmP4Y9NjT6v8Olnop2lL2bKjp//SSWJw== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id q18-20020a170906361200b00a37f77efc4fsi1340615ejb.790.2024.02.06.10.44.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 10:44:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-55472-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=n88zmfA1; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-55472-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55472-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.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 am.mirrors.kernel.org (Postfix) with ESMTPS id D9FF31F24F4E for ; Tue, 6 Feb 2024 18:44:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E5F13168DC; Tue, 6 Feb 2024 18:43:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="n88zmfA1" Received: from mail-ej1-f53.google.com (mail-ej1-f53.google.com [209.85.218.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 24A9613FEA for ; Tue, 6 Feb 2024 18:43:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707245026; cv=none; b=arFj607UKkDXy7PfYgI49XN19rKAqxRVUfYvebIH/oNrhxXWTM3610wjW76V+rK/I8+CWu/hO+qYSqLAcdPWR+buoegPxGzb1OOirhYl+qDmHHErn2vEhxw1szvAge98RpfS23q+WvSvjCXUnnZGltQohFcIWV3mb5PI5tflvU0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707245026; c=relaxed/simple; bh=XwCgSZpLR0e1PPyOXyw9iz+BwYBf4ZHexOSsfIVdxQU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=CFCC/FIu9xfdVcGJhu2d33ky73F19nCQIhPI+c+vKop09Z03sDrrO+02rD88+luI76c4WWXXYR9N5hhC+tHzWf/Ed3oHTJGRq8/VpcIPo/bGl4/juQlcixUSRPkBuTVdpUDk/VMiqoxkxdO2SYoA2ZzcQLBvM7OpgYNdnrONgv4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=n88zmfA1; arc=none smtp.client-ip=209.85.218.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ej1-f53.google.com with SMTP id a640c23a62f3a-a359e6fde44so139153366b.3 for ; Tue, 06 Feb 2024 10:43:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707245023; x=1707849823; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=hvL5qVc53pRM2ItjtrWEvKCgIea1KTM6jFEXiD2pTIk=; b=n88zmfA16tac3dTriWwFjbFeppDs3QCehS3dS9zYc6ISdsqi/+N7kYa8RVdk7PrG3V JHVd+fGdNvr8dYF/b3lZ2LuAvAn6vQ+ISxAHLRd3Td3dIzJCa4/JkqRtftbwRLg93Ja7 ZdS0iL/SaqjeHZcUVj73ubTEbWbev/8mPkFjJjJYDZZgwTOUS8/CzRIjCWEuE1bnBsvG HhJ1G8HZwFmObUd7znj6gCCXlBLzp1qdJijj8flCbLkXXIkTTart4jOJX2RJo9Il2atq ETVk+QWMQ6MzEJp6ZKJg6bhzjoejLap/VGQuG8QSPHKKh6R7C6P/q2fupy8BTqbVHnPN tFgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707245023; x=1707849823; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hvL5qVc53pRM2ItjtrWEvKCgIea1KTM6jFEXiD2pTIk=; b=JrWMtx0j8qnt7F0i4XGj9+r/oiMFM5CT+ULyHjmgHhnCbcwfN3m+rPOVBdCCTwH+LZ vj5L0NHxjSxDXr54jLWAzYJoCLNEhHKV5oyHDJqXrAmdYGUtb0L6teNFLGysPbN+se16 cqAqnixNYOva0s1Mzk7KX9F3hOMYH7405nljsvemYHMu7P5eYNF4o3s873An0N7gcvDW 0zfFq+nzK/jRVqyB3Fx9NEMa4P6KlbeIkLQw5J6J8k7oJOJ1vV4lZ4soG94KZfH+KWi6 ypMDaE+epvkHp843Ut0TIMSUevAA+rjHJ44gBwzozqMDcB8Fbr+D+3miCUaswC0k2iFp 2eJQ== X-Gm-Message-State: AOJu0YzK/CBcAcyYNIiTEBRgtxk3suCUaiwSpSwIgLM9ueTEXZEWkEL3 oB7LhYTJCwwi9L7z1UOIx+hwzrYac73fcvLyb7NcHoRcm0/1xkZNRwhSAPvYd74= X-Received: by 2002:a17:906:5290:b0:a31:83a2:463c with SMTP id c16-20020a170906529000b00a3183a2463cmr2821529ejm.34.1707245023306; Tue, 06 Feb 2024 10:43:43 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCWzBwgE40NoQJNzoN6JSw4Wjez8/Ag0DcojFpjommyB40AgMlUE/2XqAEx8GzyqQRu0n+Gf6BPPBtw0GJk5JHQhpqnm9wTanHLkqAFGNEu9StIqpimJ3LQ/bh/choLxc9xYvIslXMUyNrY61oIAjPhXTck3pQDC3OFqGLXAFx/TIN6rxWNRnLl80REIXNm+H3LWvFfoHxYHliZ1b9Cd6Z8qWIxWNz28bbjp874R4NzcK4HaJPXy8u14SqljSDsQrMCSy9WfeYwae54IR4lpNeZcjYCgKl0toBqdAzeEWdi5p6i08NE4A/IeL2gwgUisfg5IsdlgXA4KSzvf1vmfsL4BBtBTJbSf5KNssuSrsYrfPg3umt1i6MAG8r11TtQZdMAC35PIbJJgHuTLP0vc/N+7NYdxkR5syNN31BkE+v98az+z1IISEBMTlSD9hRllymVU34Asv/su Received: from [10.167.154.1] (037008245233.garwolin.vectranet.pl. [37.8.245.233]) by smtp.gmail.com with ESMTPSA id un9-20020a170907cb8900b00a384365e3b9sm562305ejc.195.2024.02.06.10.43.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 10:43:43 -0800 (PST) From: Konrad Dybcio Date: Tue, 06 Feb 2024 19:43:36 +0100 Subject: [PATCH v2 03/18] clk: qcom: reset: Ensure write completion on reset de/assertion Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240105-topic-venus_reset-v2-3-c37eba13b5ce@linaro.org> References: <20240105-topic-venus_reset-v2-0-c37eba13b5ce@linaro.org> In-Reply-To: <20240105-topic-venus_reset-v2-0-c37eba13b5ce@linaro.org> To: Bjorn Andersson , Michael Turquette , Stephen Boyd , Philipp Zabel Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Bryan O'Donoghue , Dikshita Agarwal , Vikash Garodia , Manivannan Sadhasivam , Konrad Dybcio X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1707245017; l=1253; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=XwCgSZpLR0e1PPyOXyw9iz+BwYBf4ZHexOSsfIVdxQU=; b=Tq60ALVlciDLkdivYsIcmrQF748EJR+pUE1IufXNafFGsZuOAbb9f/rPSAB0nnwQSqzg3qqQb 6l7lLfFExgEDOXPfLnpXb/GSuu3ptYAHeuizJ30cBnCMswdh1J1/Bz5 X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= 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: db1029814f1f ("clk: qcom: reset: Ensure write completion on reset de/assertion") Signed-off-by: Konrad Dybcio --- 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 20d1d35aaf22..d96c96a9089f 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