[PATCH] dma-mapping: Use 'bitmap_zalloc()' when applicable

2021-10-24 Thread Christophe JAILLET
'dma_mem->bitmap' is a bitmap. So use 'bitmap_zalloc()' to simplify code, improve the semantic and avoid some open-coded arithmetic in allocator arguments. Also change the corresponding 'kfree()' into 'bitmap_free()' to keep consistency. Signed-off-by: Christophe JAILLET ---

Re: [PATCH] dma-mapping: Use 'bitmap_zalloc()' when applicable

2021-10-24 Thread Joe Perches
On Sun, 2021-10-24 at 19:40 +0200, Christophe JAILLET wrote: > 'dma_mem->bitmap' is a bitmap. So use 'bitmap_zalloc()' to simplify code, > improve the semantic and avoid some open-coded arithmetic in allocator > arguments. There is a cocci script for some of these.

[PATCH] iommu/vt-d: Drop duplicate check in dma_pte_free_pagetable()

2021-10-24 Thread Kefeng Wang
The BUG_ON check exists in dma_pte_clear_range(), kill the duplicate check. Signed-off-by: Kefeng Wang --- drivers/iommu/intel/iommu.c | 4 1 file changed, 4 deletions(-) diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c index d75f59ae28e6..ea2eec87a1ea 100644 ---

Re: [PATCH v3 13/33] iommu/mediatek: Remove the power status checking in tlb flush all

2021-10-24 Thread Yong Wu
On Fri, 2021-10-22 at 16:03 +0200, Dafna Hirschfeld wrote: > Hi > > > On 23.09.21 13:58, Yong Wu wrote: > > To simplify the code, Remove the power status checking in the > > tlb_flush_all, remove this: > > if (pm_runtime_get_if_in_use(data->dev) <= 0) > > continue; > > > > After

Re: [PATCH v8 04/12] iommu/mediatek: Add device_link between the consumer and the larb devices

2021-10-24 Thread Yong Wu
On Mon, 2021-10-18 at 09:13 +0200, Dafna Hirschfeld wrote: > > On 16.10.21 04:23, Yong Wu wrote: > > On Mon, 2021-10-11 at 14:36 +0200, Dafna Hirschfeld wrote: > > > > > > On 29.09.21 03:37, Yong Wu wrote: > > > > MediaTek IOMMU-SMI diagram is like below. all the consumer > > > > connect > > > >

Re: [PATCH] dma-mapping: Use 'bitmap_zalloc()' when applicable

2021-10-24 Thread Christophe JAILLET
Le 24/10/2021 à 19:54, Joe Perches a écrit : On Sun, 2021-10-24 at 19:40 +0200, Christophe JAILLET wrote: 'dma_mem->bitmap' is a bitmap. So use 'bitmap_zalloc()' to simplify code, improve the semantic and avoid some open-coded arithmetic in allocator arguments. There is a cocci script for

Re: [RFC 13/20] iommu: Extend iommu_at[de]tach_device() for multiple devices group

2021-10-24 Thread David Gibson
On Mon, Oct 18, 2021 at 01:32:38PM -0300, Jason Gunthorpe wrote: > On Mon, Oct 18, 2021 at 02:57:12PM +1100, David Gibson wrote: > > > The first user might read this. Subsequent users are likely to just > > copy paste examples from earlier things without fully understanding > > them. In general

Re: [RFC 11/20] iommu/iommufd: Add IOMMU_IOASID_ALLOC/FREE

2021-10-24 Thread David Gibson
On Thu, Oct 14, 2021 at 06:53:01AM +, Tian, Kevin wrote: > > From: David Gibson > > Sent: Thursday, October 14, 2021 1:00 PM > > > > On Wed, Oct 13, 2021 at 07:00:58AM +, Tian, Kevin wrote: > > > > From: David Gibson > > > > Sent: Friday, October 1, 2021 2:11 PM > > > > > > > > On Sun,