Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp218863pxb; Tue, 2 Feb 2021 03:32:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJyocCsbzw+ADhyICfVrTHe7OT9+vqFt1mkE78/Nxx235HfzvnJWSFe0478MkUnq8+l4iGDJ X-Received: by 2002:a05:6402:1291:: with SMTP id w17mr2220269edv.112.1612265524144; Tue, 02 Feb 2021 03:32:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612265524; cv=none; d=google.com; s=arc-20160816; b=clf8pHYiClpKus6Lu2FbndV1PjDIvCQOOKak8vNpEgnrPu6rOkBH7hYPB3BSE+tYpm 8A0lXvUt8DvGz++DKK9MPzN4mdWo1tODhGkNuC0LDMTQYG84fu8kyx7FrlYoFcqxfrIR BA7bSPiYmVzkhS4erdTD8wXRrLdQg8J+TcWljXZWpIQ1holl/XAQENNTnki/fLkeYcQK fnUlRE7FT9v5r2JSlXVAZpfBYjEDqkOI9g/FEOMJ/oNecXeXMkP3cRd0AgL/AAc4+gHn wJMGrXVemvrXrc53CItueSov0RsS6F95PUllpKPOACmlZgxKwNHRb8GrjBfZgysGEudF HwIA== 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=0IPFlVpKLNTFRoSIPkqeKn91LY3+q1bOKxQI45xrMJk=; b=JGn66GX7lBA5GH/HpAiyC0CUdangui3Uy0NzWe3wN2odACjGP1U2xhqy6zJ1RRuDOu aAoWdhHoSZpmoLQbPDU6bn/5UsknEcLz3UMi1B4AVQ/kUOe0zR7mb+SOtB1E+5RKlbfE WT42qqrrlDMNwfJisU0c5AXShkqvDS12wifY6pWsGYRyYU1hcRE5WH7LBgmnQ4rwzWsX g58SatdVp3h5aI4COCy0OZ8quiKadmdw2Ia6Vqr7c/J8NrEVu7d4zKmEW6LP9YXZUWCd JNYQGSkf2Jn5en86OyhXByFBkxB4CFWc60fxKijCZEuQhZWhklNGG0SmWANh4REDDSfa dkaA== 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 11si5458217edw.195.2021.02.02.03.31.40; Tue, 02 Feb 2021 03:32:04 -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 S231199AbhBBLbD (ORCPT + 99 others); Tue, 2 Feb 2021 06:31:03 -0500 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:44985 "EHLO relay2-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230386AbhBBL0x (ORCPT ); Tue, 2 Feb 2021 06:26:53 -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 relay2-d.mail.gandi.net (Postfix) with ESMTPSA id DBD5240006; Tue, 2 Feb 2021 11:26:00 +0000 (UTC) From: Alexandre Belloni To: linux-rtc@vger.kernel.org, Alessandro Zummo , Alexandre Belloni Cc: linux-kernel@vger.kernel.org Subject: [PATCH 1/2] rtc: rv3028: fix PORF handling Date: Tue, 2 Feb 2021 12:25:54 +0100 Message-Id: <20210202112555.3611729-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 f68baa055a0b..6d07f8261c69 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