From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Aloni Subject: Re: [PATCH] sata_mv: stabilize for 5081 and other fixes Date: Sun, 12 Mar 2006 07:49:31 +0200 Message-ID: <20060312054931.GA23943@localdomain> References: <20060308194627.GA22346@localdomain> <44137D39.3000704@pobox.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from noname.neutralserver.com ([70.84.186.210]:36314 "EHLO noname.neutralserver.com") by vger.kernel.org with ESMTP id S1751195AbWCLFtH (ORCPT ); Sun, 12 Mar 2006 00:49:07 -0500 Content-Disposition: inline In-Reply-To: <44137D39.3000704@pobox.com> Sender: linux-ide-owner@vger.kernel.org List-Id: linux-ide@vger.kernel.org To: Jeff Garzik Cc: Linux Kernel List , "linux-ide@vger.kernel.org" On Sat, Mar 11, 2006 at 08:45:29PM -0500, Jeff Garzik wrote: > > This is adding a bug. > > The IOMMU worst case requires a split for each s/g entry, due to DMA > boundary issues. See mv_fill_sg() or ata_fill_sg(). > > Thus, the above "/ 2" is required. Okay I figured it out - here we are using the SCSI sg driver, and a scatter-gatter entry generated by that driver will never cross a page boundery (nor a DMA boundary), because each userspace page is mapped into one scatter-gatter entry, so in that case the "/ 2" isn't needed. Coming to think about it, that's only valid on x86 and x86_64. Are there other architectures that break that assumption? I'd still want to be able to read/write 1MB at a time, otherwise it would require massive userspace code rewrites in our application, (limiting it to 0.5MB). Do you have any suggestions about how to do that? I mean, it is not trivial to pass 128 entries of 2*PAGE_SIZE based on userspace memory. p.s. I thought scatter-gatter entries are only valid for the page they point to, it's good to learn new things :) -- Dan Aloni da-x@monatomic.org, da-x@colinux.org, da-x@gmx.net, dan@xiv.co.il