[lkml]   [2019]   [Dec]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    Patch in this message
    Subject[PATCH AUTOSEL 4.14 005/130] spi: Add call to spi_slave_abort() function when spidev driver is released
    From: Lukasz Majewski <>

    [ Upstream commit 9f918a728cf86b2757b6a7025e1f46824bfe3155 ]

    This change is necessary for spidev devices (e.g. /dev/spidev3.0) working
    in the slave mode (like NXP's dspi driver for Vybrid SoC).

    When SPI HW works in this mode - the master is responsible for providing
    CS and CLK signals. However, when some fault happens - like for example
    distortion on SPI lines - the SPI Linux driver needs a chance to recover
    from this abnormal situation and prepare itself for next (correct)

    This change doesn't pose any threat on drivers working in master mode as
    spi_slave_abort() function checks if SPI slave mode is supported.

    Signed-off-by: Lukasz Majewski <>
    Signed-off-by: Mark Brown <>
    Reported-by: kbuild test robot <>
    Signed-off-by: Mark Brown <>
    Signed-off-by: Sasha Levin <>
    drivers/spi/spidev.c | 3 +++
    1 file changed, 3 insertions(+)

    diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c
    index c5fe08bc34a0a..028725573e632 100644
    --- a/drivers/spi/spidev.c
    +++ b/drivers/spi/spidev.c
    @@ -634,6 +634,9 @@ static int spidev_release(struct inode *inode, struct file *filp)
    if (dofree)
    +#ifdef CONFIG_SPI_SLAVE
    + spi_slave_abort(spidev->spi);

    return 0;
     \ /
      Last update: 2019-12-10 23:14    [W:4.563 / U:0.100 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site