Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp2278289imc; Tue, 12 Mar 2019 10:26:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqyCEkmBAi4ykbIWntG7zeyfGewe+c9e8vKA3qdqZ63gxqPFpNxcM32PiRfpExvPGyNgdYIX X-Received: by 2002:a63:581c:: with SMTP id m28mr419351pgb.332.1552411602716; Tue, 12 Mar 2019 10:26:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552411602; cv=none; d=google.com; s=arc-20160816; b=NHm5gHrMrufm+FHMkiPfcYSflaoBjDfe3i89gREiY3AiPyiJMfKu/yEbGcqWUk7id6 YGbz5a0ebcRWkyWuknOpRiOazWCIsBKOGxHUtrZMA0+7Q8lKHIbVDk3EfJWM+K0Lh98Q nYZ00qAau3pfKloaTARDj9MctiBvBP2XzGoWu8sHfSgvswyIrmkioQZJ2UQr0O1pX+jt CH87jH52M7am9JLB/GJzeAtnqfu7lBFm77aDVX4Y83h2WKVsSih53rfwEw0rlfrljRQk kWJex+QkZJmXIugn9L9huZ8vsKzfyIkizBCMSSH6Jg+KiIShEIRE03YboW6f8PimbYCY PGSg== 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=gB9s2Ac1r5SCQfpL6tFb9x/kYTiAW/ET0fBzBythS5E=; b=tIpYTfTznXVgRZHkdeMyh73FcJw7+BaZ2UeQIcMqxlTBYC/MpI8HsVg8X4HGShegt3 kOAZU0C7EkOUiE5So4l6bgg+dggX4EQgAwqectAQzfrX5KFeqDGg5dTMcs9blgiLTZYG 5MzVDHd8SNByCWXw2k8ivX2lrxVkC1hXeAdwSGTH1XKSg1IYZ71BSH/e+T4oTB8pYKnN NTOleD5vDVQX+Ivy059eU2DWEQPIwWzTN3IhCYP7naVBKtowYne+PN/yOjTSHsegQd8y w9c4N304JjUPuWr5BK7qRmAQtfzCIZdHoY38VmCRqPzxNrM6T5ouYc2G0tdXjDZBAq6+ vf7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=k8dE0SAr; 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 32si8753524plc.427.2019.03.12.10.26.26; Tue, 12 Mar 2019 10:26:42 -0700 (PDT) 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=k8dE0SAr; 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 S1729822AbfCLRR4 (ORCPT + 99 others); Tue, 12 Mar 2019 13:17:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:59628 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729345AbfCLRQw (ORCPT ); Tue, 12 Mar 2019 13:16:52 -0400 Received: from localhost (unknown [104.133.8.98]) (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 DD916217F5; Tue, 12 Mar 2019 17:16:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1552411012; bh=jWtSe6Bsoi8tRYEr5BM4TQb3RnNxYldFqpQTrBC6txk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=k8dE0SArFSbp8xwwK9GH91bQWKz+yW9QPfUzdoFcVK8tX7oCHU7X3pedpkHvmn8Jk e1y8eGauXXTKPO2aM4s8tGIj1mNMhC7/SENYG/ZqHzu2u7WOY2g4MswaJOzh62MBdn WmdVJ8pTaXqrj3H66vCFHi8fb8FewEFCaH+6p3ic= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Keerthy , Tony Lindgren , Vignesh R , Wolfram Sang , Sasha Levin Subject: [PATCH 4.14 116/135] i2c: omap: Use noirq system sleep pm ops to idle device for suspend Date: Tue, 12 Mar 2019 10:09:23 -0700 Message-Id: <20190312170351.909823348@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190312170341.127810985@linuxfoundation.org> References: <20190312170341.127810985@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore 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 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit c6e2bd956936d925748581e4d0294f10f1d92f2c ] We currently get the following error with pixcir_ts driver during a suspend resume cycle: omap_i2c 4802a000.i2c: controller timed out pixcir_ts 1-005c: pixcir_int_enable: can't read reg 0x34 : -110 pixcir_ts 1-005c: Failed to disable interrupt generation: -110 pixcir_ts 1-005c: Failed to stop dpm_run_callback(): pixcir_i2c_ts_resume+0x0/0x98 [pixcir_i2c_ts] returns -110 PM: Device 1-005c failed to resume: error -110 And at least am437x based devices with pixcir_ts will fail to resume to a touchscreen that is configured as the wakeup-source in device tree for these devices. This is because pixcir_ts tries to reconfigure it's registers for noirq suspend which fails. This also leaves i2c-omap in enabled state for suspend. Let's fix the pixcir_ts issue and make sure i2c-omap is suspended by adding SET_NOIRQ_SYSTEM_SLEEP_PM_OPS. Let's also get rid of some ifdefs while at it and replace them with __maybe_unused as SET_RUNTIME_PM_OPS and SET_NOIRQ_SYSTEM_SLEEP_PM_OPS already deal with the various PM Kconfig options. Reported-by: Keerthy Signed-off-by: Tony Lindgren Acked-by: Vignesh R Signed-off-by: Wolfram Sang Signed-off-by: Sasha Levin --- drivers/i2c/busses/i2c-omap.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c index 23c2ea2baedc..12ba183693d6 100644 --- a/drivers/i2c/busses/i2c-omap.c +++ b/drivers/i2c/busses/i2c-omap.c @@ -1477,8 +1477,7 @@ static int omap_i2c_remove(struct platform_device *pdev) return 0; } -#ifdef CONFIG_PM -static int omap_i2c_runtime_suspend(struct device *dev) +static int __maybe_unused omap_i2c_runtime_suspend(struct device *dev) { struct omap_i2c_dev *omap = dev_get_drvdata(dev); @@ -1504,7 +1503,7 @@ static int omap_i2c_runtime_suspend(struct device *dev) return 0; } -static int omap_i2c_runtime_resume(struct device *dev) +static int __maybe_unused omap_i2c_runtime_resume(struct device *dev) { struct omap_i2c_dev *omap = dev_get_drvdata(dev); @@ -1519,20 +1518,18 @@ static int omap_i2c_runtime_resume(struct device *dev) } static const struct dev_pm_ops omap_i2c_pm_ops = { + SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, + pm_runtime_force_resume) SET_RUNTIME_PM_OPS(omap_i2c_runtime_suspend, omap_i2c_runtime_resume, NULL) }; -#define OMAP_I2C_PM_OPS (&omap_i2c_pm_ops) -#else -#define OMAP_I2C_PM_OPS NULL -#endif /* CONFIG_PM */ static struct platform_driver omap_i2c_driver = { .probe = omap_i2c_probe, .remove = omap_i2c_remove, .driver = { .name = "omap_i2c", - .pm = OMAP_I2C_PM_OPS, + .pm = &omap_i2c_pm_ops, .of_match_table = of_match_ptr(omap_i2c_of_match), }, }; -- 2.19.1