[PATCH] iommu/dma: Fix race condition during iova_domain initialization

2022-05-30 Thread yf.wang--- via iommu
From: Yunfei Wang When many devices share the same iova domain, iommu_dma_init_domain() may be called at the same time. The checking of iovad->start_pfn will all get false in iommu_dma_init_domain() and both enter init_iova_domain() to do iovad initialization. Fix this by protecting

Re: [PATCH v4 1/6] iommu: Add a per domain PASID for DMA API

2022-05-30 Thread Jason Gunthorpe via iommu
On Tue, May 24, 2022 at 08:17:27AM -0700, Jacob Pan wrote: > Hi Jason, > > On Tue, 24 May 2022 10:50:34 -0300, Jason Gunthorpe wrote: > > > On Wed, May 18, 2022 at 11:21:15AM -0700, Jacob Pan wrote: > > > DMA requests tagged with PASID can target individual IOMMU domains. > > > Introduce a

[PATCH AUTOSEL 5.18 001/159] iommu/vt-d: Add RPLS to quirk list to skip TE disabling

2022-05-30 Thread Sasha Levin
From: Tejas Upadhyay [ Upstream commit 0a967f5bfd9134b89681cae58deb222e20840e76 ] The VT-d spec requires (10.4.4 Global Command Register, TE field) that: Hardware implementations supporting DMA draining must drain any in-flight DMA read/write requests queued within the Root-Complex before

[PATCH AUTOSEL 5.17 083/135] dma-debug: change allocation mode from GFP_NOWAIT to GFP_ATIOMIC

2022-05-30 Thread Sasha Levin
From: Mikulas Patocka [ Upstream commit 84bc4f1d5f8aa68706a96711dccb28b518e5 ] We observed the error "cacheline tracking ENOMEM, dma-debug disabled" during a light system load (copying some files). The reason for this error is that the dma_active_cacheline radix tree uses GFP_NOWAIT

[PATCH AUTOSEL 5.15 001/109] iommu/vt-d: Add RPLS to quirk list to skip TE disabling

2022-05-30 Thread Sasha Levin
From: Tejas Upadhyay [ Upstream commit 0a967f5bfd9134b89681cae58deb222e20840e76 ] The VT-d spec requires (10.4.4 Global Command Register, TE field) that: Hardware implementations supporting DMA draining must drain any in-flight DMA read/write requests queued within the Root-Complex before

[PATCH AUTOSEL 4.19 26/38] dma-debug: change allocation mode from GFP_NOWAIT to GFP_ATIOMIC

2022-05-30 Thread Sasha Levin
From: Mikulas Patocka [ Upstream commit 84bc4f1d5f8aa68706a96711dccb28b518e5 ] We observed the error "cacheline tracking ENOMEM, dma-debug disabled" during a light system load (copying some files). The reason for this error is that the dma_active_cacheline radix tree uses GFP_NOWAIT

[PATCH AUTOSEL 5.15 069/109] dma-debug: change allocation mode from GFP_NOWAIT to GFP_ATIOMIC

2022-05-30 Thread Sasha Levin
From: Mikulas Patocka [ Upstream commit 84bc4f1d5f8aa68706a96711dccb28b518e5 ] We observed the error "cacheline tracking ENOMEM, dma-debug disabled" during a light system load (copying some files). The reason for this error is that the dma_active_cacheline radix tree uses GFP_NOWAIT

Re: [PATCH V2 2/6] iommu: iova: properly handle 0 as a valid IOVA address

2022-05-30 Thread Ajay Kumar
Hi Robin On Mon, May 23, 2022 at 11:00 PM Robin Murphy wrote: > > On 2022-05-11 13:15, Ajay Kumar wrote: > > From: Marek Szyprowski > > > > Zero is a valid DMA and IOVA address on many architectures, so adjust the > > IOVA management code to properly handle it. A new value IOVA_BAD_ADDR > >

[PATCH AUTOSEL 5.10 50/76] dma-debug: change allocation mode from GFP_NOWAIT to GFP_ATIOMIC

2022-05-30 Thread Sasha Levin
From: Mikulas Patocka [ Upstream commit 84bc4f1d5f8aa68706a96711dccb28b518e5 ] We observed the error "cacheline tracking ENOMEM, dma-debug disabled" during a light system load (copying some files). The reason for this error is that the dma_active_cacheline radix tree uses GFP_NOWAIT

[syzbot] WARNING in dma_map_sgtable (2)

