1. 09 9月, 2016 2 次提交
    • M
      pstore/pmsg: drop bounce buffer · 5bf6d1b9
      Mark Salyzyn 提交于
      Removing a bounce buffer copy operation in the pmsg driver path is
      always better. We also gain in overall performance by not requesting
      a vmalloc on every write as this can cause precious RT tasks, such
      as user facing media operation, to stall while memory is being
      reclaimed. Added a write_buf_user to the pstore functions, a backup
      platform write_buf_user that uses the small buffer that is part of
      the instance, and implemented a ramoops write_buf_user that only
      supports PSTORE_TYPE_PMSG.
      Signed-off-by: NMark Salyzyn <salyzyn@android.com>
      Signed-off-by: NKees Cook <keescook@chromium.org>
      5bf6d1b9
    • S
      pstore/core: drop cmpxchg based updates · d5a9bf0b
      Sebastian Andrzej Siewior 提交于
      I have here a FPGA behind PCIe which exports SRAM which I use for
      pstore. Now it seems that the FPGA no longer supports cmpxchg based
      updates and writes back 0xff…ff and returns the same.  This leads to
      crash during crash rendering pstore useless.
      Since I doubt that there is much benefit from using cmpxchg() here, I am
      dropping this atomic access and use the spinlock based version.
      
      Cc: Anton Vorontsov <anton@enomsg.org>
      Cc: Colin Cross <ccross@android.com>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Rabin Vincent <rabinv@axis.com>
      Tested-by: NRabin Vincent <rabinv@axis.com>
      Signed-off-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Reviewed-by: NGuenter Roeck <linux@roeck-us.net>
      [kees: remove "_locked" suffix since it's the only option now]
      Signed-off-by: NKees Cook <keescook@chromium.org>
      Cc: stable@vger.kernel.org
      d5a9bf0b
  2. 12 12月, 2014 2 次提交
    • T
      pstore-ram: Allow optional mapping with pgprot_noncached · 027bc8b0
      Tony Lindgren 提交于
      On some ARMs the memory can be mapped pgprot_noncached() and still
      be working for atomic operations. As pointed out by Colin Cross
      <ccross@android.com>, in some cases you do want to use
      pgprot_noncached() if the SoC supports it to see a debug printk
      just before a write hanging the system.
      
      On ARMs, the atomic operations on strongly ordered memory are
      implementation defined. So let's provide an optional kernel parameter
      for configuring pgprot_noncached(), and use pgprot_writecombine() by
      default.
      
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Rob Herring <robherring2@gmail.com>
      Cc: Randy Dunlap <rdunlap@infradead.org>
      Cc: Anton Vorontsov <anton@enomsg.org>
      Cc: Colin Cross <ccross@android.com>
      Cc: Olof Johansson <olof@lixom.net>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: stable@vger.kernel.org
      Acked-by: NKees Cook <keescook@chromium.org>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NTony Luck <tony.luck@intel.com>
      027bc8b0
    • R
      pstore-ram: Fix hangs by using write-combine mappings · 7ae9cb81
      Rob Herring 提交于
      Currently trying to use pstore on at least ARMs can hang as we're
      mapping the peristent RAM with pgprot_noncached().
      
      On ARMs, pgprot_noncached() will actually make the memory strongly
      ordered, and as the atomic operations pstore uses are implementation
      defined for strongly ordered memory, they may not work. So basically
      atomic operations have undefined behavior on ARM for device or strongly
      ordered memory types.
      
      Let's fix the issue by using write-combine variants for mappings. This
      corresponds to normal, non-cacheable memory on ARM. For many other
      architectures, this change does not change the mapping type as by
      default we have:
      
      #define pgprot_writecombine pgprot_noncached
      
      The reason why pgprot_noncached() was originaly used for pstore
      is because Colin Cross <ccross@android.com> had observed lost
      debug prints right before a device hanging write operation on some
      systems. For the platforms supporting pgprot_noncached(), we can
      add a an optional configuration option to support that. But let's
      get pstore working first before adding new features.
      
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Anton Vorontsov <cbouatmailru@gmail.com>
      Cc: Colin Cross <ccross@android.com>
      Cc: Olof Johansson <olof@lixom.net>
      Cc: linux-kernel@vger.kernel.org
      Cc: stable@vger.kernel.org
      Acked-by: NKees Cook <keescook@chromium.org>
      Signed-off-by: NRob Herring <rob.herring@calxeda.com>
      [tony@atomide.com: updated description]
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NTony Luck <tony.luck@intel.com>
      7ae9cb81
  3. 09 8月, 2014 1 次提交
  4. 07 6月, 2014 1 次提交
  5. 18 3月, 2014 1 次提交
  6. 15 6月, 2013 1 次提交
  7. 04 4月, 2013 3 次提交
  8. 04 1月, 2013 1 次提交
    • G
      pstore: remove __dev* attributes. · f568f6ca
      Greg Kroah-Hartman 提交于
      CONFIG_HOTPLUG is going away as an option.  As a result, the __dev*
      markings need to be removed.
      
      This change removes the use of __devinit from the pstore filesystem.
      
      Based on patches originally written by Bill Pemberton, but redone by me
      in order to handle some of the coding style issues better, by hand.
      
      Cc: Bill Pemberton <wfp5p@virginia.edu>
      Cc: Anton Vorontsov <cbouatmailru@gmail.com>
      Cc: Colin Cross <ccross@android.com>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Tony Luck <tony.luck@intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f568f6ca
  9. 18 7月, 2012 4 次提交
  10. 21 6月, 2012 3 次提交
  11. 14 6月, 2012 5 次提交
  12. 17 5月, 2012 1 次提交
  13. 16 5月, 2012 1 次提交
    • A
      staging: android: persistent_ram: Prepare for modular builds · 7dd8e9be
      Anton Vorontsov 提交于
      This is a transition patch to keep things bisectable, just moves
      some routines under '#ifndef MODULE'. The code inside the #ifndef
      will go away soon, but so far we must support pstore and ram_console.
      
      So, we are about to use persistent_ram with pstore, with the ability
      to compile persistent_ram routines as modules. Some parts of
      persistent_ram uses memblock_reserve() routine, which is should be
      only used built-in code, and thus it is not exported.
      
      These persistent_ram bits are only used by Android's ram_console,
      which is always built-in.
      
      Without this patch, we won't able to compile persistent_ram as a
      module:
      
      ERROR: "memblock_reserve" [fs/pstore/ramoops.ko] undefined!
      make[1]: *** [__modpost] Error 1
      make: *** [modules] Error 2
      
      (As alternative, we could export memblock_reserve, but the thing
      is: we won't need it later.)
      Signed-off-by: NAnton Vorontsov <anton.vorontsov@linaro.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      7dd8e9be
  14. 14 5月, 2012 7 次提交
  15. 13 4月, 2012 1 次提交
    • J
      staging: android: fix mem leaks in __persistent_ram_init() · 474a8988
      Jesper Juhl 提交于
      If, in __persistent_ram_init(), the call to
      persistent_ram_buffer_init() fails or the call to
      persistent_ram_init_ecc() fails then we fail to free the memory we
      allocated to 'prz' with kzalloc() - thus leaking it.
      
      To prevent the leaks I consolidated all error exits from the function
      at a 'err:' label at the end and made all error cases jump to that
      label where we can then make sure we always free 'prz'. This is safe
      since all the situations where the code bails out happen before 'prz'
      has been stored anywhere and although we'll do a redundant kfree(NULL)
      call in the case of kzalloc() itself failing that's OK since kfree()
      deals gracefully with NULL pointers and I felt it was more important
      to keep all error exits at a single location than to avoid that one
      harmless/redundant kfree() on a error path.
      Signed-off-by: NJesper Juhl <jj@chaosbits.net>
      Acked-by: NColin Cross <ccross@android.com>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      474a8988
  16. 11 4月, 2012 1 次提交
    • R
      staging: fix android persistent_ram printk formats · f56d711b
      Randy Dunlap 提交于
      Fix printk format warnings in android/persistent_ram.c:
      
      drivers/staging/android/persistent_ram.c:426:4: warning: format '%ld' expects type 'long int', but argument 2 has type 'size_t'
      drivers/staging/android/persistent_ram.c:426:4: warning: format '%ld' expects type 'long int', but argument 3 has type 'size_t'
      drivers/staging/android/persistent_ram.c:430:4: warning: format '%ld' expects type 'long int', but argument 2 has type 'size_t'
      drivers/staging/android/persistent_ram.c:430:4: warning: format '%ld' expects type 'long int', but argument 3 has type 'size_t'
      Signed-off-by: NRandy Dunlap <rdunlap@xenotime.net>
      Cc: Brian Swetland <swetland@google.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f56d711b
  17. 09 3月, 2012 5 次提交