Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp2272820ybe; Tue, 3 Sep 2019 10:19:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqwBoSD/oEOGFsAyHJiIPu78UjIswOqwbRFrrnffmFjcpFDCFDuI2MMymze1jsaNsBJFdKe+ X-Received: by 2002:a63:2364:: with SMTP id u36mr30216006pgm.449.1567531162193; Tue, 03 Sep 2019 10:19:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567531162; cv=none; d=google.com; s=arc-20160816; b=GjLgbDALKKFr8bGFRV2lk1qzl33P/bDYSmAXCqA7m8T/u6KREcRbJUhB9WoFKZ6ZcS u60kYyuEnxJOLy3Xdlz8+fL29+29IGLawJLpL+hWxjHgiuUs4h5zzwaFqGvTB5Haw2KC nAK9RR7O3NlVJOsd9YLsAY4lTA7jY7IYLlAkHshkKelWmKzn93NV2Hl0ckVpT76m3/Zt SCQlV3tCY0GhdHblFVrwSuOsYAprzgBS2Wa/V9rRBGfMLhdK0XZjmThBUSyo1ahB0xvp Jlsj5MwNOpClDLR3Mlmws4nfyyZjLaBt7C1/oAHgGSHQKZt/mydN4xTdx+xSoz404mYD rmjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=UJLdWoR8W1L557Gkard3di3b1NpYqAxVBjUZOf8gvNI=; b=BsrgY2AhHdD9nWj9+RXjnyyeSW2Pr81ydGFis69rOmeDg6TV+CrbFu3HxbWljvprJS TUagli45GVuoibWUvIWYG7FpHnFipJmJgr6YxlP6g5tAC4sYRsLp3CWbDGH86cijgkN/ VNxSv3g/5LNsZ2L+Pe87BUH3X5gXvgBfmc7sFKS3awEtSh08SS5kGTaYuWJLxjAZ9Bqp 8Fl8AGdniHa4I8w+3mxUA0bM6V6JUULGdQyw+4PGXewu/TcDBlvPa01uxS76222HFHJD TjTvZoRQxBzpsixPoLTBVO9o5URHD4RfxhdBhoqGHCE290AzRRi7tabO1yRfpaXBBDIi KlFA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a12si14932590pgt.146.2019.09.03.10.19.05; Tue, 03 Sep 2019 10:19:22 -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; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730067AbfICRST (ORCPT + 99 others); Tue, 3 Sep 2019 13:18:19 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:54310 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729602AbfICRSS (ORCPT ); Tue, 3 Sep 2019 13:18:18 -0400 Received: from 1.general.cascardo.us.vpn ([10.172.70.58] helo=localhost.localdomain) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1i5CRc-0006nB-Lt; Tue, 03 Sep 2019 17:18:17 +0000 From: Thadeu Lima de Souza Cascardo To: linux-kernel@vger.kernel.org Cc: Stephen Boyd , John Stultz , Thomas Gleixner , Thadeu Lima de Souza Cascardo Subject: [PATCH] alarmtimer: use EOPNOTSUPP instead of ENOTSUPP Date: Tue, 3 Sep 2019 14:18:02 -0300 Message-Id: <20190903171802.28314-1-cascardo@canonical.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ENOTSUPP is not supposed to be returned to userspace. This was found on an OpenPower machine, where the RTC does not support set_alarm. On that system, before the patch, a clock_nanosleep(CLOCK_REALTIME_ALARM, ...) would result in "524 Unknown error 524", while after the patch, we get "95 Operation not supported". Signed-off-by: Thadeu Lima de Souza Cascardo Fixes: 1c6b39ad3f01 (alarmtimers: Return -ENOTSUPP if no RTC device is present) --- kernel/time/alarmtimer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/time/alarmtimer.c b/kernel/time/alarmtimer.c index 57518efc3810..b7d75a9e8ccf 100644 --- a/kernel/time/alarmtimer.c +++ b/kernel/time/alarmtimer.c @@ -672,7 +672,7 @@ static int alarm_timer_create(struct k_itimer *new_timer) enum alarmtimer_type type; if (!alarmtimer_get_rtcdev()) - return -ENOTSUPP; + return -EOPNOTSUPP; if (!capable(CAP_WAKE_ALARM)) return -EPERM; @@ -790,7 +790,7 @@ static int alarm_timer_nsleep(const clockid_t which_clock, int flags, int ret = 0; if (!alarmtimer_get_rtcdev()) - return -ENOTSUPP; + return -EOPNOTSUPP; if (flags & ~TIMER_ABSTIME) return -EINVAL; -- 2.20.1