2022-05-30 Thread syzbot
Hello, syzbot found the following issue on: HEAD commit:7e062cda7d90 Merge tag 'net-next-5.19' of git://git.kernel.. git tree: upstream console+strace: https://syzkaller.appspot.com/x/log.txt?x=172151d3f0 kernel config: https://syzkaller.appspot.com/x/.config?x=e9d71d3c07c36588

[PATCH AUTOSEL 5.18 100/159] dma-debug: change allocation mode from GFP_NOWAIT to GFP_ATIOMIC

2022-05-30 Thread Sasha Levin
From: Mikulas Patocka [ Upstream commit 84bc4f1d5f8aa68706a96711dccb28b518e5 ] We observed the error "cacheline tracking ENOMEM, dma-debug disabled" during a light system load (copying some files). The reason for this error is that the dma_active_cacheline radix tree uses GFP_NOWAIT

[PATCH AUTOSEL 5.10 01/76] iommu/vt-d: Add RPLS to quirk list to skip TE disabling

2022-05-30 Thread Sasha Levin
From: Tejas Upadhyay [ Upstream commit 0a967f5bfd9134b89681cae58deb222e20840e76 ] The VT-d spec requires (10.4.4 Global Command Register, TE field) that: Hardware implementations supporting DMA draining must drain any in-flight DMA read/write requests queued within the Root-Complex before

Re: [PATCH 01/12] iommu/vt-d: Use iommu_get_domain_for_dev() in debugfs

2022-05-30 Thread Jason Gunthorpe via iommu
On Sun, May 29, 2022 at 01:14:46PM +0800, Baolu Lu wrote: > From 1e87b5df40c6ce9414cdd03988c3b52bfb17af5f Mon Sep 17 00:00:00 2001 > From: Lu Baolu > Date: Sun, 29 May 2022 10:18:56 +0800 > Subject: [PATCH 1/1] iommu/vt-d: debugfs: Remove device_domain_lock usage > > The

[PATCH AUTOSEL 5.17 001/135] iommu/vt-d: Add RPLS to quirk list to skip TE disabling

2022-05-30 Thread Sasha Levin
From: Tejas Upadhyay [ Upstream commit 0a967f5bfd9134b89681cae58deb222e20840e76 ] The VT-d spec requires (10.4.4 Global Command Register, TE field) that: Hardware implementations supporting DMA draining must drain any in-flight DMA read/write requests queued within the Root-Complex before

[PATCH AUTOSEL 5.4 37/55] dma-debug: change allocation mode from GFP_NOWAIT to GFP_ATIOMIC

2022-05-30 Thread Sasha Levin
From: Mikulas Patocka [ Upstream commit 84bc4f1d5f8aa68706a96711dccb28b518e5 ] We observed the error "cacheline tracking ENOMEM, dma-debug disabled" during a light system load (copying some files). The reason for this error is that the dma_active_cacheline radix tree uses GFP_NOWAIT

[PATCH 1/3] dt-bindings: iommu: mediatek: add binding documentation for MT8365 SoC

2022-05-30 Thread Fabien Parent
Add IOMMU binding documentation for the MT8365 SoC. Signed-off-by: Fabien Parent --- .../bindings/iommu/mediatek,iommu.yaml| 2 + include/dt-bindings/memory/mt8365-larb-port.h | 96 +++ 2 files changed, 98 insertions(+) create mode 100644

[PATCH 2/3] iommu: mtk_iommu: add support for 6-bit encoded port IDs

2022-05-30 Thread Fabien Parent
Until now the port ID was always encoded as a 5-bit data. On MT8365, the port ID is encoded as a 6-bit data. This requires to rework the macros F_MMU_INT_ID_LARB_ID, and F_MMU_INT_ID_PORT_ID in order to support 5-bit and 6-bit encoded port IDs. Signed-off-by: Fabien Parent ---

[PATCH 3/3] iommu: mtk_iommu: add support for MT8365 SoC

2022-05-30 Thread Fabien Parent
Add IOMMU support for MT8365 SoC. Signed-off-by: Fabien Parent --- drivers/iommu/mtk_iommu.c | 11 +++ drivers/iommu/mtk_iommu.h | 1 + 2 files changed, 12 insertions(+) diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c index b692347d8d56..039b8f9d5022 100644 ---

[PATCH V3 5/8] dt-bindings: Add xen, grant-dma IOMMU description for xen-grant DMA ops

2022-05-30 Thread Oleksandr Tyshchenko
From: Oleksandr Tyshchenko The main purpose of this binding is to communicate Xen specific information using generic IOMMU device tree bindings (which is a good fit here) rather than introducing a custom property. Introduce Xen specific IOMMU for the virtualized device (e.g. virtio) to be used

