mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* 2.6.13-rc2 hangs at boot
@ 2005-07-06 13:47 Tero Roponen
  2005-07-07  1:27 ` Jon Smirl
  0 siblings, 1 reply; 24+ messages in thread
From: Tero Roponen @ 2005-07-06 13:47 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel

Hi,

my computer (a ThinkPad 380XD laptop) hangs at boot in 2.6.13-rc2.
When I revert the patch below everything seems to be fine.

thanks,
Tero Roponen


Patch to revert:

Author: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Date: Wed, 15 Jun 2005 14:59:27 +0000 (+0400)
Source: http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=299de0343c7d18448a69c635378342e9214b14af

  [PATCH] PCI: pci_assign_unassigned_resources() on x86

  - Add sanity check for io[port,mem]_resource in setup-bus.c. These
    resources look like "free" as they have no parents, but obviously
    we must not touch them.
  - In i386.c:pci_allocate_bus_resources(), if a bridge resource cannot be
    allocated for some reason, then clear its flags. This prevents any child
    allocations in this range, so the setup-bus code will work with a clean
    resource sub-tree.
  - i386.c:pcibios_enable_resources() doesn't enable bridges, as it checks
    only resources 0-5, which looks like a clear bug to me. I suspect it
    might break hotplug as well in some cases.

  From: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
  Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

--- a/arch/i386/pci/common.c
+++ b/arch/i386/pci/common.c
@@ -165,6 +165,7 @@ static int __init pcibios_init(void)
 	if ((pci_probe & PCI_BIOS_SORT) && !(pci_probe & PCI_NO_SORT))
 		pcibios_sort();
 #endif
+	pci_assign_unassigned_resources();
 	return 0;
 }

--- a/arch/i386/pci/i386.c
+++ b/arch/i386/pci/i386.c
@@ -106,11 +106,16 @@ static void __init pcibios_allocate_bus_
 		if ((dev = bus->self)) {
 			for (idx = PCI_BRIDGE_RESOURCES; idx < PCI_NUM_RESOURCES; idx++) {
 				r = &dev->resource[idx];
-				if (!r->start)
+				if (!r->flags)
 					continue;
 				pr = pci_find_parent_resource(dev, r);
-				if (!pr || request_resource(pr, r) < 0)
+				if (!r->start || !pr || request_resource(pr, r) < 0) {
 					printk(KERN_ERR "PCI: Cannot allocate resource region %d of bridge %s\n", idx, pci_name(dev));
+					/* Something is wrong with the region.
+					   Invalidate the resource to prevent child
+					   resource allocations in this range. */
+					r->flags = 0;
+				}
 			}
 		}
 		pcibios_allocate_bus_resources(&bus->children);
@@ -227,7 +232,7 @@ int pcibios_enable_resources(struct pci_

 	pci_read_config_word(dev, PCI_COMMAND, &cmd);
 	old_cmd = cmd;
-	for(idx=0; idx<6; idx++) {
+	for(idx = 0; idx < PCI_NUM_RESOURCES; idx++) {
 		/* Only set up the requested stuff */
 		if (!(mask & (1<<idx)))
 			continue;
--- a/drivers/pci/setup-bus.c
+++ b/drivers/pci/setup-bus.c
@@ -273,6 +273,8 @@ find_free_bus_resource(struct pci_bus *b

 	for (i = 0; i < PCI_BUS_NUM_RESOURCES; i++) {
 		r = bus->resource[i];
+		if (r == &ioport_resource || r == &iomem_resource)
+			continue;
 		if (r && (r->flags & type_mask) == type && !r->parent)
 			return r;
 	}

^ permalink raw reply	[flat|nested] 24+ messages in thread
* Re: 2.6.14-rc4: dma_timer_expiry [was 2.6.13-rc2 hangs at boot]
@ 2005-07-29 13:24 Mikael Pettersson
  0 siblings, 0 replies; 24+ messages in thread
From: Mikael Pettersson @ 2005-07-29 13:24 UTC (permalink / raw)
  To: akpm, teanropo; +Cc: gregkh, ink, jonsmirl, linux-kernel

On Fri, 29 Jul 2005 11:35:09 +0300 (EEST), Tero Roponen wrote:
>On Fri, 29 Jul 2005, Andrew Morton wrote:
>
>> Tero Roponen <teanropo@cc.jyu.fi> wrote:
>> >
>> > Hi,
>> >
>> > I just tested 2.6.13-rc4. At boot it prints:
>> > "dma_timer_expiry: dma status == 0x61" many times.
>> > That's the same problem as in 2.6.13-rc2.
>> >
>> > If I apply the following patch, everything seems to be fine.
>> > I'm not sure if this is the right thing to do, but it works for me.
>> >
>> > -
>> > Tero Roponen
>> >
>> >
>> > --- 2.6.13-rc2/drivers/pci/setup-bus.c	Thu Jul  7 01:32:43 2005
>> > +++ linux/drivers/pci/setup-bus.c	Fri Jul  8 10:25:20 2005
>> > @@ -40,8 +40,8 @@
>> >   * FIXME: IO should be max 256 bytes.  However, since we may
>> >   * have a P2P bridge below a cardbus bridge, we need 4K.
>> >   */
>> > -#define CARDBUS_IO_SIZE		(4096)
>> > -#define CARDBUS_MEM_SIZE	(32*1024*1024)
>> > +#define CARDBUS_IO_SIZE		(256)
>> > +#define CARDBUS_MEM_SIZE	(32*1024*1024)
>> >
>>
>> hm, how did you come up with that fix?  Those numbers have been like that
>> since forever.
>>
>> What's the latest 2.6 kernel which worked OK?
>>
>> Would it be possible for you to generate the `dmesg -s 100000' output for
>> both good and bad kernels, see what the differences are?
>>
>> Thanks.
>
>Hi,
>
>that patch was from Ivan Kokshaysky (http://lkml.org/lkml/2005/7/8/25)
>
>My original report is here: http://lkml.org/lkml/2005/7/6/174

The PCI changes in 2.6.13-rc2 caused a number of machines to
hang at boot, including my Athlon64 laptop. It was found that
reducing CARDBUS_IO_SIZE to 256 eliminated the hangs.

The LKML archives have the details.

/Mikael

^ permalink raw reply	[flat|nested] 24+ messages in thread
* Re: 2.6.14-rc4: dma_timer_expiry [was 2.6.13-rc2 hangs at boot]
@ 2005-08-02 15:34 Mikael Pettersson
  0 siblings, 0 replies; 24+ messages in thread
From: Mikael Pettersson @ 2005-08-02 15:34 UTC (permalink / raw)
  To: akpm, ink; +Cc: gregkh, jonsmirl, linux-kernel, teanropo

On Mon, 1 Aug 2005 11:22:45 +0400, Ivan Kokshaysky wrote:
> On Fri, Jul 29, 2005 at 02:39:21AM -0700, Andrew Morton wrote:
> > Tero Roponen <teanropo@cc.jyu.fi> wrote:
> > > My original report is here: http://lkml.org/lkml/2005/7/6/174
> > 
> > I see.  Ivan, do we know what's going on here?
> 
> Sort of. The 4K cardbus windows are working fine for non-x86
> architectures where all IO resources are usually well known
> and added to the resource tree properly.
> However, on x86 there are sometimes "hidden" system IO port
> ranges that aren't reported by BIOS, so the large (4K) cardbus
> windows overlap these ranges.
> 
> Actually I don't like reducing CARDBUS_IO_SIZE to 256 bytes, because
> we lose an ability to handle cards with built-in p2p bridges (which
> require 4K for IO), plus it won't fix Sony VAIO problem.
> 
> Tero and Mikael, can you try this one-liner instead?
> 
> Ivan.
> 
> --- 2.6.13-rc4/include/asm-i386/pci.h	Sun Jul 31 14:32:09 2005
> +++ linux/include/asm-i386/pci.h	Mon Aug  1 08:29:18 2005
> @@ -18,7 +18,7 @@ extern unsigned int pcibios_assign_all_b
>  #define pcibios_scan_all_fns(a, b)	0
>  
>  extern unsigned long pci_mem_start;
> -#define PCIBIOS_MIN_IO		0x1000
> +#define PCIBIOS_MIN_IO		0x2000
>  #define PCIBIOS_MIN_MEM		(pci_mem_start)
>  
>  #define PCIBIOS_MIN_CARDBUS_IO	0x4000

No joy. 2.6.13-rc5 vanilla + this patch still hangs my laptop
during boot. So far only the CARDBUS_IO_SIZE reduction patch
avoids the hang during boot regression 2.6.13-rc2 introduced.

I can send lspci & /proc/ioports if you think that might help.

/Mikael

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

end of thread, other threads:[~2005-08-04 20:51 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-07-06 13:47 2.6.13-rc2 hangs at boot Tero Roponen
2005-07-07  1:27 ` Jon Smirl
2005-07-07  9:59   ` Ivan Kokshaysky
2005-07-07 10:33     ` Tero Roponen
2005-07-07 12:31       ` Ivan Kokshaysky
2005-07-07 12:47         ` Tero Roponen
2005-07-07 13:41           ` Ivan Kokshaysky
2005-07-07 13:53             ` Tero Roponen
2005-07-07 14:13             ` Tero Roponen
2005-07-08  6:28               ` Ivan Kokshaysky
2005-07-08  7:57                 ` [SOLVED] " Tero Roponen
2005-07-08  9:19                   ` Ivan Kokshaysky
2005-07-08  9:38                     ` Tero Roponen
2005-07-08  9:45                       ` Ivan Kokshaysky
2005-07-07 13:59     ` Jon Smirl
     [not found]   ` <20050728233408.550939d4.akpm@osdl.org>
2005-07-29  8:09     ` 2.6.14-rc4: dma_timer_expiry [was 2.6.13-rc2 hangs at boot] Tero Roponen
2005-07-29  8:24       ` Andrew Morton
2005-07-29  8:35         ` Tero Roponen
2005-07-29  9:39           ` Andrew Morton
2005-08-01  7:22             ` Ivan Kokshaysky
2005-08-01  7:42               ` Tero Roponen
2005-08-04 20:49   ` 2.6.13-rc2 hangs at boot Andrew Morton
2005-07-29 13:24 2.6.14-rc4: dma_timer_expiry [was 2.6.13-rc2 hangs at boot] Mikael Pettersson
2005-08-02 15:34 Mikael Pettersson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®