Received: by 10.223.185.116 with SMTP id b49csp3581986wrg; Mon, 26 Feb 2018 02:29:58 -0800 (PST) X-Google-Smtp-Source: AH8x227JkG9o2Aodp1euem32xuPRWXcyA/HWcfl40V8/X03dRIsBbt47p/6Cw62gc+q/gxw7HPif X-Received: by 10.99.167.2 with SMTP id d2mr8006213pgf.408.1519640998225; Mon, 26 Feb 2018 02:29:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519640998; cv=none; d=google.com; s=arc-20160816; b=uR571+bx0vG1CpU8CmCN/YHRGmF4AM/X/Lc2v+8vvQNgxvpr0eELv7kONHPiF4LXC/ qcBz8pBCVZWh9Du2ZqHlQBuQEZ4PQq/NN4PpIrz/M5xJ6pbEgyYXmb9UGmMwqzXOs0xV glR0lgBMBAOYc97XeCAKKSE72XnxuiwEsqfiozt+8i+2ccV+1pkT9c06WMhgdTyeYdnX 0l7sfUyduDy33iM48kU64IStjFp0B7o5YSJQP4c1PZhjm6TKkdZHzJnrIaFH+SURButa 8arZE+ECM8lrQys9XEQTCfjCY8KS76hm4IueJpSZ/uWEPQS/xYo7ElZf43b/syRPaFMn MFIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=Q7lK7kdzwkXItGjz3GHrtUEJxm40lUF7rBrYZEHpYYk=; b=0fVX08l2ol2yLVWypDOsQFvINRwu5maVzdurjq317Is93XxMs/DHrE8+7JWtZq0se3 Y1ilWkX4oJg0UsGwRUIaYpbJY0Z+nf9OXpvsRr3aUMmg3C8+epe9nI4lDUll/t9ehogD cxUMkYTbknbHID7oO2shGO9hO4L1EAhbDimoSe6bZuJsOfrXVKYVrZWYaDXviKrSjzGP IPA4vXpjblrUXA7CaocK6e8VLMerHZ6heerAqgATaxfsrkOSZlLRheJjpCDX1ryVkbef u8FStF5LBu8JqaiEts3/Ujp2FDS8HugkQyURBRxzr356/fojBCx6V0d9AsIZ/JVByD3p 3Eaw== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d1si5367807pgn.661.2018.02.26.02.29.44; Mon, 26 Feb 2018 02:29:58 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752744AbeBZK1Z (ORCPT + 99 others); Mon, 26 Feb 2018 05:27:25 -0500 Received: from bhuna.collabora.co.uk ([46.235.227.227]:48346 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752353AbeBZK0U (ORCPT ); Mon, 26 Feb 2018 05:26:20 -0500 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: eballetbo) with ESMTPSA id 51F64277771 From: Enric Balletbo i Serra To: lee.jones@linaro.org Cc: groeck@chromium.org, andy.shevchenko@gmail.com, kernel@collabora.com, gwendal@chromium.org, linux-kernel@vger.kernel.org, Joseph Lo Subject: [PATCH v3 8/8] mfd: cros_ec_i2c: moving the system sleep pm ops to late Date: Mon, 26 Feb 2018 11:26:06 +0100 Message-Id: <20180226102606.15093-9-enric.balletbo@collabora.com> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180226102606.15093-1-enric.balletbo@collabora.com> References: <20180226102606.15093-1-enric.balletbo@collabora.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Joseph Lo The cros_ec_i2c driver is still active after it had suspended or before it resumes. Besides that, it also tried to transfer data even after the I2C host had been suspended. This will lead the system to crash. During the test, we also observe that the EC needs to be resumed earlier due to some status polling from the EC FW (e.g. battery status). So we move the PM ops to late stage to make it work normally. Signed-off-by: Joseph Lo Signed-off-by: Enric Balletbo i Serra Reviewed-by: Andy Shevchenko --- Changes in v3: - [8/8] Add static to cros_ec_i2c_pm_ops. - [8/8] Add the Reviewed-by Andy Shevchenko. Changes in v2: - [8/8] This patch is new in this series replacing [5/6] of v1. drivers/mfd/cros_ec_i2c.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/mfd/cros_ec_i2c.c b/drivers/mfd/cros_ec_i2c.c index 02a7bacdc056..ef9b4763356f 100644 --- a/drivers/mfd/cros_ec_i2c.c +++ b/drivers/mfd/cros_ec_i2c.c @@ -342,8 +342,9 @@ static int cros_ec_i2c_resume(struct device *dev) } #endif -static SIMPLE_DEV_PM_OPS(cros_ec_i2c_pm_ops, cros_ec_i2c_suspend, - cros_ec_i2c_resume); +static const struct dev_pm_ops cros_ec_i2c_pm_ops = { + SET_LATE_SYSTEM_SLEEP_PM_OPS(cros_ec_i2c_suspend, cros_ec_i2c_resume) +}; #ifdef CONFIG_OF static const struct of_device_id cros_ec_i2c_of_match[] = { -- 2.16.1