<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/drivers/rtc, branch v3.16.77</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.16.77</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.16.77'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2019-09-23T20:11:38Z</updated>
<entry>
<title>rtc: don't reference bogus function pointer in kdoc</title>
<updated>2019-09-23T20:11:38Z</updated>
<author>
<name>Wolfram Sang</name>
<email>wsa+renesas@sang-engineering.com</email>
</author>
<published>2019-04-03T15:19:52Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=7fa23a38ba5eac0c5e33685d8fbde0a8dc00497c'/>
<id>urn:sha1:7fa23a38ba5eac0c5e33685d8fbde0a8dc00497c</id>
<content type='text'>
commit c48cadf5bf4becefcd0751b97995d2350aa9bb57 upstream.

The mentioned function pointer is long gone since early 2011. Remove the
reference in the comment and reword it slightly.

Fixes: 51ba60c5bb3b ("RTC: Cleanup rtc_class_ops-&gt;update_irq_enable()")
Signed-off-by: Wolfram Sang &lt;wsa+renesas@sang-engineering.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>rtc: pm8xxx: fix unintended sign extension</title>
<updated>2019-07-09T21:03:56Z</updated>
<author>
<name>Colin Ian King</name>
<email>colin.king@canonical.com</email>
</author>
<published>2019-02-06T10:31:02Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=59bfd25cff984d6a9bb0e7e5f5a5f4b2cdac0edd'/>
<id>urn:sha1:59bfd25cff984d6a9bb0e7e5f5a5f4b2cdac0edd</id>
<content type='text'>
commit e42280886018c6f77f0a90190f7cba344b0df3e0 upstream.

Shifting a u8 by 24 will cause the value to be promoted to an integer. If
the top bit of the u8 is set then the following conversion to an unsigned
long will sign extend the value causing the upper 32 bits to be set in
the result.

Fix this by casting the u8 value to an unsigned long before the shift.

Detected by CoverityScan, CID#1309693 ("Unintended sign extension")

Fixes: 9a9a54ad7aa2 ("drivers/rtc: add support for Qualcomm PMIC8xxx RTC")
Signed-off-by: Colin Ian King &lt;colin.king@canonical.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>rtc: 88pm80x: fix unintended sign extension</title>
<updated>2019-07-09T21:03:56Z</updated>
<author>
<name>Colin Ian King</name>
<email>colin.king@canonical.com</email>
</author>
<published>2019-02-06T10:08:11Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=9b52af9d8f7d3c5ff49f307f015791da5a7292c6'/>
<id>urn:sha1:9b52af9d8f7d3c5ff49f307f015791da5a7292c6</id>
<content type='text'>
commit fb0b322537a831b5b0cb948c56f8f958ce493d3a upstream.

Shifting a u8 by 24 will cause the value to be promoted to an integer. If
the top bit of the u8 is set then the following conversion to an unsigned
long will sign extend the value causing the upper 32 bits to be set in
the result.

Fix this by casting the u8 value to an unsigned long before the shift.

Detected by CoverityScan, CID#714646-714649 ("Unintended sign extension")

Fixes: 2985c29c1964 ("rtc: Add rtc support to 88PM80X PMIC")
Signed-off-by: Colin Ian King &lt;colin.king@canonical.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>rtc: 88pm860x: fix unintended sign extension</title>
<updated>2019-07-09T21:03:55Z</updated>
<author>
<name>Colin Ian King</name>
<email>colin.king@canonical.com</email>
</author>
<published>2019-02-06T09:50:53Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=1150ddfbc705e340a62f0c5c41022b7e6c8b913f'/>
<id>urn:sha1:1150ddfbc705e340a62f0c5c41022b7e6c8b913f</id>
<content type='text'>
commit dc9e47160626cdb58d5c39a4f43dcfdb27a5c004 upstream.

Shifting a u8 by 24 will cause the value to be promoted to an integer. If
the top bit of the u8 is set then the following conversion to an unsigned
long will sign extend the value causing the upper 32 bits to be set in
the result.

Fix this by casting the u8 value to an unsigned long before the shift.

Detected by CoverityScan, CID#144925-144928 ("Unintended sign extension")

Fixes: 008b30408c40 ("mfd: Add rtc support to 88pm860x")
Signed-off-by: Colin Ian King &lt;colin.king@canonical.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>rtc: ds1672: fix unintended sign extension</title>
<updated>2019-07-09T21:03:54Z</updated>
<author>
<name>Colin Ian King</name>
<email>colin.king@canonical.com</email>
</author>
<published>2019-02-05T18:04:49Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=e0b992008a9f6c1e852442c38401c966b285b6ff'/>
<id>urn:sha1:e0b992008a9f6c1e852442c38401c966b285b6ff</id>
<content type='text'>
commit f0c04c276739ed8acbb41b4868e942a55b128dca upstream.

