Permalink
Commits on Jun 27, 2016
  1. mmc: sunxi: fix endianness issues

    Andre-ARM committed Jun 25, 2016
    The MMC device in Allwinner SoCs uses an internal DMA controller, which
    gets its information from DMA descriptors in normal memory. The device
    expects the values in there to be in little-endian format.
    Since we use normal memory accesses to fill those DMA descriptors, we
    must wrap write accesses to these descriptors with cpu_to_le32() calls to
    make sure they land in memory in the expected byte order.
    
    This allows the MMC device to be used with big-endian kernels.
    Tested on BananaPi(arm) and Pine64(arm64) with both big-endian and
    little-endian kernels.
    
    Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Commits on Jun 26, 2016
  1. arm64: Kconfig: sunxi: add PINCTRL

    Andre-ARM committed Jun 20, 2016
    Add required PINCTRL symbol to cover non-defconfig setups.
    
    Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Commits on Jun 1, 2016
  1. arm64: dts: sun50i: enable Ethernet on both Pine64 models

    Andre-ARM committed May 31, 2016
    The Pine64 board has an 100Mbit PHY connected via an RMII interface,
    while the Pine64+ model has a Gigabit capable PHY and is using the
    RGMII interface.
    Add the necessary bits to the board specific .dts files to enable
    Ethernet support.
    
    Signed-off-by: Andre Przywara <andre.przywara@arm.com>
  2. arm64: dts: sun50i-a64: add sun50i-emac Ethernet driver

    Andre-ARM committed May 31, 2016
    The sun50i-emac is an Ethernet MAC that supports 10/100/1000 Mbit
    connections. It is very similar to the device found in the Allwinner
    H3, but lacks the internal 100 Mbit PHY and its associated control
    bits.
    This adds the necessary bits to the Allwinner A64 SoC .dtsi, but keeps
    it disabled at this level.
    
    Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Commits on May 31, 2016
  1. Documentation: devicetree: add Allwinner sun8i-emac bindings

    montjoie authored and Andre-ARM committed Mar 1, 2016
    Add documentation for the Allwinner sun8i-emac.
    
    Signed-off-by: LABBE Corentin <clabbe.montjoie@gmail.com>
  2. ethernet: Add myself as maintainers of sun8i-emac

    montjoie authored and Andre-ARM committed Mar 31, 2016
    TODO
    
    Signed-off-by: LABBE Corentin <clabbe.montjoie@gmail.com>
  3. ethernet: sun8i-emac: add optionnal phy regulator

    montjoie authored and Andre-ARM committed May 18, 2016
    Signed-off-by: LABBE Corentin <clabbe.montjoie@gmail.com>
  4. ethernet: add sun8i-emac driver

    montjoie authored and Andre-ARM committed Jan 14, 2016
    This patch add support for sun8i-emac ethernet MAC hardware.
    It could be found in Allwinner H3/A83T/A64 SoCs.
    
    Signed-off-by: LABBE Corentin <clabbe.montjoie@gmail.com>
  5. arm: sunxi: enable Allwinner A64 (sun50i) support

    Andre-ARM committed Feb 23, 2016
    As the Allwinner A64 SoC has Cortex-A53 cores, it can run perfectly
    fine in AArch32 mode.
    Since the SoC has a 32-bit address bus anyway, every memory and
    peripheral is accessible in 32-bit mode as well.
    
    Signed-off-by: Andre Przywara <andre.przywara@arm.com>
  6. arm64: dts: add Pine64 support

    Andre-ARM committed Jan 19, 2016
    The Pine64 is a cost-efficient development board based on the
    Allwinner A64 SoC.
    There are three models: the basic version with Fast Ethernet and
    512 MB of DRAM (Pine64) and two Pine64+ versions, which both
    feature Gigabit Ethernet and additional connectors for touchscreens
    and a camera. Or as my son put it: "Those are smaller and these are
    missing." ;-)
    The two Pine64+ models just differ in the amount of DRAM
    (1GB vs. 2GB). Since U-Boot will figure out the right size for us and
    patches the DT accordingly we just need to provide one DT for the
    Pine64+.
    
    Signed-off-by: Andre Przywara <andre.przywara@arm.com>
  7. of: add vendor prefix for Pine64

    Andre-ARM committed Feb 17, 2016
    Signed-off-by: Andre Przywara <andre.przywara@arm.com>
    Acked-by: Rob Herring <robh@kernel.org>
  8. arm64: dts: add Allwinner A64 SoC .dtsi

    Andre-ARM committed Jan 18, 2016
    The Allwinner A64 SoC is a low-cost chip with 4 ARM Cortex-A53 cores
    and the typical tablet / TV box peripherals.
    The SoC is based on the (32-bit) Allwinner H3 chip, sharing most of
    the peripherals and the memory map.
    Although the cores are proper 64-bit ones, the whole SoC is actually
    limited to 4GB (including all the supported DRAM), so we use 32-bit
    address and size cells. This has the nice feature of us being able to
    reuse the DT for 32-bit kernels as well.
    This .dtsi lists the hardware that we support so far.
    
    Signed-off-by: Andre Przywara <andre.przywara@arm.com>
    Acked-by: Rob Herring <robh@kernel.org>
  9. clk: sunxi: add generic multi-parent bus clock gates driver

    Andre-ARM committed Jan 29, 2016
    The Allwinner H3 SoC introduced bus clock gates with potentially
    different parents per clock gate. The H3 driver chose to hardcode the
    actual parent clock relation in the code.
    Add a new driver (which has the potential to drive the H3 and also
    the simple clock gates as well) which uses the power of DT to describe
    this relationship in an elegant and flexible way.
    Using one subnode for every parent clock we get away with a single
    DT compatible match, which can be used as a fallback value in the
    actual DTs without the need to add specific compatible strings to the
    code.  This avoids adding a new driver or function for every new SoC.
    
    Signed-off-by: Andre Przywara <andre.przywara@arm.com>
    Acked-by: Jean-Francois Moine <moinejf@free.fr>
  10. DT: clk: sunxi: add binding doc for the multi-bus-gates clock

    Andre-ARM committed Feb 15, 2016
    Recent Allwinner SoCs introduced a bus gates clock which can have
    different parents for individual gates.
    For the time being we encoded this relation in the driver.
    This commit specifies a new binding which allows to encode this in
    the DT by using a child node for each parent clock used. This allows
    to specify any kind of relation efficiently and also keeps the very
    same kernel driver for all SoCs at the same time.
    
    Signed-off-by: Andre Przywara <andre.przywara@arm.com>
    Acked-by: Rob Herring <robh@kernel.org>
  11. arm64: sunxi: Kconfig: add essential pinctrl driver

    Andre-ARM committed Apr 6, 2016
    The pinctrl driver is essential for the Allwinner SoCs to work.
    Add the driver's config symbol to the Kconfig entry to always compile
    it in. We can't use the arm approach to make the _driver's_ Kconfig
    symbol def_bool, because we lack the MACH_* symbols in arm64.
    That line was in the original pinctrl driver patch, but got removed
    to avoid the dependency on the Kconfig patch [1].
    
    Signed-off-by: Andre Przywara <andre.przywara@arm.com>
    
    [1]: http://lists.infradead.org/pipermail/linux-arm-kernel/2016-March/414086.html
