Re: [PATCH 2/2] iommu/amd: Remove performance counter pre-initialization test

2021-04-10 Thread David Coe
Well, well! This is a promising start to the weekend. Thank you both, Suravee and Paul. Results for AMD Ryzen 4 2400G running Ubuntu 21.04β kernel 5.11.0-13 and Windows 10 2H2 under KVM $ sudo dmesg | grep IOMMU [0.557725] pci :00:00.2: AMD-Vi: IOMMU performance counters supported [

[PATCH v5 01/16] dt-binding: mediatek: Get rid of mediatek, larb for multimedia HW

2021-04-10 Thread Yong Wu
After adding device_link between the consumer with the smi-larbs, if the consumer call its owner pm_runtime_get(_sync), the pm_runtime_get(_sync) of smi-larb and smi-common will be called automatically. Thus, the consumer don't need the property. And IOMMU also know which larb this consumer connec

[PATCH v5 03/16] iommu/mediatek: Add device_link between the consumer and the larb devices

2021-04-10 Thread Yong Wu
MediaTek IOMMU-SMI diagram is like below. all the consumer connect with smi-larb, then connect with smi-common. M4U | smi-common | - | |... | | larb1 larb2 | | vdec venc When the consumer works, it should enab

[PATCH v5 05/16] media: mtk-jpeg: Use pm_runtime_resume_and_get for PM get_sync

2021-04-10 Thread Yong Wu
pm_runtime_get_sync will increment pm usage counter even it failed. This patch use pm_runtime_resume_and_get instead of pm_runtime_get to keep usage counter balanced. CC: Xia Jiang Signed-off-by: Yong Wu --- drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c | 4 ++-- 1 file changed, 2 insertions(

[PATCH v5 08/16] media: mtk-mdp: Get rid of mtk_smi_larb_get/put

2021-04-10 Thread Yong Wu
MediaTek IOMMU has already added the device_link between the consumer and smi-larb device. If the mdp device call the pm_runtime_get_sync, the smi-larb's pm_runtime_get_sync also be called automatically. CC: Minghsiu Tsai CC: Houlong Wei Signed-off-by: Yong Wu Reviewed-by: Evan Green --- driv

[PATCH v5 11/16] drm/mediatek: Get rid of mtk_smi_larb_get/put

2021-04-10 Thread Yong Wu
MediaTek IOMMU has already added the device_link between the consumer and smi-larb device. If the drm device call the pm_runtime_get_sync, the smi-larb's pm_runtime_get_sync also be called automatically. CC: CK Hu CC: Philipp Zabel Signed-off-by: Yong Wu Reviewed-by: Evan Green Acked-by: Chun-

[PATCH v5 12/16] media: mtk-vcodec: Use pm_runtime_resume_and_get for PM get_sync

2021-04-10 Thread Yong Wu
pm_runtime_get_sync will increment pm usage counter even it failed. This patch use pm_runtime_resume_and_get instead of pm_runtime_get_sync to keep usage counter balanced. Signed-off-by: Yong Wu --- drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_pm.c | 5 +++-- 1 file changed, 3 insertions(+),

[PATCH v5 14/16] memory: mtk-smi: Get rid of mtk_smi_larb_get/put

2021-04-10 Thread Yong Wu
After adding device_link between the iommu consumer and smi-larb, the pm_runtime_get(_sync) of smi-larb and smi-common will be called automatically. we can get rid of mtk_smi_larb_get/put. CC: Matthias Brugger Signed-off-by: Yong Wu Reviewed-by: Evan Green --- drivers/memory/mtk-smi.c | 14 -

[PATCH v5 00/16] Clean up "mediatek,larb"

2021-04-10 Thread Yong Wu
MediaTek IOMMU block diagram always like below: M4U | smi-common | - | | ... | | larb1 larb2 | | vdec venc All the consumer connect with smi-larb, then connect with smi-common. When the consumer works, it should

[PATCH v5 02/16] iommu/mediatek: Add probe_defer for smi-larb

2021-04-10 Thread Yong Wu
The iommu consumer should use device_link to connect with the smi-larb(supplier). then the smi-larb should run before the iommu consumer. Here we delay the iommu driver until the smi driver is ready, then all the iommu consumer always is after the smi driver. When there is no this patch, if some c

[PATCH v5 04/16] memory: mtk-smi: Add device-link between smi-larb and smi-common

2021-04-10 Thread Yong Wu
Normally, If the smi-larb HW need work, we should enable the smi-common HW power and clock firstly. This patch adds device-link between the smi-larb dev and the smi-common dev. then If pm_runtime_get_sync(smi-larb-dev), the pm_runtime_get_sync (smi-common-dev) will be called automatically. Also, A

[PATCH v5 06/16] media: mtk-jpeg: Get rid of mtk_smi_larb_get/put

2021-04-10 Thread Yong Wu
MediaTek IOMMU has already added device_link between the consumer and smi-larb device. If the jpg device call the pm_runtime_get_sync, the smi-larb's pm_runtime_get_sync also be called automatically. CC: Rick Chang CC: Xia Jiang Signed-off-by: Yong Wu Reviewed-by: Evan Green Acked-by: Rick Cha

[PATCH v5 07/16] media: mtk-mdp: Use pm_runtime_resume_and_get for PM get_sync

2021-04-10 Thread Yong Wu
pm_runtime_get_sync will increment pm usage counter even it failed. This patch use pm_runtime_resume_and_get instead of pm_runtime_get to keep usage counter balanced. Signed-off-by: Yong Wu --- drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)

[PATCH v5 09/16] drm/mediatek: Use pm_runtime_resume_and_get for PM get_sync

2021-04-10 Thread Yong Wu
pm_runtime_get_sync will increment pm usage counter even it failed. This patch use pm_runtime_resume_and_get instead of pm_runtime_get to keep usage counter balanced. Signed-off-by: Yong Wu --- drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --

[PATCH v5 10/16] drm/mediatek: Add pm runtime support for ovl and rdma

2021-04-10 Thread Yong Wu
From: Yongqiang Niu Display use the dispsys device to call pm_rumtime_get_sync before. This patch add pm_runtime_xx with ovl and rdma device whose nodes has "iommus" property, then display could help pm_runtime_get for smi via ovl or rdma device. This is a preparing patch that smi cleaning up "m

[PATCH v5 13/16] media: mtk-vcodec: Get rid of mtk_smi_larb_get/put

2021-04-10 Thread Yong Wu
MediaTek IOMMU has already added the device_link between the consumer and smi-larb device. If the vcodec device call the pm_runtime_get_sync, the smi-larb's pm_runtime_get_sync also be called automatically. CC: Tiffany Lin CC: Irui Wang Signed-off-by: Yong Wu Reviewed-by: Evan Green Acked-by:

[PATCH v5 15/16] arm: dts: mediatek: Get rid of mediatek, larb for MM nodes

2021-04-10 Thread Yong Wu
After adding device_link between the IOMMU consumer and smi, the mediatek,larb is unnecessary now. CC: Matthias Brugger Signed-off-by: Yong Wu Reviewed-by: Evan Green --- arch/arm/boot/dts/mt2701.dtsi | 2 -- arch/arm/boot/dts/mt7623n.dtsi | 5 - 2 files changed, 7 deletions(-) diff --gi

[PATCH v5 16/16] arm64: dts: mediatek: Get rid of mediatek, larb for MM nodes

2021-04-10 Thread Yong Wu
After adding device_link between the IOMMU consumer and smi, the mediatek,larb is unnecessary now. CC: Matthias Brugger Signed-off-by: Yong Wu Reviewed-by: Evan Green --- arch/arm64/boot/dts/mediatek/mt8173.dtsi | 16 arch/arm64/boot/dts/mediatek/mt8183.dtsi | 5 - 2 file

Re: [PATCH 2/2] iommu/amd: Remove performance counter pre-initialization test

2021-04-10 Thread David Coe
Results for AMD Ryzen 4700U running Ubuntu 21.04β kernel 5.11.0-13 $ sudo dmesg | grep IOMMU [0.490352] pci :00:00.2: AMD-Vi: IOMMU performance counters supported [0.491985] pci :00:00.2: AMD-Vi: Found IOMMU cap 0x40 [0.493732] perf/amd_iommu: Detected AMD IOMMU #0 (2 banks,

Re: [PATCH v5 04/16] memory: mtk-smi: Add device-link between smi-larb and smi-common

2021-04-10 Thread Krzysztof Kozlowski
On 10/04/2021 11:11, Yong Wu wrote: > Normally, If the smi-larb HW need work, we should enable the smi-common > HW power and clock firstly. > This patch adds device-link between the smi-larb dev and the smi-common > dev. then If pm_runtime_get_sync(smi-larb-dev), the pm_runtime_get_sync > (smi-comm

Re: [PATCH v14 08/13] dma-iommu: Implement NESTED_MSI cookie

2021-04-10 Thread Auger Eric
Hi Zenghui, On 4/7/21 9:39 AM, Zenghui Yu wrote: > Hi Eric, > > On 2021/2/24 4:56, Eric Auger wrote: >> Up to now, when the type was UNMANAGED, we used to >> allocate IOVA pages within a reserved IOVA MSI range. >> >> If both the host and the guest are exposed with SMMUs, each >> would allocate a

[PATCH] iommu/amd: Fix extended features logging

2021-04-10 Thread Alexander Monakov
print_iommu_info prints the EFR register and then the decoded list of features on a separate line: pci :00:00.2: AMD-Vi: Extended features (0x206d73ef22254ade): PPR X2APIC NX GT IA GA PC GA_vAPIC The second line is emitted via 'pr_cont', which causes it to have a different ('warn') loglevel

Re: linux-next: Tree for Apr 9 (drivers/iommu/intel/pasid.c)

2021-04-10 Thread Randy Dunlap
On 4/9/21 4:51 AM, Stephen Rothwell wrote: > Hi all, > > Changes since 20210408: > > New trees: iio, iio-fixes > on ia64: (not X86) (from a 01.org kernel config file) ../drivers/iommu/intel/pasid.c: In function 'pasid_enable_wpe': ../drivers/iommu/intel/pasid.c:554:22: error: implicit declar

Re: [PATCH] iommu/amd: Fix extended features logging

2021-04-10 Thread Paul Menzel
Dear Alexander, Am 10.04.21 um 23:11 schrieb Alexander Monakov: print_iommu_info prints the EFR register and then the decoded list of features on a separate line: pci :00:00.2: AMD-Vi: Extended features (0x206d73ef22254ade): PPR X2APIC NX GT IA GA PC GA_vAPIC The second line is emitted

[PATCH 1/1] iommu/vt-d: Fix build error of pasid_enable_wpe() with !X86

2021-04-10 Thread Lu Baolu
Commit f68c7f539b6e9 ("iommu/vt-d: Enable write protect for supervisor SVM") added pasid_enable_wpe() which hit below compile error with !X86. ../drivers/iommu/intel/pasid.c: In function 'pasid_enable_wpe': ../drivers/iommu/intel/pasid.c:554:22: error: implicit declaration of function 'read_cr0'

Re: [PATCH 1/1] iommu/vt-d: Fix build error of pasid_enable_wpe() with !X86

2021-04-10 Thread Randy Dunlap
On 4/10/21 11:23 PM, Lu Baolu wrote: > Commit f68c7f539b6e9 ("iommu/vt-d: Enable write protect for supervisor > SVM") added pasid_enable_wpe() which hit below compile error with !X86. > > ../drivers/iommu/intel/pasid.c: In function 'pasid_enable_wpe': > ../drivers/iommu/intel/pasid.c:554:22: error