On Mon, 2010-02-08 at 17:14 +0000, James Bottomley wrote: > On Mon, 2010-02-08 at 16:10 +0000, Catalin Marinas wrote: > > This API would have to cope with highmem too ... and because of the > limited mappings available, we can't just map an arbitrary sized buffer > (especially in atomics where the number of available slots is often only > two). > > > static inline void *pio_map_range(void *start, size_t size, > > enum pio_data_direction dir) > > { > > return start; > > } > > > > static inline void pio_unmap_range(void *start, size_t size, > > enum pio_data_direction dir) > > { > > } > > I think really for range PIO, we need helpers to map and unmap a page at > a time ... sort of like the for_each_sg approach except this time we > loop over the pages in the range mapping and unmapping a single one. These were not intended to create any additional mapping, more like the dma_map_single() functions and only do the necessary flushing. AFAICT, an HCD driver would call the pio_map_range() once to get the address of the buffer and than wait for it to be filled in (e.g. via interrupts). When it is full, it would call pio_unmap_range(). So even if we do it per page, you still need to map the same amount of memory, unless we modify the HCD drivers but I don't think this would be very popular. Maybe the name choosing is wrong. Would something like pio_begin() and pio_end() work better for already mapped buffers? -- Catalin -- To unsubscribe from this list: send the line "unsubscribe linux-arch" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html