Re: [PATCH 01/12] iommu/vt-d: Use iommu_get_domain_for_dev() in debugfs

2022-05-30 Thread Baolu Lu
On 2022/5/30 20:14, Jason Gunthorpe wrote: On Sun, May 29, 2022 at 01:14:46PM +0800, Baolu Lu wrote: From 1e87b5df40c6ce9414cdd03988c3b52bfb17af5f Mon Sep 17 00:00:00 2001 From: Lu Baolu Date: Sun, 29 May 2022 10:18:56 +0800 Subject: [PATCH 1/1] iommu/vt-d: debugfs: Remove device_domain_lock

Re: [PATCH v1] driver core: Extend deferred probe timeout on driver registration

2022-05-30 Thread Niklas Cassel via iommu
On Wed, May 25, 2022 at 12:49:00PM -0700, Saravana Kannan wrote: > On Wed, May 25, 2022 at 12:12 AM Sebastian Andrzej Siewior > wrote: > > > > On 2022-05-24 10:46:49 [-0700], Saravana Kannan wrote: > > > > Removing probe_timeout_waitqueue (as suggested) or setting the timeout > > > > to 0 avoids

[PATCH v7 2/2] iommu/mediatek: Allow page table PA up to 35bit

2022-05-30 Thread yf.wang--- via iommu
From: Yunfei Wang Single memory zone feature will remove ZONE_DMA32 and ZONE_DMA. So add the quirk IO_PGTABLE_QUIRK_ARM_MTK_TTBR_EXT to let level 1 and level 2 pgtable support at most 35bit PA. Signed-off-by: Ning Li Signed-off-by: Yunfei Wang --- drivers/iommu/mtk_iommu.c | 29

[PATCH v7 1/2] iommu/io-pgtable-arm-v7s: Add a quirk to allow pgtable PA up to 35bit

2022-05-30 Thread yf.wang--- via iommu
From: Yunfei Wang Single memory zone feature will remove ZONE_DMA32 and ZONE_DMA and cause pgtable PA size larger than 32bit. Since Mediatek IOMMU hardware support at most 35bit PA in pgtable, so add a quirk to allow the PA of pgtables support up to bit35. Signed-off-by: Ning Li

Re: [RFC PATCH v1 0/9] deferred_probe_timeout logic clean up

2022-05-30 Thread Sebastian Andrzej Siewior
On 2022-05-26 01:15:39 [-0700], Saravana Kannan wrote: > Yoshihiro/Geert, Hi Saravana, > If you can test this patch series and confirm that the NFS root case > works, I'd really appreciate that. The two patches you sent earlier, plus this series, plus diff --git a/drivers/base/core.c

Re: [RFC PATCH v1 2/9] pinctrl: devicetree: Delete usage of driver_deferred_probe_check_state()

2022-05-30 Thread Geert Uytterhoeven
Hi Saravana, Thanks for your patch! On Thu, May 26, 2022 at 10:16 AM Saravana Kannan wrote: > Now that fw_devlink=on by default and fw_devlink supports > "pinctrl-[0-8]" property, the execution will never get to the point 0-9? oh, it's really 0-8:

Re: [RFC PATCH v1 4/9] Revert "driver core: Set default deferred_probe_timeout back to 0."

2022-05-30 Thread Geert Uytterhoeven
Hi Saravana, On Thu, May 26, 2022 at 10:16 AM Saravana Kannan wrote: > This reverts commit 11f7e7ef553b6b93ac1aa74a3c2011b9cc8aeb61. scripts/chdeckpatch.pl says: WARNING: Unknown commit id '11f7e7ef553b6b93ac1aa74a3c2011b9cc8aeb61', maybe rebased or not pulled? I assume this is your local

Re: [RFC PATCH v1 0/9] deferred_probe_timeout logic clean up

2022-05-30 Thread Geert Uytterhoeven
Hi Saravana, On Thu, May 26, 2022 at 10:15 AM Saravana Kannan wrote: > This series is based on linux-next + these 2 small patches applies on top: > https://lore.kernel.org/lkml/20220526034609.480766-1-sarava...@google.com/ > > A lot of the deferred_probe_timeout logic is redundant with >

Re: [RFC PATCH v1 7/9] driver core: Add fw_devlink_unblock_may_probe() helper function

2022-05-30 Thread Andy Shevchenko
On Thu, May 26, 2022 at 1:22 PM Saravana Kannan wrote: > > This function can be used during the kernel boot sequence to forcefully > override fw_devlink=on and unblock the probing of all devices that have > a driver. > > It's mainly meant to be called from late_initcall() or >