Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752023AbWCBRWX (ORCPT ); Thu, 2 Mar 2006 12:22:23 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752027AbWCBRWX (ORCPT ); Thu, 2 Mar 2006 12:22:23 -0500 Received: from stat9.steeleye.com ([209.192.50.41]:35249 "EHLO hancock.sc.steeleye.com") by vger.kernel.org with ESMTP id S1751593AbWCBRWV (ORCPT ); Thu, 2 Mar 2006 12:22:21 -0500 Subject: Re: Question: how to map SCSI data DMA address to virtual address? From: James Bottomley To: Christoph Hellwig Cc: "Ju, Seokmann" , "Ju, Seokmann" , linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org In-Reply-To: <20060302170915.GA31316@infradead.org> References: <9738BCBE884FDB42801FAD8A7769C2651420C1@NAMAIL1.ad.lsil.com> <20060302170915.GA31316@infradead.org> Content-Type: text/plain Date: Thu, 02 Mar 2006 11:22:12 -0600 Message-Id: <1141320132.3238.20.camel@mulgrave.il.steeleye.com> Mime-Version: 1.0 X-Mailer: Evolution 2.2.3 (2.2.3-2.fc4) Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 658 Lines: 19 On Thu, 2006-03-02 at 17:09 +0000, Christoph Hellwig wrote: > For each sg list entry do something like: > > buffer = kmap_atomic(sg->page, KM_USER0) + sg->offset; > > kunmap_atomic(buffer - sg->offset, KM_USER0); Remember too that the data might not necessarily be valid without a flush depending on where it has come from (or where it is going). See the dma_sync_sg_for_device/cpu. James - 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/