<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/drivers/rtc/rtc-cmos.c, branch linux-6.9.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-6.9.y</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-6.9.y'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2023-12-17T21:33:55Z</updated>
<entry>
<title>rtc: Extend timeout for waiting for UIP to clear to 1s</title>
<updated>2023-12-17T21:33:55Z</updated>
<author>
<name>Mario Limonciello</name>
<email>mario.limonciello@amd.com</email>
</author>
<published>2023-11-28T05:36:53Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=cef9ecc8e938dd48a560f7dd9be1246359248d20'/>
<id>urn:sha1:cef9ecc8e938dd48a560f7dd9be1246359248d20</id>
<content type='text'>
Specs don't say anything about UIP being cleared within 10ms. They
only say that UIP won't occur for another 244uS. If a long NMI occurs
while UIP is still updating it might not be possible to get valid
data in 10ms.

This has been observed in the wild that around s2idle some calls can
take up to 480ms before UIP is clear.

Adjust callers from outside an interrupt context to wait for up to a
1s instead of 10ms.

Cc:  &lt;stable@vger.kernel.org&gt; # 6.1.y
Fixes: ec5895c0f2d8 ("rtc: mc146818-lib: extract mc146818_avoid_UIP")
Reported-by: Carsten Hatger &lt;xmb8dsv4@gmail.com&gt;
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217626
Tested-by: Mateusz Jończyk &lt;mat.jonczyk@o2.pl&gt;
Reviewed-by: Mateusz Jończyk &lt;mat.jonczyk@o2.pl&gt;
Acked-by: Mateusz Jończyk &lt;mat.jonczyk@o2.pl&gt;
Signed-off-by: Mario Limonciello &lt;mario.limonciello@amd.com&gt;
Link: https://lore.kernel.org/r/20231128053653.101798-5-mario.limonciello@amd.com
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
</content>
</entry>
<entry>
<title>rtc: Add support for configuring the UIP timeout for RTC reads</title>
<updated>2023-12-17T21:33:55Z</updated>
<author>
<name>Mario Limonciello</name>
<email>mario.limonciello@amd.com</email>
</author>
<published>2023-11-28T05:36:52Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=120931db07b49252aba2073096b595482d71857c'/>
<id>urn:sha1:120931db07b49252aba2073096b595482d71857c</id>
<content type='text'>
The UIP timeout is hardcoded to 10ms for all RTC reads, but in some
contexts this might not be enough time. Add a timeout parameter to
mc146818_get_time() and mc146818_get_time_callback().

If UIP timeout is configured by caller to be &gt;=100 ms and a call
takes this long, log a warning.

Make all callers use 10ms to ensure no functional changes.

Cc:  &lt;stable@vger.kernel.org&gt; # 6.1.y
Fixes: ec5895c0f2d8 ("rtc: mc146818-lib: extract mc146818_avoid_UIP")
Signed-off-by: Mario Limonciello &lt;mario.limonciello@amd.com&gt;
Tested-by: Mateusz Jończyk &lt;mat.jonczyk@o2.pl&gt;
Reviewed-by: Mateusz Jończyk &lt;mat.jonczyk@o2.pl&gt;
Acked-by: Mateusz Jończyk &lt;mat.jonczyk@o2.pl&gt;
Link: https://lore.kernel.org/r/20231128053653.101798-4-mario.limonciello@amd.com
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
</content>
</entry>
<entry>
<title>rtc: Adjust failure return code for cmos_set_alarm()</title>
<updated>2023-12-17T21:33:54Z</updated>
<author>
<name>Mario Limonciello</name>
<email>mario.limonciello@amd.com</email>
</author>
<published>2023-11-28T05:36:51Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=1311a8f0d4b23f58bbababa13623aa40b8ad4e0c'/>
<id>urn:sha1:1311a8f0d4b23f58bbababa13623aa40b8ad4e0c</id>
<content type='text'>
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 &lt;mat.jonczyk@o2.pl&gt;
Reviewed-by: Mateusz Jończyk &lt;mat.jonczyk@o2.pl&gt;
Acked-by: Mateusz Jończyk &lt;mat.jonczyk@o2.pl&gt;
Cc:  &lt;stable@vger.kernel.org&gt;
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 &lt;mario.limonciello@amd.com&gt;
Link: https://lore.kernel.org/r/20231128053653.101798-3-mario.limonciello@amd.com
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
</content>
</entry>
<entry>
<title>rtc: cmos: Use ACPI alarm for non-Intel x86 systems too</title>
<updated>2023-11-17T17:35:43Z</updated>
<author>
<name>Mario Limonciello</name>
<email>mario.limonciello@amd.com</email>
</author>
<published>2023-11-06T16:23:10Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=3d762e21d56370a43478b55e604b4a83dd85aafc'/>
<id>urn:sha1:3d762e21d56370a43478b55e604b4a83dd85aafc</id>
<content type='text'>
Intel systems &gt; 2015 have been configured to use ACPI alarm instead
of HPET to avoid s2idle issues.

