Re: [PATCH v3 02/25] drm: core: fix common struct sg_table related issues

2020-05-12 Thread Marek Szyprowski
Hi Christoph, On 08.05.2020 09:16, Christoph Hellwig wrote: > On Fri, May 08, 2020 at 09:12:13AM +0200, Marek Szyprowski wrote: >> Then we would just need one more helper to construct scatterlist, as the >> above two are read-only don't allow to modify scatterlist: >> >> #define for_each_sgtable_s

Re: [PATCH v3 02/25] drm: core: fix common struct sg_table related issues

2020-05-08 Thread Marek Szyprowski
Hi Christoph, On 05.05.2020 13:09, Christoph Hellwig wrote: > On Tue, May 05, 2020 at 12:51:58PM +0200, Marek Szyprowski wrote: >> On 05.05.2020 12:15, Christoph Hellwig wrote: - for_each_sg_page(st->sgl, &sg_iter, st->nents, 0) + for_each_sg_page(st->sgl, &sg_iter, st-

Re: [PATCH v3 02/25] drm: core: fix common struct sg_table related issues

2020-05-05 Thread Marek Szyprowski
Hi Christoph, On 05.05.2020 12:15, Christoph Hellwig wrote: >> -for_each_sg_page(st->sgl, &sg_iter, st->nents, 0) >> +for_each_sg_page(st->sgl, &sg_iter, st->orig_nents, 0) > Would it make sense to also add a for_each_sgtable_page helper that > hides the use of orig_nents?

[PATCH v3 02/25] drm: core: fix common struct sg_table related issues

2020-05-05 Thread Marek Szyprowski
The Documentation/DMA-API-HOWTO.txt states that dma_map_sg returns the numer of the created entries in the DMA address space. However the subsequent calls to dma_sync_sg_for_{device,cpu} and dma_unmap_sg must be called with the original number of the entries passed to dma_map_sg. The sg_table->nent