From patchwork Sat Jul 4 03:01:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 50652 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0DB54214B3 for ; Sat, 4 Jul 2015 03:10:18 +0000 (UTC) Received: by lagh6 with SMTP id h6sf32963645lag.0 for ; Fri, 03 Jul 2015 20:10:16 -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=gtXaz4F++aaSPxBH7LBg448YLJwze6swqqKOjziChLo=; b=jQMvMeYebprZo7invPeo9JCKlsWZltv2nLOeaouOnYvi4oy59jM/3I+PW5negjDuEb LBtsvD+IQmW8hKAb4T4I9VUjc2qTfRX74Rpp/a9uScKzSOXPX5H4Fn9+ePyh84DcxT+v 9KBVXbVzleX6zogYj95ZMItlTH93fDTisItUw6Ju6pm3RMsHojfr5YpdjT7vw/Z75wjq l+MKgKsbzClFZbPAI80k6E35t0CVyL17nBYePiO8P0bVku6cEuidab8Tr2VOhQKP9fR3 /wvhy6NDXgcT5UiWbgP8W+LfCTBhWIjHNb1f1b1lRQn7i8e5inL7V0iZNG8zluiIV3fI w3lw== X-Gm-Message-State: ALoCoQks5O3jg4ETTIqjdveodNLLeJRvQct54WaYEbQWMF3XZKYj6mBIoHCDyV+qaFVbtIfC8lZe X-Received: by 10.180.97.9 with SMTP id dw9mr8990812wib.2.1435979416665; Fri, 03 Jul 2015 20:10:16 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.29.7 with SMTP id f7ls501404lah.48.gmail; Fri, 03 Jul 2015 20:10:16 -0700 (PDT) X-Received: by 10.152.43.69 with SMTP id u5mr38338493lal.119.1435979416124; Fri, 03 Jul 2015 20:10:16 -0700 (PDT) Received: from mail-la0-f51.google.com (mail-la0-f51.google.com. [209.85.215.51]) by mx.google.com with ESMTPS id a4si8824738lak.156.2015.07.03.20.10.16 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Jul 2015 20:10:16 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.51 as permitted sender) client-ip=209.85.215.51; Received: by lagh6 with SMTP id h6so101499439lag.2 for ; Fri, 03 Jul 2015 20:10:16 -0700 (PDT) X-Received: by 10.112.42.50 with SMTP id k18mr35478664lbl.76.1435979416031; Fri, 03 Jul 2015 20:10:16 -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 hn6csp377167lbb; Fri, 3 Jul 2015 20:10:15 -0700 (PDT) X-Received: by 10.69.26.4 with SMTP id iu4mr81894138pbd.140.1435979051125; Fri, 03 Jul 2015 20:04:11 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id yw2si17068206pbc.95.2015.07.03.20.04.10; Fri, 03 Jul 2015 20:04:11 -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 S1755120AbbGDDEJ (ORCPT + 2 others); Fri, 3 Jul 2015 23:04:09 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:29235 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754653AbbGDDEE (ORCPT ); Fri, 3 Jul 2015 23:04:04 -0400 Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id t6433vNq023322 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 4 Jul 2015 03:03:57 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0021.oracle.com (8.13.8/8.13.8) with ESMTP id t6433uLT024051 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Sat, 4 Jul 2015 03:03:56 GMT Received: from abhmp0013.oracle.com (abhmp0013.oracle.com [141.146.116.19]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id t6433eSm017555; Sat, 4 Jul 2015 03:03:51 GMT Received: from lappy.hsd1.nh.comcast.net (/10.154.162.71) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 03 Jul 2015 20:03:40 -0700 From: Sasha Levin To: stable@vger.kernel.org, stable-commits@vger.kernel.org Cc: Grygorii Strashko , "Rafael J. Wysocki" , Sasha Levin Subject: [added to the 3.18 stable tree] leds / PM: fix hibernation on arm when gpio-led used with CPU led trigger Date: Fri, 3 Jul 2015 23:01:07 -0400 Message-Id: <1435978997-14393-18-git-send-email-sasha.levin@oracle.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1435978997-14393-1-git-send-email-sasha.levin@oracle.com> References: <1435978997-14393-1-git-send-email-sasha.levin@oracle.com> X-Source-IP: aserv0021.oracle.com [141.146.126.233] 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.51 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 This patch has been added to the 3.18 stable tree. If you have any objections, please let us know. =============== [ 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.