From: Mark Brown <broonie@kernel.org>
To: Lukasz Majewski <lukma@denx.de>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>,
Colin Ian King <colin.king@canonical.com>,
linux-spi <linux-spi@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: spi: Add call to spi_slave_abort() function when spidev driver is released
Date: Thu, 26 Sep 2019 08:17:52 -0700 [thread overview]
Message-ID: <20190926151752.GU2036@sirena.org.uk> (raw)
In-Reply-To: <20190926160645.0a2623fa@jawa>
[-- Attachment #1: Type: text/plain, Size: 1278 bytes --]
On Thu, Sep 26, 2019 at 04:06:45PM +0200, Lukasz Majewski wrote:
> > On Thu, Sep 26, 2019 at 2:49 PM Lukasz Majewski <lukma@denx.de> wrote:
> > > The question is if we shall call the spi_slave_abort() when
> > > cleaning up spi after releasing last reference, or each time
> > > release callback is called ?
> > TBH, I don't know. Is it realistic that there are multiple opens?
> I'm using on my setup only one test program to use /dev/spidevX.Y and
> /dev/spidevA.B (loopback with wired connection).
> However, you also shall be able to connect via ssh and run the same
> setup in parallel...
It doesn't seem entirely realistic, but I can imagine cases like
fork()/exec() where we end up with two copies of the file open
but end up immediately closing one.
> > That means the abort is called only for the last user.
> > And only if the underlying device still exists. Which means that if
> > it has disappeared (how can that happen? spidev unbind?),
> In my case, I just disconnect some SPI signals and the test program
> just hangs. I do need to ctrl+c to stop it (or use timeout).
> From my debugging the .release callback is called each time the program
> is aborted (either with ctrl+c or timeout).
Should be on file close IIRC.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2019-09-26 15:17 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-26 10:00 spi: Add call to spi_slave_abort() function when spidev driver is released Colin Ian King
2019-09-26 10:14 ` Lukasz Majewski
2019-09-26 10:15 ` Colin Ian King
2019-09-26 10:32 ` Geert Uytterhoeven
2019-09-26 12:49 ` Lukasz Majewski
2019-09-26 13:51 ` Geert Uytterhoeven
2019-09-26 14:06 ` Lukasz Majewski
2019-09-26 15:17 ` Mark Brown [this message]
2019-09-26 22:38 ` Lukasz Majewski
2019-10-07 17:02 ` Mark Brown
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=20190926151752.GU2036@sirena.org.uk \
--to=broonie@kernel.org \
--cc=colin.king@canonical.com \
--cc=geert@linux-m68k.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).