Received: by 2002:a05:7412:7c14:b0:fa:6e18:a558 with SMTP id ii20csp199244rdb; Mon, 22 Jan 2024 00:51:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IHt98iJgpPGxddkGBr3wDPmVy2ScdNM66aknmh1kbjZqocKCXH5pEb/Y9rD2DAGiOLDuRtY X-Received: by 2002:a05:6214:dc2:b0:683:d9df:ca5a with SMTP id 2-20020a0562140dc200b00683d9dfca5amr5689222qvt.108.1705913510083; Mon, 22 Jan 2024 00:51:50 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705913510; cv=pass; d=google.com; s=arc-20160816; b=kxIJN4ilm5whD8aA7vXXNzqtBmltHv6yutJ0oVI0h1Sn4eblzhpQ8X2cUniEXKabDw SkcuwRDugOGkz75cc5a4Je04Us56/ORUo6++g1lcW7ujkRaUiQZdJi57MqgjYKl3cLst ZCoyfIQ7r/7dxkMy47044jUgbDSzBEWp5ILL/9T5ddOFmfwcQ6aqo5urOeZpnMhwXHlW M0CqRl/MTNC53v/7s7qWZwQifg4PakK7GtOkjeMUI4amfnOid0tZWTi5n5bGCuuKPw+A roxg+lC3TJgrFY8/IjE69nsYSIEt6K5PVBSXi+6BhGkm/yMqBQqdO+ubBP/oBXpsKB/e dk+Q== 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=OVJFY1Gxb1ISOb6T1YpgtOq7AUto91S3jCAoBzpivuk=; fh=0Ax3s06S0YEdQaNdLE3dhpVPPQQH0vUln+hcOi5MdtU=; b=xQqn39/766fNQfOg1al3Dr+j5QZA5JUlOHH0+6zfVPtNbalKFU1MLBUFEnS+uiooRD gWUSshCNA5jnLvxutKo6/tcAgoSGwvGAvCGCBC5whHEW8vA7N7Hb36zDkxSQqx480o2y mTEvtLClVMkHw//BDJsdLHCvsuZ2GbL6kcDpSEobucvGsnv5M4C1rqYhN9mivm4BFiKx 85umXT/WJ3NHs3plG+zmxGKxcC7KUzLzJC5bNQD/Q/wyjI+LFgTXq28RbOAhMDBRNeXX 4ym2gC4r4TqY45PBvd54BJsO3Wey/uTwQy5D3Vk4kvDyXeIjLP8QdKhQkdGtymYmIu07 I91g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eYbE4gQ8; 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-32561-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-32561-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id b9-20020a0cc989000000b006819a5cf1a7si5080304qvk.568.2024.01.22.00.51.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 00:51:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-32561-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=@linaro.org header.s=google header.b=eYbE4gQ8; 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-32561-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-32561-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id C43411C21FE6 for ; Mon, 22 Jan 2024 08:51:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 661D53CF57; Mon, 22 Jan 2024 08:47:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="eYbE4gQ8" Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com [209.85.167.45]) (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 CB1F23BB43 for ; Mon, 22 Jan 2024 08:47:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705913251; cv=none; b=Nsr4piDNDbVqDjIsGDcP2i3dLXLdSQdzNsrW+R1tg9j0QtMUDk+bqWaeFzNUb1SBeHO0n17iZ77/+Ya6VuDtdHuxfXHrDlALYpyNWrPET23ZETARBH+ri4DGuKx9SPnqS9eZKaZ/KOC8cNfbnfnDlYvf854drq/Op5uJKU1qBoc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705913251; c=relaxed/simple; bh=xVzk6PcGz8JGRaQpKhkaEOsaJx+PBVqpDgR2m0MxeLk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=f1Mqkk8+Yr2MmScPp8a1WSseGZY12QS4FKhSlzDqPukxhFmC0rXXBNqn/v92LagVNNNvsAXawyR9OwVDnij98+X0aZr0+PgIL9b7UZxoLFWbJ7oOzacQ0EVeoxRMDiNZ3/OfLWjIJX/3FzQPY++tkiaAizskHIHClZ4FoLhtVEk= 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=eYbE4gQ8; arc=none smtp.client-ip=209.85.167.45 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-lf1-f45.google.com with SMTP id 2adb3069b0e04-50e7e55c0f6so3006044e87.0 for ; Mon, 22 Jan 2024 00:47:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1705913248; x=1706518048; 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=OVJFY1Gxb1ISOb6T1YpgtOq7AUto91S3jCAoBzpivuk=; b=eYbE4gQ8Ca3gplIKySq8aNLbws3D/hpNMbjU5vTlN5+msw1xEfMhfqSgwx26mStjvN tgPcOl/4JLxr3X5jAsPvYuDCwAARJwpqXzQgW3OpkYhwABXeipNSjixflVf7zwO/qI9m /qETkmVvv1DPZj8Ozaxr9ppcznOP/DlZLXSjIZ5mq7kiFR4H1qPJY8My1aJNy5TmMTgh 8R4nZa+uW5nqXFMMPELUL/NILoyAqrn60q+XPJglQaN5QCSYgiC+8WWuULDiYvUek0GQ h8w+oxlllbmsb0zoET+BLU+bwYOocheryNnrQkMqcE7JyiulN7WrbWOdmZhky3OX5nYP wfFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705913248; x=1706518048; 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=OVJFY1Gxb1ISOb6T1YpgtOq7AUto91S3jCAoBzpivuk=; b=P1EPkQKySbC7pzPInc6EuZvHLVBVzd1kwgENsokM8T5aqO0veTSOdf4RYKkyDFB1fN u8w2i2B8evqT8veeDG40ptF+cSJc3fzhpZBTpdrwgZkjmI+Y56Sl9zHjvJijy3O9uibm J8Ccws97UnNTKVXk6Xhz9uUCbGORpp/hUifE+6DhjAdx3wkwhEFGfaeFG/SQyZ3ehbiw UOA4Hy9LVQwMXtrS1K/cVF07t6wwHMh9Kjp9VyIzrmKMV/ny45MD3D1DUn6ATp21SdiJ ea8NS71RzU4bSSWWP7AptQ+thiSZBh5j2MBIzThwUs64a3lFhF4Tjqn7VeFLlNzjrzy4 8mvg== X-Gm-Message-State: AOJu0Yy6uTBYz7MejOVDYiRlgTvFN7gHHBHJrus0CCeRm+N+5xc8W3D3 XJUo68n6tB2xGBDbdlASzkv9WmgfEUDiqhT9t0fqdc0VpxFnjBzNn6g0oaDZJAE= X-Received: by 2002:ac2:4c8e:0:b0:50e:e8f0:2298 with SMTP id d14-20020ac24c8e000000b0050ee8f02298mr542781lfl.267.1705913247775; Mon, 22 Jan 2024 00:47:27 -0800 (PST) Received: from [127.0.1.1] ([79.115.23.25]) by smtp.gmail.com with ESMTPSA id b21-20020a17090630d500b00a2c4c23cd12sm13075462ejb.217.2024.01.22.00.47.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 00:47:27 -0800 (PST) From: Abel Vesa Date: Mon, 22 Jan 2024 10:47:04 +0200 Subject: [PATCH v4 4/5] clk: qcom: Use HW_CTRL_TRIGGER flag to switch video GDSC to HW mode 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: <20240122-gdsc-hwctrl-v4-4-9061e8a7aa07@linaro.org> References: <20240122-gdsc-hwctrl-v4-0-9061e8a7aa07@linaro.org> In-Reply-To: <20240122-gdsc-hwctrl-v4-0-9061e8a7aa07@linaro.org> To: "Rafael J. Wysocki" , Kevin Hilman , Ulf Hansson , Pavel Machek , Len Brown , Greg Kroah-Hartman , Bjorn Andersson , Andy Gross , Konrad Dybcio , Michael Turquette , Stephen Boyd , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Mauro Carvalho Chehab , Taniya Das , Jagadeesh Kona , Dmitry Baryshkov Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-media@vger.kernel.org, Abel Vesa X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=1921; i=abel.vesa@linaro.org; h=from:subject:message-id; bh=6YCTgAGeGVs43KDgKfImSE+xArUbcRShc9pkDKKCCac=; b=owEBbQKS/ZANAwAKARtfRMkAlRVWAcsmYgBlriuThQApLjd1pjc0SdaYfQW02n40AeD/XJR+z EpLTRfM6lSJAjMEAAEKAB0WIQRO8+4RTnqPKsqn0bgbX0TJAJUVVgUCZa4rkwAKCRAbX0TJAJUV VuO0D/9bQL9I/1mXOi9y2EWRygpuPvCo8p5viVHdlpIlMLffd033I+1m1se6bQFzuE3XqUHRnG6 N61rhS/f7QSFl1jIDuLx7vpPG7K8woM/Hv9pLQtwKiXL4eF+kriPmghr4n3rwQcHWL34LE7Rx7E VkcFcGMU39MW1hlDQcZJ7/QDLr+hYzci2WOa1hEwBGDSuNH2PlS/KpgHp6PCoENc1mOECqUEfXt pwArCw2vNk3isDW2nSjRFzlPWi7PuHsu+tVDlCfdo/BJ8jlhdWYIkZYHKtkDYAgvqbr4wWk9eq7 BPDmuaheBI1tzurdSqotPdLvp8MT4L0w5tqXkeGtAcEzIK3r5v56lv/e+l71QVdGR8eMJTx43UY gi6FQsVEDCiCoCuG3H2FEi9bqHmrUjuAUsUCf5lF6j6LILX4vjxQIrwNUqh8s4N18kJFqtNUUgu rskjr98Kj2YI8FbEB4OTAxSVeov9u5uhAgmwLLYNhMRv1/uqI/lr5vnFRaoc+2iAhopnduwESy0 hSNJfrOu/ClI1dK2aMkP9QpN+/CEvuUxRq385IWt0mgnUuAH8q1YzbeMbTxVBwzFsQF8xvWVNFd BGU3F0ZIvXeHHkWqPYAezxuHN797gpX5V1nfW3T9uRmjlRZ85cL4uiMwHmpVU/U52Rzebq93bek 5V7vYbPOWxgsl1A== X-Developer-Key: i=abel.vesa@linaro.org; a=openpgp; fpr=6AFF162D57F4223A8770EF5AF7BF214136F41FAE From: Jagadeesh Kona The current HW_CTRL flag switches the video GDSC to HW control mode as part of GDSC enable itself, and HW can disable the GDSC right after the GDSC is moved to HW mode. This can lead to subsequent video clock enable failures that are dependent on the GDSC if GDSC is collapsed by HW. Also, while few video hardware registers are being programmed by TZ, GDSC should be in non collapsed state which can be achieved by keeping it in SW mode. Use HW_CTRL_TRIGGER flag instead which allows consumer drivers to switch the video GDSC to HW/SW control modes at runtime using dev_pm_genpd_set_hwmode API as per the requirement. Signed-off-by: Jagadeesh Kona Signed-off-by: Abel Vesa --- drivers/clk/qcom/videocc-sc7280.c | 2 +- drivers/clk/qcom/videocc-sm8250.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/clk/qcom/videocc-sc7280.c b/drivers/clk/qcom/videocc-sc7280.c index 615695d82319..3d07b1e95986 100644 --- a/drivers/clk/qcom/videocc-sc7280.c +++ b/drivers/clk/qcom/videocc-sc7280.c @@ -236,7 +236,7 @@ static struct gdsc mvs0_gdsc = { .name = "mvs0_gdsc", }, .pwrsts = PWRSTS_OFF_ON, - .flags = HW_CTRL | RETAIN_FF_ENABLE, + .flags = HW_CTRL_TRIGGER | RETAIN_FF_ENABLE, }; static struct gdsc mvsc_gdsc = { diff --git a/drivers/clk/qcom/videocc-sm8250.c b/drivers/clk/qcom/videocc-sm8250.c index ad46c4014a40..c1b73d852f1c 100644 --- a/drivers/clk/qcom/videocc-sm8250.c +++ b/drivers/clk/qcom/videocc-sm8250.c @@ -293,7 +293,7 @@ static struct gdsc mvs0_gdsc = { .pd = { .name = "mvs0_gdsc", }, - .flags = HW_CTRL, + .flags = HW_CTRL_TRIGGER, .pwrsts = PWRSTS_OFF_ON, }; @@ -302,7 +302,7 @@ static struct gdsc mvs1_gdsc = { .pd = { .name = "mvs1_gdsc", }, - .flags = HW_CTRL, + .flags = HW_CTRL_TRIGGER, .pwrsts = PWRSTS_OFF_ON, }; -- 2.34.1