1. 14 5月, 2022 12 次提交
    • J
      mips: use fallback for random_get_entropy() instead of just c0 random · 1c99c6a7
      Jason A. Donenfeld 提交于
      For situations in which we don't have a c0 counter register available,
      we've been falling back to reading the c0 "random" register, which is
      usually bounded by the amount of TLB entries and changes every other
      cycle or so. This means it wraps extremely often. We can do better by
      combining this fast-changing counter with a potentially slower-changing
      counter from random_get_entropy_fallback() in the more significant bits.
      This commit combines the two, taking into account that the changing bits
      are in a different bit position depending on the CPU model. In addition,
      we previously were falling back to 0 for ancient CPUs that Linux does
      not support anyway; remove that dead path entirely.
      
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Tested-by: NMaciej W. Rozycki <macro@orcam.me.uk>
      Acked-by: NThomas Bogendoerfer <tsbogend@alpha.franken.de>
      Signed-off-by: NJason A. Donenfeld <Jason@zx2c4.com>
      1c99c6a7
    • J
      riscv: use fallback for random_get_entropy() instead of zero · 6d012386
      Jason A. Donenfeld 提交于
      In the event that random_get_entropy() can't access a cycle counter or
      similar, falling back to returning 0 is really not the best we can do.
      Instead, at least calling random_get_entropy_fallback() would be
      preferable, because that always needs to return _something_, even
      falling back to jiffies eventually. It's not as though
      random_get_entropy_fallback() is super high precision or guaranteed to
      be entropic, but basically anything that's not zero all the time is
      better than returning zero all the time.
      
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Paul Walmsley <paul.walmsley@sifive.com>
      Acked-by: NPalmer Dabbelt <palmer@rivosinc.com>
      Reviewed-by: NPalmer Dabbelt <palmer@rivosinc.com>
      Signed-off-by: NJason A. Donenfeld <Jason@zx2c4.com>
      6d012386
    • J
      m68k: use fallback for random_get_entropy() instead of zero · 0f392c95
      Jason A. Donenfeld 提交于
      In the event that random_get_entropy() can't access a cycle counter or
      similar, falling back to returning 0 is really not the best we can do.
      Instead, at least calling random_get_entropy_fallback() would be
      preferable, because that always needs to return _something_, even
      falling back to jiffies eventually. It's not as though
      random_get_entropy_fallback() is super high precision or guaranteed to
      be entropic, but basically anything that's not zero all the time is
      better than returning zero all the time.
      
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Acked-by: NGeert Uytterhoeven <geert@linux-m68k.org>
      Signed-off-by: NJason A. Donenfeld <Jason@zx2c4.com>
      0f392c95
    • J
      timekeeping: Add raw clock fallback for random_get_entropy() · 1366992e
      Jason A. Donenfeld 提交于
      The addition of random_get_entropy_fallback() provides access to
      whichever time source has the highest frequency, which is useful for
      gathering entropy on platforms without available cycle counters. It's
      not necessarily as good as being able to quickly access a cycle counter
      that the CPU has, but it's still something, even when it falls back to
      being jiffies-based.
      
      In the event that a given arch does not define get_cycles(), falling
      back to the get_cycles() default implementation that returns 0 is really
      not the best we can do. Instead, at least calling
      random_get_entropy_fallback() would be preferable, because that always
      needs to return _something_, even falling back to jiffies eventually.
      It's not as though random_get_entropy_fallback() is super high precision
      or guaranteed to be entropic, but basically anything that's not zero all
      the time is better than returning zero all the time.
      
      Finally, since random_get_entropy_fallback() is used during extremely
      early boot when randomizing freelists in mm_init(), it can be called
      before timekeeping has been initialized. In that case there really is
      nothing we can do; jiffies hasn't even started ticking yet. So just give
      up and return 0.
      Suggested-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NJason A. Donenfeld <Jason@zx2c4.com>
      Reviewed-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Theodore Ts'o <tytso@mit.edu>
      1366992e
    • J
      openrisc: start CPU timer early in boot · 516dd4aa
      Jason A. Donenfeld 提交于
      In order to measure the boot process, the timer should be switched on as
      early in boot as possible. As well, the commit defines the get_cycles
      macro, like the previous patches in this series, so that generic code is
      aware that it's implemented by the platform, as is done on other archs.
      
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Jonas Bonn <jonas@southpole.se>
      Cc: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
      Acked-by: NStafford Horne <shorne@gmail.com>
      Reported-by: NGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: NJason A. Donenfeld <Jason@zx2c4.com>
      516dd4aa
    • J
      powerpc: define get_cycles macro for arch-override · 40883583
      Jason A. Donenfeld 提交于
      PowerPC defines a get_cycles() function, but it does not do the usual
      `#define get_cycles get_cycles` dance, making it impossible for generic
      code to see if an arch-specific function was defined. While the
      get_cycles() ifdef is not currently used, the following timekeeping
      patch in this series will depend on the macro existing (or not existing)
      when defining random_get_entropy().
      
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Benjamin Herrenschmidt <benh@ozlabs.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Acked-by: NMichael Ellerman <mpe@ellerman.id.au>
      Signed-off-by: NJason A. Donenfeld <Jason@zx2c4.com>
      40883583
    • J
      alpha: define get_cycles macro for arch-override · 1097710b
      Jason A. Donenfeld 提交于
      Alpha defines a get_cycles() function, but it does not do the usual
      `#define get_cycles get_cycles` dance, making it impossible for generic
      code to see if an arch-specific function was defined. While the
      get_cycles() ifdef is not currently used, the following timekeeping
      patch in this series will depend on the macro existing (or not existing)
      when defining random_get_entropy().
      
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
      Acked-by: NMatt Turner <mattst88@gmail.com>
      Signed-off-by: NJason A. Donenfeld <Jason@zx2c4.com>
      1097710b
    • J
      parisc: define get_cycles macro for arch-override · 8865bbe6
      Jason A. Donenfeld 提交于
      PA-RISC defines a get_cycles() function, but it does not do the usual
      `#define get_cycles get_cycles` dance, making it impossible for generic
      code to see if an arch-specific function was defined. While the
      get_cycles() ifdef is not currently used, the following timekeeping
      patch in this series will depend on the macro existing (or not existing)
      when defining random_get_entropy().
      
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Acked-by: NHelge Deller <deller@gmx.de>
      Signed-off-by: NJason A. Donenfeld <Jason@zx2c4.com>
      8865bbe6
    • J
      s390: define get_cycles macro for arch-override · 2e3df523
      Jason A. Donenfeld 提交于
      S390x defines a get_cycles() function, but it does not do the usual
      `#define get_cycles get_cycles` dance, making it impossible for generic
      code to see if an arch-specific function was defined. While the
      get_cycles() ifdef is not currently used, the following timekeeping
      patch in this series will depend on the macro existing (or not existing)
      when defining random_get_entropy().
      
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Vasily Gorbik <gor@linux.ibm.com>
      Cc: Alexander Gordeev <agordeev@linux.ibm.com>
      Cc: Christian Borntraeger <borntraeger@linux.ibm.com>
      Cc: Sven Schnelle <svens@linux.ibm.com>
      Acked-by: NHeiko Carstens <hca@linux.ibm.com>
      Signed-off-by: NJason A. Donenfeld <Jason@zx2c4.com>
      2e3df523
    • J
      ia64: define get_cycles macro for arch-override · 57c0900b
      Jason A. Donenfeld 提交于
      Itanium defines a get_cycles() function, but it does not do the usual
      `#define get_cycles get_cycles` dance, making it impossible for generic
      code to see if an arch-specific function was defined. While the
      get_cycles() ifdef is not currently used, the following timekeeping
      patch in this series will depend on the macro existing (or not existing)
      when defining random_get_entropy().
      
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Signed-off-by: NJason A. Donenfeld <Jason@zx2c4.com>
      57c0900b
    • J
      init: call time_init() before rand_initialize() · fe222a6c
      Jason A. Donenfeld 提交于
      Currently time_init() is called after rand_initialize(), but
      rand_initialize() makes use of the timer on various platforms, and
      sometimes this timer needs to be initialized by time_init() first. In
      order for random_get_entropy() to not return zero during early boot when
      it's potentially used as an entropy source, reverse the order of these
      two calls. The block doing random initialization was right before
      time_init() before, so changing the order shouldn't have any complicated
      effects.
      
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Reviewed-by: NStafford Horne <shorne@gmail.com>
      Signed-off-by: NJason A. Donenfeld <Jason@zx2c4.com>
      fe222a6c
    • J
      random: fix sysctl documentation nits · 069c4ea6
      Jason A. Donenfeld 提交于
      A semicolon was missing, and the almost-alphabetical-but-not ordering
      was confusing, so regroup these by category instead.
      Signed-off-by: NJason A. Donenfeld <Jason@zx2c4.com>
      069c4ea6
  2. 09 5月, 2022 23 次提交
  3. 08 5月, 2022 4 次提交
    • T
      Merge tag 'asoc-fix-v5.18-rc4' of... · ac02e3cd
      Takashi Iwai 提交于
      Merge tag 'asoc-fix-v5.18-rc4' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
      
      ASoC: Fixes for v5.18
      
      A larger collection of fixes than I'd like, mainly because mixer-test
      is making it's way into the CI systems and turning up issues on a wider
      range of systems.  The most substantial thing though is a revert and an
      alternative fix for a dmaengine issue where the fix caused disruption
      for some other configurations, the core fix is backed out an a driver
      specific thing done instead.
      ac02e3cd
    • L
      Merge tag 'gpio-fixes-for-v5.18-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux · 30c8e80f
      Linus Torvalds 提交于
      Pull gpio fixes from Bartosz Golaszewski:
      
       - fix the bounds check for the 'gpio-reserved-ranges' device property
         in gpiolib-of
      
       - drop the assignment of the pwm base number in gpio-mvebu (this was
         missed by the patch doing it globally for all pwm drivers)
      
       - fix the fwnode assignment (use own fwnode, not the parent's one) for
         the GPIO irqchip in gpio-visconti
      
       - update the irq_stat field before checking the trigger field in
         gpio-pca953x
      
       - update GPIO entry in MAINTAINERS
      
      * tag 'gpio-fixes-for-v5.18-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux:
        gpio: pca953x: fix irq_stat not updated when irq is disabled (irq_mask not set)
        gpio: visconti: Fix fwnode of GPIO IRQ
        MAINTAINERS: update the GPIO git tree entry
        gpio: mvebu: drop pwm base assignment
        gpiolib: of: fix bounds check for 'gpio-reserved-ranges'
      30c8e80f
    • L
      Merge tag 'block-5.18-2022-05-06' of git://git.kernel.dk/linux-block · 8967605e
      Linus Torvalds 提交于
      Pull block fixes from Jens Axboe:
       "A single revert for a change that isn't needed in 5.18, and a small
        series for s390/dasd"
      
      * tag 'block-5.18-2022-05-06' of git://git.kernel.dk/linux-block:
        s390/dasd: Use kzalloc instead of kmalloc/memset
        s390/dasd: Fix read inconsistency for ESE DASD devices
        s390/dasd: Fix read for ESE with blksize < 4k
        s390/dasd: prevent double format of tracks for ESE devices
        s390/dasd: fix data corruption for ESE devices
        Revert "block: release rq qos structures for queue without disk"
      8967605e
    • L
      Merge tag 'io_uring-5.18-2022-05-06' of git://git.kernel.dk/linux-block · b366bd7d
      Linus Torvalds 提交于
      Pull io_uring fix from Jens Axboe:
       "Just a single file assignment fix this week"
      
      * tag 'io_uring-5.18-2022-05-06' of git://git.kernel.dk/linux-block:
        io_uring: assign non-fixed early for async work
      b366bd7d
  4. 07 5月, 2022 1 次提交
    • L
      Merge tag 'for-5.18-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux · 4b97bac0
      Linus Torvalds 提交于
      Pull btrfs fixes from David Sterba:
       "Regression fixes in zone activation:
      
         - move a loop invariant out of the loop to avoid checking space
           status
      
         - properly handle unlimited activation
      
        Other fixes:
      
         - for subpage, force the free space v2 mount to avoid a warning and
           make it easy to switch a filesystem on different page size systems
      
         - export sysfs status of exclusive operation 'balance paused', so the
           user space tools can recognize it and allow adding a device with
           paused balance
      
         - fix assertion failure when logging directory key range item"
      
      * tag 'for-5.18-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
        btrfs: sysfs: export the balance paused state of exclusive operation
        btrfs: fix assertion failure when logging directory key range item
        btrfs: zoned: activate block group properly on unlimited active zone device
        btrfs: zoned: move non-changing condition check out of the loop
        btrfs: force v2 space cache usage for subpage mount
      4b97bac0