Message ID | 20240120100711.2832897-1-cristian.marussi@arm.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-31757-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2bc4:b0:101:a8e8:374 with SMTP id hx4csp1535559dyb; Sat, 20 Jan 2024 02:07:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IECuwTrSiG0pF62NdhVnify9/KpLfyUPajHFdCowSvx3j7JxICQZVQS+wAeSYaHSUnf6zKv X-Received: by 2002:a17:90b:2282:b0:290:2deb:9010 with SMTP id kx2-20020a17090b228200b002902deb9010mr3297090pjb.28.1705745258548; Sat, 20 Jan 2024 02:07:38 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705745258; cv=pass; d=google.com; s=arc-20160816; b=yx+W/4xqtINGt3pqHmivK90BKtWJSB99Js/TC+1MlsLyGBluysdBSFblXoCy9IR9KI J2jgj2O/01EXdzthRFWJnzzOfoM0T1GfqNXgGo9DE73KbjDBRJmeNPLho2C6ecttL8gs J6Wl2lnIN8rpbjbQ5grNhP/2Ar8+Npq02TAcj8ZfzjK84rXUQ/ESun53xznq52HrC2i5 9VYyptp5wfBAEf+hu+6p67NO4NYFKiKiDvvDOCu/8nhXffuCqCEV7y9rLv6epn7etyC2 3kfBMPXqRduGM3RG19zDFYmJioQuP/YxEryHDWq1G5q2vri2diadefZ2kN2aRtIdmlPm bk0A== 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:message-id:date:subject:cc:to :from; bh=JzVAOCoEYznYter2sNm60QjB+T/+9jkQt77Ql90Spqk=; fh=bxpCpK0HZokzJ5aSwZTfV5bbzUNDArBVIrYtaRvzWuw=; b=QF/d8c6R0Q8L40dFNIGK2mpR0aUnWcT+Zq6ruvGzI/OMv/7pbq3Mzh63tE448X3c+H 6mY6eUD8T/h/WKOMxknzeILEINftXbqRz/aJppB9D+SH1j17JqjujNQfZ5DJR+5na2QW 3fE5ahyU7X2AdWpp2JBRSxhiXtP3GOLuCmNIFIPMg3d38rP1xe7aIMKBxoVOoEtE/Ahy GQzHSAOfF4KMQ+19LU8y49Psq0UX8Niw/3BaH7WKc+/U8HxOX56OF+R+GYJ+XaTXm6dJ 7cJodYLvxyrhCmdSYR8TbmwTMpK125wi4EYDYX6VXtiXFFe/8AmthBdvlvTFhDwjyu5w +pBg== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-31757-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-31757-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id s16-20020a17090aa11000b002900d52ba95si4906955pjp.179.2024.01.20.02.07.38 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 20 Jan 2024 02:07:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-31757-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-31757-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-31757-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 546CC283578 for <ouuuleilei@gmail.com>; Sat, 20 Jan 2024 10:07:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E8973D2FA; Sat, 20 Jan 2024 10:07:25 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4418CD262; Sat, 20 Jan 2024 10:07:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705745244; cv=none; b=KhOLz/a/2sqxorC79PX2Bp4svOn1FV86lyXXrMGw+8iytc0HN0KsbmOJNVZkXBE701o0MKJMBf1nlR0I2HygybiOZi7djcGvxmCW3XMCdv/7b4GCWs3f1Z8oDMJv1ym5zEoHgmFWOmSZBnBsHRSuK51K8xOEIs2vnOu0cChI2Rs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705745244; c=relaxed/simple; bh=RHllaD+Z3afhGqk7hdVhYxhjR8H3nKx82VdjEZg6NJE=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=JDFo7FVdd4zMjBd7apa2UzDgy8fM688LBTazJbIOtjDt0k+7RAxNZi3tyzeJ1ZKeZiBGGQwBPyRt6PAja0C9PoUheWaYPANAMxPU8GqswNPl8KfMHHxM3P8yEVzQnF+E3/pCkVOPW9d24xtbQSXgbHNwW1ZDd+wsVRtfgXETxS4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 24B96DA7; Sat, 20 Jan 2024 02:08:07 -0800 (PST) Received: from pluto.fritz.box (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5F7003F73F; Sat, 20 Jan 2024 02:07:19 -0800 (PST) From: Cristian Marussi <cristian.marussi@arm.com> To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: sudeep.holla@arm.com, peng.fan@oss.nxp.com, Cristian Marussi <cristian.marussi@arm.com>, Michael Turquette <mturquette@baylibre.com>, Stephen Boyd <sboyd@kernel.org>, linux-clk@vger.kernel.org Subject: [PATCH] clk: Check ops are available in clk_gate_restore_context Date: Sat, 20 Jan 2024 10:07:11 +0000 Message-ID: <20240120100711.2832897-1-cristian.marussi@arm.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1788603540348581362 X-GMAIL-MSGID: 1788603540348581362 |
Series |
clk: Check ops are available in clk_gate_restore_context
|
|
Commit Message
Cristian Marussi
Jan. 20, 2024, 10:07 a.m. UTC
Add a check in clk_gate_restore_context() to assure that the clock enable
and disable ops are available before calling them.
CC: Michael Turquette <mturquette@baylibre.com>
CC: Stephen Boyd <sboyd@kernel.org>
CC: linux-clk@vger.kernel.org
Fixes: 9be766274db4 ("clk: Clean up suspend/resume coding style")
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
---
Spotted this by code inspection.
I may be missing something, though, given my limited familiarity with CLK.
---
drivers/clk/clk.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index f0940af485a5..79b90a8099d7 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -1200,9 +1200,11 @@ void clk_gate_restore_context(struct clk_hw *hw) struct clk_core *core = hw->core; if (core->enable_count) - core->ops->enable(hw); + if (core->ops->enable) + core->ops->enable(hw); else - core->ops->disable(hw); + if (core->ops->disable) + core->ops->disable(hw); } EXPORT_SYMBOL_GPL(clk_gate_restore_context);