30 Dec, 2020

1 commit

  • [ Upstream commit 9bb9ef2b3e5d9d012876e7e2d7757eb30e865bee ]

    Fix the missing clk_disable_unprepare() before return
    from bcm63xx_hsspi_resume in the error handling case when
    fails to prepare and enable bs->pll_clk.

    Fixes: 0fd85869c2a9 ("spi/bcm63xx-hsspi: keep pll clk enabled")
    Signed-off-by: Qinglang Miao
    Link: https://lore.kernel.org/r/20201103074911.195530-1-miaoqinglang@huawei.com
    Signed-off-by: Mark Brown
    Signed-off-by: Sasha Levin

    Qinglang Miao
     

17 Jun, 2020

1 commit

  • bcm63xx arch resets the HSSPI controller at early boot. However, bmips arch
    needs to perform a reset when probing the driver.

    Signed-off-by: Álvaro Fernández Rojas
    Reviewed-by: Philipp Zabel
    Reviewed-by: Florian Fainelli
    Link: https://lore.kernel.org/r/20200616173235.3473149-3-noltari@gmail.com
    Signed-off-by: Mark Brown

    Álvaro Fernández Rojas
     

02 Mar, 2020

1 commit

  • The purpose of commit 0fd85869c2a9 ("spi/bcm63xx-hsspi: keep pll clk enabled")
    was to keep the pll clk enabled through the lifetime of the device.

    In order to do that, some 'clk_prepare_enable()'/'clk_disable_unprepare()'
    calls have been added in the error handling path of the probe function, in
    the remove function and in the suspend and resume functions.

    However, a 'clk_disable_unprepare()' call has been unfortunately left in
    the probe function. So the commit seems to be more or less a no-op.

    Axe it now, so that the pll clk is left enabled through the lifetime of
    the device, as described in the commit.

    Fixes: 0fd85869c2a9 ("spi/bcm63xx-hsspi: keep pll clk enabled")
    Signed-off-by: Christophe JAILLET
    Acked-by: Jonas Gorski
    Link: https://lore.kernel.org/r/20200228213838.7124-1-christophe.jaillet@wanadoo.fr
    Signed-off-by: Mark Brown

    Christophe JAILLET
     

15 Oct, 2019

1 commit

  • For many places in the spi drivers, using the new `spi_transfer_delay`
    helper is straightforward.
    It's just replacing:
    ```
    if (t->delay_usecs)
    udelay(t->delay_usecs);
    ```
    with `spi_transfer_delay(t)` which handles both `delay_usecs` and the new
    `delay` field.

    This change replaces in all places (in the spi drivers) where this change
    is simple.

    Signed-off-by: Alexandru Ardelean
    Link: https://lore.kernel.org/r/20190926105147.7839-10-alexandru.ardelean@analog.com
    Signed-off-by: Mark Brown

    Alexandru Ardelean
     

05 Sep, 2019

1 commit


02 Aug, 2019

1 commit

  • We don't need dev_err() messages when platform_get_irq() fails now that
    platform_get_irq() prints an error message itself when something goes
    wrong. Let's remove these prints with a simple semantic patch.

    //
    @@
    expression ret;
    struct platform_device *E;
    @@

    ret =
    (
    platform_get_irq(E, ...)
    |
    platform_get_irq_byname(E, ...)
    );

    if ( \( ret < 0 \| ret

    While we're here, remove braces on if statements that only have one
    statement (manually).

    Cc: Mark Brown
    Cc: linux-spi@vger.kernel.org
    Cc: Greg Kroah-Hartman
    Signed-off-by: Stephen Boyd
    Link: https://lore.kernel.org/r/20190730181557.90391-42-swboyd@chromium.org
    Signed-off-by: Mark Brown

    Stephen Boyd
     

19 Sep, 2018

1 commit

  • If the pll clock needs to be enabled to get its rate, it will also need
    to be enabled to provide it. So ensure it is kept enabled through the
    lifetime of the device.

    Fixes: 0d7412ed1f5dc ("spi/bcm63xx-hspi: Enable the clock before calling clk_get_rate().")
    Signed-off-by: Jonas Gorski
    Signed-off-by: Mark Brown

    Jonas Gorski
     

26 Apr, 2018

1 commit

  • Enable the clock prior to calling clk_get_rate(), because clk_get_rate()
    should only be called if the clock is enabled.

    Additionally, prepare/enable the pll_clk before calling clk_get_rate()
    for the same reason.

    Found by Linux Driver Verification project (linuxtesting.org).

    Fixes: 142168eba9dc ("spi: bcm63xx-hsspi: add bcm63xx HSSPI driver")
    Signed-off-by: Stefan Potyra
    Signed-off-by: Mark Brown

    Stefan Potyra
     

04 Sep, 2017

1 commit


08 Aug, 2017

1 commit

  • platform_get_irq() returns an error code, but the spi-bcm63xx-hsspi
    driver ignores it and always returns -ENXIO. This is not correct and,
    prevents -EPROBE_DEFER from being propagated properly.

    Notice that platform_get_irq() no longer returns 0 on error:
    https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e330b9a6bb35dc7097a4f02cb1ae7b6f96df92af

    Print and propagate the return value of platform_get_irq on failure.

    This issue was detected with the help of Coccinelle.

    Signed-off-by: Gustavo A. R. Silva
    Signed-off-by: Mark Brown

    Gustavo A. R. Silva
     

17 Jul, 2017

1 commit


14 May, 2017

1 commit


13 Mar, 2017

2 commits


26 Aug, 2015

1 commit

  • Add support for dual read/writes on spi-bcm63xx-hsspi. This has been
    tested with a s25fl129p1 dual read capable spi flash, with a nice speed
    improvement:

    serial read:

    root@OpenWrt:/# time dd if=/dev/mtd4 of=/dev/null bs=8192
    2032+0 records in
    2032+0 records out
    real 0m 4.39s
    user 0m 0.00s
    sys 0m 1.55s

    dual read:

    root@OpenWrt:/# time dd if=/dev/mtd4 of=/dev/null bs=8192
    2032+0 records in
    2032+0 records out
    real 0m 3.09s
    user 0m 0.00s
    sys 0m 1.56s

    Signed-off-by: Jonas Gorski
    Signed-off-by: Mark Brown

    Jonas Gorski
     

20 Oct, 2014

1 commit


15 Apr, 2014

1 commit


30 Mar, 2014

1 commit


05 Mar, 2014

1 commit


10 Feb, 2014

1 commit


18 Dec, 2013

4 commits


10 Dec, 2013

1 commit

  • devm_request_and_ioremap() returns NULL on error, it doesn't return an
    ERR_PTR(). This patch fixes it by switching to devm_ioremap_resource()
    which is the prefered function anyway.

    Fixes: 142168eba9dc ('spi: bcm63xx-hsspi: add bcm63xx HSSPI driver')
    Signed-off-by: Dan Carpenter
    Acked-by: Jonas Gorski
    Signed-off-by: Mark Brown

    Dan Carpenter
     

04 Dec, 2013

1 commit