/linux-6.3-rc2/lib/ |
A D | sg_pool.c | 40 static inline unsigned int sg_pool_index(unsigned short nents) in sg_pool_index() argument 44 BUG_ON(nents > SG_CHUNK_SIZE); in sg_pool_index() 46 if (nents <= 8) in sg_pool_index() 49 index = get_count_order(nents) - 3; in sg_pool_index() 58 sgp = sg_pools + sg_pool_index(nents); in sg_pool_free() 66 sgp = sg_pools + sg_pool_index(nents); in sg_pool_alloc() 117 BUG_ON(!nents); in sg_alloc_table_chained() 120 if (nents <= nents_first_chunk) { in sg_alloc_table_chained() 121 table->nents = table->orig_nents = nents; in sg_alloc_table_chained() 122 sg_init_table(table->sgl, nents); in sg_alloc_table_chained() [all …]
|
A D | scatterlist.c | 47 int nents; in sg_nents() local 49 nents++; in sg_nents() 50 return nents; in sg_nents() 70 int nents; in sg_nents_for_len() local 77 nents++; in sg_nents_for_len() 80 return nents; in sg_nents_for_len() 106 for_each_sg(sgl, sg, nents, i) in sg_last() 127 sg_init_marker(sgl, nents); in sg_init_table() 294 if (nents == 0) in __sg_alloc_table() 301 left = nents; in __sg_alloc_table() [all …]
|
A D | sg_split.c | 13 int nents; member 20 static int sg_calculate_split(struct scatterlist *in, int nents, int nb_splits, in sg_calculate_split() argument 32 splitters[i].nents = 0; in sg_calculate_split() 35 for_each_sg(in, sg, nents, i) { in sg_calculate_split() 48 curr->nents++; in sg_calculate_split() 59 curr->nents = 1; in sg_calculate_split() 86 for (j = 0; j < split->nents; j++, out_sg++) { in sg_split_phys() 112 for (j = 0; j < split->nents; j++, out_sg++) { in sg_split_mapped() 168 splitters[i].out_sg = kmalloc_array(splitters[i].nents, in sg_split() 190 out_mapped_nents[i] = splitters[i].nents; in sg_split()
|
A D | kfifo.c | 296 int nents, unsigned int len) in setup_sgl_buf() argument 303 if (!nents) in setup_sgl_buf() 323 if (++n == nents || sgl == NULL) in setup_sgl_buf() 335 int nents, unsigned int len, unsigned int off) in setup_sgl() argument 350 n = setup_sgl_buf(sgl, fifo->data + off, nents, l); in setup_sgl() 357 struct scatterlist *sgl, int nents, unsigned int len) in __kfifo_dma_in_prepare() argument 365 return setup_sgl(fifo, sgl, nents, len, fifo->in); in __kfifo_dma_in_prepare() 370 struct scatterlist *sgl, int nents, unsigned int len) in __kfifo_dma_out_prepare() argument 378 return setup_sgl(fifo, sgl, nents, len, fifo->out); in __kfifo_dma_out_prepare() 551 BUG_ON(!nents); in __kfifo_dma_in_prepare_r() [all …]
|
/linux-6.3-rc2/drivers/gpu/drm/virtio/ |
A D | virtgpu_gem.c | 172 objs->nents = 0; in virtio_gpu_array_alloc() 173 objs->total = nents; in virtio_gpu_array_alloc() 192 for (i = 0; i < nents; i++) { in virtio_gpu_array_from_handles() 195 objs->nents = i; in virtio_gpu_array_from_handles() 200 objs->nents = i; in virtio_gpu_array_from_handles() 211 objs->objs[objs->nents] = obj; in virtio_gpu_array_add_obj() 212 objs->nents++; in virtio_gpu_array_add_obj() 220 if (objs->nents == 1) { in virtio_gpu_array_lock_resv() 241 if (objs->nents == 1) { in virtio_gpu_array_unlock_resv() 254 for (i = 0; i < objs->nents; i++) in virtio_gpu_array_add_fence() [all …]
|
A D | virtgpu_object.c | 138 unsigned int *nents) in virtio_gpu_object_shmem_init() argument 150 *nents = pages->nents; in virtio_gpu_object_shmem_init() 152 *nents = pages->orig_nents; in virtio_gpu_object_shmem_init() 154 *ents = kvmalloc_array(*nents, in virtio_gpu_object_shmem_init() 188 unsigned int nents; in virtio_gpu_object_create() local 205 ret = virtio_gpu_object_shmem_init(vgdev, bo, &ents, &nents); in virtio_gpu_object_create() 226 ents, nents); in virtio_gpu_object_create() 230 virtio_gpu_object_attach(vgdev, bo, ents, nents); in virtio_gpu_object_create() 234 virtio_gpu_object_attach(vgdev, bo, ents, nents); in virtio_gpu_object_create()
|
/linux-6.3-rc2/samples/kfifo/ |
A D | dma-example.c | 25 unsigned int nents; in example_init() local 63 nents = kfifo_dma_in_prepare(&fifo, sg, ARRAY_SIZE(sg), FIFO_SIZE); in example_init() 64 printk(KERN_INFO "DMA sgl entries: %d\n", nents); in example_init() 65 if (!nents) { in example_init() 73 for (i = 0; i < nents; i++) { in example_init() 93 nents = kfifo_dma_out_prepare(&fifo, sg, ARRAY_SIZE(sg), 8); in example_init() 94 printk(KERN_INFO "DMA sgl entries: %d\n", nents); in example_init() 95 if (!nents) { in example_init() 102 for (i = 0; i < nents; i++) { in example_init()
|
/linux-6.3-rc2/include/linux/ |
A D | scatterlist.h | 41 unsigned int nents; /* number of mapped entries */ member 186 for_each_sg((sgt)->sgl, sg, (sgt)->nents, i) 354 unsigned int nents) in sg_init_marker() argument 356 sg_mark_end(&sgl[nents - 1]); in sg_init_marker() 427 void sgl_free_n_order(struct scatterlist *sgl, int nents, int order); 444 size_t sg_zero_buffer(struct scatterlist *sgl, unsigned int nents, 475 int sg_alloc_table_chained(struct sg_table *table, int nents, 514 struct scatterlist *sglist, unsigned int nents, 547 #define for_each_sg_page(sglist, piter, nents, pgoffset) \ argument 592 for_each_sg_dma_page((sgt)->sgl, dma_iter, (sgt)->nents, pgoffset) [all …]
|
/linux-6.3-rc2/drivers/hwtracing/intel_th/ |
A D | msu-sink.c | 54 unsigned int nents; in msu_sink_alloc_window() local 62 nents = DIV_ROUND_UP(size, PAGE_SIZE); in msu_sink_alloc_window() 64 ret = sg_alloc_table(*sgt, nents, GFP_KERNEL); in msu_sink_alloc_window() 70 for_each_sg((*sgt)->sgl, sg_ptr, nents, i) { in msu_sink_alloc_window() 80 return nents; in msu_sink_alloc_window() 90 for_each_sg(sgt->sgl, sg_ptr, sgt->nents, i) { in msu_sink_free_window()
|
/linux-6.3-rc2/drivers/gpu/drm/i915/ |
A D | i915_scatterlist.c | 21 if (orig_st->nents == orig_st->orig_nents) in i915_sg_trim() 24 if (sg_alloc_table(&new_st, orig_st->nents, GFP_KERNEL | __GFP_NOWARN)) in i915_sg_trim() 28 for_each_sg(orig_st->sgl, sg, orig_st->nents, i) { in i915_sg_trim() 113 st->nents = 0; in i915_rsgt_from_mm_node() 122 if (st->nents) in i915_rsgt_from_mm_node() 130 st->nents++; in i915_rsgt_from_mm_node() 199 st->nents = 0; in i915_rsgt_from_buddy_resource() 212 if (st->nents) in i915_rsgt_from_buddy_resource() 220 st->nents++; in i915_rsgt_from_buddy_resource()
|
/linux-6.3-rc2/drivers/spi/ |
A D | spi-dw-dma.c | 252 u32 nents; in dw_spi_dma_wait_tx_done() local 254 nents = dw_readl(dws, DW_SPI_TXFLR); in dw_spi_dma_wait_tx_done() 256 delay.value = nents * dws->n_bytes * BITS_PER_BYTE; in dw_spi_dma_wait_tx_done() 300 unsigned int nents) in dw_spi_dma_submit_tx() argument 337 u32 nents; in dw_spi_dma_wait_rx_done() local 348 nents = dw_readl(dws, DW_SPI_RXFLR); in dw_spi_dma_wait_rx_done() 349 ns = 4U * NSEC_PER_SEC / dws->max_freq * nents; in dw_spi_dma_wait_rx_done() 401 unsigned int nents) in dw_spi_dma_submit_rx() argument 479 xfer->rx_sg.nents); in dw_spi_dma_transfer_all() 600 unsigned int nents; in dw_spi_dma_transfer() local [all …]
|
A D | spi-ep93xx.c | 285 int i, ret, nents; in ep93xx_spi_dma_prepare() local 325 nents = DIV_ROUND_UP(len, PAGE_SIZE); in ep93xx_spi_dma_prepare() 326 if (nents != sgt->nents) { in ep93xx_spi_dma_prepare() 329 ret = sg_alloc_table(sgt, nents, GFP_KERNEL); in ep93xx_spi_dma_prepare() 335 for_each_sg(sgt->sgl, sg, sgt->nents, i) { in ep93xx_spi_dma_prepare() 355 nents = dma_map_sg(chan->device->dev, sgt->sgl, sgt->nents, dir); in ep93xx_spi_dma_prepare() 356 if (!nents) in ep93xx_spi_dma_prepare() 359 txd = dmaengine_prep_slave_sg(chan, sgt->sgl, nents, conf.direction, in ep93xx_spi_dma_prepare() 362 dma_unmap_sg(chan->device->dev, sgt->sgl, sgt->nents, dir); in ep93xx_spi_dma_prepare() 391 dma_unmap_sg(chan->device->dev, sgt->sgl, sgt->nents, dir); in ep93xx_spi_dma_finish()
|
/linux-6.3-rc2/drivers/crypto/ccree/ |
A D | cc_buffer_mgr.c | 77 unsigned int nents = 0; in cc_get_sgl_nents() local 82 nents++; in cc_get_sgl_nents() 91 return nents; in cc_get_sgl_nents() 109 u32 nents; in cc_copy_sg_portion() local 244 sgl_data->nents[index] = nents; in cc_add_sg_entry() 264 *nents = 0; in cc_map_sg() 270 *nents = 0; in cc_map_sg() 272 *nents, max_sg_nents); in cc_map_sg() 278 *nents = 0; in cc_map_sg() 518 sg_virt(req->src), areq_ctx->src.nents, areq_ctx->assoc.nents, in cc_unmap_aead_request() [all …]
|
/linux-6.3-rc2/kernel/dma/ |
A D | direct.h | 21 int dma_direct_map_sg(struct device *dev, struct scatterlist *sgl, int nents, 28 int nents, enum dma_data_direction dir); 31 struct scatterlist *sgl, int nents, enum dma_data_direction dir) in dma_direct_sync_sg_for_device() argument 40 int nents, enum dma_data_direction dir, unsigned long attrs); 42 struct scatterlist *sgl, int nents, enum dma_data_direction dir); 45 struct scatterlist *sgl, int nents, enum dma_data_direction dir, in dma_direct_unmap_sg() argument 50 struct scatterlist *sgl, int nents, enum dma_data_direction dir) in dma_direct_sync_sg_for_cpu() argument
|
A D | mapping.c | 194 arch_dma_map_sg_direct(dev, sg, nents)) in __dma_map_sg_attrs() 197 ents = ops->map_sg(dev, sg, nents, dir, attrs); in __dma_map_sg_attrs() 200 kmsan_handle_dma_sg(sg, nents, dir); in __dma_map_sg_attrs() 269 int nents; in dma_map_sgtable() local 272 if (nents < 0) in dma_map_sgtable() 273 return nents; in dma_map_sgtable() 274 sgt->nents = nents; in dma_map_sgtable() 286 debug_dma_unmap_sg(dev, sg, nents, dir); in dma_unmap_sg_attrs() 288 arch_dma_unmap_sg_direct(dev, sg, nents)) in dma_unmap_sg_attrs() 291 ops->unmap_sg(dev, sg, nents, dir, attrs); in dma_unmap_sg_attrs() [all …]
|
/linux-6.3-rc2/drivers/parisc/ |
A D | iommu-helpers.h | 15 iommu_fill_pdir(struct ioc *ioc, struct scatterlist *startsg, int nents, in iommu_fill_pdir() argument 30 while (nents-- > 0) { in iommu_fill_pdir() 34 DBG_RUN_SG(" %d : %08lx/%05x %p/%05x\n", nents, in iommu_fill_pdir() 102 struct scatterlist *startsg, int nents, in iommu_coalesce_chunks() argument 114 while (nents > 0) { in iommu_coalesce_chunks() 131 while(--nents > 0) { in iommu_coalesce_chunks()
|
/linux-6.3-rc2/fs/netfs/ |
A D | iterator.c | 115 struct scatterlist *sg = sgtable->sgl + sgtable->nents; in netfs_extract_user_to_sg() 143 sgtable->nents++; in netfs_extract_user_to_sg() 153 while (sgtable->nents > sgtable->orig_nents) in netfs_extract_user_to_sg() 154 put_page(sg_page(&sgtable->sgl[--sgtable->nents])); in netfs_extract_user_to_sg() 169 struct scatterlist *sg = sgtable->sgl + sgtable->nents; in netfs_extract_bvec_to_sg() 187 sgtable->nents++; in netfs_extract_bvec_to_sg() 215 struct scatterlist *sg = sgtable->sgl + sgtable->nents; in netfs_extract_kvec_to_sg() 246 sgtable->nents++; in netfs_extract_kvec_to_sg() 275 struct scatterlist *sg = sgtable->sgl + sgtable->nents; in netfs_extract_xarray_to_sg() 298 sgtable->nents++; in netfs_extract_xarray_to_sg()
|
/linux-6.3-rc2/drivers/target/iscsi/cxgbit/ |
A D | cxgbit_ddp.c | 153 unsigned int nents) in cxgbit_ddp_sgl_check() argument 155 unsigned int last_sgidx = nents - 1; in cxgbit_ddp_sgl_check() 158 for (i = 0; i < nents; i++, sg = sg_next(sg)) { in cxgbit_ddp_sgl_check() 177 unsigned int sgcnt = ttinfo->nents; in cxgbit_ddp_reserve() 184 xferlen, ttinfo->nents); in cxgbit_ddp_reserve() 246 ttinfo->nents = cmd->se_cmd.t_data_nents; in cxgbit_get_r2t_ttt() 251 csk, cmd, cmd->se_cmd.data_length, ttinfo->nents); in cxgbit_get_r2t_ttt() 254 ttinfo->nents = 0; in cxgbit_get_r2t_ttt() 286 ttinfo->nents, DMA_FROM_DEVICE); in cxgbit_unmap_cmd() 287 ttinfo->nents = 0; in cxgbit_unmap_cmd()
|
/linux-6.3-rc2/drivers/crypto/cavium/nitrox/ |
A D | nitrox_req.h | 555 static inline void *alloc_req_buf(int nents, int extralen, gfp_t gfp) in alloc_req_buf() argument 559 size = sizeof(struct scatterlist) * nents; in alloc_req_buf() 621 int nents, int ivsize) in alloc_src_req_buf() argument 625 nkreq->src = alloc_req_buf(nents, ivsize, creq->gfp); in alloc_src_req_buf() 643 int nents, int ivsize, in nitrox_creq_set_src_sg() argument 652 sg_init_table(sg, nents); in nitrox_creq_set_src_sg() 667 int nents) in alloc_dst_req_buf() argument 672 nkreq->dst = alloc_req_buf(nents, extralen, creq->gfp); in alloc_dst_req_buf() 701 int nents, int ivsize, in nitrox_creq_set_dst_sg() argument 710 sg_init_table(sg, nents); in nitrox_creq_set_dst_sg()
|
A D | nitrox_aead.c | 97 int nents = sg_nents_for_len(src, buflen); in alloc_src_sglist() local 100 if (nents < 0) in alloc_src_sglist() 101 return nents; in alloc_src_sglist() 104 nents += 1; in alloc_src_sglist() 106 ret = alloc_src_req_buf(nkreq, nents, ivsize); in alloc_src_sglist() 111 nitrox_creq_set_src_sg(nkreq, nents, ivsize, src, buflen); in alloc_src_sglist() 119 int nents = sg_nents_for_len(dst, buflen); in alloc_dst_sglist() local 122 if (nents < 0) in alloc_dst_sglist() 123 return nents; in alloc_dst_sglist() 126 nents += 3; in alloc_dst_sglist() [all …]
|
/linux-6.3-rc2/drivers/mmc/core/ |
A D | sdio_ops.c | 122 unsigned int nents, left_size, i; in mmc_io_rw_extended() local 152 nents = DIV_ROUND_UP(left_size, seg_size); in mmc_io_rw_extended() 153 if (nents > 1) { in mmc_io_rw_extended() 154 if (sg_alloc_table(&sgtable, nents, GFP_KERNEL)) in mmc_io_rw_extended() 158 data.sg_len = nents; in mmc_io_rw_extended() 196 if (nents > 1) in mmc_io_rw_extended()
|
/linux-6.3-rc2/arch/ia64/hp/common/ |
A D | sba_iommu.c | 389 while (nents-- > 0) { in sba_dump_sg() 401 int the_nents = nents; in sba_check_sg() 1200 int nents) in sba_fill_pdir() argument 1207 while (nents-- > 0) { in sba_fill_pdir() 1295 int nents) in sba_coalesce_chunks() argument 1306 while (nents > 0) { in sba_coalesce_chunks() 1324 while (--nents > 0) { in sba_coalesce_chunks() 1457 if (nents == 1) { in sba_map_sg_attrs() 1470 sba_dump_sg(ioc, sglist, nents); in sba_map_sg_attrs() 1506 sba_dump_sg(ioc, sglist, nents); in sba_map_sg_attrs() [all …]
|
/linux-6.3-rc2/arch/sparc/mm/ |
A D | iommu.c | 249 int nents, enum dma_data_direction dir, unsigned long attrs, in __sbus_iommu_map_sg() argument 255 for_each_sg(sgl, sg, nents, j) { in __sbus_iommu_map_sg() 263 return nents; in __sbus_iommu_map_sg() 267 int nents, enum dma_data_direction dir, unsigned long attrs) in sbus_iommu_map_sg_gflush() argument 270 return __sbus_iommu_map_sg(dev, sgl, nents, dir, attrs, false); in sbus_iommu_map_sg_gflush() 274 int nents, enum dma_data_direction dir, unsigned long attrs) in sbus_iommu_map_sg_pflush() argument 276 return __sbus_iommu_map_sg(dev, sgl, nents, dir, attrs, true); in sbus_iommu_map_sg_pflush() 299 int nents, enum dma_data_direction dir, unsigned long attrs) in sbus_iommu_unmap_sg() argument 304 for_each_sg(sgl, sg, nents, i) { in sbus_iommu_unmap_sg()
|
/linux-6.3-rc2/arch/mips/jazz/ |
A D | jazzdma.c | 544 int nents, enum dma_data_direction dir, unsigned long attrs) in jazz_dma_map_sg() argument 549 for_each_sg(sglist, sg, nents, i) { in jazz_dma_map_sg() 559 return nents; in jazz_dma_map_sg() 563 int nents, enum dma_data_direction dir, unsigned long attrs) in jazz_dma_unmap_sg() argument 568 for_each_sg(sglist, sg, nents, i) { in jazz_dma_unmap_sg() 588 struct scatterlist *sgl, int nents, enum dma_data_direction dir) in jazz_dma_sync_sg_for_device() argument 593 for_each_sg(sgl, sg, nents, i) in jazz_dma_sync_sg_for_device() 598 struct scatterlist *sgl, int nents, enum dma_data_direction dir) in jazz_dma_sync_sg_for_cpu() argument 603 for_each_sg(sgl, sg, nents, i) in jazz_dma_sync_sg_for_cpu()
|
/linux-6.3-rc2/arch/x86/kernel/ |
A D | amd_gart_64.c | 276 static void gart_unmap_sg(struct device *dev, struct scatterlist *sg, int nents, in gart_unmap_sg() argument 282 for_each_sg(sg, s, nents, i) { in gart_unmap_sg() 291 int nents, int dir) in dma_map_sg_nonforce() argument 300 for_each_sg(sg, s, nents, i) { in dma_map_sg_nonforce() 308 nents = 0; in dma_map_sg_nonforce() 318 return nents; in dma_map_sg_nonforce() 377 static int gart_map_sg(struct device *dev, struct scatterlist *sg, int nents, in gart_map_sg() argument 386 if (nents == 0) in gart_map_sg() 397 for_each_sg(sg, s, nents, i) { in gart_map_sg() 439 if (out < nents) { in gart_map_sg() [all …]
|