public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: grundler@cup.hp.com (Grant Grundler)
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: mj@ucw.cz,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	turukawa@icc.melco.co.jp, ink@jurassic.park.msu.ru,
	torvalds@transmeta.com, grundler@cup.hp.com
Subject: Re: PATCH 2.5.x disable BAR when sizing
Date: Fri, 20 Dec 2002 11:50:31 -0800	[thread overview]
Message-ID: <20021220195031.GC21823@cup.hp.com> (raw)
In-Reply-To: <1040352868.30778.12.camel@irongate.swansea.linux.org.uk>

On Fri, Dec 20, 2002 at 02:54:28AM +0000, Alan Cox wrote:
> Nothing says your memory can't be behind the bridge and you just turned
> memory access off. Whoops bang, game over.
> And yes this happens on some PC class systems.

ugh. very poor design.
Can someone send URL or old mail describing such a broken system?
(or point me at previous attempts to submit this patch?)

I'm not able to narrow down the search to a reasonable number
of useful keywords.


I agree the patch I posted isn't ready.
But I have a real problem to solve on real HW.

I've tried to catchup with lkml postings via an archive:

Linux Torvalds wrote:
| Think about it: if you move the BAR to high memory, you basically disable 
| only _that_ bar, and nothing else. You don't clobber any other associated 
| functions, or anything like that.

That's exactly the problem on ia64 - it does.
Could this also be a problem on i386 that we just haven't noticed yet?

Original problem report says:
> In this case, the video device gets 64MB memory space from 0xFC000000 to 
> 0xFFFFFFFF improperly, and it conflicts with System reserve region
> (0xFCxxxxxx - 0xFExxxxxx) for SAPIC interrupt messages.
> After that the video device reacts to an SAPIC interrupt improperly.

