Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Linux: Kernel

2.6.13-rc3-mm3

 

 

First page Previous page 1 2 3 4 Next page Last page  View All Linux kernel RSS feed   Index | Next | Previous | View Threaded


bjorn.helgaas at hp

Aug 1, 2005, 8:36 AM

Post #51 of 90 (1063 views)
Permalink
Re: 2.6.13-rc3-mm3 [In reply to]

On Friday 29 July 2005 5:17 pm, Andrew Morton wrote:
> Khalid Aziz <khalid_aziz [at] hp> wrote:
> >
> > Serial console is broken on ia64 on an HP rx2600 machine on
> > 2.6.13-rc3-mm3. When kernel is booted up with "console=ttyS,...", no
> > output ever appears on the console and system is hung. So I booted the
> > kernel with "console=uart,mmio,0xff5e0000" to enable early console and
> > here is how far the kernel got before hanging:

> > Serial: 8250/16550 driver $Revision: 1.90 $ 6 ports, IRQ sharing enabled
> > ...
> > No ttyS device at MMIO 0xff5e0000 for console
> >
> > Serial driver failed to find any serial ports. I am using defconfig. A
> > 2.6.13-rc3 kernel (no mm3 patch) compiled with defconfig boots up fine
> > and finds all serial ports.

Your rc3-mm3 boot is also missing this:

IOC: zx1 2.2 HPA 0xfed01000 IOVA space 1024Mb at 0x40000000

So something's busted with ACPI. Both the IOC and the rx2600 serial
ports should be discovered via ACPI.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


christoph at lameter

Aug 1, 2005, 9:10 AM

Post #52 of 90 (1069 views)
Permalink
Re: 2.6.13-rc3-mm3 [In reply to]

On Mon, 1 Aug 2005, Richard Purdie wrote:

> The system appears to be ok and boots happily to a console but if you
> load any graphical UI, the screen will blank and the process stops
> working (tested with opie and and xserver+GPE). You can kill -9 the
> process but you can't regain the console without a suspend/resume cycle
> which performs enough of a reset to get it back. chvt and the console
> switching keys don't respond.

Is this related to the size of the process? Can you do a successful kernel
compile w/o X?

> I tried the patch mentioned in http://lkml.org/lkml/2005/7/28/304 but it
> makes no difference.

Yes that only helps if compilation fails and its alread in rc4-mm1 AFAIK.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


rpurdie at rpsys

Aug 1, 2005, 1:02 PM

Post #53 of 90 (1051 views)
Permalink
Re: 2.6.13-rc3-mm3 [In reply to]

On Mon, 2005-08-01 at 09:10 -0700, Christoph Lameter wrote:
> On Mon, 1 Aug 2005, Richard Purdie wrote:
>
> > The system appears to be ok and boots happily to a console but if you
> > load any graphical UI, the screen will blank and the process stops
> > working (tested with opie and and xserver+GPE). You can kill -9 the
> > process but you can't regain the console without a suspend/resume cycle
> > which performs enough of a reset to get it back. chvt and the console
> > switching keys don't respond.
>
> Is this related to the size of the process? Can you do a successful kernel
> compile w/o X?

Its an embedded device and lacks development tools to test that. I ran
some programs which abuse malloc and the process would quite happily hit
oom so it looks like something more is needed to trigger the bug...

> > I tried the patch mentioned in http://lkml.org/lkml/2005/7/28/304 but it
> > makes no difference.
>
> Yes that only helps if compilation fails and its alread in rc4-mm1 AFAIK.

I thought that might be the case.

Richard

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


christoph at lameter

Aug 1, 2005, 1:36 PM

Post #54 of 90 (1053 views)
Permalink
Re: 2.6.13-rc3-mm3 [In reply to]

On Mon, 1 Aug 2005, Richard Purdie wrote:

> > Is this related to the size of the process? Can you do a successful kernel
> > compile w/o X?
>
> Its an embedded device and lacks development tools to test that. I ran
> some programs which abuse malloc and the process would quite happily hit
> oom so it looks like something more is needed to trigger the bug...

Could you get me some more information about the hang? A stacktrace would
be useful.

Well the device is able to run X so I guess that a slow kernel compile
would work. At least the embedded device that I used to work on was
capable of doing that (but then we had Debian on that thing which made
doing stuff like that very easy).

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


rpurdie at rpsys

Aug 1, 2005, 2:07 PM

Post #55 of 90 (1066 views)
Permalink
Re: 2.6.13-rc3-mm3 [In reply to]

On Mon, 2005-08-01 at 13:36 -0700, Christoph Lameter wrote:
> Could you get me some more information about the hang? A stacktrace would
> be useful.

I've attached gdb to it and its stuck in memcpy (from glibc). The rest
of the trace is junk as glibc's arm memcpy implementation will have
destroyed the frame pointer. The current instruction is a store to
memory (stmneia r0!, {r3,r4} ) and the instruction pointer isn't
changing...

> Well the device is able to run X so I guess that a slow kernel compile
> would work. At least the embedded device that I used to work on was
> capable of doing that (but then we had Debian on that thing which made
> doing stuff like that very easy).

