LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* PCI memory reservation failure - 2.4/2.6
@ 2004-05-10 13:07 Alec H. Peterson
2004-05-12 21:07 ` Manfred Spraul
0 siblings, 1 reply; 7+ messages in thread
From: Alec H. Peterson @ 2004-05-10 13:07 UTC (permalink / raw)
To: linux-kernel; +Cc: Manfred Spraul, Dominik Brodowski, netdev
[-- Attachment #1: Type: text/plain, Size: 2257 bytes --]
Greetings,
Several users (myself included) have reported problems with PCI memory
reservation failures when using Cardbus cards with certain PCMCIA
bridge/motherboard configurations. I believe the problem stems from either
the Cardbus controller or the motherboard BIOS not assigning large enough
aligned blocks of memory to the Cardbus slots.
I am running on a Shuttle XPC (built in mainboard) with a Ricoh RL5C475
single slot PCMCIA/PCI bridge. The current kernel I am using is 2.4.25,
but I have duplicated the problem in 2.4.26 as well as 2.6.5. The lspci
-vv/iomem details (without the patched yenta_socket.o module) are attached.
The fix I propose is as follows:
*** linux-2.4.25/drivers/pcmcia/yenta.c.old Wed Feb 18 13:36:31 2004
--- linux-2.4.25/drivers/pcmcia/yenta.c Fri May 7 05:29:56 2004
***************
*** 753,758 ****
--- 753,767 ----
start = config_readl(socket, offset) & mask;
end = config_readl(socket, offset+4) | ~mask;
+ #if 1
+ if (!(type & IORESOURCE_IO) && (((end - start) < BRIDGE_SIZE_MIN)
||
+ (start & (end - start))))
+ {
+ printk(KERN_INFO "yenta %s: Preassigned resource start %lx
end %lx too small or not aligned.\n", socket->dev->slot_name, start, end);
+ res->start = res->end = 0;
+ }
+ else
+ #endif
if (start && end > start) {
res->start = start;
res->end = end;
The yenta_allocate_res() routine has a variety of restrictions it places on
memory it assigns itself (it must be >= BRIDGE_SIZE_MIN, <=
BRIDGE_SIZE_MAX, and aligned based on its size). However, the routine does
not place any such restrictions on memory it is assigned by the BIOS. This
is probably the case because it is assumed that such memory will meet the
restrictions, but at least in some cases (such as in my configuration) this
is not the case. I believe this fix will have no affect on properly
functioning BIOS, and it should do the right thing when the BIOS decides it
does not need to allocate enough aligned memory.
However, my experience in the kernel is very limited, so I hope those who
are far more versed in the details of the kernel than I will weigh in.
Thanks!
Alec
[-- Attachment #2: lspci/iomem --]
[-- Type: text/plain, Size: 11955 bytes --]
00:00.0 Host bridge: Silicon Integrated Systems [SiS]: Unknown device 0651
(rev 02)
Subsystem: Silicon Integrated Systems [SiS]: Unknown device 0651
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr-
Stepping- SERR- FastB2B-
Status: Cap+ 66Mhz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort-
<TAbort- <MAbort+ >SERR- <PERR-
Latency: 32
Region 0: Memory at e8000000 (32-bit, non-prefetchable) [size=64M]
Capabilities: [c0] AGP version 2.0
Status: RQ=31 SBA+ 64bit- FW+ Rate=x1,x2
Command: RQ=0 SBA- AGP- 64bit- FW- Rate=<none>
00:01.0 PCI bridge: Silicon Integrated Systems [SiS] 5591/5592 AGP (prog-if
00 [Normal decode])
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr-
Stepping- SERR+ FastB2B-
Status: Cap- 66Mhz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort-
<TAbort- <MAbort- >SERR- <PERR-
Latency: 64
Bus: primary=00, secondary=01, subordinate=01, sec-latency=32
I/O behind bridge: 00009000-00009fff
Memory behind bridge: ec000000-ec0fffff
Prefetchable memory behind bridge: e0000000-e7ffffff
BridgeCtl: Parity- SERR+ NoISA+ VGA+ MAbort- >Reset- FastB2B-
00:02.0 ISA bridge: Silicon Integrated Systems [SiS] 85C503/5513 (rev 14)
Control: I/O+ Mem+ BusMaster+ SpecCycle+ MemWINV- VGASnoop- ParErr-
Stepping- SERR- FastB2B-
Status: Cap- 66Mhz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort-
<TAbort- <MAbort- >SERR- <PERR-
Latency: 0
00:02.5 IDE interface: Silicon Integrated Systems [SiS] 5513 [IDE] (prog-if
8a [Master SecP PriP])
Subsystem: Silicon Integrated Systems [SiS] SiS5513 EIDE Controller
(A,B step)
Control: I/O+ Mem- BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr-
Stepping- SERR- FastB2B-
Status: Cap+ 66Mhz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort-
<TAbort- <MAbort- >SERR- <PERR-
Latency: 128
Interrupt: pin A routed to IRQ 10
Region 0: I/O ports at <ignored>
Region 1: I/O ports at <ignored>
Region 2: I/O ports at <ignored>
Region 3: I/O ports at <ignored>
Region 4: I/O ports at 4000 [size=16]
Capabilities: [58] Power Management version 2
Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA
PME(D0-,D1-,D2-,D3hot-,D3cold+)
Status: D0 PME-Enable- DSel=0 DScale=0 PME-
00:02.7 Multimedia audio controller: Silicon Integrated Systems [SiS]
SiS7012 PCI Audio Accelerator (rev a0)
Subsystem: Holco Enterprise Co, Ltd/Shuttle Computer: Unknown
device c120
Control: I/O+ Mem- BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr-
Stepping- SERR- FastB2B-
Status: Cap+ 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort-
<TAbort- <MAbort- >SERR- <PERR-
Latency: 32 (13000ns min, 2750ns max)
Interrupt: pin C routed to IRQ 11
Region 0: I/O ports at a000 [size=256]
Region 1: I/O ports at a400 [size=128]
Capabilities: [48] Power Management version 2
Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=55mA
PME(D0-,D1-,D2-,D3hot+,D3cold+)
Status: D0 PME-Enable- DSel=0 DScale=0 PME-
00:03.0 USB Controller: Silicon Integrated Systems [SiS] 7001 (rev 0f)
(prog-if 10 [OHCI])
Subsystem: Silicon Integrated Systems [SiS] 7001
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr-
Stepping- SERR- FastB2B-
Status: Cap- 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort-
<TAbort- <MAbort- >SERR- <PERR-
Latency: 32 (20000ns max), cache line size 08
Interrupt: pin A routed to IRQ 9
Region 0: Memory at ec100000 (32-bit, non-prefetchable) [size=4K]
00:03.1 USB Controller: Silicon Integrated Systems [SiS] 7001 (rev 0f)
(prog-if 10 [OHCI])
Subsystem: Silicon Integrated Systems [SiS] 7001
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr-
Stepping- SERR- FastB2B-
Status: Cap- 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort-
<TAbort- <MAbort- >SERR- <PERR-
Latency: 32 (20000ns max), cache line size 08
Interrupt: pin B routed to IRQ 5
Region 0: Memory at ec101000 (32-bit, non-prefetchable) [size=4K]
00:03.2 USB Controller: Silicon Integrated Systems [SiS] 7001 (rev 0f)
(prog-if 10 [OHCI])
Subsystem: Silicon Integrated Systems [SiS] 7001
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr-
Stepping- SERR- FastB2B-
Status: Cap- 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort-
<TAbort- <MAbort- >SERR- <PERR-
Latency: 32 (20000ns max), cache line size 08
Interrupt: pin C routed to IRQ 10
Region 0: Memory at ec102000 (32-bit, non-prefetchable) [size=4K]
00:03.3 USB Controller: Silicon Integrated Systems [SiS]: Unknown device
7002 (prog-if 20 [EHCI])
Subsystem: Holco Enterprise Co, Ltd/Shuttle Computer: Unknown
device f451
Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr-
Stepping- SERR- FastB2B-
Status: Cap+ 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort-
<TAbort- <MAbort- >SERR- <PERR-
Latency: 32 (20000ns max), cache line size 08
Interrupt: pin D routed to IRQ 11
Region 0: Memory at ec103000 (32-bit, non-prefetchable) [size=4K]
Capabilities: [50] Power Management version 2
Flags: PMEClk- DSI- D1- D2- AuxCurrent=375mA
PME(D0+,D1-,D2-,D3hot+,D3cold+)
Status: D0 PME-Enable- DSel=0 DScale=0 PME-
00:0a.0 CardBus bridge: Texas Instruments PCI1420
Subsystem: CARRY Computer ENG. CO Ltd: Unknown device 0202
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr-
Stepping- SERR- FastB2B-
Status: Cap+ 66Mhz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort-
<TAbort- <MAbort- >SERR- <PERR-
Latency: 168, cache line size 08
Interrupt: pin A routed to IRQ 5
Region 0: Memory at ec104000 (32-bit, non-prefetchable) [size=4K]
Bus: primary=00, secondary=02, subordinate=02, sec-latency=176
Memory window 0: ec105000-ec106000 (prefetchable)
Memory window 1: ec107000-ec108000
I/O window 0: 0000a800-0000ac03
I/O window 1: 0000b000-0000b403
BridgeCtl: Parity- SERR- ISA- VGA- MAbort- >Reset- 16bInt-
PostWrite+
16-bit legacy interface ports at 0001
00:0a.1 CardBus bridge: Texas Instruments PCI1420
Subsystem: CARRY Computer ENG. CO Ltd: Unknown device 0202
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr-
Stepping- SERR- FastB2B-
Status: Cap+ 66Mhz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort-
<TAbort- <MAbort- >SERR- <PERR-
Latency: 168, cache line size 08
Interrupt: pin A routed to IRQ 5
Region 0: Memory at ec109000 (32-bit, non-prefetchable) [size=4K]
Bus: primary=00, secondary=03, subordinate=03, sec-latency=176
Memory window 0: ec10a000-ec10b000 (prefetchable)
Memory window 1: ec10c000-ec10d000
I/O window 0: 0000b800-0000bc03
I/O window 1: 0000c000-0000c403
BridgeCtl: Parity- SERR- ISA- VGA- MAbort- >Reset+ 16bInt+
PostWrite+
16-bit legacy interface ports at 0001
00:0f.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C
(rev 10)
Subsystem: Realtek Semiconductor Co., Ltd. RT8139
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr-
Stepping- SERR- FastB2B-
Status: Cap+ 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort-
<TAbort- <MAbort- >SERR- <PERR-
Latency: 32 (8000ns min, 16000ns max)
Interrupt: pin A routed to IRQ 11
Region 0: I/O ports at c800 [size=256]
Region 1: Memory at ec10e000 (32-bit, non-prefetchable) [size=256]
Capabilities: [50] Power Management version 2
Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=375mA
PME(D0-,D1+,D2+,D3hot+,D3cold+)
Status: D0 PME-Enable- DSel=0 DScale=0 PME-
00:10.0 FireWire (IEEE 1394): VIA Technologies, Inc. IEEE 1394 Host
Controller (rev 46) (prog-if 10 [OHCI])
Subsystem: VIA Technologies, Inc. IEEE 1394 Host Controller
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr-
Stepping- SERR- FastB2B-
Status: Cap+ 66Mhz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort-
<TAbort- <MAbort- >SERR- <PERR-
Latency: 32 (8000ns max), cache line size 08
Interrupt: pin A routed to IRQ 9
Region 0: Memory at ec10f000 (32-bit, non-prefetchable) [size=2K]
Region 1: I/O ports at cc00 [size=128]
Capabilities: [50] Power Management version 2
Flags: PMEClk- DSI- D1- D2+ AuxCurrent=0mA
PME(D0-,D1-,D2+,D3hot+,D3cold+)
Status: D0 PME-Enable- DSel=0 DScale=0 PME-
01:00.0 VGA compatible controller: Silicon Integrated Systems [SiS]:
Unknown device 6325 (prog-if 00 [VGA])
Subsystem: Holco Enterprise Co, Ltd/Shuttle Computer: Unknown
device f451
Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr-
Stepping- SERR- FastB2B-
Status: Cap+ 66Mhz+ UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort-
<TAbort- <MAbort- >SERR- <PERR-
Interrupt: pin A routed to IRQ 10
BIST result: 00
Region 0: Memory at e0000000 (32-bit, prefetchable) [size=128M]
Region 1: Memory at ec000000 (32-bit, non-prefetchable) [size=128K]
Region 2: I/O ports at 9000 [size=128]
Capabilities: [40] Power Management version 2
Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA
PME(D0-,D1-,D2-,D3hot-,D3cold-)
Status: D0 PME-Enable- DSel=0 DScale=0 PME-
Capabilities: [50] AGP version 2.0
Status: RQ=15 SBA+ 64bit- FW- Rate=x1,x2
Command: RQ=0 SBA- AGP- 64bit- FW- Rate=<none>
02:00.0 Network controller: Harris Semiconductor: Unknown device 3890 (rev
01)
Subsystem: Netgear: Unknown device 4800
Control: I/O- Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr-
Stepping- SERR- FastB2B-
Status: Cap+ 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort-
<TAbort- <MAbort- >SERR- <PERR-
Interrupt: pin A routed to IRQ 5
Region 0: [virtual] Memory at ec108000 (32-bit, non-prefetchable)
[size=4K]
Capabilities: [dc] Power Management version 1
Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA
PME(D0+,D1+,D2+,D3hot+,D3cold+)
Status: D0 PME-Enable- DSel=0 DScale=0 PME-
00000000-0009ffff : System RAM
000a0000-000bffff : Video RAM area
000c0000-000c7fff : Video ROM
000f0000-000fffff : System ROM
00100000-0dfeffff : System RAM
00100000-00256b24 : Kernel code
00256b25-002eaf0b : Kernel data
0dff0000-0dff2fff : ACPI Non-volatile Storage
0dff3000-0dffffff : ACPI Tables
e0000000-e7ffffff : PCI Bus #01
e0000000-e7ffffff : Silicon Integrated Systems [SiS] SiS65x/M650/740
PCI/AGP VGA Display Adapter
e8000000-ebffffff : Silicon Integrated Systems [SiS] SiS651 Host
ec000000-ec0fffff : PCI Bus #01
ec000000-ec01ffff : Silicon Integrated Systems [SiS] SiS65x/M650/740
PCI/AGP VGA Display Adapter
ec100000-ec100fff : Silicon Integrated Systems [SiS] USB 1.0 Controller
ec101000-ec101fff : Silicon Integrated Systems [SiS] USB 1.0 Controller (#2)
ec102000-ec102fff : Silicon Integrated Systems [SiS] USB 1.0 Controller (#3)
ec103000-ec103fff : Silicon Integrated Systems [SiS] USB 2.0 Controller
ec104000-ec104fff : Texas Instruments PCI1420
ec105000-ec106fff : PCI CardBus #02
ec107000-ec108fff : PCI CardBus #02
ec108000-ec108fff :
ec109000-ec109fff : Texas Instruments PCI1420 (#2)
ec10a000-ec10bfff : PCI CardBus #03
ec10c000-ec10dfff : PCI CardBus #03
ec10e000-ec10e0ff : Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+
ec10e000-ec10e0ff : 8139too
ec10f000-ec10f7ff : VIA Technologies, Inc. IEEE 1394 Host Controller
fec00000-ffffffff : reserved
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: PCI memory reservation failure - 2.4/2.6
2004-05-10 13:07 PCI memory reservation failure - 2.4/2.6 Alec H. Peterson
@ 2004-05-12 21:07 ` Manfred Spraul
2004-05-12 21:35 ` Alec H. Peterson
0 siblings, 1 reply; 7+ messages in thread
From: Manfred Spraul @ 2004-05-12 21:07 UTC (permalink / raw)
To: Alec H. Peterson; +Cc: linux-kernel, Dominik Brodowski, netdev
Alec H. Peterson wrote:
> + #if 1
> + if (!(type & IORESOURCE_IO) && (((end - start) <
> BRIDGE_SIZE_MIN) ||
> + (start & (end - start))))
> + {
> + printk(KERN_INFO "yenta %s: Preassigned resource start
> %lx end %lx too small or not aligned.\n", socket->dev->slot_name,
> start, end);
> + res->start = res->end = 0;
> + }
I'm not sure if this is the right approach - what if a bios
intentionally assigns a small area? It's dangerous to override the BIOS
setting.
I'd prefer a kernel command line parameter / module parameter / dmi
based override instead of an unconditional override based on the minimum
size.
I'll think about it.
--
Manfred
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: PCI memory reservation failure - 2.4/2.6
2004-05-12 21:07 ` Manfred Spraul
@ 2004-05-12 21:35 ` Alec H. Peterson
2004-05-15 19:34 ` Manfred Spraul
0 siblings, 1 reply; 7+ messages in thread
From: Alec H. Peterson @ 2004-05-12 21:35 UTC (permalink / raw)
To: Manfred Spraul; +Cc: linux-kernel, Dominik Brodowski, netdev
--On Wednesday, May 12, 2004 11:07 PM +0200 Manfred Spraul
<manfred@colorfullife.com> wrote:
>
> I'm not sure if this is the right approach - what if a bios intentionally
> assigns a small area? It's dangerous to override the BIOS setting.
> I'd prefer a kernel command line parameter / module parameter / dmi based
> override instead of an unconditional override based on the minimum size.
> I'll think about it.
A module parameter sounds like a grand idea. I'd be happy to take a stab
at it if others feel it is the way to go.
Alec
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: PCI memory reservation failure - 2.4/2.6
2004-05-12 21:35 ` Alec H. Peterson
@ 2004-05-15 19:34 ` Manfred Spraul
2004-05-17 13:49 ` Alec H. Peterson
0 siblings, 1 reply; 7+ messages in thread
From: Manfred Spraul @ 2004-05-15 19:34 UTC (permalink / raw)
To: Alec H. Peterson; +Cc: linux-kernel, Dominik Brodowski, netdev
[-- Attachment #1: Type: text/plain, Size: 596 bytes --]
Alec H. Peterson wrote:
>
> A module parameter sounds like a grand idea. I'd be happy to take a
> stab at it if others feel it is the way to go.
There are two possible approaches:
- just a module parameter. Probably something for 2.4.
- a combination of a dmi detection of buggy bios versions plus a pci
quirk that resets start and end to 0.
Attached is the module parameter patch against 2.6. If it works I can
write a backport to 2.4 and try to convince Marcelo to merge it.
Could you send me the output of dmidecode? I'll try to write the
autodetection patch for 2.6.
--
Manfred
[-- Attachment #2: patch-yenta --]
[-- Type: text/plain, Size: 905 bytes --]
--- 2.6/drivers/pcmcia/yenta_socket.c 2004-05-15 11:21:38.000000000 +0200
+++ build-2.6/drivers/pcmcia/yenta_socket.c 2004-05-15 15:00:22.000000000 +0200
@@ -40,7 +40,7 @@
#define to_ns(cycles) ((cycles)*120)
static int yenta_probe_cb_irq(struct yenta_socket *socket);
-
+static int override_bios;
/*
* Generate easy-to-use ways of reading a cardbus sockets
@@ -548,7 +548,7 @@
start = config_readl(socket, offset) & mask;
end = config_readl(socket, offset+4) | ~mask;
- if (start && end > start) {
+ if (start && end > start && !override_bios) {
res->start = start;
res->end = end;
if (request_resource(root, res) == 0)
@@ -1105,6 +1105,8 @@
};
MODULE_DEVICE_TABLE(pci, yenta_table);
+MODULE_PARM (override_bios, "i");
+MODULE_PARM_DESC (override_bios, "yenta ignore bios resource allocation");
static struct pci_driver yenta_cardbus_driver = {
.name = "yenta_cardbus",
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: PCI memory reservation failure - 2.4/2.6
2004-05-15 19:34 ` Manfred Spraul
@ 2004-05-17 13:49 ` Alec H. Peterson
0 siblings, 0 replies; 7+ messages in thread
From: Alec H. Peterson @ 2004-05-17 13:49 UTC (permalink / raw)
To: Manfred Spraul; +Cc: linux-kernel, Dominik Brodowski, netdev
--On Saturday, May 15, 2004 9:34 PM +0200 Manfred Spraul
<manfred@colorfullife.com> wrote:
>
> There are two possible approaches:
> - just a module parameter. Probably something for 2.4.
> - a combination of a dmi detection of buggy bios versions plus a pci
> quirk that resets start and end to 0.
>
> Attached is the module parameter patch against 2.6. If it works I can
> write a backport to 2.4 and try to convince Marcelo to merge it.
> Could you send me the output of dmidecode? I'll try to write the
> autodetection patch for 2.6.
I'm actually sticking with 2.4 for right now, which I'd be more than happy
to test on. How different would your patch be for 2.4?
I am unfamiliar with dmidecode, I am afraid.
If you can't get the requisite info for 2.6 I would be happy to move one of
my systems with the issue over to it to get the info. Please let me know.
FWIW I saw a post from somebody on netdev and madwifi-users who says he is
using your 2.6 patch with no problems.
Alec
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: PCI memory reservation failure - 2.4/2.6
[not found] ` <200405081542.39712.s0348365@sms.ed.ac.uk>
@ 2004-05-08 14:50 ` Alec H. Peterson
0 siblings, 0 replies; 7+ messages in thread
From: Alec H. Peterson @ 2004-05-08 14:50 UTC (permalink / raw)
To: s0348365; +Cc: linux-kernel
--On Saturday, May 8, 2004 3:42 PM +0100 Alistair John Strachan
<s0348365@sms.ed.ac.uk> wrote:
>
> If it's of any help to you, please see my recent bugzilla posting and
> mail to the linux-pcmcia list. I believe we have the same problem. I
> have had problems with PCI allocations on this nForce 2 (for example,
> lots of hardware that somehow works in Linux does not work in The Other
> OS, the PCMCIA bridge is no exception).
I don't think that patch will work, and here is why (at least in my case).
There they are using 4k alignment, but unfortunately I already tried that
and it required that the memory be aligned on its allocation size.
Could you try my patch instead of the one described in the bug report and
see if it works?
Thanks!
Alec
^ permalink raw reply [flat|nested] 7+ messages in thread
* PCI memory reservation failure - 2.4/2.6
@ 2004-05-08 14:30 Alec H. Peterson
[not found] ` <200405081542.39712.s0348365@sms.ed.ac.uk>
0 siblings, 1 reply; 7+ messages in thread
From: Alec H. Peterson @ 2004-05-08 14:30 UTC (permalink / raw)
To: linux-kernel
[-- Attachment #1: Type: text/plain, Size: 2257 bytes --]
Greetings,
Several users (myself included) have reported problems with PCI memory
reservation failures when using Cardbus cards with certain PCMCIA
bridge/motherboard configurations. I believe the problem stems from either
the Cardbus controller or the motherboard BIOS not assigning large enough
aligned blocks of memory to the Cardbus slots.
I am running on a Shuttle XPC (built in mainboard) with a Ricoh RL5C475
single slot PCMCIA/PCI bridge. The current kernel I am using is 2.4.25,
but I have duplicated the problem in 2.4.26 as well as 2.6.5. The lspci
-vv/iomem details (without the patched yenta_socket.o module) are attached.
The fix I propose is as follows:
*** linux-2.4.25/drivers/pcmcia/yenta.c.old Wed Feb 18 13:36:31 2004
--- linux-2.4.25/drivers/pcmcia/yenta.c Fri May 7 05:29:56 2004
***************
*** 753,758 ****
--- 753,767 ----
start = config_readl(socket, offset) & mask;
end = config_readl(socket, offset+4) | ~mask;
+ #if 1
+ if (!(type & IORESOURCE_IO) && (((end - start) < BRIDGE_SIZE_MIN)
||
+ (start & (end - start))))
+ {
+ printk(KERN_INFO "yenta %s: Preassigned resource start %lx
end %lx too small or not aligned.\n", socket->dev->slot_name, start, end);
+ res->start = res->end = 0;
+ }
+ else
+ #endif
if (start && end > start) {
res->start = start;
res->end = end;
The yenta_allocate_res() routine has a variety of restrictions it places on
memory it assigns itself (it must be >= BRIDGE_SIZE_MIN, <=
BRIDGE_SIZE_MAX, and aligned based on its size). However, the routine does
not place any such restrictions on memory it is assigned by the BIOS. This
is probably the case because it is assumed that such memory will meet the
restrictions, but at least in some cases (such as in my configuration) this
is not the case. I believe this fix will have no affect on properly
functioning BIOS, and it should do the right thing when the BIOS decides it
does not need to allocate enough aligned memory.
However, my experience in the kernel is very limited, so I hope those who
are far more versed in the details of the kernel than I will weigh in.
Thanks!
Alec
[-- Attachment #2: lspci/iomem --]
[-- Type: text/plain, Size: 11955 bytes --]
00:00.0 Host bridge: Silicon Integrated Systems [SiS]: Unknown device 0651
(rev 02)
Subsystem: Silicon Integrated Systems [SiS]: Unknown device 0651
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr-
Stepping- SERR- FastB2B-
Status: Cap+ 66Mhz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort-
<TAbort- <MAbort+ >SERR- <PERR-
Latency: 32
Region 0: Memory at e8000000 (32-bit, non-prefetchable) [size=64M]
Capabilities: [c0] AGP version 2.0
Status: RQ=31 SBA+ 64bit- FW+ Rate=x1,x2
Command: RQ=0 SBA- AGP- 64bit- FW- Rate=<none>
00:01.0 PCI bridge: Silicon Integrated Systems [SiS] 5591/5592 AGP (prog-if
00 [Normal decode])
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr-
Stepping- SERR+ FastB2B-
Status: Cap- 66Mhz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort-
<TAbort- <MAbort- >SERR- <PERR-
Latency: 64
Bus: primary=00, secondary=01, subordinate=01, sec-latency=32
I/O behind bridge: 00009000-00009fff
Memory behind bridge: ec000000-ec0fffff
Prefetchable memory behind bridge: e0000000-e7ffffff
BridgeCtl: Parity- SERR+ NoISA+ VGA+ MAbort- >Reset- FastB2B-
00:02.0 ISA bridge: Silicon Integrated Systems [SiS] 85C503/5513 (rev 14)
Control: I/O+ Mem+ BusMaster+ SpecCycle+ MemWINV- VGASnoop- ParErr-
Stepping- SERR- FastB2B-
Status: Cap- 66Mhz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort-
<TAbort- <MAbort- >SERR- <PERR-
Latency: 0
00:02.5 IDE interface: Silicon Integrated Systems [SiS] 5513 [IDE] (prog-if
8a [Master SecP PriP])
Subsystem: Silicon Integrated Systems [SiS] SiS5513 EIDE Controller
(A,B step)
Control: I/O+ Mem- BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr-
Stepping- SERR- FastB2B-
Status: Cap+ 66Mhz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort-
<TAbort- <MAbort- >SERR- <PERR-
Latency: 128
Interrupt: pin A routed to IRQ 10
Region 0: I/O ports at <ignored>
Region 1: I/O ports at <ignored>
Region 2: I/O ports at <ignored>
Region 3: I/O ports at <ignored>
Region 4: I/O ports at 4000 [size=16]
Capabilities: [58] Power Management version 2
Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA
PME(D0-,D1-,D2-,D3hot-,D3cold+)
Status: D0 PME-Enable- DSel=0 DScale=0 PME-
00:02.7 Multimedia audio controller: Silicon Integrated Systems [SiS]
SiS7012 PCI Audio Accelerator (rev a0)
Subsystem: Holco Enterprise Co, Ltd/Shuttle Computer: Unknown
device c120
Control: I/O+ Mem- BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr-
Stepping- SERR- FastB2B-
Status: Cap+ 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort-
<TAbort- <MAbort- >SERR- <PERR-
Latency: 32 (13000ns min, 2750ns max)
Interrupt: pin C routed to IRQ 11
Region 0: I/O ports at a000 [size=256]
Region 1: I/O ports at a400 [size=128]
Capabilities: [48] Power Management version 2
Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=55mA
PME(D0-,D1-,D2-,D3hot+,D3cold+)
Status: D0 PME-Enable- DSel=0 DScale=0 PME-
00:03.0 USB Controller: Silicon Integrated Systems [SiS] 7001 (rev 0f)
(prog-if 10 [OHCI])
Subsystem: Silicon Integrated Systems [SiS] 7001
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr-
Stepping- SERR- FastB2B-
Status: Cap- 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort-
<TAbort- <MAbort- >SERR- <PERR-
Latency: 32 (20000ns max), cache line size 08
Interrupt: pin A routed to IRQ 9
Region 0: Memory at ec100000 (32-bit, non-prefetchable) [size=4K]
00:03.1 USB Controller: Silicon Integrated Systems [SiS] 7001 (rev 0f)
(prog-if 10 [OHCI])
Subsystem: Silicon Integrated Systems [SiS] 7001
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr-
Stepping- SERR- FastB2B-
Status: Cap- 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort-
<TAbort- <MAbort- >SERR- <PERR-
Latency: 32 (20000ns max), cache line size 08
Interrupt: pin B routed to IRQ 5
Region 0: Memory at ec101000 (32-bit, non-prefetchable) [size=4K]
00:03.2 USB Controller: Silicon Integrated Systems [SiS] 7001 (rev 0f)
(prog-if 10 [OHCI])
Subsystem: Silicon Integrated Systems [SiS] 7001
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr-
Stepping- SERR- FastB2B-
Status: Cap- 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort-
<TAbort- <MAbort- >SERR- <PERR-
Latency: 32 (20000ns max), cache line size 08
Interrupt: pin C routed to IRQ 10
Region 0: Memory at ec102000 (32-bit, non-prefetchable) [size=4K]
00:03.3 USB Controller: Silicon Integrated Systems [SiS]: Unknown device
7002 (prog-if 20 [EHCI])
Subsystem: Holco Enterprise Co, Ltd/Shuttle Computer: Unknown
device f451
Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr-
Stepping- SERR- FastB2B-
Status: Cap+ 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort-
<TAbort- <MAbort- >SERR- <PERR-
Latency: 32 (20000ns max), cache line size 08
Interrupt: pin D routed to IRQ 11
Region 0: Memory at ec103000 (32-bit, non-prefetchable) [size=4K]
Capabilities: [50] Power Management version 2
Flags: PMEClk- DSI- D1- D2- AuxCurrent=375mA
PME(D0+,D1-,D2-,D3hot+,D3cold+)
Status: D0 PME-Enable- DSel=0 DScale=0 PME-
00:0a.0 CardBus bridge: Texas Instruments PCI1420
Subsystem: CARRY Computer ENG. CO Ltd: Unknown device 0202
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr-
Stepping- SERR- FastB2B-
Status: Cap+ 66Mhz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort-
<TAbort- <MAbort- >SERR- <PERR-
Latency: 168, cache line size 08
Interrupt: pin A routed to IRQ 5
Region 0: Memory at ec104000 (32-bit, non-prefetchable) [size=4K]
Bus: primary=00, secondary=02, subordinate=02, sec-latency=176
Memory window 0: ec105000-ec106000 (prefetchable)
Memory window 1: ec107000-ec108000
I/O window 0: 0000a800-0000ac03
I/O window 1: 0000b000-0000b403
BridgeCtl: Parity- SERR- ISA- VGA- MAbort- >Reset- 16bInt-
PostWrite+
16-bit legacy interface ports at 0001
00:0a.1 CardBus bridge: Texas Instruments PCI1420
Subsystem: CARRY Computer ENG. CO Ltd: Unknown device 0202
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr-
Stepping- SERR- FastB2B-
Status: Cap+ 66Mhz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort-
<TAbort- <MAbort- >SERR- <PERR-
Latency: 168, cache line size 08
Interrupt: pin A routed to IRQ 5
Region 0: Memory at ec109000 (32-bit, non-prefetchable) [size=4K]
Bus: primary=00, secondary=03, subordinate=03, sec-latency=176
Memory window 0: ec10a000-ec10b000 (prefetchable)
Memory window 1: ec10c000-ec10d000
I/O window 0: 0000b800-0000bc03
I/O window 1: 0000c000-0000c403
BridgeCtl: Parity- SERR- ISA- VGA- MAbort- >Reset+ 16bInt+
PostWrite+
16-bit legacy interface ports at 0001
00:0f.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C
(rev 10)
Subsystem: Realtek Semiconductor Co., Ltd. RT8139
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr-
Stepping- SERR- FastB2B-
Status: Cap+ 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort-
<TAbort- <MAbort- >SERR- <PERR-
Latency: 32 (8000ns min, 16000ns max)
Interrupt: pin A routed to IRQ 11
Region 0: I/O ports at c800 [size=256]
Region 1: Memory at ec10e000 (32-bit, non-prefetchable) [size=256]
Capabilities: [50] Power Management version 2
Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=375mA
PME(D0-,D1+,D2+,D3hot+,D3cold+)
Status: D0 PME-Enable- DSel=0 DScale=0 PME-
00:10.0 FireWire (IEEE 1394): VIA Technologies, Inc. IEEE 1394 Host
Controller (rev 46) (prog-if 10 [OHCI])
Subsystem: VIA Technologies, Inc. IEEE 1394 Host Controller
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr-
Stepping- SERR- FastB2B-
Status: Cap+ 66Mhz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort-
<TAbort- <MAbort- >SERR- <PERR-
Latency: 32 (8000ns max), cache line size 08
Interrupt: pin A routed to IRQ 9
Region 0: Memory at ec10f000 (32-bit, non-prefetchable) [size=2K]
Region 1: I/O ports at cc00 [size=128]
Capabilities: [50] Power Management version 2
Flags: PMEClk- DSI- D1- D2+ AuxCurrent=0mA
PME(D0-,D1-,D2+,D3hot+,D3cold+)
Status: D0 PME-Enable- DSel=0 DScale=0 PME-
01:00.0 VGA compatible controller: Silicon Integrated Systems [SiS]:
Unknown device 6325 (prog-if 00 [VGA])
Subsystem: Holco Enterprise Co, Ltd/Shuttle Computer: Unknown
device f451
Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr-
Stepping- SERR- FastB2B-
Status: Cap+ 66Mhz+ UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort-
<TAbort- <MAbort- >SERR- <PERR-
Interrupt: pin A routed to IRQ 10
BIST result: 00
Region 0: Memory at e0000000 (32-bit, prefetchable) [size=128M]
Region 1: Memory at ec000000 (32-bit, non-prefetchable) [size=128K]
Region 2: I/O ports at 9000 [size=128]
Capabilities: [40] Power Management version 2
Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA
PME(D0-,D1-,D2-,D3hot-,D3cold-)
Status: D0 PME-Enable- DSel=0 DScale=0 PME-
Capabilities: [50] AGP version 2.0
Status: RQ=15 SBA+ 64bit- FW- Rate=x1,x2
Command: RQ=0 SBA- AGP- 64bit- FW- Rate=<none>
02:00.0 Network controller: Harris Semiconductor: Unknown device 3890 (rev
01)
Subsystem: Netgear: Unknown device 4800
Control: I/O- Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr-
Stepping- SERR- FastB2B-
Status: Cap+ 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort-
<TAbort- <MAbort- >SERR- <PERR-
Interrupt: pin A routed to IRQ 5
Region 0: [virtual] Memory at ec108000 (32-bit, non-prefetchable)
[size=4K]
Capabilities: [dc] Power Management version 1
Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA
PME(D0+,D1+,D2+,D3hot+,D3cold+)
Status: D0 PME-Enable- DSel=0 DScale=0 PME-
00000000-0009ffff : System RAM
000a0000-000bffff : Video RAM area
000c0000-000c7fff : Video ROM
000f0000-000fffff : System ROM
00100000-0dfeffff : System RAM
00100000-00256b24 : Kernel code
00256b25-002eaf0b : Kernel data
0dff0000-0dff2fff : ACPI Non-volatile Storage
0dff3000-0dffffff : ACPI Tables
e0000000-e7ffffff : PCI Bus #01
e0000000-e7ffffff : Silicon Integrated Systems [SiS] SiS65x/M650/740
PCI/AGP VGA Display Adapter
e8000000-ebffffff : Silicon Integrated Systems [SiS] SiS651 Host
ec000000-ec0fffff : PCI Bus #01
ec000000-ec01ffff : Silicon Integrated Systems [SiS] SiS65x/M650/740
PCI/AGP VGA Display Adapter
ec100000-ec100fff : Silicon Integrated Systems [SiS] USB 1.0 Controller
ec101000-ec101fff : Silicon Integrated Systems [SiS] USB 1.0 Controller (#2)
ec102000-ec102fff : Silicon Integrated Systems [SiS] USB 1.0 Controller (#3)
ec103000-ec103fff : Silicon Integrated Systems [SiS] USB 2.0 Controller
ec104000-ec104fff : Texas Instruments PCI1420
ec105000-ec106fff : PCI CardBus #02
ec107000-ec108fff : PCI CardBus #02
ec108000-ec108fff :
ec109000-ec109fff : Texas Instruments PCI1420 (#2)
ec10a000-ec10bfff : PCI CardBus #03
ec10c000-ec10dfff : PCI CardBus #03
ec10e000-ec10e0ff : Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+
ec10e000-ec10e0ff : 8139too
ec10f000-ec10f7ff : VIA Technologies, Inc. IEEE 1394 Host Controller
fec00000-ffffffff : reserved
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2004-05-17 13:49 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-05-10 13:07 PCI memory reservation failure - 2.4/2.6 Alec H. Peterson
2004-05-12 21:07 ` Manfred Spraul
2004-05-12 21:35 ` Alec H. Peterson
2004-05-15 19:34 ` Manfred Spraul
2004-05-17 13:49 ` Alec H. Peterson
-- strict thread matches above, loose matches on Subject: below --
2004-05-08 14:30 Alec H. Peterson
[not found] ` <200405081542.39712.s0348365@sms.ed.ac.uk>
2004-05-08 14:50 ` Alec H. Peterson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).