From patchwork Wed May 13 22:13:05 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 48467 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 91BAF214BA for ; Wed, 13 May 2015 22:13:24 +0000 (UTC) Received: by wixv7 with SMTP id v7sf15160261wix.0 for ; Wed, 13 May 2015 15:13:23 -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:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=J3d+H0qWGAF+ZcEJlILWm8x/qmt9uWPRSF+8ceSHHVk=; b=QLS011Dt+fgoijZQKjkWwYqTp0oAn2sCryoVNny55P58zlBCRxIQ/bOTbQkUMANioX uF4u/Jv8xoO/JE7+oEu01PZi1lQLbO8PC4gJnObvsdg+5Oc7WZps7kbgPxfbkcZ1hhB3 eyv9PFENYCewRn0ANZU0dRZYiGBZIcSoUkYLdJ1EkvfocMhqUGP7frTehfBm3OaGjdjm EJIbek42lXkETupD52y4Q5itrDPfpNRsPZh3iaVsQu+mLCD4nVqx6n+tV1eN9FidQOw0 0HtvBPXEpURfmqMAF9o8LZ/bvtJpRKnYW2TN+oIWJ4B2hoXFa/v4CNhzOKaWCuCLTIPd egJg== X-Gm-Message-State: ALoCoQnXmQrn90o8opyFKZhlAN90KbcaQIo18KpxQa+CaaWHBc5or4h6rOTmh7mZG7EeAOEF25KB X-Received: by 10.152.8.17 with SMTP id n17mr739108laa.0.1431555203699; Wed, 13 May 2015 15:13:23 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.153.5.42 with SMTP id cj10ls323665lad.51.gmail; Wed, 13 May 2015 15:13:23 -0700 (PDT) X-Received: by 10.152.29.198 with SMTP id m6mr751178lah.11.1431555203541; Wed, 13 May 2015 15:13:23 -0700 (PDT) Received: from mail-la0-f49.google.com (mail-la0-f49.google.com. [209.85.215.49]) by mx.google.com with ESMTPS id lb2si13186253lbc.151.2015.05.13.15.13.23 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 May 2015 15:13:23 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) client-ip=209.85.215.49; Received: by lagv1 with SMTP id v1so42670601lag.3 for ; Wed, 13 May 2015 15:13:23 -0700 (PDT) X-Received: by 10.112.204.72 with SMTP id kw8mr780328lbc.88.1431555203366; Wed, 13 May 2015 15:13:23 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp803557lbb; Wed, 13 May 2015 15:13:22 -0700 (PDT) X-Received: by 10.68.102.69 with SMTP id fm5mr1837613pbb.131.1431555199002; Wed, 13 May 2015 15:13:19 -0700 (PDT) Received: from mail-pa0-f43.google.com (mail-pa0-f43.google.com. [209.85.220.43]) by mx.google.com with ESMTPS id go7si28950375pbc.46.2015.05.13.15.13.14 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 May 2015 15:13:18 -0700 (PDT) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.43 as permitted sender) client-ip=209.85.220.43; Received: by pabtp1 with SMTP id tp1so63418999pab.2 for ; Wed, 13 May 2015 15:13:14 -0700 (PDT) X-Received: by 10.70.125.129 with SMTP id mq1mr1929751pdb.19.1431555194090; Wed, 13 May 2015 15:13:14 -0700 (PDT) Received: from localhost.localdomain (c-67-170-153-23.hsd1.or.comcast.net. [67.170.153.23]) by mx.google.com with ESMTPSA id ez1sm20268200pbd.0.2015.05.13.15.13.12 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 13 May 2015 15:13:13 -0700 (PDT) From: John Stultz To: linux-kernel@vger.kernel.org Cc: John Stultz , Shuah Khan , Prarit Bhargava , Thomas Gleixner , Richard Cochran Subject: [PATCH 3/3] kselftests: timers: Check _ALARM clockids are supported before suspending Date: Wed, 13 May 2015 15:13:05 -0700 Message-Id: <1431555185-10182-4-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1431555185-10182-1-git-send-email-john.stultz@linaro.org> References: <1431555185-10182-1-git-send-email-john.stultz@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: john.stultz@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.49 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , It was reported that the alarmtimer-suspend test hangs on older systems that don't support _ALARM clockids. This is due to the fact that we don't check if the timer_create fails, and thus when we suspend, the system will not programatically resume. Fix this by checking the timer_create call for errors. Cc: Shuah Khan Cc: Prarit Bhargava Cc: Thomas Gleixner Cc: Richard Cochran Signed-off-by: John Stultz --- tools/testing/selftests/timers/alarmtimer-suspend.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/timers/alarmtimer-suspend.c b/tools/testing/selftests/timers/alarmtimer-suspend.c index 13586b6..72cacf5 100644 --- a/tools/testing/selftests/timers/alarmtimer-suspend.c +++ b/tools/testing/selftests/timers/alarmtimer-suspend.c @@ -152,7 +152,11 @@ int main(void) alarm_clock_id++) { alarmcount = 0; - timer_create(alarm_clock_id, &se, &tm1); + if (timer_create(alarm_clock_id, &se, &tm1) == -1) { + printf("timer_create failled, %s unspported?\n", + clockstring(alarm_clock_id)); + break; + } clock_gettime(alarm_clock_id, &start_time); printf("Start time (%s): %ld:%ld\n", clockstring(alarm_clock_id),