From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751260AbVI1MoE (ORCPT ); Wed, 28 Sep 2005 08:44:04 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751265AbVI1MoE (ORCPT ); Wed, 28 Sep 2005 08:44:04 -0400 Received: from zproxy.gmail.com ([64.233.162.192]:21897 "EHLO zproxy.gmail.com") by vger.kernel.org with ESMTP id S1751260AbVI1MoD (ORCPT ); Wed, 28 Sep 2005 08:44:03 -0400 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:from:to:cc:user-agent:content-type:subject:message-id:date; b=GiCNwSNBGPhPtLNtc4NpuSpBk5VdkqmLyPVBiRd9SYwC/bsOrHc14XqA3NWDomG/G9Yj5CNM/wtI7hPrcnF7J4jbPNnVjb8k5foa//I7zZ/C9BuCIHa5BKxi0+91FxAjjFUvmgEz9q1cYZQH2/ozOLosnPngNcn+3yNdDjLs4Aw= From: Tejun Heo To: ak@suse.de, gregkh@suse.de Cc: linux-kernel@vger.kernel.org User-Agent: lksp 0.3 Content-Type: text/plain; charset=US-ASCII Subject: [PATCH linux-2.6 00/03] i386_and_x86_64: implement dma_broken_dac() test Message-ID: <20050928124148.EBEDFAFE@htj.dyndns.org> Date: Wed, 28 Sep 2005 21:44:06 +0900 (KST) Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Hello, Andi Kleen & Greg Kroah-Hartman. I've encountered this problem on my new desktop - an athlon 64 machine with ASUS A8N-E (w/ CK804 a.k.a nforce4 chipset, lspci results at the end of this mail) and 4 gigs of memory. I put in an intel 82541 gigabit controller in one of its PCI slot but it malfunctioned. If I ping from another machine, replies got dropped, delayed in seconds, dupped and/or corrupted. As the last 1gig of memory lived above 4G barrier, I suspected addressing problem and booted with mem=4G. Then, it worked fine. I verified again with Adaptec 29160 SCSI controller. Without mem=4G, data corruption occurred and sometimes probing went wrong with lots of messages similar to the following. scsi: host 4 channel 0 id 1 lun 0xffffffffffffffff has a LUN larger than currently supported. I believe the problem is with the PCI bridge on the chipset as the ethernet controller living on the chipset, which doesn't go throught the PCI bridge, has no problem accessing memories over 4G. The following patchset a. implements dma_broken_dac() in arch/i386/quirks.c which takes a device and returns whether any ancestor of the device is in bridges_with_broken_dac pci ID list, which currently contains only CK804 PCI bridge. b. adds dma_broken_dac() check to dma_supported() functions of i386 and x86_64 thus failing 64bit pci_set_dma_mask for devices hanging off bridges with broken DAC support. arch/i386/kernel/quirks.c was chosen as the test is needed by both i386 and x86_64. I didn't know where to put the prototype and put it right above its usage for i386 and in asm-x86_64/proto.h for x86_64. Please let me know if there are better places. With these patches applied, my machine reports like the following on boot and the e1000 and aic79xx work fine. PCI 0000:05:06.0: bridge 0000:00:09.0 has broken DAC support, 64bit DMA disabled Thanks. [ Start of patch descriptions ] 01_i386_and_x86_64_implement-dma_broken_dac.patch : implement dma_broken_dac() test for i386 and x86_64 CK804 PCI bridge fails to forward DAC commands from the secondary bus to the primary, which is required by PCI specification from ver1.1. This patch implements dma_broken_dac() which tests whether there is any such bridge among parents of a given device. 02_i386_and_x86_64_add-broken-dac-check-to-i386.patch : check broken_dac to i386 dma_supported() check for broken_dac in i386 dma_supported() routine. This disables 64-bit DMA for devices hanging off broken bridges. 03_i386_and_x86_64_add-broken-dac-check-to-x86_64.patch : check broken_dac to x86_64 dma_supported() check for broken_dac in x86-64 dma_supported() routine. This disables 64-bit DMA for devices hanging off broken bridges. [ End of patch descriptions ] Details regarding the machine. a. Memory configuration. BIOS-e820: 0000000000000000 - 000000000009f800 (usable) BIOS-e820: 000000000009f800 - 00000000000a0000 (reserved) BIOS-e820: 00000000000f0000 - 0000000000100000 (reserved) BIOS-e820: 0000000000100000 - 00000000bfff0000 (usable) BIOS-e820: 00000000bfff0000 - 00000000bfff3000 (ACPI NVS) BIOS-e820: 00000000bfff3000 - 00000000c0000000 (ACPI data) BIOS-e820: 00000000e0000000 - 00000000f0000000 (reserved) BIOS-e820: 00000000fec00000 - 0000000100000000 (reserved) BIOS-e820: 0000000100000000 - 0000000140000000 (usable) b. lspci -vt -[00]-+-00.0 nVidia Corporation CK804 Memory Controller +-01.0 nVidia Corporation CK804 ISA Bridge +-01.1 nVidia Corporation CK804 SMBus +-02.0 nVidia Corporation CK804 USB Controller +-02.1 nVidia Corporation CK804 USB Controller +-04.0 nVidia Corporation CK804 AC'97 Audio Controller +-06.0 nVidia Corporation CK804 IDE +-07.0 nVidia Corporation CK804 Serial ATA Controller +-08.0 nVidia Corporation CK804 Serial ATA Controller +-09.0-[05]--+-06.0 Intel Corporation 82541GI/PI Gigabit Ethernet Controller | +-07.0 VIA Technologies Inc. VT1720/24 [Envy24PT/HT] PCI Multi-Channel Audio Controller | \-08.0 Timedia Technology Co Ltd PCI2S550 (Dual 16550 UART) +-0a.0 nVidia Corporation CK804 Ethernet Controller +-0b.0-[04]-- +-0c.0-[03]-- +-0d.0-[02]-- +-0e.0-[01]----00.0 nVidia Corporation GeForce 6200 TurboCache(TM) +-18.0 Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] HyperTransport Technology Configuration +-18.1 Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Address Map +-18.2 Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] DRAM Controller \-18.3 Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Miscellaneous Control c. lspci -nvvv 0000:00:00.0 0580: 10de:005e (rev a3) Subsystem: 1043:815a Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- Reset- FastB2B- 0000:00:0a.0 0680: 10de:0057 (rev a3) Subsystem: 1043:8141 Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort- SERR- TAbort- SERR- Reset- FastB2B- 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: [48] Message Signalled Interrupts: 64bit+ Queue=0/1 Enable- Address: 0000000000000000 Data: 0000 Capabilities: [58] #08 [a800] Capabilities: [80] #10 [0141] 0000:00:0c.0 0604: 10de:005d (rev a3) Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- SERR- Reset- FastB2B- 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: [48] Message Signalled Interrupts: 64bit+ Queue=0/1 Enable- Address: 0000000000000000 Data: 0000 Capabilities: [58] #08 [a800] Capabilities: [80] #10 [0141] 0000:00:0d.0 0604: 10de:005d (rev a3) Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- SERR- Reset- FastB2B- 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: [48] Message Signalled Interrupts: 64bit+ Queue=0/1 Enable- Address: 0000000000000000 Data: 0000 Capabilities: [58] #08 [a800] Capabilities: [80] #10 [0141] 0000:00:0e.0 0604: 10de:005d (rev a3) Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- SERR- Reset- FastB2B- 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: [48] Message Signalled Interrupts: 64bit+ Queue=0/1 Enable- Address: 0000000000000000 Data: 0000 Capabilities: [58] #08 [a800] Capabilities: [80] #10 [0141] 0000:00:18.0 0600: 1022:1100 Control: I/O- Mem- BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR-