1. 01 Aug, 2019 1 commit
  2. 20 May, 2019 1 commit
    • Daniel Baluta's avatar
      regmap: debugfs: Fix memory leak in regmap_debugfs_init · 2899872b
      Daniel Baluta authored and Mark Brown's avatar Mark Brown committed
      
      
      As detected by kmemleak running on i.MX6ULL board:
      
      nreferenced object 0xd8366600 (size 64):
        comm "swapper/0", pid 1, jiffies 4294937370 (age 933.220s)
        hex dump (first 32 bytes):
          64 75 6d 6d 79 2d 69 6f 6d 75 78 63 2d 67 70 72  dummy-iomuxc-gpr
          40 32 30 65 34 30 30 30 00 e3 f3 ab fe d1 1b dd  @20e4000........
        backtrace:
          [<b0402aec>] kasprintf+0x2c/0x54
          [<a6fbad2c>] regmap_debugfs_init+0x7c/0x31c
          [<9c8d91fa>] __regmap_init+0xb5c/0xcf4
          [<5b1c3d2a>] of_syscon_register+0x164/0x2c4
          [<596a5d80>] syscon_node_to_regmap+0x64/0x90
          [<49bd597b>] imx6ul_init_machine+0x34/0xa0
          [<250a4dac>] customize_machine+0x1c/0x30
          [<2d19fdaf>] do_one_initcall+0x7c/0x398
          [<e6084469>] kernel_init_freeable+0x328/0x448
          [<168c9101>] kernel_init+0x8/0x114
          [<913268aa>] ret_from_fork+0x14/0x20
          [<ce7b131a>] 0x0
      
      Root cause is that map->debugfs_name is allocated using kasprintf
      and then the pointer is lost by assigning it other memory address.
      Reported-by: default avatarStefan Wahren <stefan.wahren@i2se.com>
      Signed-off-by: default avatarDaniel Baluta <daniel.baluta@nxp.com>
      Signed-off-by: Mark Brown's avatarMark Brown <broonie@kernel.org>
      2899872b
  3. 25 Apr, 2019 1 commit
  4. 20 Mar, 2019 1 commit
  5. 19 Mar, 2019 1 commit
  6. 17 Dec, 2018 1 commit
  7. 06 Mar, 2018 2 commits
  8. 05 Mar, 2018 2 commits
  9. 20 Feb, 2018 1 commit
  10. 27 Dec, 2017 1 commit
  11. 21 Dec, 2017 1 commit
  12. 13 Dec, 2017 1 commit
    • Mark Brown's avatar
      regmap: Disable debugfs when locking is disabled · 72465736
      Mark Brown authored
      
      
      The recently added support for disabling the regmap internal locking left
      debugfs enabled for devices with the locking disabled. This is a problem
      since debugfs allows userspace to do things like initiate reads from the
      hardware which will use the scratch buffers protected by the regmap locking
      so could cause data corruption.
      
      For safety address this by just disabling debugfs for these devices. That
      is overly conservative since some of the debugfs files just read internal
      data structures but it's much simpler to implmement and less likely to
      lead to problems with tooling that works with debugfs.
      Reported-by: default avatarLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: Mark Brown's avatarMark Brown <broonie@kernel.org>
      72465736
  13. 09 Aug, 2016 1 commit
  14. 05 Jan, 2016 1 commit
  15. 30 Sep, 2015 3 commits
  16. 19 Sep, 2015 3 commits
  17. 07 Aug, 2015 1 commit
    • Axel Lin's avatar
      regmap: debugfs: Fix misuse of IS_ENABLED · 1635e888
      Axel Lin authored and Mark Brown's avatar Mark Brown committed
      
      
      IS_ENABLED should only be used for CONFIG_* symbols.
      
      I have done a small test:
        #define REGMAP_ALLOW_WRITE_DEBUGFS
        IS_ENABLED(REGMAP_ALLOW_WRITE_DEBUGFS) returns 0.
      
        #define REGMAP_ALLOW_WRITE_DEBUGFS 0
        IS_ENABLED(REGMAP_ALLOW_WRITE_DEBUGFS) returns 0.
      
        #define REGMAP_ALLOW_WRITE_DEBUGFS 1
        IS_ENABLED(REGMAP_ALLOW_WRITE_DEBUGFS) returns 1.
      
        #define REGMAP_ALLOW_WRITE_DEBUGFS 2
        IS_ENABLED(REGMAP_ALLOW_WRITE_DEBUGFS) returns 0.
      
      So fix the misuse of IS_ENABLED(REGMAP_ALLOW_WRITE_DEBUGFS) and switch to
      use #if defined(REGMAP_ALLOW_WRITE_DEBUGFS) instead.
      Signed-off-by: default avatarAxel Lin <axel.lin@ingics.com>
      Signed-off-by: Mark Brown's avatarMark Brown <broonie@kernel.org>
      1635e888
  18. 20 Jul, 2015 1 commit
  19. 29 Sep, 2014 1 commit
  20. 28 Sep, 2014 1 commit
  21. 08 Sep, 2014 1 commit
  22. 26 Aug, 2014 1 commit
    • Lars-Peter Clausen's avatar
      regmap: Fix regcache debugfs initialization · 5e0cbe78
      Lars-Peter Clausen authored
      Commit 6cfec04b ("regmap: Separate regmap dev initialization") moved the
      regmap debugfs initialization after regcache initialization. This means
      that the regmap debugfs directory is not created yet when the cache
      initialization runs and so any debugfs files registered by the regcache are
      created in the debugfs root directory rather than the debugfs directory of
      the regmap instance. Fix this by adding a separate callback for the
      regcache debugfs initialization which will be called after the parent
      debugfs entry has been created.
      
      Fixes: 6cfec04b
      
       (regmap: Separate regmap dev initialization)
      Signed-off-by: default avatarLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: default avatarMark Brown <broonie@linaro.org>
      Cc: stable@vger.kernel.org
      5e0cbe78
  23. 03 Feb, 2014 1 commit
  24. 24 Oct, 2013 1 commit
  25. 28 Aug, 2013 1 commit
    • Lars-Peter Clausen's avatar
      regmap: debugfs: Fix continued read from registers file · 26ee4741
      Lars-Peter Clausen authored
      The regmap_debugfs_get_dump_start() function maps from a file offset to the
      register that can be found at that position in the file. This is done using a
      look-up table. Commit d6814a7d
      
       ("regmap: debugfs: Suppress cache for partial
      register files") added a check to bypass the look-up table for partial register
      files, since the offsets in that table are only correct for the full register
      file. The check incorrectly uses the file offset instead of the register base
      address and returns it. This will cause the file offset to be interpreted as a
      register address which will result in a incorrect output from the registers file
      for all reads except at position 0.
      
      The issue can easily be reproduced by doing small reads the registers file, e.g.
      `dd if=registers bs=10 count=5`.
      Signed-off-by: default avatarLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: default avatarMark Brown <broonie@linaro.org>
      Cc: stable@vger.kernel.org
      26ee4741
  26. 27 Jul, 2013 1 commit
  27. 19 Jun, 2013 1 commit
  28. 14 May, 2013 1 commit
  29. 12 May, 2013 2 commits
  30. 04 Mar, 2013 2 commits
  31. 11 Feb, 2013 2 commits