Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp135491pxy; Fri, 30 Apr 2021 02:01:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxA9g6jTdTp8AkKQgx5Fd/x6xZGG5XfYnz0eI8d8d6cF5OY4lsnhvIs1znoAbvyXHYu8tIQ X-Received: by 2002:aa7:8f15:0:b029:27a:4eb9:7c9a with SMTP id x21-20020aa78f150000b029027a4eb97c9amr4046298pfr.62.1619773283780; Fri, 30 Apr 2021 02:01:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619773283; cv=none; d=google.com; s=arc-20160816; b=E/LmeWKLVZHntbxmZuXPJt4qM8WYdtOIdwTqZbT+zXvnrE58Ynrwt5mqp7rA9GpNVj 1ykaNMWlQiQj5Hyo0c/GlxmsdNDTAxdaFamp62AyDF+RwNKC2B80lrw9Fn3QX01w/Ahn 0VmwAY2wtZE2BxtVHERZ0EQgnoWzjwSiGp1DKk6sD9JUwoWZdQQ5qP1cQmUV6yQGo7Nj QQYxBPty0Y9HYD2QhPt1bRqVA43h9NXYDV7i5NgVn1S7zJNRfJ53KFQIb/pycboG3/Y4 KnzC0Mh6PnMPc/K3Jf2uPS0SGD8TQJUii8xs7B9gN2gmQZgtG8ccCpQ0lJT1K1ReOaL3 PFDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=yHDXZNRd4tsaMqS5i74+1PSaitlFlgyCrsOa9AiRqvc=; b=nPsBp3s67lzIjWyhztAKqaHCXm4ZFxGpoyDieGl5omgl53GF69eSfOB5vEhdxieUZz 9RRU1G7RnEOUzrLy+LWaw0K0tAVqj5sZ4Zec3jbfoET4G9y65kOXEAgvRhaF3Gs5bsii g4/rIDo3ewpRYkjPFMq6GjdlTK32SqsiLIdYRCUUnDJTPYHM7fakSxxz1yruciFcEt/n 7Gm20UvnEYEdZwodeGuQQClu0JDDu7t6TwGZzZtxKRE/i2dcjDz3uT44ApTMGtAaQHWk EcgAAr2f5jDHnBq5C9EUKDh8hF5jGyijxBmmxzzRguAyeYmvhmvKI+zPhnJCyIUHzpT0 AuUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=NNML5AdC; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s5si1116003plg.312.2021.04.30.02.01.09; Fri, 30 Apr 2021 02:01:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=NNML5AdC; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229567AbhD3JAr (ORCPT + 99 others); Fri, 30 Apr 2021 05:00:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58734 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229522AbhD3JAr (ORCPT ); Fri, 30 Apr 2021 05:00:47 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 656DEC06174A for ; Fri, 30 Apr 2021 01:59:59 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1619773194; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=yHDXZNRd4tsaMqS5i74+1PSaitlFlgyCrsOa9AiRqvc=; b=NNML5AdCGPQzurQyjRs/4XJjMZ//nw+vSLbVnbqG/GDhBUI0hGUUTZVksTUC8GqTkpfnd6 zNgqfnjLcze/Vf18Ws0wPgphxMmVRGEBT77YZBhd3U0mp1g42y9WAh8sQ/Q89d9p0zJYm+ F5tLzwSCIWPqdetaJPsh8QE7/bK3uSG8ppDkOSyQW+OPSlhVhW0dhjhcTVzb5G94zkWMhq fD+H5tJNxaK9BLRGj0m50y1iRkBOJpIxBZORhSgrNjWz5+qmekH7lxhh7DB/YVunyRdcux 7Ca8taGuoyntjLKMfFsM51Bhx8qLlIZ0TAh1sQWhgTg5Ffdr2fJcBDRRTrFhug== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1619773194; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=yHDXZNRd4tsaMqS5i74+1PSaitlFlgyCrsOa9AiRqvc=; b=eJzxLDro/zdeiFmiHXQ/e5nQOv/Y0E52G6a1q+ViQDm8vTIYrQModU8o1FB3sdkuZtnGvt qMN1wjistVtnlADA== To: Alexandre Belloni Cc: John Stultz , Stephen Boyd , linux-kernel@vger.kernel.org Subject: Re: [PATCH] alarmtimer: check RTC features instead of ops In-Reply-To: References: <20210429214902.2612338-1-alexandre.belloni@bootlin.com> <877dkkfdif.ffs@nanos.tec.linutronix.de> Date: Fri, 30 Apr 2021 10:59:53 +0200 Message-ID: <871rasf8qe.ffs@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 30 2021 at 10:10, Alexandre Belloni wrote: > On 30/04/2021 09:16:40+0200, Thomas Gleixner wrote: >> On Thu, Apr 29 2021 at 23:49, Alexandre Belloni wrote: >> > Test RTC_FEATURE_ALARM instead of relying on ops->set_alarm to know whether >> > alarms are available. >> > >> > Fixes: 7ae41220ef58 ("rtc: introduce features bitfield") >> > Signed-off-by: Alexandre Belloni >> > --- >> > Hello, >> > >> > This doesn't seem much but this solve an issue where following a change in the >> > RTC driver, this part of the code will think the RTC is alarm capable while it >> > is not, then breaking the alarmtimer functionnality. >> >> So a driver has the set_alarm() callback but does not advertise >> RTC_FEATURE_ALARM for whatever reason and why ever this makes sense. >> > > No, it would be the other way around. The issue happens when you have > two RTCs, rtc0 is not alarm capable and rtc1 has alarms. > > The driver for rtc0 used to not have .set_alarm() to signal it didn't > support alarms, it then switched to RTC_FEATURE_ALARM, making the > alarmtimer code select that RTC instead of rtc1, breaking suspend/resume > on the platform. I'm even more confused. So RTC0 does not have .set_alarm() but why does it turn on RTC_FEATURE_ALARM? I'm obviously misinterpreting the above... Thanks, tglx