From patchwork Mon Feb 2 16:33:06 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Grygorii.Strashko@linaro.org" X-Patchwork-Id: 44160 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f71.google.com (mail-wg0-f71.google.com [74.125.82.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E8011202A5 for ; Mon, 2 Feb 2015 16:33:16 +0000 (UTC) Received: by mail-wg0-f71.google.com with SMTP id y19sf16874284wgg.2 for ; Mon, 02 Feb 2015 08:33:16 -0800 (PST) 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:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=1y7IuFbLsI7uJ4hRTBxeH2Jb6C/VTDB/GjdtHXg9+OM=; b=V4FmL3G8M65tzmRFLIEWqwx62pD9+PrBRHtgO6zAOBjRPeGh/hN5NkAac8QYLyfEGJ hwNnwPu7BsIfDVtu3lgGmuIAH69lSfAoC5rwLdxDGSStbrZxOOg40NoY/avP6KrSwx7/ cDtCsHbAwSL0rZZnzNPSrXHOwvmnJ9xjYJsT8vLiZvC9Je9e98EQmnR6iLJ4haAhPi1n Ei2Wx2SrsPfJ21ur5UJ976oZ8mgiJiYyekNJIQunMqO3AIb9753RWbQA9MK2I0V29FoU unuZFaej+TVwDuyceWZbgD+HsKLeLwQTiwLid/d/KOYk7fX9OKVzf7QpCk9thM8nqw/p RzKQ== X-Gm-Message-State: ALoCoQkNkfCkyAIl2I0jrpVEH5wq+iCEPpil0rmzttDR9Mwnj3MLwjHd3elU5uJqLtB0C3vbmM7j X-Received: by 10.152.116.80 with SMTP id ju16mr1542748lab.1.1422894796165; Mon, 02 Feb 2015 08:33:16 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.8.228 with SMTP id u4ls78895laa.71.gmail; Mon, 02 Feb 2015 08:33:16 -0800 (PST) X-Received: by 10.152.28.37 with SMTP id y5mr20456748lag.55.1422894796026; Mon, 02 Feb 2015 08:33:16 -0800 (PST) Received: from mail-la0-f52.google.com (mail-la0-f52.google.com. [209.85.215.52]) by mx.google.com with ESMTPS id nv4si17362095lbb.16.2015.02.02.08.33.15 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 02 Feb 2015 08:33:15 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.52 as permitted sender) client-ip=209.85.215.52; Received: by mail-la0-f52.google.com with SMTP id ge10so42734882lab.11 for ; Mon, 02 Feb 2015 08:33:15 -0800 (PST) X-Received: by 10.112.173.202 with SMTP id bm10mr20379369lbc.24.1422894795740; Mon, 02 Feb 2015 08:33:15 -0800 (PST) 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.35.133 with SMTP id h5csp1402428lbj; Mon, 2 Feb 2015 08:33:14 -0800 (PST) X-Received: by 10.66.124.137 with SMTP id mi9mr30306647pab.144.1422894793959; Mon, 02 Feb 2015 08:33:13 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id al3si24088381pad.232.2015.02.02.08.33.13; Mon, 02 Feb 2015 08:33:13 -0800 (PST) Received-SPF: none (google.com: linux-pm-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932512AbbBBQdM (ORCPT + 11 others); Mon, 2 Feb 2015 11:33:12 -0500 Received: from mail-la0-f51.google.com ([209.85.215.51]:45366 "EHLO mail-la0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932233AbbBBQdL (ORCPT ); Mon, 2 Feb 2015 11:33:11 -0500 Received: by mail-la0-f51.google.com with SMTP id ge10so42787332lab.10 for ; Mon, 02 Feb 2015 08:33:10 -0800 (PST) X-Received: by 10.152.26.98 with SMTP id k2mr20622430lag.53.1422894790238; Mon, 02 Feb 2015 08:33:10 -0800 (PST) Received: from localhost ([195.238.92.128]) by mx.google.com with ESMTPSA id rn9sm1708357lbb.23.2015.02.02.08.33.09 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 02 Feb 2015 08:33:09 -0800 (PST) From: To: Bryan Wu , Richard Purdie , linux-leds@vger.kernel.org Cc: sumit.semwal@linaro.org, linux-arm-kernel@lists.infradead.org, , linux-pm@vger.kernel.org, Grygorii Strashko Subject: [PATCH] leds: add hibernation callbacks Date: Mon, 2 Feb 2015 18:33:06 +0200 Message-Id: <1422894786-23353-1-git-send-email-grygorii.strashko@linaro.org> X-Mailer: git-send-email 1.9.1 Sender: linux-pm-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: grygorii.strashko@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.52 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 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. Fix this by using SIMPLE_DEV_PM_OPS, which appropriately assigns the suspend and hibernation callbacks. Signed-off-by: Grygorii Strashko --- drivers/leds/led-class.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/leds/led-class.c b/drivers/leds/led-class.c index f37d63c..4c03808 100644 --- a/drivers/leds/led-class.c +++ b/drivers/leds/led-class.c @@ -198,10 +198,7 @@ static int led_resume(struct device *dev) return 0; } -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.