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 543EB374C4; Tue, 26 Aug 2025 13:55:46 +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=1756216546; cv=none; b=DA56L4BwTD/sW1eYc432QfcHFESknry+jXcGKcM37T4TiVzVcDEtQmRAbhVzYldTeXcMyDstZSYR2zfXy/MfAsUQPvrE2rHr/Not0IniIKJmKGWJTf5p2fhZM/r7ZpAomvS3bximCxLEhZbuKex/+vUwTbxoGt4BGhSVKzMWnWk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756216546; c=relaxed/simple; bh=HFl7B7MaDPY/uFclLDQXHEDWYW8+y0vFyXw/9lVlalM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mll8aybEb88k7yCAkxMg7DqdF4mdUNZDmSl6J6yppr/3JDu0wkPBs5yL4gH3Y5QRaaiy/aSFDs4GJUaF8kzefeJmJRIh9iyillnovYxqIdTK9mQYW+PXprwD8z0lnFJ3XvXxIUgDJfE5O35ik7K8yFqYCMlaWQoNsB6+0sM+264= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=qP2iDNq2; 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="qP2iDNq2" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D4859C113CF; Tue, 26 Aug 2025 13:55:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1756216546; bh=HFl7B7MaDPY/uFclLDQXHEDWYW8+y0vFyXw/9lVlalM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qP2iDNq2zV3fJQWSuWqUdzG0rcq4DlOlSOYAmpHYUKy+QSOfRw6cny9XPNY2IRFlp NNK4s7JieWnv9PvD2+YVyXtl2XVwgnHWBGg3emcNQzjlSvqZgPP4fYiAppcfrLZR0M rjFyPOK7c50G8JCFKmkukBqeZHUpYOWUzMoqE7K8= 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.15 434/644] rtc: ds1307: remove clear of oscillator stop flag (OSF) in probe Date: Tue, 26 Aug 2025 13:08:45 +0200 Message-ID: <20250826110957.220059238@linuxfoundation.org> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250826110946.507083938@linuxfoundation.org> References: <20250826110946.507083938@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.15-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 f8e32f5c37e3..e02bc2a2e77f 100644 --- a/drivers/rtc/rtc-ds1307.c +++ b/drivers/rtc/rtc-ds1307.c @@ -1819,10 +1819,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