All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: brking@us.ibm.com, Greg KH <greg@kroah.com>,
	Paul Mackerras <paulus@samba.org>,
	Linux Kernel list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/2] pci: Block config access during BIST
Date: Sat, 20 Nov 2004 18:09:27 +1100	[thread overview]
Message-ID: <1100934567.3669.12.camel@gaston> (raw)
In-Reply-To: <1100917635.9398.12.camel@localhost.localdomain>


> Even better, put that code in your private debug tree. Replace the
> locked cases with BUG() and fix the driver to get its internal locking
> right in this situation.
> 
> It seems wrong to put expensive checks in core code paths when you could
> just as easily provide
> 
> 	my_device_is_stupid_pci_read_config_byte()
> 
> and equivalent lock taking functions that wrap the existing ones and are
> locked against the reset path without hurting sane computing devices
> (and PC's).

Unfortunately, Alan, the cases where it matters aren't a driver with bad
locking or some something that can be fixed at the driver level. There
are already 2 uses of the above:

 - The device he's working on, which sometimes need to trigger a BIST
(built-in self test). During this operation, the device stops responding
on the PCI bus, which can be sort-of fatal if anything (userland playing
with /sys/bus/pci/* for example) touches the config space.

 - On Macs, I can turn the clock of some PCI devices on/off for power
management (and I do). However, when such a device is powered off, it
will not respond to config cycles neither, resulting in all-1's reads on
some HW setups or even in deadlock iirc on the G5. We need to "cloack"
them properly while the kernel still has the pci_dev entry for them
since they are just locally power managed by their driver , while
retaining userland visibility in /proc/pci or /sysfs or things like
kudzu stops finding them.

Also, the "Mac" case here (power management) is something I've seen
doable in a variety of embedded setups.

I would add: Config space accesses are slow anyways. They are even
horribly slow. They are worse than IO accesses. I _VERY_MUCH_ doubt that
a test of a variable member of pci_dev like the above would have any
noticeable impact here.

Ben.
 


  reply	other threads:[~2004-11-20  7:11 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-19 20:23 [PATCH 1/2] pci: Block config access during BIST brking
2004-11-19 21:32 ` Greg KH
2004-11-19 22:25   ` Brian King
2004-11-19 22:46     ` Benjamin Herrenschmidt
2004-11-19 23:22       ` Brian King
2004-11-20  0:23         ` Benjamin Herrenschmidt
2004-11-19 22:45   ` Benjamin Herrenschmidt
2004-11-20  2:27 ` Alan Cox
2004-11-20  7:09   ` Benjamin Herrenschmidt [this message]
2004-11-20 12:42     ` Alan Cox
2004-11-20 22:32       ` Benjamin Herrenschmidt
2004-11-20 23:38       ` Brian King
2004-11-21  0:06         ` Benjamin Herrenschmidt
2004-11-21  1:55           ` Brian King
2004-11-21  7:03             ` Benjamin Herrenschmidt
2004-11-21 17:22               ` Brian King
2004-12-03 15:26                 ` Brian King
2004-11-24 11:49         ` Alan Cox
2004-11-25 22:00       ` Paul Mackerras
2004-11-25 21:11         ` Alan Cox

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=1100934567.3669.12.camel@gaston \
    --to=benh@kernel.crashing.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=brking@us.ibm.com \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulus@samba.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 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.