Skip to content
  1. Aug 28, 2019
  2. Aug 23, 2019
    • Bruno Thomsen's avatar
      rtc: pcf2127: bugfix: read rtc disables watchdog · 7f43020e
      Bruno Thomsen authored
      The previous fix listed bulk read of registers as root cause of
      accendential disabling of watchdog, since the watchdog counter
      register (WD_VAL) was zeroed.
      
      Fixes: 3769a375
      
       rtc: pcf2127: bulk read only date and time registers.
      
      Tested with the same PCF2127 chip as Sean reveled root cause
      of WD_VAL register value zeroing was caused by reading CTRL2
      register which is one of the watchdog feature control registers.
      
      So the solution is to not read the first two control registers
      (CTRL1 and CTRL2) in pcf2127_rtc_read_time as they are not
      needed anyway. Size of local buf variable is kept to allow
      easy usage of register defines to improve readability of code.
      
      Debug trace line was updated after CTRL1 and CTRL2 are no longer
      read from the chip. Also replaced magic numbers in buf access
      with register defines.
      
      Signed-off-by: default avatarBruno Thomsen <bruno.thomsen@gmail.com>
      Link: https://lore.kernel.org/r/20190822131936.18772-3-bruno.thomsen@gmail.com
      Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
      7f43020e
    • Bruno Thomsen's avatar
      rtc: pcf2127: cleanup register and bit defines · bbfe3a7a
      Bruno Thomsen authored
      
      
      Cleanup of defines to follow kernel coding style and increase code
      readability by using same register and bit define style.
      
      Change PCF2127_REG_RAM_{addr_MSB,wrt_cmd,rd_cmd} to upper case as
      kernel coding guide section 12 'Macros, Enums and RTL' states
      "Names of macros defining constants and labels in enums are capitalized".
      
      Improve readability of RAM register comment by making whole sentences.
      
      Remove parentheses from register defines as they are only used
      for expressions and not constants.
      
      As there are no clear style for name of registers and bits in the
      kernel drivers, I suggest the following for at least this driver,
      but hopefully also other RTC drivers.
      
      Register name should follow this convention:
      [chip]_REG_[reg name] 0xXX
      
      Bit name should follow this convention, so it clearly states which
      chip register it's part of:
      [chip]_BIT_[reg name]_[bit name] BIT(X)
      
      Additionally I suggest bit defines are always placed right below
      its corresponding register define and using an extra tab indentation
      for the BIT(X) part. This will visually make it easy to see that bit
      defines are part of the complete register definition.
      
      Rename PCF2127_OSF to PCF2127_BIT_SC_OSF and move it right below
      PCF2127_REG_SC. This will improve readability of bit checks as it's
      easy to verify that it uses the correct register.
      
      Move end of line comments above register defines as it's more like
      a heading for 1 register define and up to 8 bit defines or a
      collection of registers that are close related like timestamp
      split across 6 registers.
      
      Signed-off-by: default avatarBruno Thomsen <bruno.thomsen@gmail.com>
      Link: https://lore.kernel.org/r/20190822131936.18772-2-bruno.thomsen@gmail.com
      Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
      bbfe3a7a
    • Bruno Thomsen's avatar
      rtc: pcf2127: convert to devm_rtc_allocate_device · e788771c
      Bruno Thomsen authored
      
      
      This allows further improvement of the driver.
      
      Signed-off-by: default avatarBruno Thomsen <bruno.thomsen@gmail.com>
      Link: https://lore.kernel.org/r/20190822131936.18772-1-bruno.thomsen@gmail.com
      Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
      e788771c
    • Ondřej Jirman's avatar
      rtc: sun6i: Add support for H6 RTC · b60ff2cf
      Ondřej Jirman authored
      
      
      RTC on H6 is mostly the same as on H5 and H3. It has slight differences
      mostly in features that are not yet supported by this driver.
      
      Some differences are already stated in the comments in existing code.
      One other difference is that H6 has extra bit in LOSC_CTRL_REG, called
      EXT_LOSC_EN to enable/disable external low speed crystal oscillator.
      
      It also has bit EXT_LOSC_STA in LOSC_AUTO_SWT_STA_REG, to check whether
      external low speed oscillator is working correctly.
      
      This patch adds support for enabling LOSC when necessary:
      
      - during reparenting
      - when probing the clock
      
      H6 also has capacbility to automatically reparent RTC clock from
      external crystal oscillator, to internal RC oscillator, if external
      oscillator fails. This is enabled by default. Disable it during
      probe.
      
      Signed-off-by: default avatarOndrej Jirman <megous@megous.com>
      Reviewed-by: default avatarChen-Yu Tsai <wens@csie.org>
      Link: https://lore.kernel.org/r/20190820151934.3860-3-megous@megous.com
      Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
      b60ff2cf
    • Ondřej Jirman's avatar
      dt-bindings: rtc: sun6i: Add compatible for H6 RTC · 903e259f
      Ondřej Jirman authored
      
      
      RTC on H6 is similar to the one on H5 SoC, but incompatible in small
      details. See the driver for description of differences. For example
      H6 RTC needs to enable the external low speed oscillator. Add new
      compatible for this RTC.
      
      Signed-off-by: default avatarOndrej Jirman <megous@megous.com>
      Link: https://lore.kernel.org/r/20190820151934.3860-2-megous@megous.com
      Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
      903e259f
    • Biwen Li's avatar
      rtc: fsl-ftm-alarm: add FTM alarm driver · 7b0b551d
      Biwen Li authored
      
      
      For the platforms including LS1012A, LS1021A, LS1028A, LS1043A,
      LS1046A, LS1088A, LS208xA that has the FlexTimer
      module, implementing alarm functions within RTC subsystem
      to wakeup the system when system going to sleep (work with RCPM driver).
      
      Signed-off-by: default avatarBiwen Li <biwen.li@nxp.com>
      Link: https://lore.kernel.org/r/20190813030157.48590-1-biwen.li@nxp.com
      Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
      7b0b551d
    • Biwen Li's avatar
      dt-bindings: rtc: add bindings for FlexTimer Module · 1d74f099
      Biwen Li authored
      
      
      The patch adds bindings for FlexTimer Module
      
      Signed-off-by: default avatarBiwen Li <biwen.li@nxp.com>
      Link: https://lore.kernel.org/r/20190813030157.48590-2-biwen.li@nxp.com
      Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
      1d74f099
    • Neil Armstrong's avatar
      rtc: Add Amlogic Virtual Wake RTC · 6ef35398
      Neil Armstrong authored
      
      
      The Amlogic Meson GX SoCs uses a special register to store the
      time in seconds to wakeup after a system suspend.
      
      In order to be able to reuse the RTC wakealarm feature, this
      driver implements a fake RTC device which uses the system time
      to deduce a suspend delay.
      
      Signed-off-by: default avatarNeil Armstrong <narmstrong@baylibre.com>
      [khilman: rebase to v5.3-rc, rework and modernization]
      Signed-off-by: default avatarKevin Hilman <khilman@baylibre.com>
      Link: https://lore.kernel.org/r/20190812232850.8016-3-khilman@kernel.org
      Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
      6ef35398
    • Kevin Hilman's avatar
      dt-bindings: rtc: new binding for Amlogic VRTC · ed162396
      Kevin Hilman authored
      
      
      Add binding fo the new VRTC driver for Amlogic SoCs.  The 64-bit
      family of SoCs only has an RTC managed by firmware, and this VRTC
      driver provides the simple, one-register firmware interface.
      
      Reviewed-by: default avatarRob Herring <robh@kernel.org>
      Signed-off-by: default avatarKevin Hilman <khilman@baylibre.com>
      Link: https://lore.kernel.org/r/20190812232850.8016-2-khilman@kernel.org
      Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
      ed162396
  3. Aug 21, 2019
  4. Aug 13, 2019
  5. Jul 24, 2019
  6. Jul 23, 2019
  7. Jul 22, 2019
    • Linus Torvalds's avatar
      Linus 5.3-rc1 · 5f9e832c
      Linus Torvalds authored
      v5.3-rc1
      5f9e832c
    • Linus Torvalds's avatar
      Merge tag 'devicetree-fixes-for-5.3' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux · c7bf0a0f
      Linus Torvalds authored
      Pull Devicetree fixes from Rob Herring:
       "Fix several warnings/errors in validation of binding schemas"
      
      * tag 'devicetree-fixes-for-5.3' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux:
        dt-bindings: pinctrl: stm32: Fix missing 'clocks' property in examples
        dt-bindings: iio: ad7124: Fix dtc warnings in example
        dt-bindings: iio: avia-hx711: Fix avdd-supply typo in example
        dt-bindings: pinctrl: aspeed: Fix AST2500 example errors
        dt-bindings: pinctrl: aspeed: Fix 'compatible' schema errors
        dt-bindings: riscv: Limit cpus schema to only check RiscV 'cpu' nodes
        dt-bindings: Ensure child nodes are of type 'object'
      c7bf0a0f
    • Linus Torvalds's avatar
      Merge branch 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs · d6788eb7
      Linus Torvalds authored
      Pull vfs documentation typo fix from Al Viro.
      
      * 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
        typo fix: it's d_make_root, not d_make_inode...
      d6788eb7
    • Linus Torvalds's avatar
      Merge tag '5.3-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6 · 91962d0f
      Linus Torvalds authored
      Pull cifs fixes from Steve French:
       "Two fixes for stable, one that had dependency on earlier patch in this
        merge window and can now go in, and a perf improvement in SMB3 open"
      
      * tag '5.3-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6:
        cifs: update internal module number
        cifs: flush before set-info if we have writeable handles
        smb3: optimize open to not send query file internal info
        cifs: copy_file_range needs to strip setuid bits and update timestamps
        CIFS: fix deadlock in cached root handling
      91962d0f
    • Qian Cai's avatar
      iommu/amd: fix a crash in iova_magazine_free_pfns · 8cf66504
      Qian Cai authored
      The commit b3aa14f0 ("iommu: remove the mapping_error dma_map_ops
      method") incorrectly changed the checking from dma_ops_alloc_iova() in
      map_sg() causes a crash under memory pressure as dma_ops_alloc_iova()
      never return DMA_MAPPING_ERROR on failure but 0, so the error handling
      is all wrong.
      
         kernel BUG at drivers/iommu/iova.c:801!
          Workqueue: kblockd blk_mq_run_work_fn
          RIP: 0010:iova_magazine_free_pfns+0x7d/0xc0
          Call Trace:
           free_cpu_cached_iovas+0xbd/0x150
           alloc_iova_fast+0x8c/0xba
           dma_ops_alloc_iova.isra.6+0x65/0xa0
           map_sg+0x8c/0x2a0
           scsi_dma_map+0xc6/0x160
           pqi_aio_submit_io+0x1f6/0x440 [smartpqi]
           pqi_scsi_queue_command+0x90c/0xdd0 [smartpqi]
           scsi_queue_rq+0x79c/0x1200
           blk_mq_dispatch_rq_list+0x4dc/0xb70
           blk_mq_sched_dispatch_requests+0x249/0x310
           __blk_mq_run_hw_queue+0x128/0x200
           blk_mq_run_work_fn+0x27/0x30
           process_one_work+0x522/0xa10
           worker_thread+0x63/0x5b0
           kthread+0x1d2/0x1f0
           ret_from_fork+0x22/0x40
      
      Fixes: b3aa14f0
      
       ("iommu: remove the mapping_error dma_map_ops method")
      Signed-off-by: default avatarQian Cai <cai@lca.pw>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      8cf66504