Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2564501lqp; Mon, 25 Mar 2024 02:46:33 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWY6ZLC+LHHZbwBogl99tSjUP/f+6J+hfLTmeE8aS/qfDsUo79BHhwgljfUKzyTYdA0uImWtByQlu0WUtozNDlNcRuEtdm4kjyMuSvIHw== X-Google-Smtp-Source: AGHT+IEE6WXIqn+r6gJF0o4DO/j/xJbGpxFIT5BZLbs5MTMKKLiGSYzodyDK9RiTW3cbqLaZEsD9 X-Received: by 2002:a05:6358:cc08:b0:17f:5ef7:15cc with SMTP id gx8-20020a056358cc0800b0017f5ef715ccmr5046595rwb.3.1711359992700; Mon, 25 Mar 2024 02:46:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711359992; cv=pass; d=google.com; s=arc-20160816; b=vGGgBTIlpWab6yoLLJ19rYd6pCUxGmD9VAUXq/KitKqKwX3DM8oaUdaGkOMa+qUNGX s9mWXEqfZ/Le3YB12vV4AapmNnqRC775LEDwAGRw6530OyazoLTQ0CDWFvtcBpI3r1MN GBAZM4Gd/+HnXApqzkuzrtXvM3LHKuQlXmlm3o8siPJKYd2JmYtDIUjRW7Cp+5/i4lIF AxbaxsLidoWzYTi6/HhQmnXFDi7XmNYBIE4j3JCrhrbcc90cVHYA6Q3O6s7dNHZea2p1 E7kmMskZrl+CtJniQi1OIAZXPRZD8VncMWmU1YOAuyUEBPFEaTUACtHvVckAWugt3fGx IWyA== 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=IVbQVQqNnc4gExvh0hipaWpudAubA5acEocWlpO1mig=; fh=tCyrEZ3VvyQxx3dQnTilRCYif+fVI17IJAkB8qaQ3yI=; b=L8PSg6rUgBZmMYqyMOV3uYV6fkSJ8MCIfN2IgNkvEcRxAzqaWi9Ss5qE5epP2TZSyi pOV8urukaOJAznv0yveIfzMFVaEfOiIg0RLid4fDYV0bFEGRR4QpZ1vCTqzd8LW+mi5W sjbV/23ohB3YRl8Gin0owD8NNLEMldqlj/9gjCulWXC1ZInOhJzK+UcLhghy9xuWHUD/ 0zZto0Nn2fOw0Qvl7pIT4EipBO0yp/1R5XplQAkbc33tw2U/4efeDUME9gKQYqxMHqxw U4Lywp4LxVd8AYzmXpXQ/SGappLAHf4dg31ar3v3fXgV84xpxo6o/r+Eclf60z+7Kq4N fFpw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RbGdeduh; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-116331-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-116331-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 k2-20020a63d102000000b005dc82971734si7430713pgg.387.2024.03.25.02.46.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 02:46:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-116331-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=RbGdeduh; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-116331-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-116331-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 F33A3B3DC08 for ; Mon, 25 Mar 2024 08:44:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3F34D29BB11; Mon, 25 Mar 2024 03:41:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="RbGdeduh" 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 578C4296169; Sun, 24 Mar 2024 23:51:57 +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=1711324317; cv=none; b=U9K/yQS3CbJw2sXZ3XLFQ3xKOBeXW4yu54T2QxI6izNZS4REPrlwRiIlR0PtRYq5YQ2CU5BmIU/NQgBmDNDRSv+oqRo6FbThy4uGk2W7sP7zrVVtJi638NvIr5f2HhjkcEfMa7WoHBKHQ8b3AOACp8qdeyBb0XY0TfKuUh/akFo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711324317; c=relaxed/simple; bh=YSgfR+iwNZXq5JgYJ4A2KR4Tqnl/88XavKHKucwJQ+w=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KcMnQVmNyr7taGiWOAMRCNzsJJTMIfdZV+3i3kQlAi+HyKjHeVyvrxiMoVoyew5xZ/s/nUZyOYK9R4xFU1Ur6qcbNIX+EDLXmmxdg0AFS0Jx1LjSMnLc+fXiyBcaUrU9Hjud5o3rzn8F06+Ol/GkpUXFQN2EhFDzU7LNXvlqMbI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=RbGdeduh; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 90FD8C433C7; Sun, 24 Mar 2024 23:51:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711324317; bh=YSgfR+iwNZXq5JgYJ4A2KR4Tqnl/88XavKHKucwJQ+w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RbGdeduhp1aXbeoqrbyAXoYwV1OoOz1QJu4jLISI3pikO4yQbBFbVR7glFUpLsURN PADvZXAKgZElldv5DI0zgp8/RKn9RzTnpJc7wrrk36REYfgNws7tlHxkDRWtx+oHoS xAlOQHDrfPe2n959F4Jct9kaouOi6bqx1BkcWFuzfWhVLFNmi9ld7a60Ah2dE1Ots5 ik5bV78FoF6/53vSNlI91W04DMnPUUD25OrEaM7npb+7hwTmvuop43UAY/Uq69LS5/ CwzaqbQwc4gyl6ya1dg9ctz5mvWrp0kzxYdspI01BzkJNzsHZpXL0ArwCFj2S+TtUw vG0Zwy2w6oSUg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Stephan Gerhold , Bjorn Andersson , Sasha Levin Subject: [PATCH 4.19 088/148] clk: qcom: reset: Allow specifying custom reset delay Date: Sun, 24 Mar 2024 19:49:12 -0400 Message-ID: <20240324235012.1356413-89-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324235012.1356413-1-sashal@kernel.org> References: <20240324235012.1356413-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: Stephan Gerhold [ Upstream commit 2cb8a39b6781ea23accd1fa93b3ad000d0948aec ] The amount of time required between asserting and deasserting the reset signal can vary depending on the involved hardware component. Sometimes 1 us might not be enough and a larger delay is necessary to conform to the specifications. Usually this is worked around in the consuming drivers, by replacing reset_control_reset() with a sequence of reset_control_assert(), waiting for a custom delay, followed by reset_control_deassert(). However, in some cases the driver making use of the reset is generic and can be used with different reset controllers. In this case the reset time requirement is better handled directly by the reset controller driver. Make this possible by adding an "udelay" field to the qcom_reset_map that allows setting a different reset delay (in microseconds). Signed-off-by: Stephan Gerhold Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220706134132.3623415-4-stephan.gerhold@kernkonzept.com Stable-dep-of: 2f8cf2c3f3e3 ("clk: qcom: reset: Ensure write completion on reset de/assertion") Signed-off-by: Sasha Levin --- drivers/clk/qcom/reset.c | 4 +++- drivers/clk/qcom/reset.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/clk/qcom/reset.c b/drivers/clk/qcom/reset.c index 0324d8daab9bc..fc68c8fa30ac7 100644 --- a/drivers/clk/qcom/reset.c +++ b/drivers/clk/qcom/reset.c @@ -21,8 +21,10 @@ static int qcom_reset(struct reset_controller_dev *rcdev, unsigned long id) { + struct qcom_reset_controller *rst = to_qcom_reset_controller(rcdev); + rcdev->ops->assert(rcdev, id); - udelay(1); + udelay(rst->reset_map[id].udelay ?: 1); /* use 1 us as default */ rcdev->ops->deassert(rcdev, id); return 0; } diff --git a/drivers/clk/qcom/reset.h b/drivers/clk/qcom/reset.h index cda877927d43a..3e30f6724c7a4 100644 --- a/drivers/clk/qcom/reset.h +++ b/drivers/clk/qcom/reset.h @@ -19,6 +19,7 @@ struct qcom_reset_map { unsigned int reg; u8 bit; + u8 udelay; }; struct regmap; -- 2.43.0