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 EECE8155A2A; Mon, 29 Jan 2024 17:08:13 +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=1706548094; cv=none; b=d6UMQ/HYAVMRKHBWZ7B6lLuSL1YnpfCCp34eRWVtwc7ZkM30Zh+pmMPb+AVE61Eo38VKXUytpnrsGx0GtYuNBuf1+piGw15Nu0ClAaW7kpDqM70jgs6couLYPIxPhXPnc0SeFndbisTXpVoXHQH8/To09BxpDcfKoFDQDif5FC0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706548094; c=relaxed/simple; bh=N++BebRSxCoidojezoMZHEUowniZPAql4Kj70M1keXk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=p/Z9Elo+Uhp9VWW3e8RABy2hq5drnVjHTbOSi5n7hUsPHYDP/BOoRUHuC7I+X24QwcZyqWIMT+IlVGl5QaGVLn3zNaKpIgunYmT0gJi+JQy3RI6vfGNasSpabXrkFDWgf9i2qFOg5o1Rtw9b39MqFhPb5N7CiddARXBSGQK8ytc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=e8joBkWn; 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="e8joBkWn" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B89D7C43399; Mon, 29 Jan 2024 17:08:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1706548093; bh=N++BebRSxCoidojezoMZHEUowniZPAql4Kj70M1keXk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=e8joBkWn3FCjD3XTXQI6Zp/VCzibBcGgpx/xAfphrHZuM1QIqWw0vX9RiTnyf/K4i +IBSN7rifdZzQEz6A9OSiOby/JFwDbgzmHE9cldsUeDV/17lw6osOKTXdG6l1LAkiR qfO24irvyUFTQBZmf/YwFfNAclmfNFTzWweHH9F4= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, =?UTF-8?q?Mateusz=20Jo=C5=84czyk?= , Mario Limonciello , Alexandre Belloni Subject: [PATCH 6.7 110/346] rtc: Adjust failure return code for cmos_set_alarm() Date: Mon, 29 Jan 2024 09:02:21 -0800 Message-ID: <20240129170019.629869587@linuxfoundation.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240129170016.356158639@linuxfoundation.org> References: <20240129170016.356158639@linuxfoundation.org> User-Agent: quilt/0.67 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-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 6.7-stable review patch. If anyone has any objections, please let me know. ------------------ From: Mario Limonciello commit 1311a8f0d4b23f58bbababa13623aa40b8ad4e0c upstream. When mc146818_avoid_UIP() fails to return a valid value, this is because UIP didn't clear in the timeout period. Adjust the return code in this case to -ETIMEDOUT. Tested-by: Mateusz Jończyk Reviewed-by: Mateusz Jończyk Acked-by: Mateusz Jończyk Cc: Fixes: cdedc45c579f ("rtc: cmos: avoid UIP when reading alarm time") Fixes: cd17420ebea5 ("rtc: cmos: avoid UIP when writing alarm time") Signed-off-by: Mario Limonciello Link: https://lore.kernel.org/r/20231128053653.101798-3-mario.limonciello@amd.com Signed-off-by: Alexandre Belloni Signed-off-by: Greg Kroah-Hartman --- drivers/rtc/rtc-cmos.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/rtc/rtc-cmos.c +++ b/drivers/rtc/rtc-cmos.c @@ -292,7 +292,7 @@ static int cmos_read_alarm(struct device /* This not only a rtc_op, but also called directly */ if (!is_valid_irq(cmos->irq)) - return -EIO; + return -ETIMEDOUT; /* Basic alarms only support hour, minute, and seconds fields. * Some also support day and month, for alarms up to a year in @@ -557,7 +557,7 @@ static int cmos_set_alarm(struct device * Use mc146818_avoid_UIP() to avoid this. */ if (!mc146818_avoid_UIP(cmos_set_alarm_callback, &p)) - return -EIO; + return -ETIMEDOUT; cmos->alarm_expires = rtc_tm_to_time64(&t->time);