From patchwork Wed Jan 20 23:28:32 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: stephen hemminger X-Patchwork-Id: 43379 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id C8EACB7D73 for ; Thu, 21 Jan 2010 10:28:55 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752311Ab0ATX2u (ORCPT ); Wed, 20 Jan 2010 18:28:50 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752194Ab0ATX2u (ORCPT ); Wed, 20 Jan 2010 18:28:50 -0500 Received: from mail.vyatta.com ([76.74.103.46]:60483 "EHLO mail.vyatta.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752191Ab0ATX2u (ORCPT ); Wed, 20 Jan 2010 18:28:50 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.vyatta.com (Postfix) with ESMTP id BBFF04F42C2; Wed, 20 Jan 2010 15:28:44 -0800 (PST) X-Virus-Scanned: amavisd-new at tahiti.vyatta.com Received: from mail.vyatta.com ([127.0.0.1]) by localhost (mail.vyatta.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YOyKxLzGJlIY; Wed, 20 Jan 2010 15:28:40 -0800 (PST) Received: from nehalam (pool-74-107-135-205.ptldor.fios.verizon.net [74.107.135.205]) by mail.vyatta.com (Postfix) with ESMTP id DBB394F4271; Wed, 20 Jan 2010 15:28:39 -0800 (PST) Date: Wed, 20 Jan 2010 15:28:32 -0800 From: Stephen Hemminger To: David Miller Cc: jarkao2@gmail.com, netdev@vger.kernel.org Subject: Re: [PATCH 00/11] DMA sync errors Message-ID: <20100120152832.06a905a5@nehalam> In-Reply-To: <20100120.144639.31770545.davem@davemloft.net> References: <20100120204459.820265084@vyatta.com> <20100120.144639.31770545.davem@davemloft.net> Organization: Vyatta X-Mailer: Claws Mail 3.7.2 (GTK+ 2.18.3; x86_64-pc-linux-gnu) Mime-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This should fix the dma-debug API code (and documentation), to avoid false positives when sync is done on a partial map. Signed-off-by: Stephen Hemminger --- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- a/Documentation/DMA-API.txt 2010-01-20 15:17:01.390143729 -0800 +++ b/Documentation/DMA-API.txt 2010-01-20 15:18:48.967875255 -0800 @@ -377,9 +377,10 @@ void pci_dma_sync_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nelems, int direction) -Synchronise a single contiguous or scatter/gather mapping. All the -parameters must be the same as those passed into the single mapping -API. +Synchronise a single contiguous or scatter/gather mapping. The +device and handle must be the same as those passed into the single mapping +API. The size can be less than the original mapping if only part +of the mapping needs to be accessed. Notes: You must do this: --- a/lib/dma-debug.c 2010-01-20 15:22:55.919519883 -0800 +++ b/lib/dma-debug.c 2010-01-20 15:26:31.648895638 -0800 @@ -285,11 +285,9 @@ static struct dma_debug_entry *hash_buck } /* - * If we have multiple matches but no perfect-fit, just return - * NULL. + * If we have multiple matches but no perfect-fit + * return best value and let caller deal with it. */ - ret = (matches == 1) ? ret : NULL; - return ret; }