From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 346ED341AD4; Tue, 26 Aug 2025 14:39:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756219149; cv=none; b=EX3AiSjW07Yww28Y+LQ2FSO3uzbQjgBwy1daGcqvsiT5zn4ChbX/yOM9UeABiUfzplVdk3KhpIw2atsE4Dto+Eqn5H9FNYp+s3zvTGnGpLtvDr72EJNv6yIooqNGTfBhyFEJd0FkpnKE0RtrpgB8XPk9io77hnYjGlOFmW4N5Zg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756219149; c=relaxed/simple; bh=ZFIJlc4FGUtwnrVzwju5MOv8tupfvn4WBkyCa8OqWLs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ks3fR4+XlqVDSc2DB3RasZ2PubVgMO6fyxteqi3m4wtSmexIwgulZVQ1COMrLmTqBa2I1L+F9dKTKo1Jj3v6NnKbK4nLXNiSfzge7SDd7arxircxuMGJw2+OGLEnnZb4DuANS43ImbWkrUngkgxMugLxbeCllJkfvWkj3aXkcEQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=aB3XEPMk; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="aB3XEPMk" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AF5CFC4CEF1; Tue, 26 Aug 2025 14:39:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1756219149; bh=ZFIJlc4FGUtwnrVzwju5MOv8tupfvn4WBkyCa8OqWLs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aB3XEPMknk2hmDpG78MA4v5AYPYgmBSbJOMu6jvA59Y9JVe4nJCs9IpRrFXwhnRYh 7IagwCZfZZSEENqejZbby0XvYtKNc4/e/csQBEavYTkNYEfQvEqVzboZZGyOJmFbxd veiTJM8g5nWiaBvknYet8BZhEGkT+wOym5G/BacQ= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Meagan Lloyd , Tyler Hicks , Rodolfo Giometti , Alexandre Belloni , Sasha Levin Subject: [PATCH 5.4 271/403] rtc: ds1307: remove clear of oscillator stop flag (OSF) in probe Date: Tue, 26 Aug 2025 13:09:57 +0200 Message-ID: <20250826110914.291868157@linuxfoundation.org> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250826110905.607690791@linuxfoundation.org> References: <20250826110905.607690791@linuxfoundation.org> User-Agent: quilt/0.68 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.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Meagan Lloyd [ Upstream commit 48458654659c9c2e149c211d86637f1592470da5 ] In using CONFIG_RTC_HCTOSYS, rtc_hctosys() will sync the RTC time to the kernel time as long as rtc_read_time() succeeds. In some power loss situations, our supercapacitor-backed DS1342 RTC comes up with either an unpredictable future time or the default 01/01/00 from the datasheet. The oscillator stop flag (OSF) is set in these scenarios due to the power loss and can be used to determine the validity of the RTC data. Some chip types in the ds1307 driver already have OSF handling to determine whether .read_time provides valid RTC data or returns -EINVAL. This change removes the clear of the OSF in .probe as the OSF needs to be preserved to expand the OSF handling to the ds1341 chip type (note that DS1341 and DS1342 share a datasheet). Signed-off-by: Meagan Lloyd Reviewed-by: Tyler Hicks Acked-by: Rodolfo Giometti Link: https://lore.kernel.org/r/1749665656-30108-2-git-send-email-meaganlloyd@linux.microsoft.com Signed-off-by: Alexandre Belloni Signed-off-by: Sasha Levin --- drivers/rtc/rtc-ds1307.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/rtc/rtc-ds1307.c b/drivers/rtc/rtc-ds1307.c index b371d1e48942..ff9785ff36e7 100644 --- a/drivers/rtc/rtc-ds1307.c +++ b/drivers/rtc/rtc-ds1307.c @@ -1686,10 +1686,8 @@ static int ds1307_probe(struct i2c_client *client, regmap_write(ds1307->regmap, DS1337_REG_CONTROL, regs[0]); - /* oscillator fault? clear flag, and warn */ + /* oscillator fault? warn */ if (regs[1] & DS1337_BIT_OSF) { - regmap_write(ds1307->regmap, DS1337_REG_STATUS, - regs[1] & ~DS1337_BIT_OSF); dev_warn(ds1307->dev, "SET TIME!\n"); } break; -- 2.39.5