Received: by 2002:ab2:69cc:0:b0:1fd:c486:4f03 with SMTP id n12csp429049lqp; Tue, 11 Jun 2024 08:28:05 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU+xtefBusIpkybn25JidhobtPWXxID9X5koNP0YwG9eGysRjOwHHSnpIONCtThxIj8DRN73HJKfx3HPOG4bvwSaIgGyAJ0mmRIrMuAWg== X-Google-Smtp-Source: AGHT+IECGZEO73f6syDHfqqYslxBp/Qz42rBdx+KkLrV+LIun1LUxR5QzaTUWLBuJMAIBygGj6cR X-Received: by 2002:a05:622a:130d:b0:441:4a7d:4b9 with SMTP id d75a77b69052e-4414a7d0879mr18011091cf.15.1718119684807; Tue, 11 Jun 2024 08:28:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718119684; cv=pass; d=google.com; s=arc-20160816; b=qDYMfsX2DIIUdGu4onRD/IC1gtipoOKaprAKGXmn8x5MKdHyT3n40GbnjhyYCRSldy IEdmk/PdCd69yKqmZdXUgOZa1dVl/J3f1GWLloiLdcO3SZD1eP+9YOy78O3tsbpVAs5i 6pxU//j2geWEZigYj8QuoNas6WvBNST83cRTG2Kj1zVuALmaBRuxSmsttm6sAiNuEDjX eaVw1u8Vu1u5iAPRyTVYaxIFRRJgg12UZZf5OXxLDon0ALvmIaujHENQA3yOumJBkkP8 10mJWaLVnVH0FX5A9duobH0eA8k7nXCid2426Wq7TROQ8Z0C/m1hd6XueMHFkPf8Sc9/ sgyw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=+fcXqLCe4F1bXJgjKSJ//mKl8KYr7kb10sDPWBlrK7M=; fh=gXv1YJWhOzWENUjoapJ8OXXsX7ma5A4ziYD5Lu2AwF8=; b=J41QWOMjdV62HEAQFboZNOS1DqasY+Z1VM75FbNIWApJyc7Wws5Dm5DuddnXxwZCez TNFNR5Nc/3AYwcjoV7CuJCOW1exqfivCFFAP+ViXeWy8UCYG5+Law9g64siRf91opNKf he+TovxcirFNv8YWBdYMD2bjIQW9B0cYtzDjEEFMijco9AylZBPmkxyl5bvj0gxwkbgY vQ3X/6k5G7d/CBjtqOVUOKx/4cI10wQeCDFFRxLIeapwi5gI27NVsZg9/dgmcczOVRFC 2mAAwXCwixSsSQDduhCaAZvpJ9oUHNum74oR32396EaiHZGc2/EiJnXqROfrQ5iawVxn KIDg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@prolan.hu header.s=mail header.b=uJ0vzSkn; arc=pass (i=1 spf=pass spfdomain=prolan.hu dkim=pass dkdomain=prolan.hu dmarc=pass fromdomain=prolan.hu); spf=pass (google.com: domain of linux-kernel+bounces-210151-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210151-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=prolan.hu Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id d75a77b69052e-44038b38b01si137165531cf.413.2024.06.11.08.28.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 08:28:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-210151-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@prolan.hu header.s=mail header.b=uJ0vzSkn; arc=pass (i=1 spf=pass spfdomain=prolan.hu dkim=pass dkdomain=prolan.hu dmarc=pass fromdomain=prolan.hu); spf=pass (google.com: domain of linux-kernel+bounces-210151-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210151-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=prolan.hu Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 8719F1C215F5 for ; Tue, 11 Jun 2024 15:28:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0939F28399; Tue, 11 Jun 2024 15:27:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (4096-bit key) header.d=prolan.hu header.i=@prolan.hu header.b="uJ0vzSkn" Received: from fw2.prolan.hu (fw2.prolan.hu [193.68.50.107]) (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 ECE1A219E7; Tue, 11 Jun 2024 15:27:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.68.50.107 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718119678; cv=none; b=C/VquWtlCHbj1hNCTZOoN248Y4u0wcZ+N3ukPRM71lkABqbqIZmH3809+2RDjSOWzsdQ8WXwqV9PxfHID8wZU3ml10mCcFaPBIWH9Ji5tonr7cOmIaY8U7sUm++0+0/gwyB7x8hrXCzVOmXrnAK6Lqi4klykxTx65ENhX/YHcew= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718119678; c=relaxed/simple; bh=bckD34ce3BLIg4fhivwUbxeT9ELN7t78T8hp5H2vVD4=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=dNU4/UZNLOEDxQSrHBrlZtJSuooD00ZFHhxK7cqa2z/ckbogDGSzA156M/bBL84OQ7Qhvd3G0S34G6Mm11/kTJ2hTgaXAJBPpcekHA7ipN9ABH0hQJspXVWyocfikKBVkBa3JMTT7kqk9gCCgrL8rFlKIhpXDDF+7a1dmxRCpGM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=prolan.hu; spf=pass smtp.mailfrom=prolan.hu; dkim=pass (4096-bit key) header.d=prolan.hu header.i=@prolan.hu header.b=uJ0vzSkn; arc=none smtp.client-ip=193.68.50.107 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=prolan.hu Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=prolan.hu Received: from proxmox-mailgw.intranet.prolan.hu (localhost.localdomain [127.0.0.1]) by proxmox-mailgw.intranet.prolan.hu (Proxmox) with ESMTP id 0382EA0A9B; Tue, 11 Jun 2024 17:27:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=prolan.hu; h=cc :cc:content-transfer-encoding:content-type:content-type:date :from:from:message-id:mime-version:reply-to:subject:subject:to :to; s=mail; bh=+fcXqLCe4F1bXJgjKSJ//mKl8KYr7kb10sDPWBlrK7M=; b= uJ0vzSknW5jLFMW3SUQ9qTgps1gqUv99wdY/LGus0tp97XextN81kQ6hmSHeFKl5 2LJljIwe05aPK07c9fv2VYs0Tb615ZBn7QmDnof1FLyoIPl1cfdUU8zCFIvLpbWD koguLizVQf4QKl10YrsmsV3FPhXqTw2q513fBTKwTrjdoo8ndiAIbr4JCdxHPOJh Cdg4SvIMVKZllzlR9DbX5V5XRfjbEWMUPKuTitW+rUSoiZfCw4jP/MH6/6F3ldnC v0IP54NVKbEOIi/OmmC85YX3oRNdTwxLXqlS3aPbLgIPDY8HQo4VTcL9ArrwExAy mnbqijlj0R4ELO4uErzfBeNAuFKV5RsW3ELMuBdMqLDm0M4GtAm4vGzKRwpqwV2f QPYZ1ae4/nB0Cf8Md6HahnTUdooIBfsTWYS0YA7vvjQ954RRtcFL9DjPs6MBAJZN SqZIUvZs7fYIyMX5qHIIvS6EzHyYHuNFYMOykvHQZ7GmtjqvnSKaYY6hmPuMeLFy SN5KbzDso8JU36vjrylC2NOlJVbO8vl1GhGs/vkRz9aV9ja3jDOPXL2Jv0lQmKJ4 2JzaJqQNRi+TRRuenF7PIfDc1ZtEolFdnw1Fx0uccue622JJz7iLnOtxZhh5COgA 89vpUOtpn+s6XFUToQteJMQV+uJvmNr0Rd0cuk5v6us= From: =?UTF-8?q?Cs=C3=B3k=C3=A1s=2C=20Bence?= To: Alexandre Belloni , , CC: =?UTF-8?q?Cs=C3=B3k=C3=A1s=2C=20Bence?= Subject: [PATCH] rtc: interface: Add RTC offset to alarm after fix-up Date: Tue, 11 Jun 2024 17:27:00 +0200 Message-ID: <20240611152701.685011-1-csokas.bence@prolan.hu> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-ESET-AS: R=OK;S=0;OP=CALC;TIME=1718119673;VERSION=7972;MC=2950704555;ID=512276;TRN=0;CRV=0;IPC=;SP=0;SIPS=0;PI=3;F=0 X-ESET-Antispam: OK X-EsetResult: clean, is OK X-EsetId: 37303A29916D3B54627C65 `rtc_add_offset()` is called by `__rtc_read_time()` and `__rtc_read_alarm()` to add the RTC's offset to the raw read-outs from the device drivers. However, in the latter case, a fix-up algorithm is run if the RTC device does not report a full `struct rtc_time` alarm value. In that case, the offset was forgot to be added. Fixes: fd6792bb022e ("rtc: fix alarm read and set offset") Signed-off-by: Csókás, Bence --- drivers/rtc/interface.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/rtc/interface.c b/drivers/rtc/interface.c index 1b63111cdda2..db8dffffed91 100644 --- a/drivers/rtc/interface.c +++ b/drivers/rtc/interface.c @@ -275,8 +275,7 @@ int __rtc_read_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alarm) /* full-function RTCs won't have such missing fields */ if (rtc_valid_tm(&alarm->time) == 0) { - rtc_add_offset(rtc, &alarm->time); - return 0; + goto done; } /* get the "after" timestamp, to detect wrapped fields */ @@ -380,6 +379,8 @@ int __rtc_read_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alarm) dev_warn(&rtc->dev, "invalid alarm value: %ptR\n", &alarm->time); + rtc_add_offset(rtc, &alarm->time); + return err; } -- 2.34.1