From patchwork Mon Aug 3 08:08:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jun Nie X-Patchwork-Id: 247361 Delivered-To: patch@linaro.org Received: by 2002:a92:cc90:0:0:0:0:0 with SMTP id x16csp1006112ilo; Mon, 3 Aug 2020 01:08:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy6RO43vkftyP+2XogF6+paxwbpZhjRafB08MP2W0g0exiAdEveHk3Di+6O6lr+WEzsfVOb X-Received: by 2002:a17:906:f2cb:: with SMTP id gz11mr14987615ejb.58.1596442123606; Mon, 03 Aug 2020 01:08:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596442123; cv=none; d=google.com; s=arc-20160816; b=rZQaxDH/3k4WipdHS9rxbLRvydPpfSwkHzBm1zcQI/EJ5wBSzO8auUBTJjG7Tn3RAm PCFe7ozmIBMpFHedNNzVXMqWtfKCHwBzNYnj4w88SOpInZpLbub7N7BxPvfljx1CNlIM CwUuernNbxe4jiWbx/VN1ZItQNqMy64ly++MBQVXJessZ8O8b8vGNVOk9BtHgS2y7+g8 An9LvxVmOCEOfkRCh79E0eGCJwugClR8ieLZKmySHfIpkEthBvsbzlGkvgpPn0Pg6r4t DHBFS+IjSPZmd2duf7uQkYmZNqT+CgPwQXn2QaPfPDnYRBxtCF5BH9yLKrvoUT1h6MOJ pZXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=PkmepxYYZt/gqn/wBw6S8aNdATAO4cXfwYhCsxDd/Ng=; b=hb7YL1NE2XWi/BTHFXRLBc2a3/8czx3YHYu/5Go3DHSwJz0u5atgbgQ8wtmbueRi5Z dNK+pz+Yu5LV8OzlYR65Fg6jG1BBLrL/wMfwDmoiPAi7a4DtiZmj6fTSJ+/qx3FBkzH4 xBrIpKihQ1MNCo4U/Tr5D22gNDRJ2lQfoc2XzPVrkbCfwj30/8i9XDH9yvjF/OlD6Xmg 5+3PFkkL3zhPP+4MH++YZdjj8MkNBSeIG9W5z9/+Q4WG3Uq1KNnt+j0/LtJEFPgRUltZ kSutkAbT4fhQq5FV/GI7uXC7rSVjhGYUIyHAaJmIlhOTpWCMf9NcnnRX2JkaVC5V5UxY A1YA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=a8TS8r5m; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y11si10193256edt.52.2020.08.03.01.08.42; Mon, 03 Aug 2020 01:08:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=a8TS8r5m; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725948AbgHCIIm (ORCPT + 15 others); Mon, 3 Aug 2020 04:08:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725933AbgHCIIl (ORCPT ); Mon, 3 Aug 2020 04:08:41 -0400 Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E7D23C06174A for ; Mon, 3 Aug 2020 01:08:41 -0700 (PDT) Received: by mail-pg1-x544.google.com with SMTP id p3so19433055pgh.3 for ; Mon, 03 Aug 2020 01:08:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=PkmepxYYZt/gqn/wBw6S8aNdATAO4cXfwYhCsxDd/Ng=; b=a8TS8r5mQuMldgAH/R3NmPcGGy9ukPw0/rhTRH7cOtb2vPUdd8obl4siT0oAArbwmN kAuEqDRC24QX2Cp8DmgkfIy+K7FDQ2jz2lkV3DKVSZ+Gcv5flRNHqrrlSXu97E3cmeOS I52aNv7nFo9wltaDnUuCS5AVNdaQeckYIMJkI+mW5Mhw4krNS37BYv6fAgyg6gWdXe7t gIc8srHkvwg9RGR7HULvDrnxt8uv5sCzrvaHTtU5Zbr5Dk4KDeM0KvWJmliq8bHvqJQg WSo4LxwSQsY2uOcH/CWrxg1t+Oc1xj/p8DLvHfRbK59YGY3XdhrYtzZaDVvKCtPe6NCb f6jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=PkmepxYYZt/gqn/wBw6S8aNdATAO4cXfwYhCsxDd/Ng=; b=lVYLTbAvZ6SBLYF5DNTVZkSEc5OAcQS9OXGoXJyDboJtSl4n+BTd6zsDyXsOr3t5xi D9k22PsX/AcmBPU9pMB4dnt86JspCHVf7Uw111cQShuzeNeNzLvQEev+xUSB8YvNvSWu 2CSAz78xDkje7CPYbaXEMk/8ngVHHC3RH/N6xsI/p6kLMJ97MWY4aN4kRJ+q0VJLsnrq IqUjKytyrM3ip8h9i/qphz0AIHRNngDcwwcOoB3KV4V0X6wnNLs6jjx7eRE72lghpERv 50kgKUjjBKCjrbWckFAZJZxHzbuHfMBJpojZ5tF4EGK5/aWHi8aMRwa8WE7kulRDTYzp WB/A== X-Gm-Message-State: AOAM530+a3hlXrqzXKUwJWtTbE8VQby6ghzNzgAjRkwOevtpDa6EMaA4 ZKliBoe9ZPU7kOwYEoqqD8K23Q== X-Received: by 2002:a65:6554:: with SMTP id a20mr12439078pgw.301.1596442121516; Mon, 03 Aug 2020 01:08:41 -0700 (PDT) Received: from localhost.localdomain (li519-153.members.linode.com. [66.175.222.153]) by smtp.gmail.com with ESMTPSA id y23sm18609226pfb.66.2020.08.03.01.08.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Aug 2020 01:08:40 -0700 (PDT) From: Jun Nie To: shawn.guo@linaro.org, agross@kernel.org, bjorn.andersson@linaro.org, linux-arm-msm@vger.kernel.org Cc: Jun Nie Subject: [PATCH] i2c: qup: use pm runtime func to manage clk Date: Mon, 3 Aug 2020 16:08:08 +0800 Message-Id: <20200803080808.28134-1-jun.nie@linaro.org> X-Mailer: git-send-email 2.17.1 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Use pm runtime callback to manage clock. Otherwise, clock is enabled in resume without notifying pm rumetime core and result no gating in next suspend. Signed-off-by: Jun Nie --- drivers/i2c/busses/i2c-qup.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) -- 2.17.1 diff --git a/drivers/i2c/busses/i2c-qup.c b/drivers/i2c/busses/i2c-qup.c index fbc04b60cfd1..b447fcbaa3f0 100644 --- a/drivers/i2c/busses/i2c-qup.c +++ b/drivers/i2c/busses/i2c-qup.c @@ -1943,15 +1943,13 @@ static int qup_i2c_pm_resume_runtime(struct device *device) #ifdef CONFIG_PM_SLEEP static int qup_i2c_suspend(struct device *device) { - if (!pm_runtime_suspended(device)) - return qup_i2c_pm_suspend_runtime(device); + pm_runtime_force_suspend(device); return 0; } static int qup_i2c_resume(struct device *device) { - qup_i2c_pm_resume_runtime(device); - pm_runtime_mark_last_busy(device); + pm_runtime_force_resume(device); pm_request_autosuspend(device); return 0; }