summaryrefslogtreecommitdiff
path: root/drivers/rtc
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'rtc-4.13' of ↵Linus Torvalds2017-07-1322-839/+1696
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux Pull RTC updates from Alexandre Belloni: "Here is the pull-request for the RTC subsystem for 4.13. Subsystem: - expose non volatile RAM using nvmem instead of open coding in many drivers. Unfortunately, this option has to be enabled by default to not break existing users. - rtctest can now test for cutoff dates, showing when an RTC will start failing to properly save time and date. - new RTC registration functions to remove race conditions in drivers Newly supported RTCs: - Broadcom STB wake-timer - Epson RX8130CE - Maxim IC DS1308 - STMicroelectronics STM32H7 Drivers: - ds1307: use regmap, use nvmem, more cleanups - ds3232: temperature reading support - gemini: renamed to ftrtc010 - m41t80: use CCF to expose the clock - rv8803: use nvmem - s3c: many cleanups - st-lpc: fix y2106 bug" * tag 'rtc-4.13' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: (51 commits) rtc: Remove wrong deprecation comment nvmem: include linux/err.h from header rtc: st-lpc: make it robust against y2038/2106 bug rtc: rtctest: add check for problematic dates tools: timer: add rtctest_setdate rtc: ds1307: remove ds1307_remove rtc: ds1307: use generic nvmem rtc: ds1307: switch to rtc_register_device rtc: rv8803: remove rv8803_remove rtc: rv8803: use generic nvmem support rtc: rv8803: switch to rtc_register_device rtc: add generic nvmem support rtc: at91rm9200: remove race condition rtc: introduce new registration method rtc: class separate id allocation from registration rtc: class separate device allocation from registration rtc: stm32: add STM32H7 RTC support dt-bindings: rtc: stm32: add support for STM32H7 rtc: ds1307: add ds1308 variant rtc: ds3232: add temperature support ...
| * rtc: st-lpc: make it robust against y2038/2106 bugBenjamin Gaignard2017-07-091-11/+8
| | | | | | | | | | | | | | | | | | Make driver use u64 variables and functions to be sure that it will support dates after year 2038. Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org> Acked-by: Patrice Chotard <patrice.chotard@st.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
| * rtc: ds1307: remove ds1307_removeAlexandre Belloni2017-07-071-6/+0
| | | | | | | | | | | | ds1307_remove() is now empty, remove it Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
| * rtc: ds1307: use generic nvmemAlexandre Belloni2017-07-071-66/+22
| | | | | | | | | | | | | | | | Instead of adding a binary sysfs attribute from the driver (which suffers from a race condition as the attribute appears after the device), use the core to register an nvmem device. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
| * rtc: ds1307: switch to rtc_register_deviceAlexandre Belloni2017-07-071-2/+7
| | | | | | | | | | | | | | This removes a possible race condition and crash and allows for further improvement of the driver. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
| * rtc: rv8803: remove rv8803_removeAlexandre Belloni2017-07-071-6/+0
| | | | | | | | | | | | rv8803_remove() is now empty, remove it. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
| * rtc: rv8803: use generic nvmem supportAlexandre Belloni2017-07-071-31/+20
| | | | | | | | | | | | | | | | Instead of adding a binary sysfs attribute from the driver (which suffers from a race condition as the attribute appears after the device), use the core to register an nvmem device. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
| * rtc: rv8803: switch to rtc_register_deviceAlexandre Belloni2017-07-071-6/+9
| | | | | | | | | | | | | | This removes a possible race condition and allows for further improvement of the driver. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
| * rtc: add generic nvmem supportAlexandre Belloni2017-07-075-0/+134
| | | | | | | | | | | | | | | | | | | | | | | | Many RTCs have an on board non volatile storage. It can be battery backed RAM or an EEPROM. Use the nvmem subsystem to export it to both userspace and in-kernel consumers. This stays compatible with the previous (non documented) ABI that was using /sys/class/rtc/rtcx/device/nvram to export that memory. But will warn about the deprecation. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
| * rtc: at91rm9200: remove race conditionAlexandre Belloni2017-07-071-6/+8
| | | | | | | | | | | | | | | | | | | | While highly unlikely, it is possible to get an interrupt as soon as it is requested. In that case, at91_rtc_interrupt() will be called with rtc == NULL. Solve that by using devm_rtc_allocate_device/rtc_register_device. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
| * rtc: introduce new registration methodAlexandre Belloni2017-07-071-0/+84
| | | | | | | | | | | | | | | | | | | | Introduce rtc_register_device() to register an already allocated and initialized struct rtc_device. It automatically sets up the owner and the two steps allocation/registration will allow to remove race conditions in the IRQ handling of some driver. It also allows to properly extend the core without adding more arguments to rtc_device_register(). Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
| * rtc: class separate id allocation from registrationAlexandre Belloni2017-07-071-19/+25
| | | | | | | | | | | | Create rtc_device_get_id to allocate the id for an RTC. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
| * rtc: class separate device allocation from registrationAlexandre Belloni2017-07-071-26/+37
| | | | | | | | | | | | | | Create rtc_allocate_device to allocate memory for a struct rtc_device and initialize it. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
| * rtc: stm32: add STM32H7 RTC supportAmelie Delaunay2017-07-061-17/+65
| | | | | | | | | | | | | | | | This patch adds support for STM32H7 RTC. On STM32H7, the RTC bus interface clock (APB clock) needs to be enabled. Signed-off-by: Amelie Delaunay <amelie.delaunay@st.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
| * rtc: ds1307: add ds1308 variantSean Nyekjaer2017-07-061-0/+12
| | | | | | | | | | | | | | | | The ds1308 variant is very similar to the already supported ds1338 variant, it have more debug registers and a square wave clock output. Signed-off-by: Sean Nyekjaer <sean.nyekjaer@prevas.dk> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
| * rtc: ds3232: add temperature supportKirill Esipov2017-07-062-0/+127
| | | | | | | | | | | | | | | | | | | | | | DS3232/DS3234 has the temperature registers with a resolution of 0.25 degree celsius. This enables to get the value through hwmon. # cat /sys/class/hwmon/hwmon0/temp1_input 37250 Signed-off-by: Kirill Esipov <yesipov@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
| * rtc: rtc-nuc900: fix loop timeout testDan Carpenter2017-07-061-1/+1
| | | | | | | | | | | | | | | | | | We should change this post-op to a pre-op because we want the loop to exit with "timeout" set to zero. Fixes: 0a89b55364e0 ("nuc900/rtc: change the waiting for device ready implement") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
| * rtc: gemini/ftrtc010: rename driver and symbolsLinus Walleij2017-07-063-51/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Gemini RTC is actually a generic IP block from Faraday Technology names FTRTC010. Rename the driver file and all symbols to match this IP name. The relationship can be clearly seen in the U-Boot driver posted by Po-Yu Chuang for the Faraday A320 board: https://lists.denx.de/pipermail/u-boot/2009-September/061326.html Remove the dependency on ARCH_GEMINI but select the driver for ARCH_GEMINI so we get a smooth transition. The IP block is synthsized on different silicon and architectures. Cc: Po-Yu Chuang <ratbert@faraday-tech.com> Acked-by: Hans Ulli Kroll <ulli.kroll@googlemail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
| * rtc: gemini: Add optional clock handlingLinus Walleij2017-07-061-0/+28
| | | | | | | | | | | | | | | | | | | | | | This makes the Gemini optionally take two clock references to the PCLK and EXTCLK. As we are adding a clock framework to the Gemini platform we need to make sure that we get the right references. Acked-by: Hans Ulli Kroll <ulli.kroll@googlemail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
| * rtc: ds1307: factor out century bit handlingHeiner Kallweit2017-07-061-46/+27
| | | | | | | | | | | | | | | | | | | | | | | | The driver has lots of places with chip-specific code what doesn't necessarily facilitate maintenance. Let's describe chip-specific differences in century bit handling in struct chip_desc to improve this. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
| * rtc: ds1307: use regmap_update_bits where applicableHeiner Kallweit2017-07-051-62/+20
| | | | | | | | | | | | | | | | | | After the switch to regmap we can now make use of regmap_update_bits to simplify read/modify/write ops. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
| * rtc: brcmstb-waketimer: Add Broadcom STB wake-timerBrian Norris2017-07-053-0/+342
| | | | | | | | | | | | | | | | | | | | | | | | | | This adds support for the Broadcom STB wake-timer which is a timer in the chip's 27Mhz clock domain that offers the ability to wake the system (wake-up source) from suspend states (S2, S3, S5). It is supported using the rtc framework allowing us to configure alarms for system wake-up. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Markus Mayer <mmayer@broadcom.com> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
| * rtc: ds1307: Add support for Epson RX8130CEMarek Vasut2017-06-241-0/+175
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for yet another RTC chip, Epson RX8130CE. This time around, the chip has slightly permutated registers and also the register starts at 0x10 instead of 0x0 . So far, we only support the RTC and NVRAM parts of the chip, Alarm and Timer is not supported. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Felipe Balbi <balbi@ti.com> Cc: Nishanth Menon <nm@ti.com> Cc: Tony Lindgren <tony@atomide.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
| * rtc: s3c: Handle clock enable failuresKrzysztof Kozlowski2017-06-241-15/+57
| | | | | | | | | | | | | | clk_enable() can fail so handle such case. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
| * rtc: s3c: Handle clock prepare failures in probeKrzysztof Kozlowski2017-06-241-2/+6
| | | | | | | | | | | | | | clk_prepare_enable() can fail so handle such case. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
| * rtc: s3c: Do not remove const from rodata memoryKrzysztof Kozlowski2017-06-241-3/+3
| | | | | | | | | | | | | | | | | | All instances of struct s3c_rtc_data are in fact static const thus put in rodata so we should not drop the const while getting the pointer to them. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
| * rtc: s3c: Drop unneeded cast to void pointerKrzysztof Kozlowski2017-06-241-5/+5
| | | | | | | | | | | | | | There is no need for casting to void pointer for of_device_id data. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
| * rtc: s3c: Minor white-space cleanupsKrzysztof Kozlowski2017-06-241-24/+23
| | | | | | | | | | | | | | | | | | | | Minor cleanups to make the code easier to read. No functional changes. 1. Remove one space before labels as this is nowadays mostly preferred. 2. Fix indentation of arguments in function calls. 3. Split structure member declaration. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
| * rtc: s3c: Jump to central exit point on getting src clock errorKrzysztof Kozlowski2017-06-241-2/+2
| | | | | | | | | | | | | | | | In other error paths in probe, centralized exit point was used so make this consistent. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
| * rtc: mxc: remove unused variableDiaz de Grenu, Jose2017-06-241-11/+0
| | | | | | | | | | | | | | | | | | | | This variable was never used. With GCC 6.2, we get the following warning: drivers/rtc/rtc-mxc.c:44:18: warning: ‘PIE_BIT_DEF’ defined but not used [-Wunused-const-variable=] static const u32 PIE_BIT_DEF[MAX_PIE_NUM][2] = { Signed-off-by: Diaz de Grenu, Jose <Jose.DiazdeGrenu@digi.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
| * rtc: opal: Implement rtc_class_ops.alarm_irq_enable callbackVaibhav Jain2017-06-241-1/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Provide an implementation of the callback rtc_class_ops.alarm_irq_enable for rtc-opal driver. This callback is called when the wake alarm is disabled via the command: 'echo 0 > /sys/class/rtc/rtc0/wakealarm' Without this the Timed-Power-On(TPO) config remains set even when its disabled by the above command and FSP will still force machine boot at previously configured alarm time. The callback is implemented as function opal_tpo_alarm_irq_enable() which calls opal_set_tpo_time() with alarm.enabled == 0. A branch is added to opal_set_tpo_time() to handle this case by passing y_m_d == h_m_s_ms == 0 to opal as arguments for opal_tpo_write() call. Signed-off-by: Vaibhav Jain <vaibhav@linux.vnet.ibm.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
| * rtc: remove rtc_device.nameAlexandre Belloni2017-06-031-4/+3
| | | | | | | | | | | | | | rtc->name is only used in messages were it is superfluous. Remove it completely from the structure. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
| * rtc: ds1307: avoid using rtc-nameAlexandre Belloni2017-06-031-1/+1
| | | | | | | | | | | | ds1307->rtc->name is a copy of ds1307->name, use it instead. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
| * rtc: pcf8563: avoid using rtc->nameAlexandre Belloni2017-06-031-1/+1
| | | | | | | | | | | | pcf8563->rtc->name is a copy of pcf8563_driver.driver.name, use it instead Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
| * rtc: dev: remove rtc->name from debug messageAlexandre Belloni2017-06-031-1/+1
| | | | | | | | | | | | | | rtc->name is superfluous here because the rtc is already registered at that point and its name has already been printed. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
| * rtc: sysfs: make name uniformAlexandre Belloni2017-06-031-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The name sysfs attribute is not useful in its current form because of all the drivers: - 3 are using the feature correctly - 2 are clearly misusing it - 60 are using driver.name, either directly or indirectly - 46 are using pdev->name - 8 are using client->name - 31 are using a variation of driver.name (addition or removal of rtc-, -rtc, _rtc, rtc_) Make it uniform and use the driver name and the device name. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
| * rtc: interface: Validate alarm-time before handling rolloverVaibhav Jain2017-05-311-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In function __rtc_read_alarm() its possible for an alarm time-stamp to be invalid even after replacing missing components with current time-stamp. The condition 'alarm->time.tm_year < 70' will trigger this case and will cause the call to 'rtc_tm_to_time64(&alarm->time)' return a negative value for variable t_alm. While handling alarm rollover this negative t_alm (assumed to seconds offset from '1970-01-01 00:00:00') is converted back to rtc_time via rtc_time64_to_tm() which results in this error log with seemingly garbage values: "rtc rtc0: invalid alarm value: -2-1--1041528741 2005511117:71582844:32" This error was generated when the rtc driver (rtc-opal in this case) returned an alarm time-stamp of '00-00-00 00:00:00' to indicate that the alarm is disabled. Though I have submitted a separate fix for the rtc-opal driver, this issue may potentially impact other existing/future rtc drivers. To fix this issue the patch validates the alarm time-stamp just after filling up the missing datetime components and if rtc_valid_tm() still reports it to be invalid then bails out of the function without handling the rollover. Reported-by: Steve Best <sbest@redhat.com> Signed-off-by: Vaibhav Jain <vaibhav@linux.vnet.ibm.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
| * rtc: opal: Handle disabled TPO in opal_get_tpo_time()Vaibhav Jain2017-05-311-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On PowerNV platform when Timed-Power-On(TPO) is disabled, read of stored TPO yields value with all date components set to '0' inside opal_get_tpo_time(). The function opal_to_tm() then converts it to an offset from year 1900 yielding alarm-time == "1900-00-01 00:00:00". This causes problems with __rtc_read_alarm() that expecting an offset from "1970-00-01 00:00:00" and returned alarm-time results in a -ve value for time64_t. Which ultimately results in this error reported in kernel logs with a seemingly garbage value: "rtc rtc0: invalid alarm value: -2-1--1041528741 2005511117:71582844:32" We fix this by explicitly handling the case of all alarm date-time components being '0' inside opal_get_tpo_time() and returning -ENOENT in such a case. This signals generic rtc that no alarm is set and it bails out from the alarm initialization flow without reporting the above error. Signed-off-by: Vaibhav Jain <vaibhav@linux.vnet.ibm.com> Reported-by: Steve Best <sbest@redhat.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
| * rtc: m41t80: add clock provider supportGary Bisson2017-05-311-0/+172
| | | | | | | | | | | | | | | | | | | | | | Some devices supported by the m41t80 driver have a programmable square-wave output signal (see M41T80_FEATURE_SQ). This enables to use this feature as a clock provider of common clock framework. Signed-off-by: Gary Bisson <gary.bisson@boundarydevices.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
| * rtc: m41t80: remove sqw sysfs entryGary Bisson2017-05-311-88/+0
| | | | | | | | | | | | | | In order to use the proper clock framework to control this feature. Signed-off-by: Gary Bisson <gary.bisson@boundarydevices.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
| * rtc: m41t80: fix SQW dividers override when setting a dateGary Bisson2017-05-311-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | This patch is only relevant for RTC with the SQ_ALT feature which means the clock output frequency divider is stored in the weekday register. Current implementation discards the previous dividers value and clear them as soon as the time is set. Signed-off-by: Gary Bisson <gary.bisson@boundarydevices.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
| * rtc: m41t80: fix SQWE override when setting an alarmGary Bisson2017-05-311-0/+3
| | | | | | | | | | | | | | | | Currently setting an alarm clears the SQWE bit which means that the clock output is disabled no matter its previous state. Signed-off-by: Gary Bisson <gary.bisson@boundarydevices.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
| * rtc: rtc-ds1307: enable support for mcp794xx as a wakeup source without IRQDavid Lowe2017-05-311-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | This patch extends the fixes for ds1337, ds1339, ds3231 in commit 8bc2a40730ec ("rtc: ds1307: add support for the DT property 'wakeup-source'") to mcp794xx devices, so that those parts can similarly be used as a wakeup source without an IRQ to the processor. Tested on Raspberry Pi ZeroW with MCP79400. Signed-off-by: David Lowe <dave-lowe@ntlworld.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
| * rtc: ds1307: convert driver to regmapHeiner Kallweit2017-05-261-382/+221
| | | | | | | | | | | | | | | | | | | | | | | | This patch converts the ds1307 driver to using regmap. It's a rather big patch and I can test with DS3231 only. With this chip it's working fine. I'd appreciate if people with other supported hardware could test as well. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
* | sched/wait: Disambiguate wq_entry->task_list and wq_head->task_list namingIngo Molnar2017-06-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So I've noticed a number of instances where it was not obvious from the code whether ->task_list was for a wait-queue head or a wait-queue entry. Furthermore, there's a number of wait-queue users where the lists are not for 'tasks' but other entities (poll tables, etc.), in which case the 'task_list' name is actively confusing. To clear this all up, name the wait-queue head and entry list structure fields unambiguously: struct wait_queue_head::task_list => ::head struct wait_queue_entry::task_list => ::entry For example, this code: rqw->wait.task_list.next != &wait->task_list ... is was pretty unclear (to me) what it's doing, while now it's written this way: rqw->wait.head.next != &wait->entry ... which makes it pretty clear that we are iterating a list until we see the head. Other examples are: list_for_each_entry_safe(pos, next, &x->task_list, task_list) { list_for_each_entry(wq, &fence->wait.task_list, task_list) { ... where it's unclear (to me) what we are iterating, and during review it's hard to tell whether it's trying to walk a wait-queue entry (which would be a bug), while now it's written as: list_for_each_entry_safe(pos, next, &x->head, entry) { list_for_each_entry(wq, &fence->wait.head, entry) { Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: linux-kernel@vger.kernel.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
| |
| \
*-. \ Merge branches 'pm-sleep' and 'powercap'Rafael J. Wysocki2017-05-221-1/+1
|\ \ \ | |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | * pm-sleep: PM / hibernate: Declare variables as static RTC: rtc-cmos: Fix wakeup from suspend-to-idle PM / wakeup: Fix up wakeup_source_report_event() * powercap: PowerCap: Fix an error code in powercap_register_zone()
| * | RTC: rtc-cmos: Fix wakeup from suspend-to-idleRafael J. Wysocki2017-05-141-1/+1
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit eed4d47efe95 (ACPI / sleep: Ignore spurious SCI wakeups from suspend-to-idle) modified the core suspend-to-idle code to filter out spurious SCI interrupts received while suspended, which requires ACPI event source handlers to report wakeup events in a way that will trigger a wakeup from suspend to idle (or abort system suspends in progress, which is equivalent). That needs to be done in the rtc-cmos driver too, which was overlooked by the above commit, so do that now. Fixes: eed4d47efe95 (ACPI / sleep: Ignore spurious SCI wakeups from suspend-to-idle) Reported-by: David E. Box <david.e.box@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
* | Merge tag 'rtc-4.12' of ↵Linus Torvalds2017-05-1023-46/+672
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux Pull RTC updates from Alexandre Belloni: "RTC subsystem update: - Add OF device ID table for i2c drivers New RTC driver: - Motorola CPCAP PMIC RTC RTC driver updates: - cmos: fix IRQ selection - ds1307: Add ST m41t0 support - ds1374: fix watchdog configuration - sh: Add rza series support" * tag 'rtc-4.12' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: (33 commits) rtc: gemini: add return value validation rtc: snvs: fix an incorrect check of return value rtc: ds1374: wdt: Fix stop/start ioctl always returning -EINVAL rtc: ds1374: wdt: Fix issue with timeout scaling from secs to wdt ticks rtc: sh: mark PM functions as unused rtc: hid-sensor-time: remove some dead code rtc: m41t80: Add proper compatible for rv4162 rtc: ds1307: Add m41t0 to OF device ID table rtc: ds1307: support m41t0 variant rtc: cpcap: fix improper use of IRQ_NONE for request_threaded_irq rtc: cmos: Do not assume irq 8 for rtc when there are no legacy irqs x86: i8259: export legacy_pic symbol dt-bindings: rtc: document the rtc-sh bindings rtc: sh: add support for rza series rtc: cpcap: kfreeing devm allocated memory rtc: wm8350: Remove unused to_wm8350_from_rtc_dev rtc: cpcap: new rtc driver dt-bindings: Add vendor prefix for Motorola rtc: omap: mark PM methods as __maybe_unused rtc: omap: remove incorrect __exit markups ...
| * | rtc: gemini: add return value validationPan Bian2017-05-051-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Function devm_ioremap() will return a NULL pointer if it fails to remap IO address, and its return value should be validated before it is used. However, in function gemini_rtc_probe(), its return value is not checked. This may result in bad memory access bugs on future access, e.g. calling the function gemini_rtc_read_time(). Signed-off-by: Pan Bian <bianpan2016@163.com> Acked-by: Hans Ulli Kroll <ulli.kroll@googlemail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
| * | rtc: snvs: fix an incorrect check of return valuePan Bian2017-05-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Function devm_regmap_init_mmio() returns an ERR_PTR on error. However, in function snvs_rtc_probe() its return value is checked against NULL. This patch fixes it by checking the return value with IS_ERR(). Signed-off-by: Pan Bian <bianpan2016@163.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>