Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp8508012ybl; Thu, 16 Jan 2020 18:22:31 -0800 (PST) X-Google-Smtp-Source: APXvYqxtp859MWYaN+Mp1sImj0bPjqBVfcgu752CF072IukP0PALtGpykMZn7eb5y8nM04JKbr9N X-Received: by 2002:aca:bbc6:: with SMTP id l189mr1809785oif.53.1579227751709; Thu, 16 Jan 2020 18:22:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579227751; cv=none; d=google.com; s=arc-20160816; b=z7kydcKWFYpLwFvVSI0YP2m9MRoUlLX4d9ns9DpXXA0NxZ2POz5cuptIhHpvQP/9ij v9yFEnXEJkucEACjoGWLinsEGhxb/Pl0HS/sPsG+xD+ZQYy3cPrxv0yji9LchG04caVX onaHu1WQsYzz0UfPtIIKHlw4ZW1v5qZrgqQSJGcpE+rdCNsRGYo8QH+rRS5t5N+/zXL0 KOeJ19KRbigsKCEHxhIPTVB9M+oPsvi49ZI47m9wLDSPRu5zIKIOto6knWAGMfCevHlK tWnYlUYpZWjFMprEWccvc1Iz7koAOjep8gcOnM7RCaLLe4nqqig8w7Wp2cnopifQ6gPL JUsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=IHWOB6FsuSL0Yy2Ty3ieMphDxgf6/HTzufn9UNkhjQY=; b=ZfOyRihtxVY7jlX4Sf2zC8JdZ8NQv09eFwwEIDVFebvn57UQ9vt3T2iMseQzszmNDq lNohxWDPEQfgAtQNDmpy2g4IsBJwxd5MNM6o4eF6rSsvW6/2TvgQTmnya9E+c7LWHBgE ZFZhoosgpANmRwq2ZyLPRM2nwT03dSIVka3lTJwRrJkgKhtHzXizuuvGseV36aZY42KZ K30k6BgwrOr8kt2LfnNkh6cVynd40TuLnkoc9QgbgzQt9+5XY34slwbY/YVqGT9erxsg /BtzDz71/tADquWl+VkVxb7hZu6hy4nPHn7palrZqE5A5OGCr/Jsw+5MxKcw7D8ydq0o 8GEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=LfEihrM7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l84si12242114oig.5.2020.01.16.18.22.20; Thu, 16 Jan 2020 18:22:31 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=LfEihrM7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388258AbgAPX05 (ORCPT + 99 others); Thu, 16 Jan 2020 18:26:57 -0500 Received: from mail.kernel.org ([198.145.29.99]:57198 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388435AbgAPX0d (ORCPT ); Thu, 16 Jan 2020 18:26:33 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 582832072B; Thu, 16 Jan 2020 23:26:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579217192; bh=mEUvSOU2Akh+cScg+BBUAWEU3flXvD51J2Fu0jvxCSY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LfEihrM70HSkhbZtM651AuYZPmCeS94ZNoNS2lzmlg+ijQkBiLDpzt0qyNcXkNK7S mallynZuie8xEwAVgOUepqg9fMMdRgiv0zovoZg5ECz6r2iZ/JPAhoCx15fqTvs7BN 5iekWMIA9DSTT63kXwBOx8O2P10WA1IBiFVzZP2I= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Anan Sun , Yong Wu , Joerg Roedel Subject: [PATCH 5.4 161/203] memory: mtk-smi: Add PM suspend and resume ops Date: Fri, 17 Jan 2020 00:17:58 +0100 Message-Id: <20200116231758.801694068@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200116231745.218684830@linuxfoundation.org> References: <20200116231745.218684830@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yong Wu commit fb03082a54acd66c61535edfefe96b2ff88ce7e2 upstream. In the commit 4f0a1a1ae351 ("memory: mtk-smi: Invoke pm runtime_callback to enable clocks"), we use pm_runtime callback to enable/disable the smi larb clocks. It will cause the larb's clock may not be disabled when suspend. That is because device_prepare will call pm_runtime_get_noresume which will keep the larb's PM runtime status still is active when suspend, then it won't enter our pm_runtime suspend callback to disable the corresponding clocks. This patch adds suspend pm_ops to force disable the clocks, Use "LATE" to make sure it disable the larb's clocks after the multimedia devices. Fixes: 4f0a1a1ae351 ("memory: mtk-smi: Invoke pm runtime_callback to enable clocks") Signed-off-by: Anan Sun Signed-off-by: Yong Wu Signed-off-by: Joerg Roedel Signed-off-by: Greg Kroah-Hartman --- drivers/memory/mtk-smi.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/drivers/memory/mtk-smi.c +++ b/drivers/memory/mtk-smi.c @@ -366,6 +366,8 @@ static int __maybe_unused mtk_smi_larb_s static const struct dev_pm_ops smi_larb_pm_ops = { SET_RUNTIME_PM_OPS(mtk_smi_larb_suspend, mtk_smi_larb_resume, NULL) + SET_LATE_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, + pm_runtime_force_resume) }; static struct platform_driver mtk_smi_larb_driver = { @@ -507,6 +509,8 @@ static int __maybe_unused mtk_smi_common static const struct dev_pm_ops smi_common_pm_ops = { SET_RUNTIME_PM_OPS(mtk_smi_common_suspend, mtk_smi_common_resume, NULL) + SET_LATE_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, + pm_runtime_force_resume) }; static struct platform_driver mtk_smi_common_driver = {