30 Dec, 2020

1 commit

  • commit 7174dc655ef0578877b0b4598e69619d2be28b4d upstream.

    If the call to devm_spi_register_master() fails on probe of the GPIO SPI
    driver, the spi_master struct is erroneously not freed:

    After allocating the spi_master, its reference count is 1. The driver
    unconditionally decrements the reference count on unbind using a devm
    action. Before calling devm_spi_register_master(), the driver
    unconditionally increments the reference count because on success,
    that function will decrement the reference count on unbind. However on
    failure, devm_spi_register_master() does *not* decrement the reference
    count, so the spi_master is leaked.

    The issue was introduced by commits 8b797490b4db ("spi: gpio: Make sure
    spi_master_put() is called in every error path") and 79567c1a321e ("spi:
    gpio: Use devm_spi_register_master()"), which sought to plug leaks
    introduced by 9b00bc7b901f ("spi: spi-gpio: Rewrite to use GPIO
    descriptors") but missed this remaining leak.

    The situation was later aggravated by commit d3b0ffa1d75d ("spi: gpio:
    prevent memory leak in spi_gpio_probe"), which introduced a
    use-after-free because it releases a reference on the spi_master if
    devm_add_action_or_reset() fails even though the function already
    does that.

    Fix by switching over to the new devm_spi_alloc_master() helper.

    Fixes: 9b00bc7b901f ("spi: spi-gpio: Rewrite to use GPIO descriptors")
    Signed-off-by: Lukas Wunner
    Reviewed-by: Linus Walleij
    Cc: # v4.17+: 5e844cc37a5c: spi: Introduce device-managed SPI controller allocation
    Cc: # v5.1-: 8b797490b4db: spi: gpio: Make sure spi_master_put() is called in every error path
    Cc: # v5.1-: 45beec351998: spi: bitbang: Introduce spi_bitbang_init()
    Cc: # v5.1-: 79567c1a321e: spi: gpio: Use devm_spi_register_master()
    Cc: # v5.4-: d3b0ffa1d75d: spi: gpio: prevent memory leak in spi_gpio_probe
    Cc: # v4.17+
    Cc: Navid Emamdoost
    Cc: Andrey Smirnov
    Link: https://lore.kernel.org/r/86eaed27431c3d709e3748eb76ceecbfc790dd37.1607286887.git.lukas@wunner.de
    Signed-off-by: Mark Brown
    Signed-off-by: Greg Kroah-Hartman

    Lukas Wunner
     

09 Oct, 2019

1 commit


07 Oct, 2019

1 commit

  • This driver doesn't do anything with the match for the device node. The
    logic is the same as looking to see if a device node exists or not
    because this driver wouldn't probe unless there is a device node match
    when the device is created from DT. Just test for the presence of the
    device node to simplify and avoid referencing a potentially undefined
    match table when CONFIG_OF=n.

    Cc: Arnd Bergmann
    Cc: Geert Uytterhoeven
    Cc: Mark Brown
    Cc: Rob Herring
    Cc: Frank Rowand
    Cc:
    Signed-off-by: Stephen Boyd
    Link: https://lore.kernel.org/r/20191004214334.149976-9-swboyd@chromium.org
    Signed-off-by: Mark Brown

    Stephen Boyd
     

02 Oct, 2019

1 commit

  • In spi_gpio_probe an SPI master is allocated via spi_alloc_master, but
    this controller should be released if devm_add_action_or_reset fails,
    otherwise memory leaks. In order to avoid leak spi_contriller_put must
    be called in case of failure for devm_add_action_or_reset.

    Fixes: 8b797490b4db ("spi: gpio: Make sure spi_master_put() is called in every error path")
    Signed-off-by: Navid Emamdoost
    Link: https://lore.kernel.org/r/20190930205241.5483-1-navid.emamdoost@gmail.com
    Signed-off-by: Mark Brown

    Navid Emamdoost
     

09 Sep, 2019

1 commit


18 Jul, 2019

1 commit

  • The GPIO SPI master has some code in its local CS
    callback to set the initial sck GPIO value. This was
    lost in the commit converting it to use SPI core
    GPIO handling as this callback isn't called if the
    internal GPIO handling is active.

    Add the special SPI_MASTER_GPIO_SS to ascertain it
    gets called anyway so we get the initial SCK setting
    right. There is some platform provided GPIO handling
    there as well but this will be skipped as the cs_gpios
    will be NULL.

    My test targets seem not to care about the initial
    SCK value so I am uncertain if this is a regression,
    but to preserve the previous semantic we better do
    this.

    Cc: Andrey Smirnov
    Fixes: 249e2632dcd0 ("spi: gpio: Don't request CS GPIO in DT use-case")
    Signed-off-by: Linus Walleij
    Link: https://lore.kernel.org/r/20190716204651.7743-1-linus.walleij@linaro.org
    Signed-off-by: Mark Brown

    Linus Walleij
     

31 May, 2019

1 commit

  • Based on 3 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license as published by
    the free software foundation either version 2 of the license or at
    your option any later version this program is distributed in the
    hope that it will be useful but without any warranty without even
    the implied warranty of merchantability or fitness for a particular
    purpose see the gnu general public license for more details

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license as published by
    the free software foundation either version 2 of the license or at
    your option any later version [author] [kishon] [vijay] [abraham]
    [i] [kishon]@[ti] [com] this program is distributed in the hope that
    it will be useful but without any warranty without even the implied
    warranty of merchantability or fitness for a particular purpose see
    the gnu general public license for more details

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license as published by
    the free software foundation either version 2 of the license or at
    your option any later version [author] [graeme] [gregory]
    [gg]@[slimlogic] [co] [uk] [author] [kishon] [vijay] [abraham] [i]
    [kishon]@[ti] [com] [based] [on] [twl6030]_[usb] [c] [author] [hema]
    [hk] [hemahk]@[ti] [com] this program is distributed in the hope
    that it will be useful but without any warranty without even the
    implied warranty of merchantability or fitness for a particular
    purpose see the gnu general public license for more details

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-or-later

    has been chosen to replace the boilerplate/reference in 1105 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Allison Randal
    Reviewed-by: Richard Fontana
    Reviewed-by: Kate Stewart
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190527070033.202006027@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

08 Apr, 2019

2 commits

  • Replace spi_bitbang_start() with a combination of spi_bitbang_init()
    and devm_spi_register_master() and drop all of the explicit
    cleanup-related code that's no longer necessary.

    Signed-off-by: Andrey Smirnov
    Cc: Mark Brown
    Cc: Chris Healy
    Cc: linux-spi@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Signed-off-by: Mark Brown

    Andrey Smirnov
     
  • There's a number of failure paths in spi_gpio_probe() that do not call
    spi_master_put() potentially leaking memory. Fix this problem by
    registering a cleanup funciont via devm_add_action_or_reset() right
    after SPI controller is allocated.

    Signed-off-by: Andrey Smirnov
    Cc: Mark Brown
    Cc: Chris Healy
    Cc: linux-spi@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Signed-off-by: Mark Brown

    Andrey Smirnov
     

05 Apr, 2019

4 commits


04 Apr, 2019

1 commit


03 Apr, 2019

5 commits


22 Feb, 2019

1 commit

  • spi-gpio is capable of dealing with active-high chip-selects.
    Unfortunately, commit 4b859db2c606 ("spi: spi-gpio: add SPI_3WIRE
    support") broke this by setting master->mode_bits, which overrides
    the setting in the spi-bitbang code. Fix this.

    [Fixed a trivial conflict with SPI_3WIRE_HIZ support -- broonie]

    Fixes: 4b859db2c606 ("spi: spi-gpio: add SPI_3WIRE support")
    Signed-off-by: Russell King
    Signed-off-by: Mark Brown
    Cc: stable@vger.kernel.org

    Russell King
     

13 Feb, 2019

1 commit


08 Nov, 2018

1 commit

  • Some devices such as the TPO TPG110 display panel require
    a "high-impedance turn-around", in effect a clock cycle after
    switching the line from output to input mode.

    Support this in the GPIO driver to begin with. Other driver
    may implement it if they can, it is unclear if this can
    be achieved with anything else than GPIO bit-banging.

    Cc: Andrzej Hajda
    Acked-by: Lorenzo Bianconi
    Signed-off-by: Linus Walleij
    Signed-off-by: Mark Brown

    Linus Walleij
     

22 Oct, 2018

1 commit


10 Sep, 2018

1 commit

  • There is a logical problem in spi-gpio with host just
    assigning a MOSI line and no MISO: this is interpreted
    as the host cannot do RX and the host is flagged with
    SPI_MASTER_NO_RX.

    This is wrong: since GPIO lines can switch direction,
    in 3WIRE operation the host will simply reverse the
    direction of the GPIO line and start reading from it,
    there is even code for doing this in the driver, but
    it went unnoticed because it was tested by using a
    master with 4 wires but a device using just 3 wires.

    Remove the offending flag.

    Cc: Andrzej Hajda
    Cc: Lorenzo Bianconi
    Signed-off-by: Linus Walleij
    Signed-off-by: Mark Brown

    Linus Walleij
     

06 Sep, 2018

1 commit


05 Sep, 2018

1 commit

  • This fixes an embarrassing copy-and-paste error in the
    errorpath of spi_gpio_request(): we were checking the wrong
    struct member for error code right after retrieveing the
    sck GPIO.

    Fixes: 9b00bc7b901ff672 ("spi: spi-gpio: Rewrite to use GPIO descriptors")
    Reviewed-by: Geert Uytterhoeven
    Signed-off-by: Linus Walleij
    Signed-off-by: Mark Brown

    Linus Walleij
     

01 Aug, 2018

2 commits

  • Add SPI_3WIRE support to spi-gpio controller introducing
    set_line_direction function pointer in spi_bitbang data structure.
    Spi-gpio controller has been tested using hts221 temp/rh iio sensor
    running in 3wire mode and lsm6dsm running in 4wire mode

    Signed-off-by: Lorenzo Bianconi
    Signed-off-by: Mark Brown

    Lorenzo Bianconi
     
  • Add the capability to specify the flag parameter used in
    bitbang_txrx_be_cpha{0,1} through the txrx_word function pointers of
    spi_bitbang data structure. That feature will be used to add spi-3wire
    support to the spi-gpio controller

    Signed-off-by: Lorenzo Bianconi
    Signed-off-by: Mark Brown

    Lorenzo Bianconi
     

13 Jun, 2018

1 commit

  • The devm_kzalloc() function has a 2-factor argument form, devm_kcalloc().
    This patch replaces cases of:

    devm_kzalloc(handle, a * b, gfp)

    with:
    devm_kcalloc(handle, a * b, gfp)

    as well as handling cases of:

    devm_kzalloc(handle, a * b * c, gfp)

    with:

    devm_kzalloc(handle, array3_size(a, b, c), gfp)

    as it's slightly less ugly than:

    devm_kcalloc(handle, array_size(a, b), c, gfp)

    This does, however, attempt to ignore constant size factors like:

    devm_kzalloc(handle, 4 * 1024, gfp)

    though any constants defined via macros get caught up in the conversion.

    Any factors with a sizeof() of "unsigned char", "char", and "u8" were
    dropped, since they're redundant.

    Some manual whitespace fixes were needed in this patch, as Coccinelle
    really liked to write "=devm_kcalloc..." instead of "= devm_kcalloc...".

    The Coccinelle script used for this was:

    // Fix redundant parens around sizeof().
    @@
    expression HANDLE;
    type TYPE;
    expression THING, E;
    @@

    (
    devm_kzalloc(HANDLE,
    - (sizeof(TYPE)) * E
    + sizeof(TYPE) * E
    , ...)
    |
    devm_kzalloc(HANDLE,
    - (sizeof(THING)) * E
    + sizeof(THING) * E
    , ...)
    )

    // Drop single-byte sizes and redundant parens.
    @@
    expression HANDLE;
    expression COUNT;
    typedef u8;
    typedef __u8;
    @@

    (
    devm_kzalloc(HANDLE,
    - sizeof(u8) * (COUNT)
    + COUNT
    , ...)
    |
    devm_kzalloc(HANDLE,
    - sizeof(__u8) * (COUNT)
    + COUNT
    , ...)
    |
    devm_kzalloc(HANDLE,
    - sizeof(char) * (COUNT)
    + COUNT
    , ...)
    |
    devm_kzalloc(HANDLE,
    - sizeof(unsigned char) * (COUNT)
    + COUNT
    , ...)
    |
    devm_kzalloc(HANDLE,
    - sizeof(u8) * COUNT
    + COUNT
    , ...)
    |
    devm_kzalloc(HANDLE,
    - sizeof(__u8) * COUNT
    + COUNT
    , ...)
    |
    devm_kzalloc(HANDLE,
    - sizeof(char) * COUNT
    + COUNT
    , ...)
    |
    devm_kzalloc(HANDLE,
    - sizeof(unsigned char) * COUNT
    + COUNT
    , ...)
    )

    // 2-factor product with sizeof(type/expression) and identifier or constant.
    @@
    expression HANDLE;
    type TYPE;
    expression THING;
    identifier COUNT_ID;
    constant COUNT_CONST;
    @@

    (
    - devm_kzalloc
    + devm_kcalloc
    (HANDLE,
    - sizeof(TYPE) * (COUNT_ID)
    + COUNT_ID, sizeof(TYPE)
    , ...)
    |
    - devm_kzalloc
    + devm_kcalloc
    (HANDLE,
    - sizeof(TYPE) * COUNT_ID
    + COUNT_ID, sizeof(TYPE)
    , ...)
    |
    - devm_kzalloc
    + devm_kcalloc
    (HANDLE,
    - sizeof(TYPE) * (COUNT_CONST)
    + COUNT_CONST, sizeof(TYPE)
    , ...)
    |
    - devm_kzalloc
    + devm_kcalloc
    (HANDLE,
    - sizeof(TYPE) * COUNT_CONST
    + COUNT_CONST, sizeof(TYPE)
    , ...)
    |
    - devm_kzalloc
    + devm_kcalloc
    (HANDLE,
    - sizeof(THING) * (COUNT_ID)
    + COUNT_ID, sizeof(THING)
    , ...)
    |
    - devm_kzalloc
    + devm_kcalloc
    (HANDLE,
    - sizeof(THING) * COUNT_ID
    + COUNT_ID, sizeof(THING)
    , ...)
    |
    - devm_kzalloc
    + devm_kcalloc
    (HANDLE,
    - sizeof(THING) * (COUNT_CONST)
    + COUNT_CONST, sizeof(THING)
    , ...)
    |
    - devm_kzalloc
    + devm_kcalloc
    (HANDLE,
    - sizeof(THING) * COUNT_CONST
    + COUNT_CONST, sizeof(THING)
    , ...)
    )

    // 2-factor product, only identifiers.
    @@
    expression HANDLE;
    identifier SIZE, COUNT;
    @@

    - devm_kzalloc
    + devm_kcalloc
    (HANDLE,
    - SIZE * COUNT
    + COUNT, SIZE
    , ...)

    // 3-factor product with 1 sizeof(type) or sizeof(expression), with
    // redundant parens removed.
    @@
    expression HANDLE;
    expression THING;
    identifier STRIDE, COUNT;
    type TYPE;
    @@

    (
    devm_kzalloc(HANDLE,
    - sizeof(TYPE) * (COUNT) * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    devm_kzalloc(HANDLE,
    - sizeof(TYPE) * (COUNT) * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    devm_kzalloc(HANDLE,
    - sizeof(TYPE) * COUNT * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    devm_kzalloc(HANDLE,
    - sizeof(TYPE) * COUNT * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    devm_kzalloc(HANDLE,
    - sizeof(THING) * (COUNT) * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    |
    devm_kzalloc(HANDLE,
    - sizeof(THING) * (COUNT) * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    |
    devm_kzalloc(HANDLE,
    - sizeof(THING) * COUNT * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    |
    devm_kzalloc(HANDLE,
    - sizeof(THING) * COUNT * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    )

    // 3-factor product with 2 sizeof(variable), with redundant parens removed.
    @@
    expression HANDLE;
    expression THING1, THING2;
    identifier COUNT;
    type TYPE1, TYPE2;
    @@

    (
    devm_kzalloc(HANDLE,
    - sizeof(TYPE1) * sizeof(TYPE2) * COUNT
    + array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
    , ...)
    |
    devm_kzalloc(HANDLE,
    - sizeof(TYPE1) * sizeof(THING2) * (COUNT)
    + array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
    , ...)
    |
    devm_kzalloc(HANDLE,
    - sizeof(THING1) * sizeof(THING2) * COUNT
    + array3_size(COUNT, sizeof(THING1), sizeof(THING2))
    , ...)
    |
    devm_kzalloc(HANDLE,
    - sizeof(THING1) * sizeof(THING2) * (COUNT)
    + array3_size(COUNT, sizeof(THING1), sizeof(THING2))
    , ...)
    |
    devm_kzalloc(HANDLE,
    - sizeof(TYPE1) * sizeof(THING2) * COUNT
    + array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
    , ...)
    |
    devm_kzalloc(HANDLE,
    - sizeof(TYPE1) * sizeof(THING2) * (COUNT)
    + array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
    , ...)
    )

    // 3-factor product, only identifiers, with redundant parens removed.
    @@
    expression HANDLE;
    identifier STRIDE, SIZE, COUNT;
    @@

    (
    devm_kzalloc(HANDLE,
    - (COUNT) * STRIDE * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    devm_kzalloc(HANDLE,
    - COUNT * (STRIDE) * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    devm_kzalloc(HANDLE,
    - COUNT * STRIDE * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    devm_kzalloc(HANDLE,
    - (COUNT) * (STRIDE) * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    devm_kzalloc(HANDLE,
    - COUNT * (STRIDE) * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    devm_kzalloc(HANDLE,
    - (COUNT) * STRIDE * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    devm_kzalloc(HANDLE,
    - (COUNT) * (STRIDE) * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    devm_kzalloc(HANDLE,
    - COUNT * STRIDE * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    )

    // Any remaining multi-factor products, first at least 3-factor products,
    // when they're not all constants...
    @@
    expression HANDLE;
    expression E1, E2, E3;
    constant C1, C2, C3;
    @@

    (
    devm_kzalloc(HANDLE, C1 * C2 * C3, ...)
    |
    devm_kzalloc(HANDLE,
    - (E1) * E2 * E3
    + array3_size(E1, E2, E3)
    , ...)
    |
    devm_kzalloc(HANDLE,
    - (E1) * (E2) * E3
    + array3_size(E1, E2, E3)
    , ...)
    |
    devm_kzalloc(HANDLE,
    - (E1) * (E2) * (E3)
    + array3_size(E1, E2, E3)
    , ...)
    |
    devm_kzalloc(HANDLE,
    - E1 * E2 * E3
    + array3_size(E1, E2, E3)
    , ...)
    )

    // And then all remaining 2 factors products when they're not all constants,
    // keeping sizeof() as the second factor argument.
    @@
    expression HANDLE;
    expression THING, E1, E2;
    type TYPE;
    constant C1, C2, C3;
    @@

    (
    devm_kzalloc(HANDLE, sizeof(THING) * C2, ...)
    |
    devm_kzalloc(HANDLE, sizeof(TYPE) * C2, ...)
    |
    devm_kzalloc(HANDLE, C1 * C2 * C3, ...)
    |
    devm_kzalloc(HANDLE, C1 * C2, ...)
    |
    - devm_kzalloc
    + devm_kcalloc
    (HANDLE,
    - sizeof(TYPE) * (E2)
    + E2, sizeof(TYPE)
    , ...)
    |
    - devm_kzalloc
    + devm_kcalloc
    (HANDLE,
    - sizeof(TYPE) * E2
    + E2, sizeof(TYPE)
    , ...)
    |
    - devm_kzalloc
    + devm_kcalloc
    (HANDLE,
    - sizeof(THING) * (E2)
    + E2, sizeof(THING)
    , ...)
    |
    - devm_kzalloc
    + devm_kcalloc
    (HANDLE,
    - sizeof(THING) * E2
    + E2, sizeof(THING)
    , ...)
    |
    - devm_kzalloc
    + devm_kcalloc
    (HANDLE,
    - (E1) * E2
    + E1, E2
    , ...)
    |
    - devm_kzalloc
    + devm_kcalloc
    (HANDLE,
    - (E1) * (E2)
    + E1, E2
    , ...)
    |
    - devm_kzalloc
    + devm_kcalloc
    (HANDLE,
    - E1 * E2
    + E1, E2
    , ...)
    )

    Signed-off-by: Kees Cook

    Kees Cook
     

15 Feb, 2018

1 commit

  • This converts the bit-banged GPIO SPI driver to looking up and
    using GPIO descriptors to get a handle on GPIO lines for SCK,
    MOSI, MISO and all CS lines.

    All existing board files are converted in one go to keep it all
    consistent. With these conversions I rarely find any interrim
    steps that makes any sense.

    Device tree probing and GPIO handling should work like before
    also after this patch.

    For board files, we stop using controller data to pass the GPIO
    line for chip select, instead we pass this as a GPIO descriptor
    lookup like everything else.

    In some s3c24xx machines the names of the SPI devices were set to
    "spi-gpio" rather than "spi_gpio" which can never have worked, I
    fixed it working (I guess) as part of this patch set. Sometimes
    I wonder how this code got upstream in the first place, it
    obviously is not tested.

    mach-s3c64xx/mach-smartq.c has the same problem and additionally
    defines the *same* GPIO line for MOSI and MISO which is not going
    to be accepted by gpiolib. As the lines were number 1,2,2 I assumed
    it was a typo and use lines 1,2,3. A comment gives awat that line 0
    is chip select though no actual SPI device is provided for the LCD
    supposed to be on this bit-banged SPI bus. I left it intact instead
    of just deleting the bus though.

    Kill off board file code that try to initialize the SPI lines
    to the same values that they will later be set by the spi_gpio
    driver anyways. Given the huge number of weird things in these
    board files I do not think this code is very tested or put in
    with much afterthought anyways.

    In order to assert that we do not get performance regressions on
    this crucial bing-banged driver, a ran a script like this dumping the
    Ilitek ILI9322 regmap 10000 times (it has no caching obviously) on
    an otherwise idle system in two iterations before and after the
    patches:

    #!/bin/sh
    for run in `seq 10000`
    do
    cat /debug/regmap/spi0.0/registers > /dev/null
    done

    Before the patch:

    time test.sh
    real 3m 41.03s
    user 0m 29.41s
    sys 3m 7.22s

    time test.sh
    real 3m 44.24s
    user 0m 32.31s
    sys 3m 7.60s

    After the patch:

    time test.sh
    real 3m 41.32s
    user 0m 28.92s
    sys 3m 8.08s

    time test.sh
    real 3m 39.92s
    user 0m 30.20s
    sys 3m 5.56s

    So any performance differences seems to be in the error margin.

    Signed-off-by: Linus Walleij
    Acked-by: Olof Johansson
    Reviewed-by: Andy Shevchenko
    Signed-off-by: Mark Brown

    Linus Walleij
     

08 Feb, 2015

1 commit


06 Jan, 2015

1 commit


22 Dec, 2014

1 commit


15 Dec, 2014

1 commit

  • Pull driver core update from Greg KH:
    "Here's the set of driver core patches for 3.19-rc1.

    They are dominated by the removal of the .owner field in platform
    drivers. They touch a lot of files, but they are "simple" changes,
    just removing a line in a structure.

    Other than that, a few minor driver core and debugfs changes. There
    are some ath9k patches coming in through this tree that have been
    acked by the wireless maintainers as they relied on the debugfs
    changes.

    Everything has been in linux-next for a while"

    * tag 'driver-core-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (324 commits)
    Revert "ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries"
    fs: debugfs: add forward declaration for struct device type
    firmware class: Deletion of an unnecessary check before the function call "vunmap"
    firmware loader: fix hung task warning dump
    devcoredump: provide a one-way disable function
    device: Add dev__once variants
    ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries
    ath: use seq_file api for ath9k debugfs files
    debugfs: add helper function to create device related seq_file
    drivers/base: cacheinfo: remove noisy error boot message
    Revert "core: platform: add warning if driver has no owner"
    drivers: base: support cpu cache information interface to userspace via sysfs
    drivers: base: add cpu_device_create to support per-cpu devices
    topology: replace custom attribute macros with standard DEVICE_ATTR*
    cpumask: factor out show_cpumap into separate helper function
    driver core: Fix unbalanced device reference in drivers_probe
    driver core: fix race with userland in device_add()
    sysfs/kernfs: make read requests on pre-alloc files use the buffer.
    sysfs/kernfs: allow attributes to request write buffer be pre-allocated.
    fs: sysfs: return EGBIG on write if offset is larger than file size
    ...

    Linus Torvalds
     

08 Nov, 2014

1 commit

  • The assignment of SPI_GPIO_NO_CHIPSELECT to cs_gpios[0] causes the following
    compiler warning, when building for 64 bit systems:
    "warning: overflow in implicit constant conversion [-Woverflow]".

    This is because the SPI_GPIO_NO_CHIPSELECT flag is a '-1' type casted to
    unsigned long and cs_gpios is of the type int.

    Furthermore the chip select's GPIO number is locally stored as unsigned int
    and compared with SPI_GPIO_NO_CHIPSELECT. Thus the result of the comparison
    is always false, if unsigned long and unsigned int have a different size.

    As part of the fix this patch adds a check for the device tree's cs-gpios
    property.

    Reported-by: kbuild test robot
    Signed-off-by: Torsten Fleischer
    Signed-off-by: Mark Brown

    Torsten Fleischer
     

05 Nov, 2014

1 commit


20 Oct, 2014

1 commit


08 May, 2014

1 commit


30 Mar, 2014

2 commits