Shifting a u8 by 24 will cause the value to be promoted to an integer. If
the top bit of the u8 is set then the following conversion to an unsigned
long will sign extend the value causing the upper 32 bits to be set in
the result.

Fix this by casting the u8 value to an unsigned long before the shift.

Detected by CoverityScan, CID#138801 ("Unintended sign extension")

Fixes: edf1aaa31fc5 ("[PATCH] RTC subsystem: DS1672 driver")
Signed-off-by: Colin Ian King &lt;colin.king@canonical.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>iio/hid-sensors: Fix IIO_CHAN_INFO_RAW returning wrong values for signed numbers</title>
<updated>2019-02-11T17:54:05Z</updated>
<author>
<name>Hans de Goede</name>
<email>hdegoede@redhat.com</email>
</author>
<published>2018-10-31T14:20:05Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=ab77f8541e7116a4d5f127f9eda2a4f87709fa0f'/>
<id>urn:sha1:ab77f8541e7116a4d5f127f9eda2a4f87709fa0f</id>
<content type='text'>
commit 0145b50566e7de5637e80ecba96c7f0e6fff1aad upstream.

Before this commit sensor_hub_input_attr_get_raw_value() failed to take
the signedness of 16 and 8 bit values into account, returning e.g.
65436 instead of -100 for the z-axis reading of an accelerometer.

This commit adds a new is_signed parameter to the function and makes all
callers pass the appropriate value for this.

While at it, this commit also fixes up some neighboring lines where
statements were needlessly split over 2 lines to improve readability.

Signed-off-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
Acked-by: Srinivas Pandruvada &lt;srinivas.pandruvada@linux.intel.com&gt;
Acked-by: Benjamin Tissoires &lt;benjamin.tissoires@redhat.com&gt;
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
[bwh: Backported to 3.16:
 - sensor_hub_input_attr_get_raw_value() doesn't take a sync/async flag
   parameter
 - In sensor_hub_input_attr_get_raw_value() keep using data-&gt;pending instead of
   hsdev-&gt;pending
 - In magn_3d_read_raw() keep using chan-&gt;scan_index intstead of chan-&gt;address
 - Drop changes in hid-sensor-{custom,humidity,temperature}
 - Adjust context]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>rtc: snvs: Fix usage of snvs_rtc_enable</title>
<updated>2018-10-21T07:45:10Z</updated>
<author>
<name>Bryan O'Donoghue</name>
<email>pure.logic@nexus-software.ie</email>
</author>
<published>2018-03-28T19:14:05Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=5c3124fdd7eb82df3f0e3fcb601cccaefa6d59d0'/>
<id>urn:sha1:5c3124fdd7eb82df3f0e3fcb601cccaefa6d59d0</id>
<content type='text'>
commit 1485991c024603b2fb4ae77beb7a0d741128a48e upstream.

commit 179a502f8c46 ("rtc: snvs: add Freescale rtc-snvs driver") introduces
the SNVS RTC driver with a function snvs_rtc_enable().

snvs_rtc_enable() can return an error on the enable path however this
driver does not currently trap that failure on the probe() path and
consequently if enabling the RTC fails we encounter a later error spinning
forever in rtc_write_sync_lp().

[   36.093481] [&lt;c010d630&gt;] (__irq_svc) from [&lt;c0c2e9ec&gt;] (_raw_spin_unlock_irqrestore+0x34/0x44)
[   36.102122] [&lt;c0c2e9ec&gt;] (_raw_spin_unlock_irqrestore) from [&lt;c072e32c&gt;] (regmap_read+0x4c/0x5c)
[   36.110938] [&lt;c072e32c&gt;] (regmap_read) from [&lt;c085d0f4&gt;] (rtc_write_sync_lp+0x6c/0x98)
[   36.118881] [&lt;c085d0f4&gt;] (rtc_write_sync_lp) from [&lt;c085d160&gt;] (snvs_rtc_alarm_irq_enable+0x40/0x4c)
[   36.128041] [&lt;c085d160&gt;] (snvs_rtc_alarm_irq_enable) from [&lt;c08567b4&gt;] (rtc_timer_do_work+0xd8/0x1a8)
[   36.137291] [&lt;c08567b4&gt;] (rtc_timer_do_work) from [&lt;c01441b8&gt;] (process_one_work+0x28c/0x76c)
[   36.145840] [&lt;c01441b8&gt;] (process_one_work) from [&lt;c01446cc&gt;] (worker_thread+0x34/0x58c)
[   36.153961] [&lt;c01446cc&gt;] (worker_thread) from [&lt;c014aee4&gt;] (kthread+0x138/0x150)
[   36.161388] [&lt;c014aee4&gt;] (kthread) from [&lt;c0107e14&gt;] (ret_from_fork+0x14/0x20)
[   36.168635] rcu_sched kthread starved for 2602 jiffies! g496 c495 f0x2 RCU_GP_WAIT_FQS(3) -&gt;state=0x0 -&gt;cpu=0
[   36.178564] rcu_sched       R  running task        0     8      2 0x00000000
[   36.185664] [&lt;c0c288b0&gt;] (__schedule) from [&lt;c0c29134&gt;] (schedule+0x3c/0xa0)
[   36.192739] [&lt;c0c29134&gt;] (schedule) from [&lt;c0c2db80&gt;] (schedule_timeout+0x78/0x4e0)
[   36.200422] [&lt;c0c2db80&gt;] (schedule_timeout) from [&lt;c01a7ab0&gt;] (rcu_gp_kthread+0x648/0x1864)
[   36.208800] [&lt;c01a7ab0&gt;] (rcu_gp_kthread) from [&lt;c014aee4&gt;] (kthread+0x138/0x150)
[   36.216309] [&lt;c014aee4&gt;] (kthread) from [&lt;c0107e14&gt;] (ret_from_fork+0x14/0x20)

