Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp461013pxb; Wed, 27 Jan 2021 12:01:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJxepD8s5t99uILPRO3Ou/JR9pG/6fZDz47sKb4Cuyz33KbhGJCdLqN3/oPrM3bgrBsCjT4G X-Received: by 2002:a17:906:3fc4:: with SMTP id k4mr7762092ejj.137.1611777705586; Wed, 27 Jan 2021 12:01:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611777705; cv=none; d=google.com; s=arc-20160816; b=S/1IZcz1oGiroJ+lx59/HLfWQ+p8SNFGkUWSfZLXV+W0kgviQAStfqzqbNXF9PdxXL vBCXTUfltIJiS+Y4ojoVyjfS0o8UYGQ+iemdagfuIoG1/4Nj6jf0cdlDhn305htApBDN m/4pttNPGKR78RKg4C3jfrX5HJZkpBugw+jJgonD4n1X568A4cJf7ZSxhhU5c/iiVinp 2ngOhQy1fJMOMLZ/RkRQFJVf5ehmxNwTNHTY3jzqDIt/teAFSoymaKv4AflQ6oJwSk3E +EMJLIrOWiiZcwnMrXzsuFgsZs8JSJbiVA04xaJt2Oox32mCL2fhaAnmuV0t1R5Qh0zE 5Lgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=vrwkbHb1dcWKwoHE7vhwbHRIYZ+Y2r9vWNO/t51cO5U=; b=Rh1jSDCJSe8kudGfsEduTjb8WrAnbz2nKwilunS39iIi4EgtNT+fftNQv8XjtzIDX9 bsPy5SFyulXsMPKJcD5q+I3EreOak2VWPfRpqgGb9qRA97e9zTg80APItOH80J69eIeZ 8VBFqZBL7AND2/Oe9fsF1FJ4iXU7JrT5V3CIbMQDdf3yYqFdYxe8CS6cMYHLDe7QkbgN KxJ/wJ1STs9sOg9e5JjaPrBtxwkAVNcFgdRVyDSLG6MTdKAR+i7ymHNcmaW8MB0BqY34 0+6U9kWrp6c0MLE/ThgNfGhgyvjTBCI8E1DiLFlTV0ooXjY1lpVShieJQNDNnIslcteC c0Rg== 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 g20si1336931ejm.29.2021.01.27.12.01.19; Wed, 27 Jan 2021 12:01:45 -0800 (PST) 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 S236783AbhA0DmE (ORCPT + 99 others); Tue, 26 Jan 2021 22:42:04 -0500 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:56437 "EHLO relay1-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728202AbhAZWPW (ORCPT ); Tue, 26 Jan 2021 17:15:22 -0500 X-Originating-IP: 86.202.109.140 Received: from localhost (lfbn-lyo-1-13-140.w86-202.abo.wanadoo.fr [86.202.109.140]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id 913A2240003; Tue, 26 Jan 2021 22:14:36 +0000 (UTC) From: Alexandre Belloni To: Alessandro Zummo , Alexandre Belloni Cc: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] rtc: rv3028: fix PORF handling Date: Tue, 26 Jan 2021 23:14:33 +0100 Message-Id: <20210126221435.2152339-1-alexandre.belloni@bootlin.com> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The PORF bit is cleared on interrupts which prevents the driver to know when the time and date are invalid. Stop clearing PORF in the interrupt handler. Signed-off-by: Alexandre Belloni --- drivers/rtc/rtc-rv3028.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/rtc/rtc-rv3028.c b/drivers/rtc/rtc-rv3028.c index 2004f8c5397f..4f8f6092097a 100644 --- a/drivers/rtc/rtc-rv3028.c +++ b/drivers/rtc/rtc-rv3028.c @@ -268,6 +268,8 @@ static irqreturn_t rv3028_handle_irq(int irq, void *dev_id) if (status & RV3028_STATUS_PORF) dev_warn(&rv3028->rtc->dev, "Voltage low, data loss detected.\n"); + status &= ~RV3028_STATUS_PORF; + if (status & RV3028_STATUS_TF) { status |= RV3028_STATUS_TF; ctrl |= RV3028_CTRL2_TIE; -- 2.29.2