All of lore.kernel.org
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Lukasz Majewski <lukma@denx.de>
Cc: Mark Brown <broonie@kernel.org>,
	linux-spi <linux-spi@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Krzysztof Kozlowski <krzk@kernel.org>
Subject: Re: [PATCH 1/2] spi: Add call to spi_slave_abort() function when spidev driver is released
Date: Thu, 26 Sep 2019 08:52:48 +0200	[thread overview]
Message-ID: <CAMuHMdXseZppE74D8XW=5ZWNNNLXZFLTSiqqe_qoZ8C1rAFQSg@mail.gmail.com> (raw)
In-Reply-To: <20190924110547.14770-2-lukma@denx.de>

Hi Lukasz,

On Thu, Sep 26, 2019 at 3:33 AM Lukasz Majewski <lukma@denx.de> wrote:
> 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)
> transmission.
>
> 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 <lukma@denx.de>

Thanks for your patch!

Yesterday I saw this appear on spi/for-next, but I couldn't find the
email in my mbox.  Today it has arrived. Looks like gmail had some troubles
("Delivered after 138401 seconds", ugh).

> --- a/drivers/spi/spidev.c
> +++ b/drivers/spi/spidev.c
> @@ -627,6 +627,7 @@ static int spidev_release(struct inode *inode, struct file *filp)
>                 if (dofree)
>                         kfree(spidev);
>         }
> +       spi_slave_abort(spidev->spi);

Looks good to me.  Just wondering if this should be done for the last user only,
i.e. in the "if" block above, like resetting speed_hz?

>         mutex_unlock(&device_list_lock);
>
>         return 0;

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

  parent reply	other threads:[~2019-09-26  6:53 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-24 11:05 [PATCH 0/2] spi: Fix problem with interrupted slave transmission Lukasz Majewski
2019-09-24 11:05 ` [PATCH 1/2] spi: Add call to spi_slave_abort() function when spidev driver is released Lukasz Majewski
2019-09-24 20:08   ` Applied "spi: Add call to spi_slave_abort() function when spidev driver is released" to the spi tree Mark Brown
2019-09-24 20:08     ` Mark Brown
2019-09-26  6:52   ` Geert Uytterhoeven [this message]
2019-09-26  7:59     ` [PATCH 1/2] spi: Add call to spi_slave_abort() function when spidev driver is released Lukasz Majewski
2019-09-24 11:05 ` [PATCH 2/2] spi: Introduce dspi_slave_abort() function for NXP's dspi SPI driver Lukasz Majewski
2019-10-01 11:41   ` Applied "spi: Introduce dspi_slave_abort() function for NXP's dspi SPI driver" to the spi tree Mark Brown
2019-10-01 11:41     ` Mark Brown
2019-09-25  9:11 ` [PATCH v2 0/2] spi: Fix problem with interrupted slave transmission Lukasz Majewski
2019-09-25  9:11   ` [PATCH v2 1/2] spi: Add call to spi_slave_abort() function when spidev driver is released Lukasz Majewski
2019-09-25 16:45     ` Mark Brown
2019-09-25 19:57       ` Lukasz Majewski
2019-09-25 16:47     ` Applied "spi: Add call to spi_slave_abort() function when spidev driver is released" to the spi tree Mark Brown
2019-09-25 16:47       ` Mark Brown
2019-09-25  9:11   ` [PATCH v2 2/2] spi: Introduce dspi_slave_abort() function for NXP's dspi SPI driver Lukasz Majewski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAMuHMdXseZppE74D8XW=5ZWNNNLXZFLTSiqqe_qoZ8C1rAFQSg@mail.gmail.com' \
    --to=geert@linux-m68k.org \
    --cc=broonie@kernel.org \
    --cc=krzk@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=lukma@denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.