RE: [PATCH] tpm: ibmvtpm: Make use of dma_alloc_coherent()

2021-10-12 Thread David Laight
From: Jarkko Sakkinen > Sent: 12 October 2021 18:41 > > On Tue, 2021-10-12 at 12:43 -0300, Jason Gunthorpe wrote: > > On Tue, Oct 12, 2021 at 06:29:58PM +0300, Jarkko Sakkinen wrote: > > > On Mon, 2021-10-11 at 00:01 +0800, Cai Huoqing wrote: > > > > Replacing

Re: [PATCH] tpm: ibmvtpm: Make use of dma_alloc_coherent()

2021-10-12 Thread Jarkko Sakkinen
On Tue, 2021-10-12 at 12:43 -0300, Jason Gunthorpe wrote: > On Tue, Oct 12, 2021 at 06:29:58PM +0300, Jarkko Sakkinen wrote: > > On Mon, 2021-10-11 at 00:01 +0800, Cai Huoqing wrote: > > > Replacing kmalloc/kfree/get_zeroed_page/free_page/dma_map_single/ > >   ~ > >   Replace > > > > >

Re: [PATCH] tpm: ibmvtpm: Make use of dma_alloc_coherent()

2021-10-12 Thread Jason Gunthorpe
On Tue, Oct 12, 2021 at 06:29:58PM +0300, Jarkko Sakkinen wrote: > On Mon, 2021-10-11 at 00:01 +0800, Cai Huoqing wrote: > > Replacing kmalloc/kfree/get_zeroed_page/free_page/dma_map_single/ > ~ > Replace > > > dma_unmap_single() with dma_alloc_coherent/dma_free_coherent() > > helps

Re: [PATCH] tpm: ibmvtpm: Make use of dma_alloc_coherent()

2021-10-12 Thread Jarkko Sakkinen
On Mon, 2021-10-11 at 00:01 +0800, Cai Huoqing wrote: > Replacing kmalloc/kfree/get_zeroed_page/free_page/dma_map_single/ ~ Replace > dma_unmap_single() with dma_alloc_coherent/dma_free_coherent() > helps to reduce code size, and simplify the code, and coherent > DMA will not clear

[PATCH] tpm: ibmvtpm: Make use of dma_alloc_coherent()

2021-10-10 Thread Cai Huoqing
Replacing kmalloc/kfree/get_zeroed_page/free_page/dma_map_single/ dma_unmap_single() with dma_alloc_coherent/dma_free_coherent() helps to reduce code size, and simplify the code, and coherent DMA will not clear the cache every time. Signed-off-by: Cai Huoqing --- drivers/char/tpm/tpm_ibmvtpm.c