(https://lists.linuxia64.org/archives//linux-ia64/2002-April/003302.html)

One of my boxes with serverworks chips + Foster CPU (1.6Ghz) also
has SAPIC and /proc/iomem shows:
...
fec00000-fec0ffff : reserved
fee00000-fee00fff : reserved
fff80000-ffffffff : reserved


and later:
| Ivan pointed out that it also disables things like VGA legacy registers. 

I expect disabling VGA is only a problem for debugging PCI code.
Is that the only thing that outputs for the duration we have things disabled?
Anyway, I've been there (debugging code crashes the box) and don't want
to go there again.

| It will disable IDE legacy registers too, btw. I'd also expect it to 
| disable IDE DMA access, so if you happen to be trying to probe the BAR's 
| after somebody started IO on the IDE, you just made that IO fail 
| spectacularly, and I'd not be surprised if the IDE controller just locked 
| up as a result. 

We aren't clearing PCI_COMMAND_MASTER.
I would expect DMA to continue working.
But some chip sets could be broken in this way too...


| Let me re-iterate the "turn power off at the master switch in a house when 
| switching a light bulb" analogy. Yes, it's a good idea if you are nervous, 
| but you do that only when you _know_ who is in the house and you know what 
| they are doing and it's ok by them. 

The PCI subsystem does know "who is in the house and what they are doing".
We currently never probe active devices. PCI bridges complicate the
picture since the definition of "active" has to include downstream devices.
I would like to determine "active" (or a reasonable approximation)
and only disable PCI_COMMAND_IO/PCI_COMMAND_MEMORY when it's clearly
safe to do so. I'll resubmit if I can figure out an appropriate test.


Ivan Kokshaysky wrote:
| I don't think that generic BAR probing is ever avoidable - too often 
| it's the only way to build a consistent resource tree. Without that 
| the driver cannot know whether the BAR setting is safe or there is a 
| conflict with something else. 

I agree.

| Anyway, in the short term we could give the architecture ability to use its 
| own probing code, something like this: 

An arch specific hook might be useful.
But how about letting the arch decide if it's safe to disable a device?
ie don't replicate the rest of the code in pci_read_bases() in
the arch that needs to disable the device.
It's very similar to what Ivan proposed.

thanks,
grant

  parent reply	other threads:[~2002-12-20 19:42 UTC|newest]

Thread overview: 78+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-19 21:37 PATCH 2.5.x disable BAR when sizing Grant Grundler
2002-12-20  2:54 ` Alan Cox
2002-12-20  2:27   ` David Mosberger
2002-12-20  6:05     ` Linus Torvalds
2002-12-20 19:50   ` Grant Grundler [this message]
2002-12-20 20:14     ` Linus Torvalds
2002-12-20 21:22       ` Grant Grundler
2002-12-21 18:34       ` Maciej W. Rozycki
2002-12-20 20:37     ` Richard B. Johnson
2002-12-20 21:29       ` Grant Grundler
2002-12-20  5:57 ` Linus Torvalds
2002-12-20  9:42   ` David Mosberger
2002-12-20 12:53     ` Ivan Kokshaysky
2002-12-20 17:05     ` Linus Torvalds
2002-12-20 18:26       ` David Mosberger
2002-12-20 19:28         ` Linus Torvalds
2002-12-21 22:06         ` Eric W. Biederman
2002-12-21 22:44           ` Linus Torvalds
2002-12-22  7:15             ` Paul Mackerras
2002-12-22 15:03               ` Benjamin Herrenschmidt
2002-12-22 19:21                 ` Ivan Kokshaysky
2002-12-23  0:29                   ` Paul Mackerras
2002-12-23 15:26                     ` Ivan Kokshaysky
2003-01-05 12:37                     ` [patch 2.5] PCI: allow alternative methods for probing the BARs Ivan Kokshaysky
2003-01-06  0:29                       ` Anton Blanchard
2003-01-06  4:14                       ` Linus Torvalds
2003-01-06  5:22                         ` Eric W. Biederman
2003-01-06 10:31                         ` Benjamin Herrenschmidt
2003-01-06 11:32                           ` Andrew Walrond
2003-01-06 22:01                             ` Grant Grundler
2003-01-06 19:45                           ` Grant Grundler
2003-01-07 17:05                             ` Ivan Kokshaysky
2003-01-07 17:46                               ` Linus Torvalds
2003-01-07 20:17                               ` Grant Grundler
2003-01-08 14:47                                 ` Ivan Kokshaysky
2003-01-08 22:34                                   ` Grant Grundler
2003-01-06 15:33                         ` Ivan Kokshaysky
2003-01-06 21:52                           ` Grant Grundler
2003-01-06 23:19                             ` Linus Torvalds
2003-01-07  0:13                               ` Grant Grundler
2003-01-07 12:33                                 ` Alan Cox
2003-01-07 17:27                                   ` Ivan Kokshaysky
2003-01-07 18:46                                     ` Alan Cox
2003-01-07 17:44                                   ` Linus Torvalds
2003-01-08 16:55                                     ` Ivan Kokshaysky
2003-01-09 17:46                                     ` [patch 2.5] 2-pass PCI probing, generic part Ivan Kokshaysky
2003-01-09 17:52                                       ` Benjamin Herrenschmidt
2003-01-09 22:09                                         ` Ivan Kokshaysky
2003-01-09 22:16                                           ` Linus Torvalds
2003-01-09 22:26                                             ` Benjamin Herrenschmidt
2003-01-10  3:49                                               ` Alan Cox
2003-01-09 23:19                                             ` Ivan Kokshaysky
2003-01-09 23:35                                               ` Linus Torvalds
2003-01-10  1:09                                                 ` Grant Grundler
2003-01-10  7:56                                                   ` Eric W. Biederman
2003-01-10 19:00                                                     ` Grant Grundler
2003-01-10 21:42                                                       ` Ivan Kokshaysky
2003-01-10 23:07                                                         ` Grant Grundler
2003-01-11 19:39                                                         ` Scott Murray
2003-01-12  7:19                                                           ` Greg KH
2003-01-13  6:28                                                             ` Scott Murray
2003-01-10 13:35                                                 ` Ivan Kokshaysky
2003-01-14 16:39                                                   ` Ivan Kokshaysky
2003-01-09 18:36                                       ` David Mosberger
2003-01-09 19:52                                       ` Grant Grundler
2003-01-09 22:40                                         ` Ivan Kokshaysky
2003-01-09 17:48                                     ` [patch 2.5] 2-pass PCI probing, hotplug changes Ivan Kokshaysky
2003-01-09 17:51                                     ` [patch 2.5] 2-pass PCI probing, i386 USB quirk Ivan Kokshaysky
2003-01-07 17:12                                 ` [patch 2.5] PCI: allow alternative methods for probing the BARs Ivan Kokshaysky
2003-01-07 17:06                             ` Ivan Kokshaysky
2002-12-22 19:51               ` PATCH 2.5.x disable BAR when sizing Linus Torvalds
2002-12-22 19:57                 ` Eric W. Biederman
2002-12-22 10:38             ` Eric W. Biederman
2002-12-22 18:39               ` Ivan Kokshaysky
2002-12-22 19:47                 ` Eric W. Biederman
2002-12-22 21:05                   ` Ivan Kokshaysky
2002-12-20 18:50       ` Ivan Kokshaysky
2002-12-20 19:11         ` Linus Torvalds

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=20021220195031.GC21823@cup.hp.com \
    --to=grundler@cup.hp.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=ink@jurassic.park.msu.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mj@ucw.cz \
    --cc=torvalds@transmeta.com \
    --cc=turukawa@icc.melco.co.jp \
    /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