This patch fixes by parsing the result of rtc_write_sync_lp() and
propagating both in the probe and elsewhere. If the RTC doesn't start we
don't proceed loading the driver and don't get into this loop mess later
on.

Fixes: 179a502f8c46 ("rtc: snvs: add Freescale rtc-snvs driver")
Signed-off-by: Bryan O'Donoghue &lt;pure.logic@nexus-software.ie&gt;
Acked-by: Shawn Guo &lt;shawn.guo@linaro.org&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
[bwh: Backported to 3.16:
 - No cleanup is needed on error in snvs_rtc_probe(); just return
 - Adjust context]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>rtc: tx4939: avoid unintended sign extension on a 24 bit shift</title>
<updated>2018-10-21T07:44:52Z</updated>
<author>
<name>Colin Ian King</name>
<email>colin.king@canonical.com</email>
</author>
<published>2018-02-15T19:36:14Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=f853f92a6d08bb281bbc039441dd26928d41f0d3'/>
<id>urn:sha1:f853f92a6d08bb281bbc039441dd26928d41f0d3</id>
<content type='text'>
commit 347876ad47b9923ce26e686173bbf46581802ffa upstream.

The shifting of buf[5] by 24 bits to the left will be promoted to
a 32 bit signed int and then sign-extended to an unsigned long. If
the top bit of buf[5] is set then all then all the upper bits sec
end up as also being set because of the sign-extension. Fix this by
casting buf[5] to an unsigned long before the shift.

Detected by CoverityScan, CID#1465292 ("Unintended sign extension")

Fixes: 0e1492330cd2 ("rtc: add rtc-tx4939 driver")
Signed-off-by: Colin Ian King &lt;colin.king@canonical.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>rtc: set the alarm to the next expiring timer</title>
<updated>2018-02-13T18:42:03Z</updated>
<author>
<name>Alexandre Belloni</name>
<email>alexandre.belloni@free-electrons.com</email>
</author>
<published>2017-09-28T11:53:27Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=f4441dfde01600d60ba0ca047e9a40222970fc36'/>
<id>urn:sha1:f4441dfde01600d60ba0ca047e9a40222970fc36</id>
<content type='text'>
commit 74717b28cb32e1ad3c1042cafd76b264c8c0f68d upstream.

If there is any non expired timer in the queue, the RTC alarm is never set.
This is an issue when adding a timer that expires before the next non
expired timer.

Ensure the RTC alarm is set in that case.

Fixes: 2b2f5ff00f63 ("rtc: interface: ignore expired timers when enqueuing new timers")
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>rtc: interface: ignore expired timers when enqueuing new timers</title>
<updated>2018-02-13T18:42:03Z</updated>
<author>
<name>Colin Ian King</name>
<email>colin.king@canonical.com</email>
</author>
<published>2016-05-16T16:22:54Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=39fae4d713c2063df49efefe1b8783037c9e238c'/>
<id>urn:sha1:39fae4d713c2063df49efefe1b8783037c9e238c</id>
<content type='text'>
commit 2b2f5ff00f63847d95adad6289bd8b05f5983dd5 upstream.

This patch fixes a RTC wakealarm issue, namely, the event fires during
hibernate and is not cleared from the list, causing hwclock to block.

The current enqueuing does not trigger an alarm if any expired timers
already exist on the timerqueue. This can occur when a RTC wake alarm
is used to wake a machine out of hibernate and the resumed state has
old expired timers that have not been removed from the timer queue.
This fix skips over any expired timers and triggers an alarm if there
are no pending timers on the timerqueue. Note that the skipped expired
timer will get reaped later on, so there is no need to clean it up
immediately.

The issue can be reproduced by putting a machine into hibernate and
waking it with the RTC wakealarm.  Running the example RTC test program
from tools/testing/selftests/timers/rtctest.c after the hibernate will
block indefinitely.  With the fix, it no longer blocks after the
hibernate resume.

BugLink: http://bugs.launchpad.net/bugs/1333569

Signed-off-by: Colin Ian King &lt;colin.king@canonical.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
</feed>