Commits on May 29, 2016
  1. Linux 4.7-rc1

    torvalds committed May 29, 2016
  2. hash_string: Fix zero-length case for !DCACHE_WORD_ACCESS

    George Spelvin authored and torvalds committed May 29, 2016
    The self-test was updated to cover zero-length strings; the function
    needs to be updated, too.
    
    Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
    Signed-off-by: George Spelvin <linux@sciencehorizons.net>
    Fixes: fcfd2fb ("fs/namei.c: Add hashlen_string() function")
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  3. Rename other copy of hash_string to hashlen_string

    George Spelvin authored and torvalds committed May 29, 2016
    The original name was simply hash_string(), but that conflicted with a
    function with that name in drivers/base/power/trace.c, and I decided
    that calling it "hashlen_" was better anyway.
    
    But you have to do it in two places.
    
    [ This caused build errors for architectures that don't define
      CONFIG_DCACHE_WORD_ACCESS   - Linus ]
    
    Signed-off-by: George Spelvin <linux@sciencehorizons.net>
    Reported-by: Guenter Roeck <linux@roeck-us.net>
    Fixes: fcfd2fb ("fs/namei.c: Add hashlen_string() function")
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Commits on May 28, 2016
  1. hpfs: implement the show_options method

    Mikulas Patocka authored and torvalds committed May 24, 2016
    The HPFS filesystem used generic_show_options to produce string that is
    displayed in /proc/mounts.  However, there is a problem that the options
    may disappear after remount.  If we mount the filesystem with option1
    and then remount it with option2, /proc/mounts should show both option1
    and option2, however it only shows option2 because the whole option
    string is replaced with replace_mount_options in hpfs_remount_fs.
    
    To fix this bug, implement the hpfs_show_options function that prints
    options that are currently selected.
    
    Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
    Cc: stable@vger.kernel.org
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  2. affs: fix remount failure when there are no options changed

    Mikulas Patocka authored and torvalds committed May 24, 2016
    Commit c8f33d0 ("affs: kstrdup() memory handling") checks if the
    kstrdup function returns NULL due to out-of-memory condition.
    
    However, if we are remounting a filesystem with no change to
    filesystem-specific options, the parameter data is NULL.  In this case,
    kstrdup returns NULL (because it was passed NULL parameter), although no
    out of memory condition exists.  The mount syscall then fails with
    ENOMEM.
    
    This patch fixes the bug.  We fail with ENOMEM only if data is non-NULL.
    
    The patch also changes the call to replace_mount_options - if we didn't
    pass any filesystem-specific options, we don't call
    replace_mount_options (thus we don't erase existing reported options).
    
    Fixes: c8f33d0 ("affs: kstrdup() memory handling")
    Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
    Cc: stable@vger.kernel.org	# v4.1+
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  3. hpfs: fix remount failure when there are no options changed

    Mikulas Patocka authored and torvalds committed May 24, 2016
    Commit ce65761 ("hpfs: kstrdup() out of memory handling") checks if
    the kstrdup function returns NULL due to out-of-memory condition.
    
    However, if we are remounting a filesystem with no change to
    filesystem-specific options, the parameter data is NULL.  In this case,
    kstrdup returns NULL (because it was passed NULL parameter), although no
    out of memory condition exists.  The mount syscall then fails with
    ENOMEM.
    
    This patch fixes the bug.  We fail with ENOMEM only if data is non-NULL.
    
    The patch also changes the call to replace_mount_options - if we didn't
    pass any filesystem-specific options, we don't call
    replace_mount_options (thus we don't erase existing reported options).
    
    Fixes: ce65761 ("hpfs: kstrdup() out of memory handling")
    Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
    Cc: stable@vger.kernel.org
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  4. Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upst…

    torvalds committed May 28, 2016
    …ream-linus
    
    Pull more MIPS updates from Ralf Baechle:
     "This is the secondnd batch of MIPS patches for 4.7. Summary:
    
      CPS:
       - Copy EVA configuration when starting secondary VPs.
    
      EIC:
       - Clear Status IPL.
    
      Lasat:
       - Fix a few off by one bugs.
    
      lib:
       - Mark intrinsics notrace.  Not only are the intrinsics
         uninteresting, it would cause infinite recursion.
    
      MAINTAINERS:
       - Add file patterns for MIPS BRCM device tree bindings.
       - Add file patterns for mips device tree bindings.
    
      MT7628:
       - Fix MT7628 pinmux typos.
       - wled_an pinmux gpio.
       - EPHY LEDs pinmux support.
    
      Pistachio:
       - Enable KASLR
    
      VDSO:
       - Build microMIPS VDSO for microMIPS kernels.
       - Fix aliasing warning by building with `-fno-strict-aliasing' for
         debugging but also tracing them might result in recursion.
    
      Misc:
       - Add missing FROZEN hotplug notifier transitions.
       - Fix clk binding example for varioius PIC32 devices.
       - Fix cpu interrupt controller node-names in the DT files.
       - Fix XPA CPU feature separation.
       - Fix write_gc0_* macros when writing zero.
       - Add inline asm encoding helpers.
       - Add missing VZ accessor microMIPS encodings.
       - Fix little endian microMIPS MSA encodings.
       - Add 64-bit HTW fields and fix its configuration.
       - Fix sigreturn via VDSO on microMIPS kernel.
       - Lots of typo fixes.
       - Add definitions of SegCtl registers and use them"
    
    * 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus: (49 commits)
      MIPS: Add missing FROZEN hotplug notifier transitions
      MIPS: Build microMIPS VDSO for microMIPS kernels
      MIPS: Fix sigreturn via VDSO on microMIPS kernel
      MIPS: devicetree: fix cpu interrupt controller node-names
      MIPS: VDSO: Build with `-fno-strict-aliasing'
      MIPS: Pistachio: Enable KASLR
      MIPS: lib: Mark intrinsics notrace
      MIPS: Fix 64-bit HTW configuration
      MIPS: Add 64-bit HTW fields
      MAINTAINERS: Add file patterns for mips device tree bindings
      MAINTAINERS: Add file patterns for mips brcm device tree bindings
      MIPS: Simplify DSP instruction encoding macros
      MIPS: Add missing tlbinvf/XPA microMIPS encodings
      MIPS: Fix little endian microMIPS MSA encodings
      MIPS: Add missing VZ accessor microMIPS encodings
      MIPS: Add inline asm encoding helpers
      MIPS: Spelling fix lets -> let's
      MIPS: VR41xx: Fix typo
      MIPS: oprofile: Fix typo
      MIPS: math-emu: Fix typo
      ...
  5. fs: fix binfmt_aout.c build error

    groeck authored and torvalds committed May 28, 2016
    Various builds (such as i386:allmodconfig) fail with
    
      fs/binfmt_aout.c:133:2: error: expected identifier or '(' before 'return'
      fs/binfmt_aout.c:134:1: error: expected identifier or '(' before '}' token
    
    [ Oops. My bad, I had stupidly thought that "allmodconfig" covered this
      on x86-64 too, but it obviously doesn't.  Egg on my face.  - Linus ]
    
    Fixes: 5d22fc2 ("mm: remove more IS_ERR_VALUE abuses")
    Signed-off-by: Guenter Roeck <linux@roeck-us.net>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  6. Merge branch 'hash' of git://ftp.sciencehorizons.net/linux

    torvalds committed May 28, 2016
    Pull string hash improvements from George Spelvin:
     "This series does several related things:
    
       - Makes the dcache hash (fs/namei.c) useful for general kernel use.
    
         (Thanks to Bruce for noticing the zero-length corner case)
    
       - Converts the string hashes in <linux/sunrpc/svcauth.h> to use the
         above.
    
       - Avoids 64-bit multiplies in hash_64() on 32-bit platforms.  Two
         32-bit multiplies will do well enough.
    
       - Rids the world of the bad hash multipliers in hash_32.
    
         This finishes the job started in commit 689de1d ("Minimal
         fix-up of bad hashing behavior of hash_64()")
    
         The vast majority of Linux architectures have hardware support for
         32x32-bit multiply and so derive no benefit from "simplified"
         multipliers.
    
         The few processors that do not (68000, h8/300 and some models of
         Microblaze) have arch-specific implementations added.  Those
         patches are last in the series.
    
       - Overhauls the dcache hash mixing.
    
         The patch in commit 0fed3ac ("namei: Improve hash mixing if
         CONFIG_DCACHE_WORD_ACCESS") was an off-the-cuff suggestion.
         Replaced with a much more careful design that's simultaneously
         faster and better.  (My own invention, as there was noting suitable
         in the literature I could find.  Comments welcome!)
    
       - Modify the hash_name() loop to skip the initial HASH_MIX().  This
         would let us salt the hash if we ever wanted to.
    
       - Sort out partial_name_hash().
    
         The hash function is declared as using a long state, even though
         it's truncated to 32 bits at the end and the extra internal state
         contributes nothing to the result.  And some callers do odd things:
    
          - fs/hfs/string.c only allocates 32 bits of state
          - fs/hfsplus/unicode.c uses it to hash 16-bit unicode symbols not bytes
    
       - Modify bytemask_from_count to handle inputs of 1..sizeof(long)
         rather than 0..sizeof(long)-1.  This would simplify users other
         than full_name_hash"
    
      Special thanks to Bruce Fields for testing and finding bugs in v1.  (I
      learned some humbling lessons about "obviously correct" code.)
    
      On the arch-specific front, the m68k assembly has been tested in a
      standalone test harness, I've been in contact with the Microblaze
      maintainers who mostly don't care, as the hardware multiplier is never
      omitted in real-world applications, and I haven't heard anything from
      the H8/300 world"
    
    * 'hash' of git://ftp.sciencehorizons.net/linux:
      h8300: Add <asm/hash.h>
      microblaze: Add <asm/hash.h>
      m68k: Add <asm/hash.h>
      <linux/hash.h>: Add support for architecture-specific functions
      fs/namei.c: Improve dcache hash function
      Eliminate bad hash multipliers from hash_32() and  hash_64()
      Change hash_64() return value to 32 bits
      <linux/sunrpc/svcauth.h>: Define hash_str() in terms of hashlen_string()
      fs/namei.c: Add hashlen_string() function
      Pull out string hash to <linux/stringhash.h>
  7. h8300: Add <asm/hash.h>

    George Spelvin
    George Spelvin committed May 25, 2016
    This will improve the performance of hash_32() and hash_64(), but due
    to complete lack of multi-bit shift instructions on H8, performance will
    still be bad in surrounding code.
    
    Designing H8-specific hash algorithms to work around that is a separate
    project.  (But if the maintainers would like to get in touch...)
    
    Signed-off-by: George Spelvin <linux@sciencehorizons.net>
    Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
    Cc: uclinux-h8-devel@lists.sourceforge.jp
  8. microblaze: Add <asm/hash.h>

    George Spelvin
    George Spelvin committed May 25, 2016
    Microblaze is an FPGA soft core that can be configured various ways.
    
    If it is configured without a multiplier, the standard __hash_32()
    will require a call to __mulsi3, which is a slow software loop.
    
    Instead, use a shift-and-add sequence for the constant multiply.
    GCC knows how to do this, but it's not as clever as some.
    
    Signed-off-by: George Spelvin <linux@sciencehorizons.net>
    Cc: Alistair Francis <alistair.francis@xilinx.com>
    Cc: Michal Simek <michal.simek@xilinx.com>
  9. m68k: Add <asm/hash.h>

    George Spelvin
    George Spelvin committed May 26, 2016
    This provides a multiply by constant GOLDEN_RATIO_32 = 0x61C88647
    for the original mc68000, which lacks a 32x32-bit multiply instruction.
    
    Yes, the amount of optimization effort put in is excessive. :-)
    
    Shift-add chain found by Yevgen Voronenko's Hcub algorithm at
    http://spiral.ece.cmu.edu/mcm/gen.html
    
    Signed-off-by: George Spelvin <linux@sciencehorizons.net>
    Cc: Geert Uytterhoeven <geert@linux-m68k.org>
    Cc: Greg Ungerer <gerg@linux-m68k.org>
    Cc: Andreas Schwab <schwab@linux-m68k.org>
    Cc: Philippe De Muyter <phdm@macq.eu>
    Cc: linux-m68k@lists.linux-m68k.org
  10. <linux/hash.h>: Add support for architecture-specific functions

    George Spelvin
    George Spelvin committed May 27, 2016
    This is just the infrastructure; there are no users yet.
    
    This is modelled on CONFIG_ARCH_RANDOM; a CONFIG_ symbol declares
    the existence of <asm/hash.h>.
    
    That file may define its own versions of various functions, and define
    HAVE_* symbols (no CONFIG_ prefix!) to suppress the generic ones.
    
    Included is a self-test (in lib/test_hash.c) that verifies the basics.
    It is NOT in general required that the arch-specific functions compute
    the same thing as the generic, but if a HAVE_* symbol is defined with
    the value 1, then equality is tested.
    
    Signed-off-by: George Spelvin <linux@sciencehorizons.net>
    Cc: Geert Uytterhoeven <geert@linux-m68k.org>
    Cc: Greg Ungerer <gerg@linux-m68k.org>
    Cc: Andreas Schwab <schwab@linux-m68k.org>
    Cc: Philippe De Muyter <phdm@macq.eu>
    Cc: linux-m68k@lists.linux-m68k.org
    Cc: Alistair Francis <alistai@xilinx.com>
    Cc: Michal Simek <michal.simek@xilinx.com>
    Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
    Cc: uclinux-h8-devel@lists.sourceforge.jp
  11. fs/namei.c: Improve dcache hash function

    George Spelvin
    George Spelvin committed May 23, 2016
    Patch 0fed3ac improved the hash mixing, but the function is slower
    than necessary; there's a 7-instruction dependency chain (10 on x86)
    each loop iteration.
    
    Word-at-a-time access is a very tight loop (which is good, because
    link_path_walk() is one of the hottest code paths in the entire kernel),
    and the hash mixing function must not have a longer latency to avoid
    slowing it down.
    
    There do not appear to be any published fast hash functions that:
    1) Operate on the input a word at a time, and
    2) Don't need to know the length of the input beforehand, and
    3) Have a single iterated mixing function, not needing conditional
       branches or unrolling to distinguish different loop iterations.
    
    One of the algorithms which comes closest is Yann Collet's xxHash, but
    that's two dependent multiplies per word, which is too much.
    
    The key insights in this design are:
    
    1) Barring expensive ops like multiplies, to diffuse one input bit
       across 64 bits of hash state takes at least log2(64) = 6 sequentially
       dependent instructions.  That is more cycles than we'd like.
    2) An operation like "hash ^= hash << 13" requires a second temporary
       register anyway, and on a 2-operand machine like x86, it's three
       instructions.
    3) A better use of a second register is to hold a two-word hash state.
       With careful design, no temporaries are needed at all, so it doesn't
       increase register pressure.  And this gets rid of register copying
       on 2-operand machines, so the code is smaller and faster.
    4) Using two words of state weakens the requirement for one-round mixing;
       we now have two rounds of mixing before cancellation is possible.
    5) A two-word hash state also allows operations on both halves to be
       done in parallel, so on a superscalar processor we get more mixing
       in fewer cycles.
    
    I ended up using a mixing function inspired by the ChaCha and Speck
    round functions.  It is 6 simple instructions and 3 cycles per iteration
    (assuming multiply by 9 can be done by an "lea" instruction):
    
    		x ^= *input++;
    	y ^= x;	x = ROL(x, K1);
    	x += y;	y = ROL(y, K2);
    	y *= 9;
    
    Not only is this reversible, two consecutive rounds are reversible:
    if you are given the initial and final states, but not the intermediate
    state, it is possible to compute both input words.  This means that at
    least 3 words of input are required to create a collision.
    
    (It also has the property, used by hash_name() to avoid a branch, that
    it hashes all-zero to all-zero.)
    
    The rotate constants K1 and K2 were found by experiment.  The search took
    a sample of random initial states (I used 1023) and considered the effect
    of flipping each of the 64 input bits on each of the 128 output bits two
    rounds later.  Each of the 8192 pairs can be considered a biased coin, and
    adding up the Shannon entropy of all of them produces a score.
    
    The best-scoring shifts also did well in other tests (flipping bits in y,
    trying 3 or 4 rounds of mixing, flipping all 64*63/2 pairs of input bits),
    so the choice was made with the additional constraint that the sum of the
    shifts is odd and not too close to the word size.
    
    The final state is then folded into a 32-bit hash value by a less carefully
    optimized multiply-based scheme.  This also has to be fast, as pathname
    components tend to be short (the most common case is one iteration!), but
    there's some room for latency, as there is a fair bit of intervening logic
    before the hash value is used for anything.
    
    (Performance verified with "bonnie++ -s 0 -n 1536:-2" on tmpfs.  I need
    a better benchmark; the numbers seem to show a slight dip in performance
    between 4.6.0 and this patch, but they're too noisy to quote.)
    
    Special thanks to Bruce fields for diligent testing which uncovered a
    nasty fencepost error in an earlier version of this patch.
    
    [checkpatch.pl formatting complaints noted and respectfully disagreed with.]
    
    Signed-off-by: George Spelvin <linux@sciencehorizons.net>
    Tested-by: J. Bruce Fields <bfields@redhat.com>
  12. Eliminate bad hash multipliers from hash_32() and hash_64()

    George Spelvin
    George Spelvin committed May 27, 2016
    The "simplified" prime multipliers made very bad hash functions, so get rid
    of them.  This completes the work of 689de1d.
    
    To avoid the inefficiency which was the motivation for the "simplified"
    multipliers, hash_64() on 32-bit systems is changed to use a different
    algorithm.  It makes two calls to hash_32() instead.
    
    drivers/media/usb/dvb-usb-v2/af9015.c uses the old GOLDEN_RATIO_PRIME_32
    for some horrible reason, so it inherits a copy of the old definition.
    
    Signed-off-by: George Spelvin <linux@sciencehorizons.net>
    Cc: Antti Palosaari <crope@iki.fi>
    Cc: Mauro Carvalho Chehab <m.chehab@samsung.com>
  13. Change hash_64() return value to 32 bits

    George Spelvin
    George Spelvin committed May 27, 2016
    That's all that's ever asked for, and it makes the return
    type of hash_long() consistent.
    
    It also allows (upcoming patch) an optimized implementation
    of hash_64 on 32-bit machines.
    
    I tried adding a BUILD_BUG_ON to ensure the number of bits requested
    was never more than 32 (most callers use a compile-time constant), but
    adding <linux/bug.h> to <linux/hash.h> breaks the tools/perf compiler
    unless tools/perf/MANIFEST is updated, and understanding that code base
    well enough to update it is too much trouble.  I did the rest of an
    allyesconfig build with such a check, and nothing tripped.
    
    Signed-off-by: George Spelvin <linux@sciencehorizons.net>
  14. <linux/sunrpc/svcauth.h>: Define hash_str() in terms of hashlen_string()

    George Spelvin
    George Spelvin committed May 20, 2016
    Finally, the first use of previous two patches: eliminate the
    separate ad-hoc string hash functions in the sunrpc code.
    
    Now hash_str() is a wrapper around hash_string(), and hash_mem() is
    likewise a wrapper around full_name_hash().
    
    Note that sunrpc code *does* call hash_mem() with a zero length, which
    is why the previous patch needed to handle that in full_name_hash().
    (Thanks, Bruce, for finding that!)
    
    This also eliminates the only caller of hash_long which asks for
    more than 32 bits of output.
    
    The comment about the quality of hashlen_string() and full_name_hash()
    is jumping the gun by a few patches; they aren't very impressive now,
    but will be improved greatly later in the series.
    
    Signed-off-by: George Spelvin <linux@sciencehorizons.net>
    Tested-by: J. Bruce Fields <bfields@redhat.com>
    Acked-by: J. Bruce Fields <bfields@redhat.com>
    Cc: Jeff Layton <jlayton@poochiereds.net>
    Cc: linux-nfs@vger.kernel.org
  15. fs/namei.c: Add hashlen_string() function

    George Spelvin
    George Spelvin committed May 20, 2016
    We'd like to make more use of the highly-optimized dcache hash functions
    throughout the kernel, rather than have every subsystem create its own,
    and a function that hashes basic null-terminated strings is required
    for that.
    
    (The name is to emphasize that it returns both hash and length.)
    
    It's actually useful in the dcache itself, specifically d_alloc_name().
    Other uses in the next patch.
    
    full_name_hash() is also tweaked to make it more generally useful:
    1) Take a "char *" rather than "unsigned char *" argument, to
       be consistent with hash_name().
    2) Handle zero-length inputs.  If we want more callers, we don't want
       to make them worry about corner cases.
    
    Signed-off-by: George Spelvin <linux@sciencehorizons.net>
  16. Pull out string hash to <linux/stringhash.h>

    George Spelvin
    George Spelvin committed May 20, 2016
    ... so they can be used without the rest of <linux/dcache.h>
    
    The hashlen_* macros will make sense next patch.
    
    Signed-off-by: George Spelvin <linux@sciencehorizons.net>
  17. Merge branch 'i2c/for-next' of git://git.kernel.org/pub/scm/linux/ker…

    torvalds committed May 28, 2016
    …nel/git/wsa/linux
    
    Pull i2c fix from Wolfram Sang:
     "A fix for a regression introduced yesterday.
    
      The regression didn't show up here locally because I did not have
      PAGE_POISONING enabled.  And buildbots discovered this only after it
      hit your tree.  Thanks to Dan for the quick response"
    
    * 'i2c/for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
      i2c: dev: use after free in detach