I agree, it would probably do a slow compile. I have no compiler or
development tools on it though and only slow vfat disks other than the
internal flash. There are plenty of options to get such things working
but it will take me a while to setup.

Hopefully the memcpy clue will mean something?

Richard

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


christoph at lameter

Aug 1, 2005, 2:16 PM

Post #56 of 90 (1056 views)
Permalink
Re: 2.6.13-rc3-mm3 [In reply to]

On Mon, 1 Aug 2005, Richard Purdie wrote:

> On Mon, 2005-08-01 at 13:36 -0700, Christoph Lameter wrote:
> > Could you get me some more information about the hang? A stacktrace would
> > be useful.
>
> I've attached gdb to it and its stuck in memcpy (from glibc). The rest
> of the trace is junk as glibc's arm memcpy implementation will have
> destroyed the frame pointer. The current instruction is a store to
> memory (stmneia r0!, {r3,r4} ) and the instruction pointer isn't
> changing...

IP Not changing? Could it be in a loop doing faults for the same memory
location that you cannot observe with gdb? Or is there some hardware fault
that has stopped the processor?
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


rpurdie at rpsys

Aug 1, 2005, 2:27 PM

Post #57 of 90 (1054 views)
Permalink
Re: 2.6.13-rc3-mm3 [In reply to]

On Mon, 2005-08-01 at 14:16 -0700, Christoph Lameter wrote:
> On Mon, 1 Aug 2005, Richard Purdie wrote:
> > I've attached gdb to it and its stuck in memcpy (from glibc). The rest
> > of the trace is junk as glibc's arm memcpy implementation will have
> > destroyed the frame pointer. The current instruction is a store to
> > memory (stmneia r0!, {r3,r4} ) and the instruction pointer isn't
> > changing...
>
> IP Not changing? Could it be in a loop doing faults for the same memory
> location that you cannot observe with gdb? Or is there some hardware fault
> that has stopped the processor?

I'm not the worlds most experienced user of gdb but I can't see any
evidence of a hardware fault and the processor shows all indications of
running. It seems likely to be looping with memory faults or otherwise
jammed somehow.

Is there anything I can use in /proc to monitor page faults or anything
I can do with gdb to help narrow this down?

Richard



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


christoph at lameter

Aug 1, 2005, 2:40 PM

Post #58 of 90 (1041 views)
Permalink
Re: 2.6.13-rc3-mm3 [In reply to]

On Mon, 1 Aug 2005, Richard Purdie wrote:

> > IP Not changing? Could it be in a loop doing faults for the same memory
> > location that you cannot observe with gdb? Or is there some hardware fault
> > that has stopped the processor?
>
> I'm not the worlds most experienced user of gdb but I can't see any
> evidence of a hardware fault and the processor shows all indications of
> running. It seems likely to be looping with memory faults or otherwise
> jammed somehow.

Can you run kgdb on it to figure out what is going on?

> Is there anything I can use in /proc to monitor page faults or anything
> I can do with gdb to help narrow this down?

Run kgdb and see what is going on in the fault handler.

There are some variables in /proc/vmstat that may help:

spurious_page_faults 0
cmpxchg_fail_flag_update 0
cmpxchg_fail_flag_reuse 0
cmpxchg_fail_anon_read 0
cmpxchg_fail_anon_write 0

etc.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


rpurdie at rpsys

Aug 1, 2005, 2:52 PM

Post #59 of 90 (1038 views)
Permalink
Re: 2.6.13-rc3-mm3 [In reply to]

On Mon, 2005-08-01 at 14:40 -0700, Christoph Lameter wrote:
> Can you run kgdb on it to figure out what is going on?

Maybe, depending on how easily kgdb cross compiles and how quickly I can
learn to use it...

> There are some variables in /proc/vmstat that may help:
>
> spurious_page_faults 0
> cmpxchg_fail_flag_update 0
> cmpxchg_fail_flag_reuse 0
> cmpxchg_fail_anon_read 0
> cmpxchg_fail_anon_write 0

In my case:

spurious_page_faults 0
cmpxchg_fail_flag_update 1359210189
cmpxchg_fail_flag_reuse 0
cmpxchg_fail_anon_read 0
cmpxchg_fail_anon_write 0

That number rapidly increases and so it looks like something is failing
and looping...

Richard

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


christoph at lameter

Aug 1, 2005, 3:02 PM

Post #60 of 90 (1050 views)
Permalink
Re: 2.6.13-rc3-mm3 [In reply to]

On Mon, 1 Aug 2005, Richard Purdie wrote:

> cmpxchg_fail_flag_update 1359210189
>
> That number rapidly increases and so it looks like something is failing
> and looping...

That looks like some trouble with the MMU. The time between pte read and
write has been shortened through the page fault scalability patches.

Does this patch fix it?

