From: Evan Lavelle <sa212+lkml@cyconix.com>
To: LKML <linux-kernel@vger.kernel.org>
Subject: Kernel deferring driver 'close' call: workaround?
Date: Wed, 26 Jan 2011 12:48:36 +0000 [thread overview]
Message-ID: <4D401824.6090109@cyconix.com> (raw)
I've written a PCIe driver for a specialist card, which can only have a
single user ('open' returns EBUSY if the board is already open). A user
has complained that they can't do this with the card:
1 - open() // Ok
2 - close()
3 - open() // fails
'strace' shows that the 'close' succeeds, but the driver debug output
shows that the driver close/release (step 2) is not called before the
next open (step 3), so the open fails.
I appreciate that the kernel may want to defer the driver 'close', even
though the open count is only 1. However, I'm surprised that the kernel
calls the driver open code at step (3) without first calling the
deferred close from step (2).
Is this expected behaviour? If so, can anyone suggest a work-around, at
either driver or user level?
Thanks.
next reply other threads:[~2011-01-26 13:10 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-26 12:48 Evan Lavelle [this message]
2011-01-26 13:17 ` Kernel deferring driver 'close' call: workaround? Alan Cox
2011-01-26 14:29 ` Evan Lavelle
2011-01-26 14:38 ` Alan Cox
2011-01-26 15:29 ` Evan Lavelle
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=4D401824.6090109@cyconix.com \
--to=sa212+lkml@cyconix.com \
--cc=linux-kernel@vger.kernel.org \
/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