All of lore.kernel.org
 help / color / mirror / Atom feed
* PATCH 2.5.x disable BAR when sizing
@ 2002-12-19 21:37 Grant Grundler
  2002-12-20  2:54 ` Alan Cox
  2002-12-20  5:57 ` Linus Torvalds
  0 siblings, 2 replies; 79+ messages in thread
From: Grant Grundler @ 2002-12-19 21:37 UTC (permalink / raw)
  To: mj; +Cc: linux-kernel, turukawa


Martin,
In April 2002, turukawa@icc.melco.co.jp sent a 2.4.x patch to disable
BARs while the BARs were being sized.  I've "forward ported" this patch
to 2.5.x (appended).  turukawa's excellent problem description and
original posting are here:
	https://lists.linuxia64.org/archives//linux-ia64/2002-April/003302.html

David Mosberger agrees this is an "obvious fix".
We've been using this in the ia64 2.4 code stream since about August.

thanks,
grant


Index: drivers/pci/probe.c
===================================================================
RCS file: /var/cvs/linux-2.5/drivers/pci/probe.c,v
retrieving revision 1.2
diff -u -p -r1.2 probe.c
--- drivers/pci/probe.c	9 Oct 2002 20:42:57 -0000	1.2
+++ drivers/pci/probe.c	17 Dec 2002 21:53:14 -0000
@@ -48,6 +48,12 @@ static void pci_read_bases(struct pci_de
 	unsigned int pos, reg, next;
 	u32 l, sz;
 	struct resource *res;
+	u16 cmd;
+
+	/* Disable I/O & memory decoding while we size the BARs. */
+	pci_read_config_word(dev, PCI_COMMAND, &cmd);
+	pci_write_config_word(dev, PCI_COMMAND,
+		cmd & ~(PCI_COMMAND_IO | PCI_COMMAND_MEMORY));
 
 	for(pos=0; pos<howmany; pos = next) {
 		next = pos+1;
@@ -114,6 +120,8 @@ static void pci_read_bases(struct pci_de
 		}
 		res->name = dev->name;
 	}
+
+	pci_write_config_word(dev, PCI_COMMAND, cmd);
 }
 
 void __devinit pci_read_bridge_bases(struct pci_bus *child)

^ permalink raw reply	[flat|nested] 79+ messages in thread
* Re: [patch 2.5] PCI: allow alternative methods for probing the BARs
@ 2003-01-06 10:31 Benjamin Herrenschmidt
  0 siblings, 0 replies; 79+ messages in thread
From: Benjamin Herrenschmidt @ 2003-01-06 10:31 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Ivan Kokshaysky, Paul Mackerras, Eric W. Biederman, davidm,
	grundler, linux-kernel

On Mon, 2003-01-06 at 05:14, Linus Torvalds wrote:

> Alternatively, we could even have a very limited phase #1 that only 
> enumerates _reachable_ devices (ie it doesn't even try to create bus 
> numbers, it only enumerates devices and buses that have already been set 
> up by the firmware, and ignores bridges that aren't set up yet). A pure 
> discovery phase, without any configuration at all.

That would only work for cases where the kernel isn't responsible for
the actual bus numbering/renumbering. For example, since we do not quite
deal with PCI domains yet, I have to force pcibios_assign_all_busses()
on pmac so that my 3 root busses get re-numbered (else I get 3 trees
with conflicting bus numbers all starting at 0). Another case is embedded
which can deal with completely unassigned bus numbers.

Ben.


^ permalink raw reply	[flat|nested] 79+ messages in thread

end of thread, other threads:[~2003-01-14 16:34 UTC | newest]

Thread overview: 79+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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
  -- strict thread matches above, loose matches on Subject: below --
2003-01-06 10:31 [patch 2.5] PCI: allow alternative methods for probing the BARs Benjamin Herrenschmidt

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.