From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3BBA91A9F90; Sat, 30 May 2026 18:45:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780166736; cv=none; b=fBc2SwSbJaUseEqoYw0rxIjBO7d+/54DsRgeBiOU08xBPxfO4++unUFFOAb2zzaYf842uRnZio7pYdP1EFK2dp3AVn0mfvYu0qQamadBXMS1Vwe4q9CZrtGh+2na/hO/NjKchZ4C/FpyVpN30bOuR8r7rUmntBfsPJmgZekhSPQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780166736; c=relaxed/simple; bh=6INpQ6jhk61GXIy4EN05QhJv8nz5xwVHghJTCKwLMvg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=H/rQF+KPsCy7Ag8ZIt+8BKkrPumko/8oi1NihnUG19g+DHJ85+a7k6UPa7lDjYWHayo7TQaIFJ1LGFaOmTAIQ1KfxWXqBi8SwZNJoejkvTuIJZl0+2o8mwkzNdwKoEpW404m+NE8D2A6dzC1XInqSGnbW9mJDi7rC6IZzagt9Gk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=QG1aOAGV; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="QG1aOAGV" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 884731F00893; Sat, 30 May 2026 18:45:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1780166735; bh=iEv06bDItEwyiL+A5ksbpRxmmH7Cz5Un8IGlJ9htn2w=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=QG1aOAGVa2FKPzZ7dN8VmU+Q95ltZMw6e9tjs5Z/QHPutskQ/h4KTR2iBiXazvKhP HK4lXGb03e4UV2dT8ZttyclsQxoEBXz9XPS8lLQjYKzujc/MGLSAdX59rx1SNCaYzV 4JnTOz9aAeYvBDw422LhFwDZq/Cbb/qLgMzbvJA4= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Anthony Pighin , Alexandre Belloni , Sasha Levin Subject: [PATCH 5.10 455/589] rtc: abx80x: Disable alarm feature if no interrupt attached Date: Sat, 30 May 2026 18:05:36 +0200 Message-ID: <20260530160236.640272749@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260530160224.570625122@linuxfoundation.org> References: <20260530160224.570625122@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Anthony Pighin (Nokia) [ Upstream commit 0fedce7244e4b85c049ce579c87e298a1b0b811d ] Commit 795cda8338ea ("rtc: interface: Fix long-standing race when setting alarm") exposed an issue where the rtc-abx80x driver does not clear the alarm feature bit, but instead relies on the set_alarm operation to return invalid. For example, when a RTC_UIE_ON ioctl is handled, it should abort at the feature validation. Instead, it proceeds to the rtc_timer_enqueue(), which used to return an error from the set_alarm call. However, following the race condition handling, which likely should not be discarding predecing errors, a success condition is returned to the ioctl() caller. This results in (for example): hwclock: select() to /dev/rtc0 to wait for clock tick timed out Notwithstanding the validity of the race condition handling, if an interrupt wasn't specified, or could not be attached, the driver should clear the alarm feature bit. Fixes: 718a820a303c ("rtc: abx80x: add alarm support") Signed-off-by: Anthony Pighin Link: https://patch.msgid.link/BN0PR08MB69510928028C933749F4139383D1A@BN0PR08MB6951.namprd08.prod.outlook.com Signed-off-by: Alexandre Belloni Signed-off-by: Sasha Levin --- drivers/rtc/rtc-abx80x.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/rtc/rtc-abx80x.c b/drivers/rtc/rtc-abx80x.c index 034b314fb3ec9..8d15a68eedb81 100644 --- a/drivers/rtc/rtc-abx80x.c +++ b/drivers/rtc/rtc-abx80x.c @@ -843,6 +843,8 @@ static int abx80x_probe(struct i2c_client *client, client->irq = 0; } } + if (client->irq <= 0) + clear_bit(RTC_FEATURE_ALARM, priv->rtc->features); err = rtc_add_group(priv->rtc, &rtc_calib_attr_group); if (err) { -- 2.53.0