Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S265357AbUAEUlN (ORCPT ); Mon, 5 Jan 2004 15:41:13 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S265359AbUAEUlN (ORCPT ); Mon, 5 Jan 2004 15:41:13 -0500 Received: from pizda.ninka.net ([216.101.162.242]:45965 "EHLO pizda.ninka.net") by vger.kernel.org with ESMTP id S265357AbUAEUku (ORCPT ); Mon, 5 Jan 2004 15:40:50 -0500 Date: Mon, 5 Jan 2004 12:35:09 -0800 From: "David S. Miller" To: Andi Kleen Cc: gibbs@scsiguy.com, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org Subject: Re: [BUG] x86_64 pci_map_sg modifies sg list - fails multiple map/unmaps Message-Id: <20040105123509.4bacf670.davem@redhat.com> In-Reply-To: References: <2938942704.1073325455@aslan.btc.adaptec.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1062 Lines: 29 On Mon, 05 Jan 2004 20:47:19 +0100 Andi Kleen wrote: > Actually I disabled merging by default in the latest x86-64 code, > but it can be still enabled by the user using options (it makes some > adapters run several percent faster). I would appreciate if you could > fix the problem anyways. > > I was actually planning to add a BUG() for this. Should do that. > There is already one that triggers often when the problem occurs. Andi, you must not modify sg->length in any way shape or form. The following is legal: pci_map_sg(..&sg); pci_unmap_sg(...&sg); pci_map_sg(..&sg); If you must modify the length field for DMA, you must have a seperate dma_length member of the scatterlist structure on your platform, see what sparc64 does here. If the documentation states this wrongly, it's a doc bug. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/