From: Greg KH <greg@kroah.com>
To: Brian King <brking@us.ibm.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: userspace pci config space accesses
Date: Fri, 30 Apr 2004 22:50:27 -0700 [thread overview]
Message-ID: <20040501055027.GI21431@kroah.com> (raw)
In-Reply-To: <40904E72.7020308@us.ibm.com>
On Wed, Apr 28, 2004 at 07:38:10PM -0500, Brian King wrote:
> Greg KH wrote:
> >>>What driver is doing this?
> >>
> >>The ipr driver, a scsi device driver for ppc64.
> >>
> >>http://marc.theaimsgroup.com/?l=linux-scsi&m=108144942527994&w=2
> >>
> >>The driver runs BIST at device initialization time to ensure that the
> >>device
> >>is in a clean state.
> >
> >
> >Ick. It sounds like "clean state" isn't always true if userspace can
> >mess the device up by simply reading its config space :)
>
> Yeah, its not so much the device, bus the way pSeries PCI bridges work.
> Other adapters would have the same problem, but after a quick grep it
> doesn't look like running BIST is a very common thing to do in most
> Linux drivers.
Not really.
> >Worse case thing, stop the whole machine while doing BIST if you want to
> >prevent this from happening (not that I'm actually suggesting you do it,
> >but if you really think it's the only way...)
>
> Yeah, mdelay(2000) kind of sticks out in a code review;)
And, as pointed out by others, will not work :)
> Two ideas I had would either be to create interfaces in the pci layer
> that a device driver could call to disable all pci adapter accesses and
> one to re-enable them. We could probably just make all pci accesses fail
> when disabled. These interfaces could then grab the lock and set the
> state on the pci_dev, then the read/write interfaces would check the
> state after acquiring the lock.
Ick, we currently don't keep track of the mapping of things to do this
very easily.
I don't know what to suggest.
Good luck,
greg k-h
prev parent reply other threads:[~2004-05-01 5:53 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-04-28 21:49 userspace pci config space accesses Brian King
2004-04-28 22:52 ` Greg KH
2004-04-28 23:26 ` Brian King
2004-04-28 23:38 ` Greg KH
2004-04-29 0:38 ` Brian King
2004-04-29 10:11 ` Arjan van de Ven
2004-05-01 5:50 ` Greg KH [this message]
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=20040501055027.GI21431@kroah.com \
--to=greg@kroah.com \
--cc=brking@us.ibm.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