From patchwork Mon Jul 6 14:07:21 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 50765 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f69.google.com (mail-wg0-f69.google.com [74.125.82.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 29353218EA for ; Mon, 6 Jul 2015 14:11:48 +0000 (UTC) Received: by wgjx7 with SMTP id x7sf50276412wgj.3 for ; Mon, 06 Jul 2015 07:11:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=uJTffIvV8ONAuOqpuMPEIyKQG2q96gUorAd0c6q4vJw=; b=JF5TFpyOQA4CocrfhyKzDGJ3wWhgzP7N+31gIj0IiGxkhZUETCmSkmnumHnKjk9F42 DMzpBuc3LBkfIUAqz75NHzX1XcELxiUfjsw+P4NmpS5bSn3FcPN4NvVpUgoRrjfYmCU9 LeK3Qi9Cy2MlaG8rur0WcWMjZgYMPBghEn53PEKrJRMcOZQ41Mp5RjbocEm9Mn5wUc4A WPODwl6apqZ5WTxSovlJFyHvr98cA+hnuqYDRIi7lzE8prLEjO0r2bmC0cimza+v0Ipf miCMeZXKqYBuQROdrcLskA8FC4wIhdY0Cgys9Fj9x5g+oFR2A0xbNdMgA404NDfJdyi3 MeeA== X-Gm-Message-State: ALoCoQn4lkujHrS8/xhm+xckfFL25DxVRr/1SEKTCNidTFi9N8/iAXBwzq9ij+dM3nboVNbaFl1f X-Received: by 10.112.139.137 with SMTP id qy9mr306695lbb.17.1436191907286; Mon, 06 Jul 2015 07:11:47 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.205.70 with SMTP id le6ls702142lac.10.gmail; Mon, 06 Jul 2015 07:11:47 -0700 (PDT) X-Received: by 10.153.6.7 with SMTP id cq7mr4638103lad.105.1436191907169; Mon, 06 Jul 2015 07:11:47 -0700 (PDT) Received: from mail-la0-f45.google.com (mail-la0-f45.google.com. [209.85.215.45]) by mx.google.com with ESMTPS id ml17si15355133lbb.116.2015.07.06.07.11.47 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Jul 2015 07:11:47 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.45 as permitted sender) client-ip=209.85.215.45; Received: by laar3 with SMTP id r3so156974266laa.0 for ; Mon, 06 Jul 2015 07:11:47 -0700 (PDT) X-Received: by 10.152.26.163 with SMTP id m3mr49242040lag.86.1436191906886; Mon, 06 Jul 2015 07:11:46 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp1751213lbb; Mon, 6 Jul 2015 07:11:45 -0700 (PDT) X-Received: by 10.70.87.231 with SMTP id bb7mr105174208pdb.70.1436191875759; Mon, 06 Jul 2015 07:11:15 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id gz10si29172698pbd.213.2015.07.06.07.11.14; Mon, 06 Jul 2015 07:11:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756110AbbGFOLH (ORCPT + 2 others); Mon, 6 Jul 2015 10:11:07 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:23037 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755604AbbGFOKU (ORCPT ); Mon, 6 Jul 2015 10:10:20 -0400 Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id t66EAJxo009407 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 6 Jul 2015 14:10:19 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0022.oracle.com (8.13.8/8.13.8) with ESMTP id t66EAJWQ009927 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Mon, 6 Jul 2015 14:10:19 GMT Received: from abhmp0002.oracle.com (abhmp0002.oracle.com [141.146.116.8]) by aserv0122.oracle.com (8.13.8/8.13.8) with ESMTP id t66EAJJi003267; Mon, 6 Jul 2015 14:10:19 GMT Received: from lappy.hsd1.nh.comcast.net (/10.154.116.12) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 06 Jul 2015 07:10:19 -0700 From: Sasha Levin To: stable@vger.kernel.org, stable-commits@vger.kernel.org Cc: sasha.levin@oracle.com Subject: [PATCH 3.18 065/195] leds / PM: fix hibernation on arm when gpio-led used with CPU led trigger Date: Mon, 6 Jul 2015 10:07:21 -0400 Message-Id: <1436191771-13828-66-git-send-email-sasha.levin@oracle.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1436191771-13828-1-git-send-email-sasha.levin@oracle.com> References: <1436191771-13828-1-git-send-email-sasha.levin@oracle.com> X-Source-IP: aserv0022.oracle.com [141.146.126.234] Sender: stable-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: stable@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: patch@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.45 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Grygorii Strashko [ Upstream commit 084609bf727981c7a2e6e69aefe0052c9d793300 ] Setting a dev_pm_ops suspend/resume pair of callbacks but not a set of hibernation callbacks means those pm functions will not be called upon hibernation - that leads to system crash on ARM during freezing if gpio-led is used in combination with CPU led trigger. It may happen after freeze_noirq stage (GPIO is suspended) and before syscore_suspend stage (CPU led trigger is suspended) - usually when disable_nonboot_cpus() is called. Log: PM: noirq freeze of devices complete after 1.425 msecs Disabling non-boot CPUs ... ^ system may crash or stuck here with message (TI AM572x) WARNING: CPU: 0 PID: 3100 at drivers/bus/omap_l3_noc.c:148 l3_interrupt_handler+0x22c/0x370() 44000000.ocp:L3 Custom Error: MASTER MPU TARGET L4_PER1_P3 (Idle): Data Access in Supervisor mode during Functional access CPU1: shutdown ^ or here Fix this by using SIMPLE_DEV_PM_OPS, which appropriately assigns the suspend and hibernation callbacks and move led_suspend/led_resume under CONFIG_PM_SLEEP to avoid build warnings. Fixes: 73e1ab41a80d (leds: Convert led class driver from legacy pm ops to dev_pm_ops) Signed-off-by: Grygorii Strashko Acked-by: Jacek Anaszewski Cc: 3.11+ # 3.11+ Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin --- drivers/leds/led-class.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/leds/led-class.c b/drivers/leds/led-class.c index 7440c58..f5dfb8f 100644 --- a/drivers/leds/led-class.c +++ b/drivers/leds/led-class.c @@ -173,6 +173,7 @@ void led_classdev_resume(struct led_classdev *led_cdev) } EXPORT_SYMBOL_GPL(led_classdev_resume); +#ifdef CONFIG_PM_SLEEP static int led_suspend(struct device *dev) { struct led_classdev *led_cdev = dev_get_drvdata(dev); @@ -192,11 +193,9 @@ static int led_resume(struct device *dev) return 0; } +#endif -static const struct dev_pm_ops leds_class_dev_pm_ops = { - .suspend = led_suspend, - .resume = led_resume, -}; +static SIMPLE_DEV_PM_OPS(leds_class_dev_pm_ops, led_suspend, led_resume); /** * led_classdev_register - register a new object of led_classdev class.