From: Matthew Wilcox <matthew@wil.cx>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Brian King <brking@us.ibm.com>,
linux-pci@atrey.karlin.mff.cuni.cz, linux-pm@lists.osdl.org,
linux-kernel@vger.kernel.org, Greg KH <greg@kroah.com>,
Adam Belay <abelay@MIT.EDU>
Subject: Re: [PATCH] Block on access to temporarily unavailable pci device
Date: Wed, 18 Oct 2006 10:20:42 -0600 [thread overview]
Message-ID: <20061018162042.GT22289@parisc-linux.org> (raw)
In-Reply-To: <1161186652.9363.68.camel@localhost.localdomain>
On Wed, Oct 18, 2006 at 04:50:51PM +0100, Alan Cox wrote:
> Ar Mer, 2006-10-18 am 08:51 -0600, ysgrifennodd Matthew Wilcox:
> > The existing implementation of pci_block_user_cfg_access() was recently
> > criticised for providing out of date information and for returning errors
> > on write, which applications won't be expecting.
>
> It was also favoured by some of us as well. In addition this whole issue
> was extensively debated in the past to select the current approach. That
> said I do like the approach of a short wait *specifically* on power
> transitions, its bounded in time, its neat and it makes sense.
>
> We must be very very sure its never triggered in the real world any
> other way (eg your >block testing must be impossible)
Oh yes, absolutely. That's why I posted it with a Nacked-by.
> So unless you distinguish between "back in a moment", "back someday" and
> "not coming back" it isn't useful. Thus your patch is incomplete as it
> does not provide the cache that is also needed. At least I don't think X
> hanging forever mid mode switch is terribly useful...
I don't see how that's possible. If the driver forgets to call
pci_unblock_user_cfg_access(), that's a bug in the kernel driver.
The current user is limited to a two-second delay and the one I'm
proposing introducing is a delay measued in milli- or microseconds.
An extra two-second delay while you BIST your IPR device and change
modes in X at the same time (does X really scan all devices when it's
changing mode settings? That's odd) doesn't strike me as a huge failure.
> > I also addressed the potential issue with nested attempts to block.
> > Now pci_block_user_cfg_access() can return -EBUSY if it's already blocked,
> > and pci_unblock_user_cfg_access() will WARN if you try to unblock an
> > already unblocked device.
>
> Gak that is IMHO a mistake. Just keep a counter. You've just added
> another "what the hell do I do if this returns -EBUSY" problem for all
> the driver authors.
You fail the operation if it returns busy. Or you loop. It's really up
to you, the driver author. You know what operation you're trying to do,
you know what makes more sense.
> NAK for all the above reasons. This is a cure looking for a disease, and
> its a cure which is worse than the theoretical disease it wants to fix.
Absolutely not. It's an attempt to solve a tricky problem. Devfs, now
there was a cure looking for a disease.
It seemed to me there was consensus that blocking was a better approach
than returning a cached value or returning an error. If we're
decided that returning a cached value is the better approach, then
the patch to fix it is trivial; move the pci_set_state() call from the
pci_block_user_cfg_access() function to the IPR driver. Done and dusted.
next prev parent reply other threads:[~2006-10-18 16:20 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-17 14:51 [PATCH] Block on access to temporarily unavailable pci device Matthew Wilcox
2006-10-17 14:54 ` Matthew Wilcox
2006-10-17 21:25 ` Brian King
2006-10-18 14:38 ` [linux-pm] " Alan Stern
2006-10-18 14:51 ` Matthew Wilcox
2006-10-18 15:52 ` Alan Stern
2006-10-18 16:05 ` Alan Cox
2006-10-18 16:09 ` Matthew Wilcox
2006-10-18 16:42 ` Alan Cox
2006-10-18 14:51 ` Matthew Wilcox
2006-10-18 14:57 ` Matthew Wilcox
2006-10-18 15:12 ` Nick Piggin
2006-10-18 15:16 ` Matthew Wilcox
2006-10-18 15:27 ` Nick Piggin
2006-10-18 15:50 ` Alan Cox
2006-10-18 16:20 ` Matthew Wilcox [this message]
2006-10-18 16:39 ` Alan Cox
2006-10-18 17:14 ` Matthew Wilcox
2006-10-19 15:41 ` [PATCH] Block on access to temporarily unavailable pci device [version 3] Matthew Wilcox
2006-10-19 16:32 ` Alan Cox
2006-10-19 23:13 ` Adam Belay
2006-10-19 23:51 ` Greg KH
2006-10-20 21:50 ` Brian King
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=20061018162042.GT22289@parisc-linux.org \
--to=matthew@wil.cx \
--cc=abelay@MIT.EDU \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=brking@us.ibm.com \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@atrey.karlin.mff.cuni.cz \
--cc=linux-pm@lists.osdl.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