From patchwork Tue Feb 27 23:13:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Belloni X-Patchwork-Id: 207503 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp3021926dyb; Tue, 27 Feb 2024 15:20:57 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXFOmxDMIrzc7SE/llZ7Ktb/vb/ytmaD2usQlQbCc0mQiWo1X9nJtOc8WpDKADDkndGUGF1zhnrWwIV4CJlvruSbaz8wQ== X-Google-Smtp-Source: AGHT+IFVPyjtAOr7WWtnf/e21zMvnqcGSbTBCKNTopbpY6fBSjKuGqPAt3uopZxZxw5k1BxF+Xhr X-Received: by 2002:a17:902:9a46:b0:1dc:3402:354e with SMTP id x6-20020a1709029a4600b001dc3402354emr10248047plv.54.1709076056877; Tue, 27 Feb 2024 15:20:56 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709076056; cv=pass; d=google.com; s=arc-20160816; b=LTP3LbT72g1mBwHF1mcpdMQFng1uJe0uLw+ZwdlfPpnQnvPtx24Q5D+h5GM4IcxMC2 +DZSTYyOvnGmWupfd4wRRM8Bz1nR0frX+3NyqPGOqHMXcJojMh5e5Op1CNMuPzrAGEs2 Zp2g3ejGjfWudzADA4nXOGYmVHYj1fOTbvUIbmLcxRF4RmPPP91lcMvJSi5iHI4FBVcY eAIC2B+vGb8AM9iSHGCIjedcqGTEPOYHtvldM8V3JCMS+bSnjudi0NHoCJvjzSfPtdHG zA51zQURnu44ODA6LWzZUKcVMVti2uVd9Mp04f54hEstvPYbJnWtfDeYwzgVFlOK2WHp BRQQ== 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=UE7EiRd4bNA/hzZvwUNjNWHpGsJRtcTpEKCKzOC3+w8=; fh=v+fQpqqloRxheg66y6v5BEIIh4tqlWdyRuynNr5XQWo=; b=MN5TZ+pL/dS8kgeBr9OhA7myw6+APfVVDRvxo5qVCmaVnoAPMvIEvwwLi1neJ2Yts1 4m5c4Zf3f6nOTPj4459sTVv2XdRlcO5SYtIIwaKfzYAO/VJ6sw96c/nT73z+1MxtEy4T 8rnaZszbOdJJ+U3zeccSCiywYgnP7MlZhQ6MGc5K3xp7JF9rn9aMrYIhuAmxrWrk+tZm LGEciAAyaPxVMNae6J7Z55ynrmr9JPgLJGpi7EjCZ+OJQIDWpjkUhSUwrVZZKYqI2fzm 28bcYn0EVekKAZ6ZFYuWIjuI5jbcQH/PB6QndElfX8f8BK55u87vebEvuopZKngS68/8 UwAQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=GV+H7ERU; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-84180-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84180-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id t10-20020a170902e84a00b001dcaf71fefasi2167492plg.543.2024.02.27.15.20.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 15:20:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-84180-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=GV+H7ERU; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-84180-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84180-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id E153F293AD2 for ; Tue, 27 Feb 2024 23:14:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3AE1D56B6A; Tue, 27 Feb 2024 23:14:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="GV+H7ERU" Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) (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 1BA2D5577A; Tue, 27 Feb 2024 23:14:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.197 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709075650; cv=none; b=OXsPQRXikudCCM4JjsMd16y1CL/wP6HiQK/tUclyevA0k2af/LdQ8FHOkfvsQ8yZLOB2FCsWtybBjvIQTzs1HpYXB9wHRS7uU6mtUQhX7apIivG23p8YNpGdCzUsVmqr0+YtMvrkH9gOXnEPTPUpnagbBvOkUCDY6W7HJolpPuo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709075650; c=relaxed/simple; bh=nsEziExjOLtmbpppbLO2Fb6/NxIhywmNgFfnncBJ1mw=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=apmHxd4Fr/w8U1zSsaJrSxAoHC1iJSq7ZTcnJs57eXs835BEfWIU4qNuTcTcvIQsT4tObMZq0z0zLNvrb+xZi5I4Y/s5IE1e8r7qsNng2H2rhAVXtoN+KZlP6msiuVoWXmN3yVY9wGzAxWvTij8ncwVaFgOaCZLbWNfFUDKA8VI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=GV+H7ERU; arc=none smtp.client-ip=217.70.183.197 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id 9B4691C0004; Tue, 27 Feb 2024 23:14:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1709075646; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=UE7EiRd4bNA/hzZvwUNjNWHpGsJRtcTpEKCKzOC3+w8=; b=GV+H7ERUI3Uty2KdCDE651r2OvyRemaEYAtcIIFQwad5m+tcKg/BDx+H2mBPofxwL1vhDF qK8CNh1svxIXXArtzskktAcO6eTMiSXOnhfWXwtuVom28PneF9bx26u+tyEJLzxASpCJ79 QpnjHCbYtp28c+/vdoWfQFwIk+iFrtcWsIg/k1lfD/zUwqaChnUzrLMKIIERNe7UmUdybC tSGhjZrRhSSpzC9RVMszVOKElhEvFO5SkzgNeKYOZHT4QXC7BiKazGA4HFYaiOXdUEPJta z+zcSNiWyTj2jHTfUP5a0/8w5AJ9qC9mU0PHaJX2siMcprvTW0dBR6i2MGbDQQ== From: alexandre.belloni@bootlin.com To: Alexandre Belloni Cc: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] rtc: ds1511: set range Date: Wed, 28 Feb 2024 00:13:54 +0100 Message-ID: <20240227231356.1840523-1-alexandre.belloni@bootlin.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-GND-Sasl: alexandre.belloni@bootlin.com X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792096135533714482 X-GMAIL-MSGID: 1792096135533714482 From: Alexandre Belloni The ds1511 leap year calculation fails in 2100. Signed-off-by: Alexandre Belloni --- drivers/rtc/rtc-ds1511.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/rtc/rtc-ds1511.c b/drivers/rtc/rtc-ds1511.c index edb8d90812c5..6869d28d34cc 100644 --- a/drivers/rtc/rtc-ds1511.c +++ b/drivers/rtc/rtc-ds1511.c @@ -322,6 +322,7 @@ static int ds1511_rtc_probe(struct platform_device *pdev) return PTR_ERR(ds1511->rtc); ds1511->rtc->ops = &ds1511_rtc_ops; + ds1511->rtc->range_max = RTC_TIMESTAMP_END_2099; /* * if the platform has an interrupt in mind for this device, From patchwork Tue Feb 27 23:13:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Belloni X-Patchwork-Id: 207498 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp3019328dyb; Tue, 27 Feb 2024 15:15:10 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWqHC0TXnMWNB/MldvudFRmEWM/5Srl4jJJzc4+HGLAGnp8/9YbacoJir1U2C6/XV+6SPYzG1tGM+3TlERSQg6W021HXw== X-Google-Smtp-Source: AGHT+IGRHl2nPVgVf89cpU8Uf4mxEkJ7acAYFJKH8HuS9i2QHlNSvmXoF8r2mkttCHakFYQnIHc3 X-Received: by 2002:aa7:df99:0:b0:566:6a1f:c548 with SMTP id b25-20020aa7df99000000b005666a1fc548mr44141edy.3.1709075710326; Tue, 27 Feb 2024 15:15:10 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709075710; cv=pass; d=google.com; s=arc-20160816; b=YPYuuRieAEd6rQbv2AhwgMlgR10l0r648iH9EhBAsJ2wCsx2O/dbDDcGNmcmtOkl7F PFEX5t5s9nHijzOZskI2JYquNNEpPnb2IaAmAnqHTpB++sdB3Avz4FDzptaSnyqbBg/Z aodaort6smYrmuRQHvIk5NPub8uvE5LFyCmVDD2OavPCL50Lpc/p5zZWxi2KJ2q1gfln PadbsTGa6Fsn1SQSNvbtK+Ytdz4SUWJfpCnJzax3GjamJSf7Ns+1mlRSuCD5otVKzJlt KNULuWcwYuW3J+lkfbV+fsnoEA5P+5DR6Rm9Ptt5CkvX+NJYSR5NbAPvSjG4xfMD3s+1 F4wg== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=xjAcQeJGSd5BcuSQbG0A8pilf5S0iMMnTwn+eoiNSfw=; fh=v+fQpqqloRxheg66y6v5BEIIh4tqlWdyRuynNr5XQWo=; b=D1s1HY9U4K+UOCiS0xhmGttk9qe+Az4PHK/kORAuonZ6dJdv2ro823WpbvO9/fikgP MfIzD+cPOpPM4Bp8io4vV4yG9dBLF79V6axONQp8WaZpItql6a2lNnt4xpbQZXz0+g5R OTrpmwFxrNvULz9VmpIlvAVJZzeuJVGf9LKaRqMzZA5USkVZUFGXin/t2k9a96jFVUmM /alM2oDcLu7NRoNYpSmYP4vNTP4yIKyFIGcyypXZ8Ghm0yIeUZRM91rItj6eClHjZh0J j+8ZGPZWkA72jQ8R+YbvJx7aCAQYNbtp0FunYOtHZf1Gbjxiu0OFOb4UW+QiRG+7KRqv 5lxg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=WiQx2VbF; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-84181-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84181-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id w20-20020a056402129400b0056559a4907fsi1069124edv.100.2024.02.27.15.15.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 15:15:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-84181-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=WiQx2VbF; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-84181-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84181-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com 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 am.mirrors.kernel.org (Postfix) with ESMTPS id D20DD1F2E4B1 for ; Tue, 27 Feb 2024 23:15:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 142AD57336; Tue, 27 Feb 2024 23:14:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="WiQx2VbF" Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) (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 5D1EE56741; Tue, 27 Feb 2024 23:14:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.193 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709075653; cv=none; b=HWc/T0O3yZhRW4F1mfpPOE7/eJBpkdluFKIsLnvA+42T0/0wziLb8Wzz5SFSSWQ4klTQIeWRU829aVZIA7KwQqrBCRUYDsxtEYywWdYKsqraPo1fF0kO0GH/JkCfBkcQz+sdE2Ndm0ryS4ZX5ktj7fGFBwA2zrAjRqG2zbmtJ5w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709075653; c=relaxed/simple; bh=LI4PM4UegSp+OIgjo5ROBmyzBvlxEi447Fy28Z5th+U=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FgyRUg7c6ZSThUU4Im031FDzLiY8FCzD6HOPv5j8t9/8jpATOChvjcGMwsQivN6IPiNzcxNJUK+CyXDR2atcPa9DdJCeWQld29j6vC71mfp1GgfM5THYjFXIFhEkK4EDJyXoO5vlzi5+7teh9dtMLsivIPP+QJBznnBGXplBV9o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=WiQx2VbF; arc=none smtp.client-ip=217.70.183.193 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id 3B8D8240002; Tue, 27 Feb 2024 23:14:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1709075649; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xjAcQeJGSd5BcuSQbG0A8pilf5S0iMMnTwn+eoiNSfw=; b=WiQx2VbFi7fjyfycTuT5T78+hPrEXGkbUsEu2175Wi6DyG2mFiYxdfBAvsJj5m3k0XtShh T/f8Sh01z1hdshGhUWik0qQ7zJ+9pQKVN77MQO/dr0IAe0oc9yj9JnEZVIdMy7PJYKe4ut CIeYxN5FGWTdKx8G5mKmw2OZ0JMdJU9sjDKCXAyU9cUT94T//re56/MaQHCB1Yi3wbqX0L HAx0ep21oDiP6vWWOobjpDzYsT2kqjoknY+IVlehWXX7h6VXT8LwRyyKG/8D8G/rEeB/+A 4gWXld5JwQ7MT9OrF6AaeIigfDW5IrD3rgduJ+WpwCZssuwDdepVgRKk9V+rVA== From: alexandre.belloni@bootlin.com To: Alexandre Belloni Cc: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] rtc: ds1511: set alarm offset limit Date: Wed, 28 Feb 2024 00:13:55 +0100 Message-ID: <20240227231356.1840523-2-alexandre.belloni@bootlin.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240227231356.1840523-1-alexandre.belloni@bootlin.com> References: <20240227231356.1840523-1-alexandre.belloni@bootlin.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-GND-Sasl: alexandre.belloni@bootlin.com X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792095772050207801 X-GMAIL-MSGID: 1792095772050207801 From: Alexandre Belloni The ds1511 can only support alarms up to a month in the future (which we currently limit to 28 days). Signed-off-by: Alexandre Belloni --- drivers/rtc/rtc-ds1511.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/rtc/rtc-ds1511.c b/drivers/rtc/rtc-ds1511.c index 6869d28d34cc..8b087d9556be 100644 --- a/drivers/rtc/rtc-ds1511.c +++ b/drivers/rtc/rtc-ds1511.c @@ -323,6 +323,7 @@ static int ds1511_rtc_probe(struct platform_device *pdev) ds1511->rtc->ops = &ds1511_rtc_ops; ds1511->rtc->range_max = RTC_TIMESTAMP_END_2099; + ds1511->rtc->alarm_offset_max = 28 * 24 * 60 * 60 - 1; /* * if the platform has an interrupt in mind for this device,