Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp106974pxy; Fri, 30 Apr 2021 01:12:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyBqRCqH4ZJ4zExBA8j/6uJm9tk7eJM92hFLIxcOaL/fiKfEEfhAjgORt8D8VOcF+MLF6N6 X-Received: by 2002:a63:1708:: with SMTP id x8mr3529929pgl.266.1619770351257; Fri, 30 Apr 2021 01:12:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619770351; cv=none; d=google.com; s=arc-20160816; b=wuNd+XViyPLzeEF8/FSSzvFKrLYQmntQYSldofcKt7BowNVLvi3CBHGsTpY+LcCnnk zuCk3vNFOD0azprgwOEAfzYUzvvR8m8Pv4IuyFt9JoIsbx9VFhroaw8oqp3IeAPYesoW g+hII3qQnnkkVDKbi3kW+mv6FJtwnbFuZ3XNAzY0nLXAC84nnb37IoT83IYBtmVbMw4s POOWPHqDfzvEqGmzWBFDTPeiGkq+0kr6qdYvNNcAvdCigm8d2O3ZnKpaLScxTonIg/Dz zAMdl/d396BtP7eu867QSowtZIhOBUdE6ciRAyJ1jpQecINL+tIfXRtjNqbM1GEQk4Se IA6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=dukHCLcdB2bhSoBRvloLoHUdNwzxef7+I7CRwDkN6wA=; b=i6C/xJGqjElhKULAQA8z85B/xJbX8A4h9tPa1CqIMh70YuKyymzxi8ln7QbDN6eKm2 +Y87SNfXRPKZAlb67ynZFdPMgBJPy/vy8IWohOcccjgdORP9SszmlceYpCA2JXmSmQfy niJRs3sjzW14omRSTV6qsSUd9ykVtWYKBiePE+d6GGK2pvXsotTCv36CSYCWNUPxFz94 jBhBzU6y3/xkVLsi3XhquL40lg2S5S3usjLbvvZR9NBOZNxGiXLia3sAqdIhcwYS9huM R978FVYXL+uH5RSgssR9C+cfyoJ1T9KcDtZhP5AZK4whDf5hLNKGiG0PpxPdS1/chVTP hyVw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v7si2936997ply.134.2021.04.30.01.12.17; Fri, 30 Apr 2021 01:12:31 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230439AbhD3ILE (ORCPT + 99 others); Fri, 30 Apr 2021 04:11:04 -0400 Received: from relay8-d.mail.gandi.net ([217.70.183.201]:54763 "EHLO relay8-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229532AbhD3ILE (ORCPT ); Fri, 30 Apr 2021 04:11:04 -0400 X-Originating-IP: 90.65.108.55 Received: from localhost (lfbn-lyo-1-1676-55.w90-65.abo.wanadoo.fr [90.65.108.55]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id C710E1BF20F; Fri, 30 Apr 2021 08:10:14 +0000 (UTC) Date: Fri, 30 Apr 2021 10:10:14 +0200 From: Alexandre Belloni To: Thomas Gleixner Cc: John Stultz , Stephen Boyd , linux-kernel@vger.kernel.org Subject: Re: [PATCH] alarmtimer: check RTC features instead of ops Message-ID: References: <20210429214902.2612338-1-alexandre.belloni@bootlin.com> <877dkkfdif.ffs@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <877dkkfdif.ffs@nanos.tec.linutronix.de> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 don't mind the patch, but the changelog is a bit meager in explaining > the WHY. > > Thanks, > > tglx -- Alexandre Belloni, co-owner and COO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com