Having HPET programmed for wakeup causes problems on AMD systems with
s2idle as well.

One particular case is that the systemd "SuspendThenHibernate" feature
doesn't work properly on the Framework 13" AMD model. Switching to
using ACPI alarm fixes the issue.

Adjust the quirk to apply to AMD/Hygon systems from 2021 onwards.
This matches what has been tested and is specifically to avoid potential
risk to older systems.

Cc:  &lt;stable@vger.kernel.org&gt; # 6.1+
Reported-by:  &lt;alvin.zhuge@gmail.com&gt;
Reported-by:  &lt;renzhamin@gmail.com&gt;
Closes: https://github.com/systemd/systemd/issues/24279
Reported-by: Kelvie Wong &lt;kelvie@kelvie.ca&gt;
Closes: https://community.frame.work/t/systemd-suspend-then-hibernate-wakes-up-after-5-minutes/39392
Signed-off-by: Mario Limonciello &lt;mario.limonciello@amd.com&gt;
Link: https://lore.kernel.org/r/20231106162310.85711-1-mario.limonciello@amd.com
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
</content>
</entry>
<entry>
<title>rtc: cmos: Report supported alarm limit to rtc infrastructure</title>
<updated>2023-08-27T21:50:22Z</updated>
<author>
<name>Guenter Roeck</name>
<email>linux@roeck-us.net</email>
</author>
<published>2023-08-17T22:55:34Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=2546e7083f2ea96bdd6157961dc2748d65a9e487'/>
<id>urn:sha1:2546e7083f2ea96bdd6157961dc2748d65a9e487</id>
<content type='text'>
The alarm window supported by the cmos RTC depends on the chip
and its configuration. Report the limit to the RTC core.

Cc: Brian Norris &lt;briannorris@chromium.org&gt;
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Link: https://lore.kernel.org/r/20230817225537.4053865-5-linux@roeck-us.net
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
</content>
</entry>
<entry>
<title>rtc: cmos: Convert to platform remove callback returning void</title>
<updated>2023-03-17T22:03:17Z</updated>
<author>
<name>Uwe Kleine-König</name>
<email>u.kleine-koenig@pengutronix.de</email>
</author>
<published>2023-03-04T13:29:56Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=63c18a079bbb5f564b30e0fa7ec292eb123b1bf6'/>
<id>urn:sha1:63c18a079bbb5f564b30e0fa7ec292eb123b1bf6</id>
<content type='text'>
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König &lt;u.kleine-koenig@pengutronix.de&gt;
Link: https://lore.kernel.org/r/20230304133028.2135435-10-u.kleine-koenig@pengutronix.de
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
</content>
</entry>
<entry>
<title>rtc: cmos: Disable ACPI RTC event on removal</title>
<updated>2022-11-15T20:07:14Z</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rafael.j.wysocki@intel.com</email>
</author>
<published>2022-11-09T12:15:36Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=83ebb7b3036d151ee39a4a752018665648fc3bd4'/>
<id>urn:sha1:83ebb7b3036d151ee39a4a752018665648fc3bd4</id>
<content type='text'>
Make cmos_do_remove() drop the ACPI RTC fixed event handler so as to
prevent it from operating on stale data in case the event triggers
after driver removal.

