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: 5763121 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 5B90A9F380 for ; Mon, 2 Feb 2015 16:35:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8FA25206F0 for ; Mon, 2 Feb 2015 16:35:51 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 31023206EF for ; Mon, 2 Feb 2015 16:35:50 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YIJwP-0000pL-D2; Mon, 02 Feb 2015 16:33:37 +0000 Received: from mail-la0-f50.google.com ([209.85.215.50]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YIJwL-0000l6-JC for linux-arm-kernel@lists.infradead.org; Mon, 02 Feb 2015 16:33:34 +0000 Received: by mail-la0-f50.google.com with SMTP id hs14so42558759lab.9 for ; Mon, 02 Feb 2015 08:33:10 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=RnBdWhCZP5q2SGhOfFeTRnwtgL/JE1av3ISjX1vTSBA=; b=FG0JbjDTQg6dIeKXJEWCuZTZ5KRlcE3bwp/lkqLut8zxDh4FnfxDdIerCjxfwgstv3 o2Vc/0E8qINsBRnNSjLkSzNaaa262Xm2rx2xktNXxHJadicMQxnDb6TW0A+JxTIe8OWM cdZlF0FbCXiMIUPgxr9y/x5DCqKRdBoefxqlc6sdxSw0pHjlfs3qmXaPHwh/n2YSTXMi Z+Nr8AMc1Ew++pCrUTaj3tTvRk0BDu+ej4QtyiGfD7t8KXrMjs3xjjXN6R2mJHJHClIw fJPKGwhI89JEnGtFLc91oiIOGuXHLzBjEBqGxH+LH303lqAwNvkBvX2/FmlvPUhQrKiY lIVA== X-Gm-Message-State: ALoCoQn14I9Dha465FgP1fUsE5OxFNTKt+dyAwpWsaN1qxXQAr8NiYQelFtH0euWNpQfahAeC+iE 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150202_083333_837094_77FE0C4A X-CRM114-Status: GOOD ( 10.19 ) X-Spam-Score: -0.7 (/) Cc: linux-pm@vger.kernel.org, Grygorii Strashko , sumit.semwal@linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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.