From patchwork Tue Jul 28 09:52:52 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Slaby X-Patchwork-Id: 51578 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 patches.linaro.org (Postfix) with ESMTPS id B3543214B7 for ; Tue, 28 Jul 2015 09:55:00 +0000 (UTC) Received: by laah7 with SMTP id h7sf36229148laa.2 for ; Tue, 28 Jul 2015 02:54:59 -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: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=TWaTVN9/Db2LoUa6PtOB0/xwF0g9rHzB/pRRZMpepzg=; b=E4zApghOr2UdiQ08+gmf6faWMUYyWoM8M9h7oGYFmNcQh9wwEl/f0Y5y0HguBWMIir wiYve902kXFg120OC4L5/hqTd3CvWYEnslx3oSOn4csWI0rDz2kOeIQPTQ1RYcp/Lz4t MNlM3iuHp3q9SAVbQkbAMhJwYVAK0OO1QM1vkm2MxOj0K/0hjPrqatadck79LO9p45Ep N64G8JaywncVGD9ZlS9D8JApB70DPkfo1xtnALAD5wgZn2rnZkiItC1Ms+dUP6BMCnA4 SntcaLbGIj6RA6prWMj+RPETPyJGniTA2ZZj84y97m1N5KooBZJJZ/dqI6MKkm+PsZP+ 0EOA== X-Gm-Message-State: ALoCoQk7qZHRl4sFojOOTrhdTTREJ/aMM8LhxQZzndnrIlfJ/X/c1EbNniSmijz/Cp5YwnNG9E9b X-Received: by 10.152.182.226 with SMTP id eh2mr13726850lac.0.1438077299299; Tue, 28 Jul 2015 02:54:59 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.23.103 with SMTP id l7ls788390laf.35.gmail; Tue, 28 Jul 2015 02:54:58 -0700 (PDT) X-Received: by 10.112.55.207 with SMTP id u15mr31418622lbp.88.1438077298893; Tue, 28 Jul 2015 02:54:58 -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 wn2si17838836lac.93.2015.07.28.02.54.58 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Jul 2015 02:54:58 -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 lagw2 with SMTP id w2so65195818lag.3 for ; Tue, 28 Jul 2015 02:54:58 -0700 (PDT) X-Received: by 10.112.198.74 with SMTP id ja10mr31706115lbc.19.1438077298794; Tue, 28 Jul 2015 02:54:58 -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 l6csp2030591lba; Tue, 28 Jul 2015 02:54:57 -0700 (PDT) X-Received: by 10.107.18.10 with SMTP id a10mr56245379ioj.98.1438077296871; Tue, 28 Jul 2015 02:54:56 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g14si6126721pdm.256.2015.07.28.02.54.55; Tue, 28 Jul 2015 02:54:56 -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; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932910AbbG1JxZ (ORCPT + 28 others); Tue, 28 Jul 2015 05:53:25 -0400 Received: from mx2.suse.de ([195.135.220.15]:57947 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932819AbbG1JxQ (ORCPT ); Tue, 28 Jul 2015 05:53:16 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id E67C9AD69; Tue, 28 Jul 2015 09:53:14 +0000 (UTC) From: Jiri Slaby To: stable@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Grygorii Strashko , "Rafael J. Wysocki" , Jiri Slaby Subject: [PATCH 3.12 111/124] leds / PM: fix hibernation on arm when gpio-led used with CPU led trigger Date: Tue, 28 Jul 2015 11:52:52 +0200 Message-Id: <1b0cfc708b5ed592b4705df17ca4d99702eb5434.1438076484.git.jslaby@suse.cz> X-Mailer: git-send-email 2.4.6 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: linux-kernel-owner@vger.kernel.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 3.12-stable review patch. If anyone has any objections, please let me 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.