From 13369891d8b5cdd78974b116ed1ce00bea870eea Mon Sep 17 00:00:00 2001 From: David Brownell Date: Sun, 22 Jul 2007 15:13:13 -0700 Subject: [PATCH] --- yaml --- r: 63199 b: refs/heads/master c: a12b8db02035673153bbf19bb3641a08bed9e4b8 h: refs/heads/master i: 63197: abb34fdf626d0bec9b6019e484f917d51abc70ef 63195: 573f8886a60fdc45f6518eab09f8688b0df69bed 63191: def0a819e1aa6dcfc1ec2169e59a729d39386076 63183: 1f8ed2748b6ac7399076db13e121c4abe1808b4e 63167: a765c78e4799bfba6c6bde828ad57fe5e9436752 v: v3 --- [refs] | 2 +- trunk/drivers/usb/core/message.c | 15 +++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index ab568622aea6..024dba636334 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: e31c18804f584dd838a752f6628e8c15bd7a3372 +refs/heads/master: a12b8db02035673153bbf19bb3641a08bed9e4b8 diff --git a/trunk/drivers/usb/core/message.c b/trunk/drivers/usb/core/message.c index 25f63f1096b4..ad4b956380d2 100644 --- a/trunk/drivers/usb/core/message.c +++ b/trunk/drivers/usb/core/message.c @@ -411,15 +411,22 @@ int usb_sg_init ( * Some systems need to revert to PIO when DMA is temporarily * unavailable. For their sakes, both transfer_buffer and * transfer_dma are set when possible. However this can only - * work on systems without HIGHMEM, since DMA buffers located - * in high memory are not directly addressable by the CPU for - * PIO ... so when HIGHMEM is in use, transfer_buffer is NULL + * work on systems without: + * + * - HIGHMEM, since DMA buffers located in high memory are + * not directly addressable by the CPU for PIO; + * + * - IOMMU, since dma_map_sg() is allowed to use an IOMMU to + * make virtually discontiguous buffers be "dma-contiguous" + * so that PIO and DMA need diferent numbers of URBs. + * + * So when HIGHMEM or IOMMU are in use, transfer_buffer is NULL * to prevent stale pointers and to help spot bugs. */ if (dma) { io->urbs [i]->transfer_dma = sg_dma_address (sg + i); len = sg_dma_len (sg + i); -#ifdef CONFIG_HIGHMEM +#if defined(CONFIG_HIGHMEM) || defined(CONFIG_IOMMU) io->urbs[i]->transfer_buffer = NULL; #else io->urbs[i]->transfer_buffer =