Index: linux-2.6.13-rc4-mm1/mm/memory.c
===================================================================
--- linux-2.6.13-rc4-mm1.orig/mm/memory.c 2005-08-01 12:59:49.000000000 -0700
+++ linux-2.6.13-rc4-mm1/mm/memory.c 2005-08-01 15:02:19.000000000 -0700
@@ -2105,6 +2105,7 @@
lazy_mmu_prot_update(entry);
} else {
inc_page_state(cmpxchg_fail_flag_update);
+ set_pte_at(mm, address, pte, new_entry);
}

pte_unmap(pte);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


christoph at lameter

Aug 1, 2005, 3:19 PM

Post #61 of 90 (1067 views)
Permalink
Re: 2.6.13-rc3-mm3 [In reply to]

On Mon, 1 Aug 2005, Richard Purdie wrote:
> That number rapidly increases and so it looks like something is failing
> and looping...

Maybe we better restore the pte flags changes the way they were if
CONFIG_ATOMIC_TABLE_OPS is not defined. Try this instead. If this works
then we need two different handle_pte_fault functions to get rid of the
macro mess:

Index: linux-2.6.13-rc4-mm1/mm/memory.c
===================================================================
--- linux-2.6.13-rc4-mm1.orig/mm/memory.c 2005-08-01 12:59:49.000000000 -0700
+++ linux-2.6.13-rc4-mm1/mm/memory.c 2005-08-01 15:08:31.000000000 -0700
@@ -2094,6 +2094,7 @@
entry = pte_mkdirty(entry);
}

