Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4839374pxj; Wed, 9 Jun 2021 03:12:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw5CzzpWBeH66/75diZg3knwgvpGeVR9bGyFRSRbU1lVS/ykUYxDD+qXOa29MrJMStqqY4o X-Received: by 2002:a17:907:9813:: with SMTP id ji19mr28338528ejc.318.1623233568915; Wed, 09 Jun 2021 03:12:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623233568; cv=none; d=google.com; s=arc-20160816; b=Qce5f/F3jpH9zDTauIyUP0AcZO9RgK0E2465HA4mdL/okNaMrAzxA5jJDdBOx2MoO+ GmINq94XnuVRpovIl9KvIor+eqEEcbTlgXcIeXY+Q1qVIVD4qE3MzeUKFO76hv+4wXkA 0EYZDMCYp1j/GYpUrw2eJ5H5AB2p+QwhFw+o84kIIk4vB03ughYAv/Vm0ZGCUYXujZCC 48qMYhKgU7BRaWBoizRAID9wANyMNoUXmHf9ZSNQ6W00G1bxG/tKhth+h12OpOV/4blD HopAoBn60Yx291DLiQHSFSQCR7G1+X58HMO2OwRD1P32OYv9UPQ604L1+zvHSUsZdbLB 9eVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=vnIKGYdJalGzf/W5IA/crQ+SSziH+9PMGrwbR3wzGtE=; b=t1XHCTHVa/KrXEqsZXRYZqcskptFre4PLz8HemNUQiGhfiyNmexsKs6+Md6T7gctY9 dtUNTNFTYVJaEWwYasv2UHAPe2UHTgopT3OHHTz6KWHJiWCqwgeRlfpVxR4Y1w/GmkmF K0rjbqBYGwfjzLsarOXzeUOy8++Bf3XUmTHjU6RZ76G1elLq/BK6oWM8Oohru28hq3Q8 pvD2/sCa9Svzus7aNnrR/u455YdnGCr6jEyv2u/QVXuYm5efiZsP1O7N1DOsYG/EccAd VyKx2ijD1vy0BkX3ng1V5f8pIqTL15m73DyEz/tk/zOYvHYY+vMMVCA5w713sqKmEnb/ swwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=CTRDi2Jq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id mb15si2059148ejb.279.2021.06.09.03.12.25; Wed, 09 Jun 2021 03:12:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@linuxfoundation.org header.s=korg header.b=CTRDi2Jq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236717AbhFHSzF (ORCPT + 99 others); Tue, 8 Jun 2021 14:55:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:44434 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235165AbhFHStI (ORCPT ); Tue, 8 Jun 2021 14:49:08 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id F03E661463; Tue, 8 Jun 2021 18:38:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1623177528; bh=Nop9Vx39Z+8pKW20rBUxFHd6dZwSS3Yu2xp4oxhpkOM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CTRDi2JqbS385HOH965lY+ZEZauElX5OOruIWUp2qUxqD5wipmWTSl+DPYdER7rTG jvGfM28bNL+8hEd8FLGXhGkcnO3UCGaVdM9JELh+GlBI9YaixHsvIk0e1apadd25eD qqhgLnuCbqyQwg/aGSNYISxZ4lzUfISv/XZNQyPk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Roja Rani Yarubandi , Stephen Boyd , Wolfram Sang Subject: [PATCH 5.4 77/78] i2c: qcom-geni: Suspend and resume the bus during SYSTEM_SLEEP_PM ops Date: Tue, 8 Jun 2021 20:27:46 +0200 Message-Id: <20210608175937.863047645@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210608175935.254388043@linuxfoundation.org> References: <20210608175935.254388043@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Roja Rani Yarubandi commit 57648e860485de39c800a89f849fdd03c2d31d15 upstream. Mark bus as suspended during system suspend to block the future transfers. Implement geni_i2c_resume_noirq() to resume the bus. Fixes: 37692de5d523 ("i2c: i2c-qcom-geni: Add bus driver for the Qualcomm GENI I2C controller") Signed-off-by: Roja Rani Yarubandi Reviewed-by: Stephen Boyd Signed-off-by: Wolfram Sang Signed-off-by: Greg Kroah-Hartman --- drivers/i2c/busses/i2c-qcom-geni.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) --- a/drivers/i2c/busses/i2c-qcom-geni.c +++ b/drivers/i2c/busses/i2c-qcom-geni.c @@ -685,6 +685,8 @@ static int __maybe_unused geni_i2c_suspe { struct geni_i2c_dev *gi2c = dev_get_drvdata(dev); + i2c_mark_adapter_suspended(&gi2c->adap); + if (!gi2c->suspended) { geni_i2c_runtime_suspend(dev); pm_runtime_disable(dev); @@ -694,8 +696,16 @@ static int __maybe_unused geni_i2c_suspe return 0; } +static int __maybe_unused geni_i2c_resume_noirq(struct device *dev) +{ + struct geni_i2c_dev *gi2c = dev_get_drvdata(dev); + + i2c_mark_adapter_resumed(&gi2c->adap); + return 0; +} + static const struct dev_pm_ops geni_i2c_pm_ops = { - SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(geni_i2c_suspend_noirq, NULL) + SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(geni_i2c_suspend_noirq, geni_i2c_resume_noirq) SET_RUNTIME_PM_OPS(geni_i2c_runtime_suspend, geni_i2c_runtime_resume, NULL) };