Fixes: 311ee9c151ad ("rtc: cmos: allow using ACPI for RTC alarm instead of HPET")
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Reviewed-by: Zhang Rui &lt;rui.zhang@intel.com&gt;
Tested-by: Zhang Rui &lt;rui.zhang@intel.com&gt;
Reviewed-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Link: https://lore.kernel.org/r/2224609.iZASKD2KPV@kreacher
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
</content>
</entry>
<entry>
<title>rtc: cmos: Rename ACPI-related functions</title>
<updated>2022-11-15T20:07:07Z</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rafael.j.wysocki@intel.com</email>
</author>
<published>2022-11-09T12:12:00Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=d13e9ad9f5146f066a5c5a1cc993d09e4fb21ead'/>
<id>urn:sha1:d13e9ad9f5146f066a5c5a1cc993d09e4fb21ead</id>
<content type='text'>
The names of rtc_wake_setup() and cmos_wake_setup() don't indicate
that these functions are ACPI-related, which is the case, and the
former doesn't really reflect the role of the function.

Rename them to acpi_rtc_event_setup() and acpi_cmos_wake_setup(),
respectively, to address this shortcoming.

No intentional functional impact.

Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Reviewed-by: Zhang Rui &lt;rui.zhang@intel.com&gt;
Tested-by: Zhang Rui &lt;rui.zhang@intel.com&gt;
Reviewed-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Link: https://lore.kernel.org/r/3225614.44csPzL39Z@kreacher
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
</content>
</entry>
<entry>
<title>rtc: cmos: Eliminate forward declarations of some functions</title>
<updated>2022-11-15T20:06:49Z</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rafael.j.wysocki@intel.com</email>
</author>
<published>2022-11-09T12:09:32Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=dca4d3b71c8a09a16951add656711fbd6f5bfbb0'/>
<id>urn:sha1:dca4d3b71c8a09a16951add656711fbd6f5bfbb0</id>
<content type='text'>
Reorder the ACPI-related code before cmos_do_probe() so as to eliminate
excessive forward declarations of some functions.

While at it, for consistency, add the inline modifier to the
definitions of empty stub static funtions and remove it from the
corresponding definitions of functions with non-empty bodies.

No intentional functional impact.

Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Reviewed-by: Zhang Rui &lt;rui.zhang@intel.com&gt;
Tested-by: Zhang Rui &lt;rui.zhang@intel.com&gt;
Reviewed-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Link: https://lore.kernel.org/r/13157911.uLZWGnKmhe@kreacher
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
</content>
</entry>
<entry>
<title>rtc: cmos: Call rtc_wake_setup() from cmos_do_probe()</title>
<updated>2022-11-15T20:06:43Z</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rafael.j.wysocki@intel.com</email>
</author>
<published>2022-11-09T12:09:07Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=375bbba09692fe4c5218eddee8e312dd733fa846'/>
<id>urn:sha1:375bbba09692fe4c5218eddee8e312dd733fa846</id>
<content type='text'>
To reduce code duplication, move the invocation of rtc_wake_setup()
into cmos_do_probe() and simplify the callers of the latter.

No intentional functional impact.

Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Reviewed-by: Zhang Rui &lt;rui.zhang@intel.com&gt;
Tested-by: Zhang Rui &lt;rui.zhang@intel.com&gt;
Reviewed-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Link: https://lore.kernel.org/r/2143522.irdbgypaU6@kreacher
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
</content>
</entry>
</feed>