+#ifdef CONFIG_ATOMIC_TABLE_OPS
/*
* If the cmpxchg fails then another processor may have done
* the changes for us. If not then another fault will bring
@@ -2106,6 +2107,11 @@
} else {
inc_page_state(cmpxchg_fail_flag_update);
}
+#else
+ ptep_set_access_flags(vma, address, pte, entry, write_access);
+ update_mmu_cache(vma, address, entry);
+ lazy_mmu_prot_update(entry);
+#endif

pte_unmap(pte);
page_table_atomic_stop(mm);
Index: linux-2.6.13-rc4-mm1/mm/memory.o
===================================================================
Binary files linux-2.6.13-rc4-mm1.orig/mm/memory.o 2005-08-01 15:03:10.000000000 -0700 and linux-2.6.13-rc4-mm1/mm/memory.o 2005-08-01 15:09:50.000000000 -0700 differ
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


rpurdie at rpsys

Aug 1, 2005, 4:01 PM

Post #62 of 90 (1051 views)
Permalink
Re: 2.6.13-rc3-mm3 [In reply to]

On Mon, 2005-08-01 at 15:19 -0700, Christoph Lameter wrote:
> On Mon, 1 Aug 2005, Richard Purdie wrote:
> > That number rapidly increases and so it looks like something is failing
> > and looping...
>
> Maybe we better restore the pte flags changes the way they were if
> CONFIG_ATOMIC_TABLE_OPS is not defined. Try this instead. If this works
> then we need two different handle_pte_fault functions to get rid of the
> macro mess:
>
> +#ifdef CONFIG_ATOMIC_TABLE_OPS
> /*
> * If the cmpxchg fails then another processor may have done
> * the changes for us. If not then another fault will bring
> @@ -2106,6 +2107,11 @@
> } else {
> inc_page_state(cmpxchg_fail_flag_update);
> }
> +#else
> + ptep_set_access_flags(vma, address, pte, entry, write_access);
> + update_mmu_cache(vma, address, entry);
> + lazy_mmu_prot_update(entry);
> +#endif

This locks the system up after the "INIT: version 2.86 booting" message.
SysRq still responds but that's about it.

The system also feels/looks extremely sluggish after this change (more
looping?).

With your previously suggested change:

} else {
inc_page_state(cmpxchg_fail_flag_update);
+ set_pte_at(mm, address, pte, new_entry);
}

the system proceeds past INIT and boots normally but X still locks up...

Richard

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


christoph at lameter

Aug 1, 2005, 4:16 PM

Post #63 of 90 (1069 views)
Permalink
Re: 2.6.13-rc3-mm3 [In reply to]

On Tue, 2 Aug 2005, Richard Purdie wrote:

> > + update_mmu_cache(vma, address, entry);
> > + lazy_mmu_prot_update(entry);
> > +#endif
>
> This locks the system up after the "INIT: version 2.86 booting" message.
> SysRq still responds but that's about it.

Hmmm. this should have returned the behavior to normal. Ah. Need to use
new_entry instead of entry. Try this (is there any way that I could get
access to the sytem? I am on IRC (freenode.net nick o-o) or on skype).

Index: linux-2.6.13-rc4-mm1/mm/memory.c
===================================================================
--- linux-2.6.13-rc4-mm1.orig/mm/memory.c 2005-08-01 16:11:45.000000000 -0700
+++ linux-2.6.13-rc4-mm1/mm/memory.c 2005-08-01 16:15:35.000000000 -0700
@@ -2094,6 +2094,7 @@
entry = pte_mkdirty(entry);
}

+#ifdef CONFIG_ATOMIC_TABLE_OPS
/*
* If the cmpxchg fails then another processor may have done
* the changes for us. If not then another fault will bring
@@ -2106,6 +2107,11 @@
} else {
inc_page_state(cmpxchg_fail_flag_update);
}
+#else
+ ptep_set_access_flags(vma, address, pte, new_entry, write_access);
+ update_mmu_cache(vma, address, new_entry);
+ lazy_mmu_prot_update(new_entry);
+#endif

pte_unmap(pte);
page_table_atomic_stop(mm);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


rpurdie at rpsys

Aug 1, 2005, 4:32 PM

Post #64 of 90 (1070 views)
Permalink
Re: 2.6.13-rc3-mm3 [In reply to]

On Mon, 2005-08-01 at 16:16 -0700, Christoph Lameter wrote:
> Hmmm. this should have returned the behavior to normal. Ah. Need to use
> new_entry instead of entry. Try this (is there any way that I could get
> access to the sytem? I am on IRC (freenode.net nick o-o) or on skype).
>
> +#ifdef CONFIG_ATOMIC_TABLE_OPS
> /*
> * If the cmpxchg fails then another processor may have done
> * the changes for us. If not then another fault will bring
> @@ -2106,6 +2107,11 @@
> } else {
> inc_page_state(cmpxchg_fail_flag_update);
> }
> +#else
> + ptep_set_access_flags(vma, address, pte, new_entry, write_access);
> + update_mmu_cache(vma, address, new_entry);
> + lazy_mmu_prot_update(new_entry);
> +#endif

With this applied, the system boots then X locks up in memcpy as before.
The cmpxchg_fail_flag_update remains at zero but given the above patch,
that's to be expected...

Sadly, remote access to the system isn't really much use as there is no
compiler on the device and flashing a new kernel is a manual procedure
involving pressing buttons.

Richard

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


stelian at popies

Aug 2, 2005, 2:49 AM

Post #65 of 90 (1066 views)
Permalink
Re: 2.6.13-rc3-mm3 [In reply to]

Le lundi 01 août 2005 à 16:37 +0200, Stelian Pop a écrit :

> > Also, it looks like sonypi really is pretty nasty to probe for, so it's
> > not enough to just say "oh, it's a sony VAIO, let's reserve that region".
> > Otherwise I'd just suggest adding a "dmi_check_system()" table to
> > arch/i386/pci/i386.c, at the top of "pcibios_assign_resources()", and
> > then you could just allocate things based on DMI information.

> Since every Vaio laptop out there seems indeed to use only the first IO
> port range in the list, we can de-nastyify the probe. And if we don't
> even bother to check for Type1 vs. Type2 devices and we reserve both,
> then it may be acceptable to do the above.
>
> See the attached patch below which does just that. This has NOT been
> tested (only compile-tested), and moreover it has a high breakage
> probability in case some Vaios cannot live with the fixed ioport choice.
>
> Note that this patch will conflict with the recent Eric's one (added in
> CC:), he may want to rediff his Type3 changes in case this patch gets
> in.

I had no feedback at all on the patch so I have no idea if this will go
in or not, but since Eric's patch was accepted into -mm I rediffed the
patch in order to ease the testing (in case someone is willing to test
it).

Stelian.

Mark some IO regions reserved on Sony Vaio laptops because the sonypi
driver will need them later, and we don't want another driver to reserve
them before the sonypi driver starts.

Signed-off-by: Stelian Pop <stelian [at] popies>

arch/i386/pci/i386.c | 42 +++++++++++++++++++++++++++++
drivers/char/sonypi.c | 71 ++++++++++----------------------------------------
2 files changed, 57 insertions(+), 56 deletions(-)

Index: linux-2.6.git/arch/i386/pci/i386.c
===================================================================
--- linux-2.6.git.orig/arch/i386/pci/i386.c 2005-08-02 10:21:58.000000000 +0200
+++ linux-2.6.git/arch/i386/pci/i386.c 2005-08-02 10:28:26.000000000 +0200
@@ -30,6 +30,7 @@
#include <linux/init.h>
#include <linux/ioport.h>
#include <linux/errno.h>
+#include <linux/dmi.h>

#include "pci.h"

@@ -167,12 +168,53 @@
}
}

+/*
+ * Reserve IO ports used later by the sonypi driver, or they may got used
+ * by other devices.
+ */
+static int __init sonyvaio_reserve_ioports(struct dmi_system_id *d)
+{
+ /* IO ports for 'type1' device */
+ if (!request_region(0x10c0, 0x08, "Sony Programable I/O Type1 Device"))
+ printk(KERN_ERR "Sony Vaio: cannot reserve Type1 IO region\n");
+
+ /* IO ports for 'type2' and 'type3' devices */
+ if (!request_region(0x1080, 0x20, "Sony Programable I/O Type2 Device"))
+ printk(KERN_ERR "Sony Vaio: cannot reserve Type2 IO region\n");
+
+ printk(KERN_INFO "Sony Vaio: pre-reserved IO ports\n");
+
+ return 0;
+}
+
+static struct dmi_system_id __initdata sonyvaioio_dmi_table[] = {
+ {
+ .callback = sonyvaio_reserve_ioports,
+ .ident = "Sony Vaio Laptop",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "PCG-"),
+ },
+ },
+ {
+ .callback = sonyvaio_reserve_ioports,
+ .ident = "Sony Vaio Laptop",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "VGN-"),
+ },
+ },
+ { }
+};
+
static int __init pcibios_assign_resources(void)
{
struct pci_dev *dev = NULL;
int idx;
struct resource *r;

+ dmi_check_system(sonyvaioio_dmi_table);
+
for_each_pci_dev(dev) {
int class = dev->class >> 8;

Index: linux-2.6.git/drivers/char/sonypi.c
===================================================================
--- linux-2.6.git.orig/drivers/char/sonypi.c 2005-08-02 10:22:18.000000000 +0200
+++ linux-2.6.git/drivers/char/sonypi.c 2005-08-02 10:27:28.000000000 +0200
@@ -105,7 +105,9 @@
#define SONYPI_IRQ_SHIFT 22
#define SONYPI_TYPE1_BASE 0x50
#define SONYPI_G10A (SONYPI_TYPE1_BASE+0x14)
-#define SONYPI_TYPE1_REGION_SIZE 0x08
+/* those ports are reserved in arch/i386/pci/i386.c */
+#define SONYPI_TYPE1_IOPORT1 0x10c0
+#define SONYPI_TYPE1_IOPORT2 0x10c4
#define SONYPI_TYPE1_EVTYPE_OFFSET 0x04

/* type2 series specifics */
@@ -113,13 +115,18 @@
#define SONYPI_SLOB 0x9c
#define SONYPI_SHIB 0x9d
#define SONYPI_TYPE2_REGION_SIZE 0x20
+/* those ports are reserved in arch/i386/pci/i386.c */
+#define SONYPI_TYPE2_IOPORT1 0x1080
+#define SONYPI_TYPE2_IOPORT2 0x1084
#define SONYPI_TYPE2_EVTYPE_OFFSET 0x12

/* type3 series specifics */
#define SONYPI_TYPE3_BASE 0x40
#define SONYPI_TYPE3_GID2 (SONYPI_TYPE3_BASE+0x48) /* 16 bits */
#define SONYPI_TYPE3_MISC (SONYPI_TYPE3_BASE+0x6d) /* 8 bits */
-#define SONYPI_TYPE3_REGION_SIZE 0x20
+/* those ports are reserved in arch/i386/pci/i386.c */
+#define SONYPI_TYPE3_IOPORT1 SONYPI_TYPE2_IOPORT1
+#define SONYPI_TYPE3_IOPORT2 SONYPI_TYPE2_IOPORT2
#define SONYPI_TYPE3_EVTYPE_OFFSET 0x12

/* battery / brightness addresses */
@@ -144,33 +151,6 @@
#define SONYPI_DATA_IOPORT 0x62
#define SONYPI_CST_IOPORT 0x66

-/* The set of possible ioports */
-struct sonypi_ioport_list {
- u16 port1;
- u16 port2;
-};
-
-static struct sonypi_ioport_list sonypi_type1_ioport_list[] = {
- { 0x10c0, 0x10c4 }, /* looks like the default on C1Vx */
- { 0x1080, 0x1084 },
- { 0x1090, 0x1094 },
- { 0x10a0, 0x10a4 },
- { 0x10b0, 0x10b4 },
- { 0x0, 0x0 }
-};
-
-static struct sonypi_ioport_list sonypi_type2_ioport_list[] = {
- { 0x1080, 0x1084 },
- { 0x10a0, 0x10a4 },
- { 0x10c0, 0x10c4 },
- { 0x10e0, 0x10e4 },
- { 0x0, 0x0 }
-};
-
-/* same as in type 2 models */
-static struct sonypi_ioport_list *sonypi_type3_ioport_list =
- sonypi_type2_ioport_list;
-
/* The set of possible interrupts */
struct sonypi_irq_list {
u16 irq;
@@ -479,7 +459,6 @@
u16 bits;
u16 ioport1;
u16 ioport2;
- u16 region_size;
u16 evtype_offset;
int camera_power;
int bluetooth_power;
@@ -1206,7 +1185,6 @@
static int __devinit sonypi_probe(void)
{
int i, ret;
- struct sonypi_ioport_list *ioport_list;
struct sonypi_irq_list *irq_list;
struct pci_dev *pcidev;

@@ -1249,38 +1227,22 @@


if (sonypi_device.model == SONYPI_DEVICE_MODEL_TYPE1) {
- ioport_list = sonypi_type1_ioport_list;
- sonypi_device.region_size = SONYPI_TYPE1_REGION_SIZE;
+ sonypi_device.ioport1 = SONYPI_TYPE1_IOPORT1;
+ sonypi_device.ioport2 = SONYPI_TYPE1_IOPORT2;
sonypi_device.evtype_offset = SONYPI_TYPE1_EVTYPE_OFFSET;
irq_list = sonypi_type1_irq_list;
} else if (sonypi_device.model == SONYPI_DEVICE_MODEL_TYPE2) {
- ioport_list = sonypi_type2_ioport_list;
- sonypi_device.region_size = SONYPI_TYPE2_REGION_SIZE;
+ sonypi_device.ioport1 = SONYPI_TYPE2_IOPORT1;
+ sonypi_device.ioport2 = SONYPI_TYPE2_IOPORT2;
sonypi_device.evtype_offset = SONYPI_TYPE2_EVTYPE_OFFSET;
irq_list = sonypi_type2_irq_list;
} else {
- ioport_list = sonypi_type3_ioport_list;
- sonypi_device.region_size = SONYPI_TYPE3_REGION_SIZE;
+ sonypi_device.ioport1 = SONYPI_TYPE3_IOPORT1;
+ sonypi_device.ioport2 = SONYPI_TYPE3_IOPORT2;
sonypi_device.evtype_offset = SONYPI_TYPE3_EVTYPE_OFFSET;
irq_list = sonypi_type3_irq_list;
}

- for (i = 0; ioport_list[i].port1; i++) {
- if (request_region(ioport_list[i].port1,
- sonypi_device.region_size,
- "Sony Programable I/O Device")) {
- /* get the ioport */
- sonypi_device.ioport1 = ioport_list[i].port1;
- sonypi_device.ioport2 = ioport_list[i].port2;
- break;
- }
- }
- if (!sonypi_device.ioport1) {
- printk(KERN_ERR "sonypi: request_region failed\n");
- ret = -ENODEV;
- goto out_reqreg;
- }
-
for (i = 0; irq_list[i].irq; i++) {

sonypi_device.irq = irq_list[i].irq;
@@ -1379,8 +1341,6 @@
input_unregister_device(&sonypi_device.input_jog_dev);
free_irq(sonypi_device.irq, sonypi_irq);
out_reqirq:
- release_region(sonypi_device.ioport1, sonypi_device.region_size);
-out_reqreg:
misc_deregister(&sonypi_misc_device);
out_miscreg:
if (pcidev)
@@ -1408,7 +1368,6 @@
}

free_irq(sonypi_device.irq, sonypi_irq);
- release_region(sonypi_device.ioport1, sonypi_device.region_size);
misc_deregister(&sonypi_misc_device);
if (sonypi_device.dev)
pci_disable_device(sonypi_device.dev);

--
Stelian Pop <stelian [at] popies>

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


mano at roarinelk

Aug 2, 2005, 3:32 AM

Post #66 of 90 (1074 views)
Permalink
Re: 2.6.13-rc3-mm3 [In reply to]

On Tue, Aug 02, 2005 at 11:49:28AM +0200, Stelian Pop wrote:
> Le lundi 01 ao??t 2005 ?? 16:37 +0200, Stelian Pop a ??crit :
>
> > > Also, it looks like sonypi really is pretty nasty to probe for, so it's
> > > not enough to just say "oh, it's a sony VAIO, let's reserve that region".
> > > Otherwise I'd just suggest adding a "dmi_check_system()" table to
> > > arch/i386/pci/i386.c, at the top of "pcibios_assign_resources()", and
> > > then you could just allocate things based on DMI information.
>
> > Since every Vaio laptop out there seems indeed to use only the first IO
> > port range in the list, we can de-nastyify the probe. And if we don't
> > even bother to check for Type1 vs. Type2 devices and we reserve both,
> > then it may be acceptable to do the above.
> >
> > See the attached patch below which does just that. This has NOT been
> > tested (only compile-tested), and moreover it has a high breakage
> > probability in case some Vaios cannot live with the fixed ioport choice.
> >
> > Note that this patch will conflict with the recent Eric's one (added in
> > CC:), he may want to rediff his Type3 changes in case this patch gets
> > in.
>
> I had no feedback at all on the patch so I have no idea if this will go
> in or not, but since Eric's patch was accepted into -mm I rediffed the
> patch in order to ease the testing (in case someone is willing to test
> it).

Does not work on -rc4-mm1. The IO-ports pre-reserved message appears,
though. The 2 io-regions are still located under the "CardBus #03"
device. Re-Applying
"revert-gregkh-pci-pci-assign-unassigned-resources.patch" makes it
work again.

--
Manuel Lauss
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


ink at jurassic

Aug 2, 2005, 4:40 AM

Post #67 of 90 (1076 views)
Permalink
Re: 2.6.13-rc3-mm3 [In reply to]

On Tue, Aug 02, 2005 at 12:32:26PM +0200, Manuel Lauss wrote:
> Does not work on -rc4-mm1. The IO-ports pre-reserved message appears,
> though. The 2 io-regions are still located under the "CardBus #03"
> device. Re-Applying
> "revert-gregkh-pci-pci-assign-unassigned-resources.patch" makes it
> work again.

Does the patch in appended message fix that?

Ivan.

----- Forwarded message from Ivan Kokshaysky <ink [at] jurassic> -----

Date: Mon, 1 Aug 2005 11:22:45 +0400
From: Ivan Kokshaysky <ink [at] jurassic>
To: Andrew Morton <akpm [at] osdl>
Cc: Tero Roponen <teanropo [at] cc>, jonsmirl [at] gmail,
gregkh [at] suse, linux-kernel [at] vger,
Mikael Pettersson <mikpe [at] csd>
Subject: Re: 2.6.14-rc4: dma_timer_expiry [was 2.6.13-rc2 hangs at boot]
User-Agent: Mutt/1.2.5i
In-Reply-To: <20050729023921.0950968f.akpm [at] osdl>; from akpm [at] osdl on Fri, Jul 29, 2005 at 02:39:21AM -0700
X-Spam-Checker-Version: SpamAssassin 2.64 (2004-01-11) on jurassic.park.msu.ru
X-Spam-Status: No, hits=-4.9 required=4.0 tests=BAYES_00 autolearn=ham
version=2.64
X-Spam-Level:

On Fri, Jul 29, 2005 at 02:39:21AM -0700, Andrew Morton wrote:
> Tero Roponen <teanropo [at] cc> 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

----- End forwarded message -----
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


mano at roarinelk

Aug 2, 2005, 7:04 AM

Post #68 of 90 (1045 views)
Permalink
Re: 2.6.13-rc3-mm3 [In reply to]

On Tue, Aug 02, 2005 at 03:40:22PM +0400, Ivan Kokshaysky wrote:
> On Tue, Aug 02, 2005 at 12:32:26PM +0200, Manuel Lauss wrote:
> > Does not work on -rc4-mm1. The IO-ports pre-reserved message appears,
> > though. The 2 io-regions are still located under the "CardBus #03"
> > device. Re-Applying
> > "revert-gregkh-pci-pci-assign-unassigned-resources.patch" makes it
> > work again.
>
> Does the patch in appended message fix that?

Indeed, it does fix it (vanilla -rc4-mm1 and your patch)

Thanks!

--
Manuel Lauss
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


torvalds at osdl

Aug 2, 2005, 8:48 AM

Post #69 of 90 (1046 views)
Permalink
Re: 2.6.13-rc3-mm3 [In reply to]

On Tue, 2 Aug 2005, Ivan Kokshaysky wrote:
>
> Does the patch in appended message fix that?

The problem with this is that it only papers over the bug.

I don't mind trying to allocate at higher addresses per se: we used to
have the starting point be 0x4000 at some point, and that part is fine.
The problem is that this also screws us if somebody has a PCI bridge with
an IO window that is at a lower address than 0x2000 - now the PCI layer
will refuse to try to allocate within it, and you'll replace one bug by
another.

Linus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


ink at jurassic

Aug 2, 2005, 9:50 AM

Post #70 of 90 (1059 views)
Permalink
Re: 2.6.13-rc3-mm3 [In reply to]

On Tue, Aug 02, 2005 at 08:48:21AM -0700, Linus Torvalds wrote:
> The problem with this is that it only papers over the bug.
>
> I don't mind trying to allocate at higher addresses per se: we used to
> have the starting point be 0x4000 at some point, and that part is fine.
> The problem is that this also screws us if somebody has a PCI bridge with
> an IO window that is at a lower address than 0x2000 - now the PCI layer
> will refuse to try to allocate within it, and you'll replace one bug by
> another.

Right, and this hurts the cardbus as well...
But it should be pretty easy to learn the PCI layer to allocate above
PCIBIOS_MIN_IO _only_ when we allocate on the root bus.
Something like this (completely untested)?

Ivan.

--- linux/drivers/pci/setup-res.c.orig Fri Jun 17 23:48:29 2005
+++ linux/drivers/pci/setup-res.c Tue Aug 2 20:44:59 2005
@@ -113,11 +113,12 @@ int pci_assign_resource(struct pci_dev *
{
struct pci_bus *bus = dev->bus;
struct resource *res = dev->resource + resno;
- unsigned long size, min, align;
+ unsigned long size, min, align, min_io;
int ret;

+ min_io = (bus->self && !bus->self->transparent) ? 0 : PCIBIOS_MIN_IO;
size = res->end - res->start + 1;
- min = (res->flags & IORESOURCE_IO) ? PCIBIOS_MIN_IO : PCIBIOS_MIN_MEM;
+ min = (res->flags & IORESOURCE_IO) ? min_io : PCIBIOS_MIN_MEM;
/* The bridge resources are special, as their
size != alignment. Sizing routines return
required alignment in the "start" field. */
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


torvalds at osdl

Aug 2, 2005, 10:11 AM

Post #71 of 90 (1072 views)
Permalink
Re: 2.6.13-rc3-mm3 [In reply to]

On Tue, 2 Aug 2005, Ivan Kokshaysky wrote:
>
> Right, and this hurts the cardbus as well...
> But it should be pretty easy to learn the PCI layer to allocate above
> PCIBIOS_MIN_IO _only_ when we allocate on the root bus.
> Something like this (completely untested)?

I think you'd have to follow the "transparent" case down.. And even then
you'd have the half-transparent case to worry about it.

So I think it would be much easier to just make the change in
"pci_bus_alloc_resource()", and say that if the parent resource that we're
testing starts at some non-zero value, we just use that instead of "min"
when we call down to allocate_resource(). That gets it for MEM resources
too.

Something like the following (also _totally_ untested, but even simpler
than yours). It basically says: if the parent resource starts at non-zero,
we use that as the starting point for allocations, otherwise the passed-in
value.

That, together with changing PCIBIOS_MIN_IO to 0x2000 (or even 0x4000)
might be the ticket...

Linus

----
diff --git a/drivers/pci/bus.c b/drivers/pci/bus.c
--- a/drivers/pci/bus.c
+++ b/drivers/pci/bus.c
@@ -60,7 +60,9 @@ pci_bus_alloc_resource(struct pci_bus *b
continue;

/* Ok, try it out.. */
- ret = allocate_resource(r, res, size, min, -1, align,
+ ret = allocate_resource(r, res, size,
+ r->start ? : min,
+ -1, align,
alignf, alignf_data);
if (ret == 0)
break;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


ink at jurassic

Aug 2, 2005, 2:13 PM

Post #72 of 90 (1061 views)
Permalink
Re: 2.6.13-rc3-mm3 [In reply to]

On Tue, Aug 02, 2005 at 10:11:40AM -0700, Linus Torvalds wrote:
> So I think it would be much easier to just make the change in
> "pci_bus_alloc_resource()", and say that if the parent resource that we're
> testing starts at some non-zero value, we just use that instead of "min"
> when we call down to allocate_resource(). That gets it for MEM resources
> too.

Cool! I think it's the way to go.

> Something like the following (also _totally_ untested, but even simpler
> than yours). It basically says: if the parent resource starts at non-zero,
> we use that as the starting point for allocations, otherwise the passed-in
> value.

Tested on alpha. Initially I was concerned a bit about architectures
where resources _never_ start at zero (due to some specific bus to
resource conversions), but this change is just a no-op for them.

> That, together with changing PCIBIOS_MIN_IO to 0x2000 (or even 0x4000)
> might be the ticket...

Definitely 0x4000. Then we can get rid of PCIBIOS_MIN_CARDBUS_IO which
was introduced exactly for this reason, I guess.

Ivan.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


greg at kroah

Aug 2, 2005, 2:21 PM

Post #73 of 90 (1048 views)
Permalink
Re: 2.6.13-rc3-mm3 [In reply to]

On Wed, Aug 03, 2005 at 01:13:37AM +0400, Ivan Kokshaysky wrote:
> On Tue, Aug 02, 2005 at 10:11:40AM -0700, Linus Torvalds wrote:
> > So I think it would be much easier to just make the change in
> > "pci_bus_alloc_resource()", and say that if the parent resource that we're
> > testing starts at some non-zero value, we just use that instead of "min"
> > when we call down to allocate_resource(). That gets it for MEM resources
> > too.
>
> Cool! I think it's the way to go.
>
> > Something like the following (also _totally_ untested, but even simpler
> > than yours). It basically says: if the parent resource starts at non-zero,
> > we use that as the starting point for allocations, otherwise the passed-in
> > value.
>
> Tested on alpha. Initially I was concerned a bit about architectures
> where resources _never_ start at zero (due to some specific bus to
> resource conversions), but this change is just a no-op for them.
>
> > That, together with changing PCIBIOS_MIN_IO to 0x2000 (or even 0x4000)
> > might be the ticket...
>
> Definitely 0x4000. Then we can get rid of PCIBIOS_MIN_CARDBUS_IO which
> was introduced exactly for this reason, I guess.

Nice, care to make up a single patch with these two changes in it?

thanks,

greg k-h
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


ink at jurassic

Aug 2, 2005, 2:47 PM

Post #74 of 90 (1046 views)
Permalink
Re: 2.6.13-rc3-mm3 [In reply to]

On Tue, Aug 02, 2005 at 02:21:44PM -0700, Greg KH wrote:
> Nice, care to make up a single patch with these two changes in it?

Yep, I'll do it shortly, plus some minor additions as separate
patches.

Ivan.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


torvalds at osdl

Aug 2, 2005, 2:57 PM

Post #75 of 90 (1047 views)
Permalink
Re: 2.6.13-rc3-mm3 [In reply to]

On Wed, 3 Aug 2005, Ivan Kokshaysky wrote:
>
> On Tue, Aug 02, 2005 at 02:21:44PM -0700, Greg KH wrote:
> > Nice, care to make up a single patch with these two changes in it?
>
> Yep, I'll do it shortly, plus some minor additions as separate
> patches.

Actually, since everybody seems to like the "ignore 'min' if we have a
known bus resource" patch, and it was already in my tree, I just committed
it.

But you don't need to split up any patches you've already prepared: I can
easily just edit away the part I already committed.

Linus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

First page Previous page 1 2 3 4 Next page Last page  View All Linux kernel RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.