History

comedi: remove the mapping of the Comedi buffer in vmalloc address space

Now that all the code that accesses the Comedi buffer data does so page-by-page, using the `virt_addr` member of `struct comedi_buf_page` to point to the data of each page, do not linearly map the buffer into vmalloc address space (pointed to by the `prealloc_buf` member of `struct comedi_async`). That was only done for convenience, but was not done for those drivers that need a DMA coherent buffer, which is allocated in a single chunk. Remove the `prealloc_buf` member as it is no longer used.

Ian Abbott committed 1 year ago

Commit 5117f281 parent e7199b62 files · +6 −49Browse files

Showing the changes to include/linux/comedi (1 of 2 files). Show all

Unified · Split

include/linux/comedi/comedidev.h+2−8
@@ -234,16 +234,12 @@ struct comedi_buf_page { · 233 unmodified lines
234234 *
235235 * A COMEDI data buffer is allocated as individual pages, either in
236236 * conventional memory or DMA coherent memory, depending on the attached,
237− * low-level hardware device. (The buffer pages also get mapped into the
238− * kernel's contiguous virtual address space pointed to by the 'prealloc_buf'
239− * member of &struct comedi_async.)
237+ * low-level hardware device.
240238 *
241239 * The buffer is normally freed when the COMEDI device is detached from the
242240 * low-level driver (which may happen due to device removal), but if it happens
243241 * to be mmapped at the time, the pages cannot be freed until the buffer has
244− * been munmapped. That is what the reference counter is for. (The virtual
245− * address space pointed by 'prealloc_buf' is freed when the COMEDI device is
246− * detached.)
242+ * been munmapped. That is what the reference counter is for.
247243 */
248244 struct comedi_buf_map {
249245 struct device *dma_hw_dev;
@@ -255,7 +251,6 @@ struct comedi_buf_map { · 5 unmodified lines
255251
256252 /**
257253 * struct comedi_async - Control data for asynchronous COMEDI commands
258− * @prealloc_buf: Kernel virtual address of allocated acquisition buffer.
259254 * @prealloc_bufsz: Buffer size (in bytes).
260255 * @buf_map: Map of buffer pages.
261256 * @max_bufsize: Maximum allowed buffer size (in bytes).
@@ -344,7 +339,6 @@ struct comedi_buf_map { · 82 unmodified lines
344339 * less than or equal to UINT_MAX).
345340 */
346341 struct comedi_async {
347− void *prealloc_buf;
348342 unsigned int prealloc_bufsz;
349343 struct comedi_buf_map *buf_map;
350344 unsigned int max_bufsize;