Re: [PATCH v9 01/14] swiotlb: Refactor swiotlb init functions

2021-06-14 Thread Claire Chang
On Mon, Jun 14, 2021 at 2:16 PM Christoph Hellwig wrote: > > On Fri, Jun 11, 2021 at 11:26:46PM +0800, Claire Chang wrote: > > + spin_lock_init(&mem->lock); > > + for (i = 0; i < mem->nslabs; i++) { > > + mem->slots[i].list = IO_TLB_SEGSIZE - io_tlb_offset(i); > > +

Re: [PATCH v9 01/14] swiotlb: Refactor swiotlb init functions

2021-06-13 Thread Christoph Hellwig
On Fri, Jun 11, 2021 at 11:26:46PM +0800, Claire Chang wrote: > + spin_lock_init(&mem->lock); > + for (i = 0; i < mem->nslabs; i++) { > + mem->slots[i].list = IO_TLB_SEGSIZE - io_tlb_offset(i); > + mem->slots[i].orig_addr = INVALID_PHYS_ADDR; > + mem->slo

[PATCH v9 01/14] swiotlb: Refactor swiotlb init functions

2021-06-11 Thread Claire Chang
Add a new function, swiotlb_init_io_tlb_mem, for the io_tlb_mem struct initialization to make the code reusable. Signed-off-by: Claire Chang --- kernel/dma/swiotlb.c | 53 ++-- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/kernel/dma/swio