Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp2296381imc; Tue, 12 Mar 2019 10:49:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqwNlwwEfcsP2Wi9er7irkHLgIQs3qcoJ54XkSgEByNu/W1OzCWmmO706EugRswoWI5dVCLy X-Received: by 2002:a63:1602:: with SMTP id w2mr7190452pgl.406.1552412980677; Tue, 12 Mar 2019 10:49:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552412980; cv=none; d=google.com; s=arc-20160816; b=nz3lkXWk41KR4ZtunRA3+/pgBXKsgQiNwvKxEwmvCujqVHtsToe0SysMsfK+V5fA3b zIhE153wDsZlJTxPe6sInKoUofLcj/oHQP90V4qjNxZWgyw5w84HKnwj7Vmbmf9A9Gq+ GbbsSyrR2ci44IiiycJ0q6US0yMFZ91vHyIopDSeuT2NfRbuSMThzQ+nUWmAqb2I2bSV 6aUnYcjeSTG1gvFZvDVYiALcy3PUjy4oZNraOapwdwG9PSmW87YRgnZLDBZO8U8TRRqx YhUivyAAoZcWyBZuvPEJdEIyngydEZua5pw5e+CI58U/cm1Cdy4uT4/8jum/Ht/XgnqM j0wg== 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=8FqUbcJ8JEjnpjotaG9HLuL7DgRtDdolj9PcBPw6Eto=; b=XxGF3uAiqcTvlu06xRq4bKt4cPvREbVo9NOecj4tPPyg1aenfUnruR9VA7zTSlWz7g sITGt6yf8qdfOFGjV2mnYSgdYZH0Z6q21GM5gfy54UiKqnSM0iqlmsVeoIxcERAopBYD /4/3y7P5jV6kMptDeJfZqRbo67pe6Q6iakMGQlprdA7DrjjByrm17xyXygv3zNVgT6Yl N6zN9Q8JaP2kBVqpJ8sCBD5Iqsx4tXlBgxa7EhKlH5HjH5ZC00tMY5OiydjL2G8nnpKs T8+OouwA12LuhIvSxFJM9kC022gmi1B9uTi9IcRalLJVyLmRjGQI9/OO2FvFIrIGRRLQ gUCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=g642HuJq; 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 w16si7982546pgj.217.2019.03.12.10.49.24; Tue, 12 Mar 2019 10:49:40 -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=g642HuJq; 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 S1728722AbfCLRs1 (ORCPT + 99 others); Tue, 12 Mar 2019 13:48:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:54726 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728585AbfCLRPB (ORCPT ); Tue, 12 Mar 2019 13:15:01 -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 7203A206DF; Tue, 12 Mar 2019 17:15:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1552410900; bh=Ul5r+3kTF4BnSmnINmcXayxxV3/YBOb7ka73iAwojdg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=g642HuJqZ031hNrA1pzLYeWyy3dbjnIh37+7rUvyJSnNjImXUzMPqqxR27BVUJV+1 81CQ4+/h4zkWCawSUThLxf5T7Z+hEw7E0hbd9HpXpA+eGlk/AX062NG6FYQbgMaskC 62W+bWxYzz5KFcuEy3UHlOW+jlBL/uAIrrd68YvE= 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.19 113/149] i2c: omap: Use noirq system sleep pm ops to idle device for suspend Date: Tue, 12 Mar 2019 10:08:51 -0700 Message-Id: <20190312170358.954998908@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190312170349.421581206@linuxfoundation.org> References: <20190312170349.421581206@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.19-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 65d06a819307..2ac86096ddd9 100644 --- a/drivers/i2c/busses/i2c-omap.c +++ b/drivers/i2c/busses/i2c-omap.c @@ -1498,8 +1498,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); @@ -1525,7 +1524,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); @@ -1540,20 +1539,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