From patchwork Mon Jul 27 08:02:27 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Slaby X-Patchwork-Id: 51493 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by patches.linaro.org (Postfix) with ESMTPS id AC8A322918 for ; Mon, 27 Jul 2015 08:24:09 +0000 (UTC) Received: by wilm20 with SMTP id m20sf25205811wil.2 for ; Mon, 27 Jul 2015 01:24:09 -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=/rvJ43KB4aMPneMMjZc8gJk8sWKhk8+EBI/ztYzgl+k=; b=Svh7lnT1ZW+ogDdc7sqarf+JiqUF7rQzy46rxPnr69MrRpwWTB8YeoowMOD/DzIcEn +mM5egZL6NEUYLpaiehZFkbDChblYiqHzaWxmY/BsumfQnrpjDLfiUN7W/eLpSZYJjcW 4Aq8UN2u5qaCUza/vYbSXRjWWGlCufimAZRa6Z3jElf0uMA7EKOfA6/H3Ms5pWSUHz/4 IQuepgXhhaGoaYLoaDGbw2O6WYOIemdl6ufojpSLP80IqnB2Eda03J340HjGNZDePn8Y 9wxHcMtUMXLxHhejd90UeA13j9by9y7UyZsjxxobX6UFhix0oKZ+PgMNZy/D6fTE1x6r JZCw== X-Gm-Message-State: ALoCoQmTwzdwyRhfPNJMl010BzzP1DOt4OvDKMkAeKxCBalv3RGsT3XjzqCSR5iayJx2mFinqkqQ X-Received: by 10.180.90.106 with SMTP id bv10mr4850442wib.6.1437985449033; Mon, 27 Jul 2015 01:24:09 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.22.98 with SMTP id c2ls640643laf.7.gmail; Mon, 27 Jul 2015 01:24:08 -0700 (PDT) X-Received: by 10.112.51.133 with SMTP id k5mr25311375lbo.107.1437985448897; Mon, 27 Jul 2015 01:24:08 -0700 (PDT) Received: from mail-lb0-f175.google.com (mail-lb0-f175.google.com. [209.85.217.175]) by mx.google.com with ESMTPS id i6si14725079lai.30.2015.07.27.01.24.08 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Jul 2015 01:24:08 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.175 as permitted sender) client-ip=209.85.217.175; Received: by lblf12 with SMTP id f12so48316608lbl.2 for ; Mon, 27 Jul 2015 01:24:08 -0700 (PDT) X-Received: by 10.152.6.69 with SMTP id y5mr25616614lay.72.1437985448789; Mon, 27 Jul 2015 01:24:08 -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.7.198 with SMTP id l6csp1385878lba; Mon, 27 Jul 2015 01:24:07 -0700 (PDT) X-Received: by 10.66.62.133 with SMTP id y5mr66705987par.8.1437985413955; Mon, 27 Jul 2015 01:23:33 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m6si22980377pdl.249.2015.07.27.01.23.33; Mon, 27 Jul 2015 01:23:33 -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 S1752797AbbG0IXT (ORCPT + 2 others); Mon, 27 Jul 2015 04:23:19 -0400 Received: from mail-wi0-f182.google.com ([209.85.212.182]:36653 "EHLO mail-wi0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752888AbbG0IWX (ORCPT ); Mon, 27 Jul 2015 04:22:23 -0400 Received: by wicgb10 with SMTP id gb10so100743115wic.1 for ; Mon, 27 Jul 2015 01:22:22 -0700 (PDT) X-Received: by 10.180.91.76 with SMTP id cc12mr21965115wib.67.1437985342248; Mon, 27 Jul 2015 01:22:22 -0700 (PDT) Received: from ?IPv6:2a01:4240:53f0:43fb::cbb? (b.b.c.0.0.0.0.0.0.0.0.0.0.0.0.0.b.f.3.4.0.f.3.5.0.4.2.4.1.0.a.2.v6.cust.nbox.cz. [2a01:4240:53f0:43fb::cbb]) by smtp.gmail.com with ESMTPSA id q19sm12257544wik.16.2015.07.27.01.22.21 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Jul 2015 01:22:21 -0700 (PDT) Received: from imap.suse.de ([unix socket]) by imap2-int (Cyrus v2.3.11) with LMTPA; Mon, 27 Jul 2015 10:03:23 +0200 X-Sieve: CMU Sieve 2.3 Received: from relay2.suse.de (gate-dmz1.suse.de [195.135.220.254]) by imap.suse.de (Postfix) with ESMTP id B62FCAB31 for ; Mon, 27 Jul 2015 10:03:23 +0200 (CEST) Received: by relay2.suse.de (Postfix) id 95EF329A3; Mon, 27 Jul 2015 08:03:12 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by relay2.suse.de (Postfix) with ESMTP id 8FE6B29A1 for ; Mon, 27 Jul 2015 08:03:12 +0000 (UTC) X-Virus-Scanned: by amavisd-new at localhost X-Spam-Flag: NO X-Spam-Score: 0.101 X-Spam-Level: X-Spam-Status: No, score=0.101 tagged_above=-9999 required=5 tests=[BAYES_50=0.8, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled Received: from relay2.suse.de ([127.0.0.1]) by localhost (localhost [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id BAdUDivDL4k5 for ; Mon, 27 Jul 2015 08:03:12 +0000 (UTC) Received: from mx1.suse.de (mx1.suse.de [195.135.220.2]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 2AE2D29A2 for ; Mon, 27 Jul 2015 08:03:12 +0000 (UTC) Received: from mail-wi0-f179.google.com (mail-wi0-f179.google.com [209.85.212.179]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.suse.de (Postfix) with ESMTPS id 236CEAAC3 for ; Mon, 27 Jul 2015 08:03:23 +0000 (UTC) Received: by wicgb10 with SMTP id gb10so100051017wic.1 for ; Mon, 27 Jul 2015 01:03:22 -0700 (PDT) X-Received: by 10.180.87.199 with SMTP id ba7mr22473458wib.81.1437984202644; Mon, 27 Jul 2015 01:03:22 -0700 (PDT) Received: from anemoi.home (ip4-83-240-67-251.cust.nbox.cz. [83.240.67.251]) by smtp.gmail.com with ESMTPSA id s16sm12167801wib.16.2015.07.27.01.03.21 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 27 Jul 2015 01:03:22 -0700 (PDT) From: Jiri Slaby To: jslaby@suse.com Cc: Grygorii Strashko , "Rafael J. Wysocki" , Jiri Slaby Subject: [patch added to the 3.12 stable tree] leds / PM: fix hibernation on arm when gpio-led used with CPU led trigger Date: Mon, 27 Jul 2015 10:02:27 +0200 Message-Id: <1437984150-15702-46-git-send-email-jslaby@suse.com> X-Mailer: git-send-email 2.4.6 In-Reply-To: <1437984150-15702-1-git-send-email-jslaby@suse.com> References: <1437984150-15702-1-git-send-email-jslaby@suse.com> 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.217.175 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.12 stable tree. If you have any objections, please let us know. =============== commit 084609bf727981c7a2e6e69aefe0052c9d793300 upstream. 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 Signed-off-by: Rafael J. Wysocki Signed-off-by: Jiri Slaby --- 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 f37d63cf726b..825545cdfb10 100644 --- a/drivers/leds/led-class.c +++ b/drivers/leds/led-class.c @@ -178,6 +178,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); @@ -197,11 +198,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.