From patchwork Wed Jun 17 10:34:46 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 49974 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 ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 775BA228CC for ; Wed, 17 Jun 2015 10:35:35 +0000 (UTC) Received: by wifx6 with SMTP id x6sf12360232wif.1 for ; Wed, 17 Jun 2015 03:35:34 -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:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=IYhDq7o84Nm1fKDUGs+fWYyJv0U/fBsOmfBTNTU64GM=; b=lGibPsmAvdsotO2zywSPZZPrrNnqlup5neo76B3dZhDqhnDWJWn1AP4TvcgUkiK5ak 2FYZ/a9MYvqjfaELIL8memlGTZENg+L7dGr7sJM6L7H5sI6EiJFkeFhKdKHhrtZlIkLh btqOuLHKWRnEztqzUkcypjueEoSxZZQT6o3hoyjCNHWiHjDZ1JpfmHAvBIJQCti7QuLK yCmzMvCr8PpZZeZiqz4kD29o6zkDFxSl3QDTu6lA/QODZo8N2w+rOb8teITco7Iwhy5J s+eabkW++LaDoWRwA0gGMgvzWJ004JJN5yIBVkbmdtj6M3tP0fkFeM3/1tCA+repvQz4 DNvg== X-Gm-Message-State: ALoCoQleP6TwcLzx72LTs9D+WoIOxZW2tjDFC3BDNciWEhMIomfEsPdGSQKMHDQ6K1wxux53rj6U X-Received: by 10.180.89.231 with SMTP id br7mr7883139wib.0.1434537334610; Wed, 17 Jun 2015 03:35:34 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.182.228 with SMTP id eh4ls268292lac.45.gmail; Wed, 17 Jun 2015 03:35:34 -0700 (PDT) X-Received: by 10.152.22.129 with SMTP id d1mr7133062laf.13.1434537334386; Wed, 17 Jun 2015 03:35:34 -0700 (PDT) Received: from mail-la0-f53.google.com (mail-la0-f53.google.com. [209.85.215.53]) by mx.google.com with ESMTPS id et6si3183922lac.38.2015.06.17.03.35.34 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Jun 2015 03:35:34 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) client-ip=209.85.215.53; Received: by labbc20 with SMTP id bc20so29757510lab.1 for ; Wed, 17 Jun 2015 03:35:34 -0700 (PDT) X-Received: by 10.112.140.231 with SMTP id rj7mr7035058lbb.76.1434537333938; Wed, 17 Jun 2015 03:35:33 -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 hn6csp372249lbb; Wed, 17 Jun 2015 03:35:32 -0700 (PDT) X-Received: by 10.68.228.168 with SMTP id sj8mr9498500pbc.102.1434537331356; Wed, 17 Jun 2015 03:35:31 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j9si5669070pdm.87.2015.06.17.03.35.21; Wed, 17 Jun 2015 03:35:31 -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 S1753536AbbFQKfR (ORCPT + 30 others); Wed, 17 Jun 2015 06:35:17 -0400 Received: from mail-pd0-f179.google.com ([209.85.192.179]:36243 "EHLO mail-pd0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752637AbbFQKfJ (ORCPT ); Wed, 17 Jun 2015 06:35:09 -0400 Received: by pdjm12 with SMTP id m12so36597238pdj.3 for ; Wed, 17 Jun 2015 03:35:09 -0700 (PDT) X-Received: by 10.70.52.103 with SMTP id s7mr9385813pdo.117.1434537309325; Wed, 17 Jun 2015 03:35:09 -0700 (PDT) Received: from localhost ([122.167.70.98]) by mx.google.com with ESMTPSA id c3sm4254976pdk.39.2015.06.17.03.35.07 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 17 Jun 2015 03:35:08 -0700 (PDT) From: Viresh Kumar To: Thomas Gleixner Cc: linaro-kernel@lists.linaro.org, linux-kernel@vger.kernel.org, alexandre.belloni@free-electrons.com, sylvain.rochet@finsecur.com, Viresh Kumar Subject: [PATCH] clockevents: check 'state' instead of 'mode' in suspend/resume path Date: Wed, 17 Jun 2015 16:04:46 +0530 Message-Id: X-Mailer: git-send-email 2.4.0 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: viresh.kumar@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.53 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: , CLOCK_EVT_MODE_* macros are present for backward compatibility (as most of the drivers are still using old ->set_mode() interface). These macro's shouldn't be used anymore in code, that is common to both driver interfaces, i.e. ->set_mode() and ->set_state_*(). Drivers implementing ->set_state_*() interface, which have their clkevt->mode set to 0 (clkevt device structures are normally globally defined), will not participate in suspend/resume as they will always be marked as UNUSED. Fix this by checking state of the clockevent device instead of mode, which is updated for both the interfaces. Fixes: ac34ad27fc16 ("clockevents: Do not suspend/resume if unused") Signed-off-by: Viresh Kumar --- kernel/time/clockevents.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/time/clockevents.c b/kernel/time/clockevents.c index 2397b97320d8..08ccc3da3ca0 100644 --- a/kernel/time/clockevents.c +++ b/kernel/time/clockevents.c @@ -639,7 +639,7 @@ void clockevents_suspend(void) struct clock_event_device *dev; list_for_each_entry_reverse(dev, &clockevent_devices, list) - if (dev->suspend && dev->mode != CLOCK_EVT_MODE_UNUSED) + if (dev->suspend && !clockevent_state_detached(dev)) dev->suspend(dev); } @@ -651,7 +651,7 @@ void clockevents_resume(void) struct clock_event_device *dev; list_for_each_entry(dev, &clockevent_devices, list) - if (dev->resume && dev->mode != CLOCK_EVT_MODE_UNUSED) + if (dev->resume && !clockevent_state_detached(dev)) dev->resume(dev); }