On Fri, Feb 13, 2009 at 07:24:07PM -0500, Pavel Roskin wrote: > Hello! > > I've seen this problem reported many times, but it's the first time I > can reproduce it on my machine. > > I'm using a system with Intel Q6600 CPU and 4Gb of memory running a > x86_64 Fedora 10 with a custom compiled kernel from the current > wireless-testing repository (it's Linux 2.6.29-rc4 with the latest > wireless stuff). > > I have a Ricoh PCMCIA/CardBus adapter in a PCI slot. No CardBus cards > inserted into the adapter work. In particular, an Atheros 5416 card > supported by ath9k is not working, nor do any other Atheros cards > supported by ath5k. It turns out, the cards are forced to use memory > beyond the first 4Gb of RAM. From /proc/iomem (full copy is below): > > 100000000-12fffffff : System RAM > 130000000-133ffffff : PCI CardBus 0000:04 > 130000000-13000ffff : 0000:04:00.0 > > ath9k allocates its resources with the following calls (omitting error > handling): > > ret = pci_request_region(pdev, 0, "ath9k"); > mem = pci_iomap(pdev, 0, 0); I'm wondering if this has something to do with cachable vs uncachable MMIO address ranges. More below. I thought "pci_iomap_nocache" became the default a few years ago. > I don't see how the driver could be doing anything wrong. I believe > CardBus devices simply don't understand addresses beyond the first 4 > gigabytes. That can be proven by dumping the PCI config space for that device. Can you post the output of "lspci -xs 04:00.0" and "lspci -vs 04:00.0" ? If the BIOS is the one that assigned the > 32-bit address range, it expected the Cardbus bridge could support that. However, normal PCI or PCI-X bridges only support one 32-bit MMIO and one 64-bit "prefetchable" MMIO range. > It turns out the CardBus device gets another region: > d8000000-dbffffff : PCI CardBus 0000:04 And this suggests both types have been allocated. The "lspci" output will tell us. hth, grant > > However, the ath9k resources are not allocated there. I know some Ricoh > adapters have two slots, but this resource must be for the same slot, > since it's also bus 4. > > I have found a workaround. If I add "pci=cbmemsize=32M" to the kernel > command line, all PCI resources are under 4Gb and everything works: > > d8000000-d9ffffff : PCI CardBus 0000:04 > da000000-dbffffff : PCI CardBus 0000:04 > da000000-da00ffff : 0000:04:00.0 > da000000-da00ffff : ath9k > > The problem exists with "pci=cbmemsize=64M" (64M is the default). From > the kernel log: > > [ 0.916567] pci 0000:03:01.0: CardBus bridge, secondary bus 0000:04 > [ 0.916611] pci 0000:03:01.0: IO window: 0x00e000-0x00e0ff > [ 0.916656] pci 0000:03:01.0: IO window: 0x00e400-0x00e4ff > [ 0.916701] pci 0000:03:01.0: PREFETCH window: 0xd8000000-0xdbffffff > [ 0.916747] pci 0000:03:01.0: MEM window: 0x130000000-0x133ffffff > > $ cat /proc/iomem > 00000000-0000ffff : reserved > 00010000-0009fbff : System RAM > 0009fc00-0009ffff : reserved > 000c0000-000cffff : pnp 00:0e > 000e0000-000fffff : reserved > 00100000-cff9ffff : System RAM > 00200000-005cbc05 : Kernel code > 005cbc06-0077277f : Kernel data > 007f6000-008975cf : Kernel bss > cffa0000-cffadfff : ACPI Tables > cffae000-cffeffff : ACPI Non-volatile Storage > cfff0000-cfffdfff : reserved > d0000000-d7ffffff : PCI Bus 0000:01 > d0000000-d3ffffff : 0000:01:00.0 > d0000000-d3ffffff : radeonfb framebuffer > d8000000-dbffffff : PCI CardBus 0000:04 > dcf00000-deffffff : PCI Bus 0000:03 > dcfff000-dcffffff : 0000:03:02.0 > dcfff000-dcffffff : orinoco_pci > dfffbc00-dfffbfff : 0000:00:1d.7 > dfffbc00-dfffbfff : ehci_hcd > dfffc000-dfffffff : 0000:00:1b.0 > dfffc000-dfffffff : ICH HD audio > e0000000-efffffff : PCI MMCONFIG 0 > e0000000-efffffff : pnp 00:0d > f0000000-fe2fffff : PCI Bus 0000:01 > f0000000-f000ffff : 0000:01:00.0 > f0000000-f000ffff : radeonfb mmio > fe2d0000-fe2dffff : 0000:01:00.1 > fe2e0000-fe2fffff : 0000:01:00.0 > fe300000-fe3fffff : PCI Bus 0000:02 > fe3c0000-fe3dffff : 0000:02:00.0 > fe3ff000-fe3fffff : 0000:02:00.0 > fe3ff000-fe3fffff : r8169 > fe400000-febfffff : PCI Bus 0000:03 > fe400000-fe400fff : 0000:03:01.0 > fe400000-fe400fff : yenta_socket > fec00000-fec00fff : IOAPIC 0 > fec00000-fec00fff : pnp 00:0c > fed00000-fed003ff : HPET 0 > fed14000-fed19fff : pnp 00:01 > fed1c000-fed1ffff : pnp 00:08 > fed20000-fed8ffff : pnp 00:08 > fee00000-fee00fff : Local APIC > fee00000-fee00fff : reserved > fee00000-fee00fff : pnp 00:0c > ffb80000-ffffffff : reserved > ffc00000-fff7ffff : pnp 00:0b > 100000000-12fffffff : System RAM > 130000000-133ffffff : PCI CardBus 0000:04 > > $ lspci > 00:00.0 Host bridge: Intel Corporation 82G33/G31/P35/P31 Express DRAM Controller (rev 10) > 00:01.0 PCI bridge: Intel Corporation 82G33/G31/P35/P31 Express PCI Express Root Port (rev 10) > 00:1b.0 Audio device: Intel Corporation 82801G (ICH7 Family) High Definition Audio Controller (rev 01) > 00:1c.0 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 1 (rev 01) > 00:1d.0 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #1 (rev 01) > 00:1d.1 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #2 (rev 01) > 00:1d.2 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #3 (rev 01) > 00:1d.3 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #4 (rev 01) > 00:1d.7 USB Controller: Intel Corporation 82801G (ICH7 Family) USB2 EHCI Controller (rev 01) > 00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev e1) > 00:1f.0 ISA bridge: Intel Corporation 82801GB/GR (ICH7 Family) LPC Interface Bridge (rev 01) > 00:1f.2 IDE interface: Intel Corporation 82801GB/GR/GH (ICH7 Family) SATA IDE Controller (rev 01) > 00:1f.3 SMBus: Intel Corporation 82801G (ICH7 Family) SMBus Controller (rev 01) > 01:00.0 VGA compatible controller: ATI Technologies Inc RV370 5B60 [Radeon X300 (PCIE)] > 01:00.1 Display controller: ATI Technologies Inc RV370 [Radeon X300SE] > 02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8101E/RTL8102E PCI Express Fast Ethernet controller (rev 01) > 03:01.0 CardBus bridge: Ricoh Co Ltd RL5c475 (rev 81) > 03:02.0 Network controller: Intersil Corporation Prism 2.5 Wavelan chipset (rev 01) > 04:00.0 Network controller: Atheros Communications Inc. AR5008 Wireless Network Adapter (rev 01) > > $ lspci -v -s 03:01.0 > 03:01.0 CardBus bridge: Ricoh Co Ltd RL5c475 (rev 81) > Flags: bus master, medium devsel, latency 168, IRQ 18 > Memory at fe400000 (32-bit, non-prefetchable) [size=4K] > Bus: primary=03, secondary=04, subordinate=07, sec-latency=176 > Memory window 0: d8000000-dbfff000 (prefetchable) > Memory window 1: 30000000-33fff000 > I/O window 0: 0000e000-0000e0ff > I/O window 1: 0000e400-0000e4ff > 16-bit legacy interface ports at 0001 > Kernel driver in use: yenta_cardbus > > Memory window 1 is shown incorrectly! > > -- > Regards, > Pavel Roskin > -- > To unsubscribe from this list: send the line "unsubscribe linux-pci" in > the body of a message to majordomo@xxxxxxxxxxxxxxx > More majordomo info at http://vger.kernel.org/majordomo-info.html -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html