1. 22 2月, 2017 9 次提交
  2. 12 2月, 2017 5 次提交
  3. 01 2月, 2017 8 次提交
  4. 25 1月, 2017 2 次提交
  5. 23 1月, 2017 3 次提交
    • A
      rtc: stm32: fix comparison warnings · 1d70ba3b
      Amelie Delaunay 提交于
      This patches fixes comparison between signed and unsigned values as it
      could produce an incorrect result when the signed value is converted to
      unsigned:
      
      drivers/rtc/rtc-stm32.c: In function 'stm32_rtc_valid_alrm':
      drivers/rtc/rtc-stm32.c:404:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
        if ((((tm->tm_year > cur_year) &&
      ...
      
      It also fixes comparison always true or false due to the fact that unsigned
      value is compared against zero with >= or <:
      
      drivers/rtc/rtc-stm32.c: In function 'stm32_rtc_init':
      drivers/rtc/rtc-stm32.c:514:35: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
        for (pred_a = pred_a_max; pred_a >= 0; pred_a-- ) {
      
      drivers/rtc/rtc-stm32.c:530:44: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
           (rate - ((pred_a + 1) * (pred_s + 1)) < 0) ?
      
      Fixes: 4e64350f ("rtc: add STM32 RTC driver")
      Signed-off-by: NAmelie Delaunay <amelie.delaunay@st.com>
      Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
      1d70ba3b
    • A
      rtc: stm32: use 0 instead of ~PWR_CR_DBP in regmap_update_bits · a560c527
      Amelie Delaunay 提交于
      Using the ~ operator on a BIT() constant results in a large 'unsigned long'
      constant that won't fit into an 'unsigned int' function argument on 64-bit
      architectures, resulting in a harmless build warning in x86 allmodconfig:
      
      drivers/rtc/rtc-stm32.c: In function 'stm32_rtc_probe':
      drivers/rtc/rtc-stm32.c:651:51: error: large integer implicitly truncated to unsigned type [-Werror=overflow]
        regmap_update_bits(rtc->dbp, PWR_CR, PWR_CR_DBP, ~PWR_CR_DBP);
      
      As PWR_CR_DBP mask prevents other bits to be cleared, replace all
      ~PWR_CR_DBP by 0.
      
      Fixes: 4e64350f ("rtc: add STM32 RTC driver")
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NAmelie Delaunay <amelie.delaunay@st.com>
      Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
      a560c527
    • T
      rtc: tegra: Implement clock handling · 5fa40869
      Thierry Reding 提交于
      Accessing the registers of the RTC block on Tegra requires the module
      clock to be enabled. This only works because the RTC module clock will
      be enabled by default during early boot. However, because the clock is
      unused, the CCF will disable it at late_init time. This causes the RTC
      to become unusable afterwards. This can easily be reproduced by trying
      to use the RTC:
      
      	$ hwclock --rtc /dev/rtc1
      
      This will hang the system. I ran into this by following up on a report
      by Martin Michlmayr that reboot wasn't working on Tegra210 systems. It
      turns out that the rtc-tegra driver's ->shutdown() implementation will
      hang the CPU, because of the disabled clock, before the system can be
      rebooted.
      
      What confused me for a while is that the same driver is used on prior
      Tegra generations where the hang can not be observed. However, as Peter
      De Schrijver pointed out, this is because on 32-bit Tegra chips the RTC
      clock is enabled by the tegra20_timer.c clocksource driver, which uses
      the RTC to provide a persistent clock. This code is never enabled on
      64-bit Tegra because the persistent clock infrastructure does not exist
      on 64-bit ARM.
      
      The proper fix for this is to add proper clock handling to the RTC
      driver in order to ensure that the clock is enabled when the driver
      requires it. All device trees contain the clock already, therefore
      no additional changes are required.
      Reported-by: NMartin Michlmayr <tbm@cyrius.com>
      Acked-By Peter De Schrijver <pdeschrijver@nvidia.com>
      Signed-off-by: NThierry Reding <treding@nvidia.com>
      Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
      5fa40869
  6. 14 1月, 2017 3 次提交
  7. 13 1月, 2017 2 次提交
  8. 12 1月, 2017 7 次提交
  9. 10 1月, 2017 1 次提交