Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754789AbZAISIt (ORCPT ); Fri, 9 Jan 2009 13:08:49 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753014AbZAISIi (ORCPT ); Fri, 9 Jan 2009 13:08:38 -0500 Received: from kandzendo.ru ([195.178.208.66]:59108 "EHLO tservice.net.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752958AbZAISIh (ORCPT ); Fri, 9 Jan 2009 13:08:37 -0500 Date: Fri, 9 Jan 2009 21:08:36 +0300 From: Evgeniy Polyakov To: Joerg Roedel Cc: linux-kernel@vger.kernel.org, mingo@redhat.com, dwmw2@infradead.org, fujita.tomonori@lab.ntt.co.jp, netdev@vger.kernel.org, iommu@lists.linux-foundation.org Subject: Re: [PATCH 10/16] dma-debug: add add checking for map/unmap_sg Message-ID: <20090109180836.GD30168@ioremap.net> References: <1231517970-20288-1-git-send-email-joerg.roedel@amd.com> <1231517970-20288-11-git-send-email-joerg.roedel@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1231517970-20288-11-git-send-email-joerg.roedel@amd.com> User-Agent: Mutt/1.5.13 (2006-08-11) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1566 Lines: 60 On Fri, Jan 09, 2009 at 05:19:24PM +0100, Joerg Roedel (joerg.roedel@amd.com) wrote: > +void debug_map_sg(struct device *dev, struct scatterlist *sg, > + int nents, int direction) > +{ > + struct dma_debug_entry *entry; > + struct scatterlist *s; > + int i; > + > + if (global_disable) > + return; > + > + for_each_sg(sg, s, nents, i) { > + entry = dma_entry_alloc(); > + if (!entry) > + return; > + > + entry->type = dma_debug_sg; > + entry->dev = dev; > + entry->cpu_addr = sg_virt(s); > + entry->size = s->length; > + entry->dev_addr = s->dma_address; > + entry->direction = direction; > + > + add_dma_entry(entry); > + } > +} > +EXPORT_SYMBOL(debug_map_sg); > + > +void debug_unmap_sg(struct device *dev, struct scatterlist *sglist, > + int nelems, int dir) > +{ > + struct scatterlist *s; > + int i; > + > + if (global_disable) > + return; > + > + for_each_sg(sglist, s, nelems, i) { > + > + struct dma_debug_entry ref = { > + .type = dma_debug_sg, > + .dev = dev, > + .cpu_addr = sg_virt(s), > + .dev_addr = s->dma_address, > + .size = s->length, > + .direction = dir, > + }; > + > + check_unmap(&ref); Will this print false errors if above map debug failed to add an entry into the list? -- Evgeniy Polyakov -- 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/