[PATCH v7 06/12] media: mtk-mdp: Get rid of mtk_smi_larb_get/put

2021-07-29 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 Rev

[PATCH v7 00/12] Clean up "mediatek,larb"

2021-07-29 Thread Yong Wu
E_CONSUMER even though the smi is built-in from Evan. 4) Remove the shutdown callback in iommu. v1: https://lore.kernel.org/linux-iommu/1546318276-18993-1-git-send-email-yong...@mediatek.com/ Yong Wu (11): dt-binding: mediatek: Get rid of mediatek,larb for multimedia HW iommu/mediatek-

[PATCH v7 03/12] iommu/mediatek: Add probe_defer for smi-larb

2021-07-29 Thread Yong Wu
there is no this patch, if some consumer drivers run before smi-larb, the supplier link_status is DL_DEV_NO_DRIVER(0) in the device_link_add, then device_links_driver_bound will use WARN_ON to complain that the link_status of supplier is not right. Signed-off-by: Yong Wu Tested-by: Dafna

[PATCH v7 10/12] memory: mtk-smi: Get rid of mtk_smi_larb_get/put

2021-07-29 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 Acked-by: Krzysztof Kozlowski Acked

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

2021-07-29 Thread Yong Wu
sumer connects with from iommu id in the "iommus=" property. Signed-off-by: Yong Wu Reviewed-by: Rob Herring Reviewed-by: Evan Green --- .../bindings/display/mediatek/mediatek,disp.txt | 9 - .../devicetree/bindings/media/mediatek-jpeg-decoder.yaml | 9 - .../devi

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

2021-07-29 Thread Yong Wu
ed-by: Tomasz Figa Signed-off-by: Yong Wu Tested-by: Dafna Hirschfeld # on mt8173 --- drivers/iommu/mtk_iommu.c| 22 ++ drivers/iommu/mtk_iommu_v1.c | 20 +++- 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/mtk_iommu

[PATCH v7 08/12] drm/mediatek: Get rid of mtk_smi_larb_get/put

2021-07-29 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:

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

2021-07-29 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 Tested-by: Dafna Hirschfeld --- arch/arm64/boot/dts/mediatek/mt8173.dtsi | 16 arch/arm64/boot/dts/mediatek

[PATCH v7 02/12] iommu/mediatek-v1: Free the existed fwspec if the master dev already has

2021-07-29 Thread Yong Wu
return -EINVAL; } ... } Thus, Free the existed fwspec if the master device already has fwspec. This issue is reported at: https://lore.kernel.org/linux-mediatek/trinity-7d9ebdc9-4849-4d93-bfb5-429dcb4ee449-1626253158870@3c-app-gmx-bs01/ Reported-by: Frank Wunderlich Signed

[PATCH v7 09/12] media: mtk-vcodec: Get rid of mtk_smi_larb_get/put

2021-07-29 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 Ack

[PATCH v7 11/12] arm: dts: mediatek: Get rid of mediatek, larb for MM nodes

2021-07-29 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

[PATCH v7 05/12] media: mtk-jpeg: Get rid of mtk_smi_larb_get/put

2021-07-29 Thread Yong Wu
t too. CC: Rick Chang CC: Xia Jiang Signed-off-by: Yong Wu Reviewed-by: Evan Green Acked-by: Rick Chang Reviewed-by: Dafna Hirschfeld Tested-by: Dafna Hirschfeld # on mt8173 --- .../media/platform/mtk-jpeg/mtk_jpeg_core.c | 45 +-- .../media/platform/mtk-jpeg/mtk_jpeg_c

[PATCH v7 07/12] drm/mediatek: Add pm runtime support for ovl and rdma

2021-07-29 Thread Yong Wu
or rdma device. CC: CK Hu Signed-off-by: Yongqiang Niu Signed-off-by: Yong Wu (Yong: Use pm_runtime_resume_and_get instead of pm_runtime_get_sync) Acked-by: Chun-Kuang Hu Tested-by: Dafna Hirschfeld # on mt8173 --- change log: add return fail when pm_runtime_resume_and_get fail. --- driv

[PATCH v6 10/11] arm: dts: mediatek: Get rid of mediatek, larb for MM nodes

2021-07-14 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

[PATCH v6 06/11] drm/mediatek: Add pm runtime support for ovl and rdma

2021-07-14 Thread Yong Wu
or rdma device. CC: CK Hu Signed-off-by: Yongqiang Niu Signed-off-by: Yong Wu (Yong: Use pm_runtime_resume_and_get instead of pm_runtime_get_sync) Acked-by: Chun-Kuang Hu --- drivers/gpu/drm/mediatek/mtk_disp_ovl.c | 9 - drivers/gpu/drm/mediatek/mtk_disp_rdma.c | 9 - driv

[PATCH v6 07/11] drm/mediatek: Get rid of mtk_smi_larb_get/put

2021-07-14 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:

[PATCH v6 09/11] memory: mtk-smi: Get rid of mtk_smi_larb_get/put

2021-07-14 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 Acked-by: Krzysztof Kozlowski Acked

[PATCH v6 00/11] Clean up "mediatek,larb"

2021-07-14 Thread Yong Wu
shutdown callback in iommu. v1: https://lore.kernel.org/linux-iommu/1546318276-18993-1-git-send-email-yong...@mediatek.com/ Yong Wu (10): dt-binding: mediatek: Get rid of mediatek,larb for multimedia HW iommu/mediatek: Add probe_defer for smi-larb iommu/mediatek: Add device_lin

[PATCH v6 02/11] iommu/mediatek: Add probe_defer for smi-larb

2021-07-14 Thread Yong Wu
there is no this patch, if some consumer drivers run before smi-larb, the supplier link_status is DL_DEV_NO_DRIVER(0) in the device_link_add, then device_links_driver_bound will use WARN_ON to complain that the link_status of supplier is not right. Signed-off-by: Yong Wu --- since [1

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

2021-07-14 Thread Yong Wu
ed-by: Tomasz Figa Signed-off-by: Yong Wu --- drivers/iommu/mtk_iommu.c| 22 ++ drivers/iommu/mtk_iommu_v1.c | 20 +++- 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c index a02dde09

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

2021-07-14 Thread Yong Wu
sumer connects with from iommu id in the "iommus=" property. Signed-off-by: Yong Wu Reviewed-by: Rob Herring Reviewed-by: Evan Green --- .../bindings/display/mediatek/mediatek,disp.txt | 9 - .../devicetree/bindings/media/mediatek-jpeg-decoder.yaml | 9 - .../devi

[PATCH v6 04/11] media: mtk-jpeg: Get rid of mtk_smi_larb_get/put

2021-07-14 Thread Yong Wu
t too. CC: Rick Chang CC: Xia Jiang Signed-off-by: Yong Wu Reviewed-by: Evan Green Acked-by: Rick Chang --- .../media/platform/mtk-jpeg/mtk_jpeg_core.c | 45 +-- .../media/platform/mtk-jpeg/mtk_jpeg_core.h | 2 - 2 files changed, 2 insertions(+), 45 deletions(-) diff --

[PATCH v6 08/11] media: mtk-vcodec: Get rid of mtk_smi_larb_get/put

2021-07-14 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 Ack

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

2021-07-14 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 | 6 -- 2

[PATCH v6 05/11] media: mtk-mdp: Get rid of mtk_smi_larb_get/put

2021-07-14 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 Rev

Re: [PATCH v6 06/11] drm/mediatek: Add pm runtime support for ovl and rdma

2021-07-15 Thread Yong Wu
On Wed, 2021-07-14 at 10:44 +0200, Dafna Hirschfeld wrote: > > On 14.07.21 04:56, Yong Wu wrote: > > From: Yongqiang Niu > > > > Prepare for smi cleaning up "mediatek,larb". > > > > Display use the dispsys device to call pm_rumtime_get_sync before.

Re: [PATCH v6 00/11] Clean up "mediatek,larb"

2021-07-15 Thread Yong Wu
sometimes passed and sometimes failed with 'context deadline exceeded'. > With this patchset it seems that the test always passes so I added tested-by: > > Tested-by: Dafna Hirschfeld Thanks very much for your quick review and testing:) > > Thanks, > Dafna > > &g

Re: Aw: [PATCH v6 00/11] Clean up "mediatek,larb"

2021-07-15 Thread Yong Wu
r4: > [6.845669] [] (bus_for_each_drv) from [] > (__device_atta) > [6.854044] r6:0001 r5:c21f9c54 r4:c21f9c10 > [6.858662] [] (__device_attach) from [] > (device_initial) > [6.867207] r6:c21f9c10 r5:c1406f58 r4:c1406ca0 > [6.871825] [] (dev

Re: [PATCH v6 03/11] iommu/mediatek: Add device_link between the consumer and the larb devices

2021-07-15 Thread Yong Wu
On Wed, 2021-07-14 at 10:26 +0200, Dafna Hirschfeld wrote: > > On 14.07.21 04:56, Yong Wu wrote: > > MediaTek IOMMU-SMI diagram is like below. all the consumer connect with > > smi-larb, then connect with smi-common. > > > > M4U >

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

2021-10-15 Thread Yong Wu
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 > > with > > smi-larb, then connect with smi-common. > > > > M4U

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 li

[PATCH v8 00/12] Clean up "mediatek,larb"

2021-09-28 Thread Yong Wu
5.2-rc1. 2) Move adding device_link between the consumer and smi-larb into iommu_add_device from Robin. 3) add DL_FLAG_AUTOREMOVE_CONSUMER even though the smi is built-in from Evan. 4) Remove the shutdown callback in iommu. v1: https://lore.kernel.org/linux-iommu/1546318276-18993-1

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

2021-09-28 Thread Yong Wu
sumer connects with from iommu id in the "iommus=" property. Signed-off-by: Yong Wu Reviewed-by: Rob Herring Reviewed-by: Evan Green --- .../bindings/display/mediatek/mediatek,disp.txt | 9 - .../devicetree/bindings/media/mediatek-jpeg-decoder.yaml | 9 - .../devi

[PATCH v8 02/12] iommu/mediatek-v1: Free the existed fwspec if the master dev already has

2021-09-28 Thread Yong Wu
return -EINVAL; } ... } Thus, Free the existed fwspec if the master device already has fwspec. This issue is reported at: https://lore.kernel.org/linux-mediatek/trinity-7d9ebdc9-4849-4d93-bfb5-429dcb4ee449-1626253158870@3c-app-gmx-bs01/ Reported-by: Frank Wunderlich Signed

[PATCH v8 03/12] iommu/mediatek: Add probe_defer for smi-larb

2021-09-28 Thread Yong Wu
it is not allowed to EXPORT from https://lore.kernel.org/patchwork/patch/1334670/. Signed-off-by: Yong Wu Tested-by: Frank Wunderlich # BPI-R2/MT7623 --- drivers/iommu/mtk_iommu.c| 2 +- drivers/iommu/mtk_iommu_v1.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a

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

2021-09-28 Thread Yong Wu
ed-by: Tomasz Figa Signed-off-by: Yong Wu Tested-by: Frank Wunderlich # BPI-R2/MT7623 --- drivers/iommu/mtk_iommu.c| 22 ++ drivers/iommu/mtk_iommu_v1.c | 20 +++- 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/mtk_iommu

[PATCH v8 05/12] media: mtk-jpeg: Get rid of mtk_smi_larb_get/put

2021-09-28 Thread Yong Wu
t too. CC: Rick Chang CC: Xia Jiang Signed-off-by: Yong Wu Reviewed-by: Evan Green Acked-by: Rick Chang Reviewed-by: Dafna Hirschfeld Tested-by: Frank Wunderlich # BPI-R2/MT7623 --- .../media/platform/mtk-jpeg/mtk_jpeg_core.c | 45 +-- .../media/platform/mtk

[PATCH v8 06/12] media: mtk-mdp: Get rid of mtk_smi_larb_get/put

2021-09-28 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 Rev

[PATCH v8 07/12] drm/mediatek: Add pm runtime support for ovl and rdma

2021-09-28 Thread Yong Wu
or rdma device. CC: CK Hu Signed-off-by: Yongqiang Niu Signed-off-by: Yong Wu (Yong: Use pm_runtime_resume_and_get instead of pm_runtime_get_sync) Acked-by: Chun-Kuang Hu Tested-by: Frank Wunderlich # BPI-R2/MT7623 --- drivers/gpu/drm/mediatek/mtk_disp_ovl.c | 8 +++- driv

[PATCH v8 08/12] drm/mediatek: Get rid of mtk_smi_larb_get/put

2021-09-28 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:

[PATCH v8 09/12] media: mtk-vcodec: Get rid of mtk_smi_larb_get/put

2021-09-28 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 Ack

[PATCH v8 10/12] memory: mtk-smi: Get rid of mtk_smi_larb_get/put

2021-09-28 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 Acked-by: Krzysztof Kozlowski Acked

[PATCH v8 11/12] arm: dts: mediatek: Get rid of mediatek, larb for MM nodes

2021-09-28 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 Tested-by: Frank Wunderlich # BPI-R2/MT7623 --- arch/arm/boot/dts/mt2701.dtsi | 2 -- arch/arm/boot/dts/mt7623n.dtsi | 5

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

2021-09-28 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 | 6 -- 2

Re: [PATCH v8 09/12] media: mtk-vcodec: Get rid of mtk_smi_larb_get/put

2021-09-29 Thread Yong Wu
Hi Dafna, Thanks very much for the review. On Wed, 2021-09-29 at 14:13 +0200, Dafna Hirschfeld wrote: > > On 29.09.21 03:37, Yong Wu wrote: > > MediaTek IOMMU has already added the device_link between the > > consumer > > and smi-larb device. If th

Re: [PATCH v8 03/12] iommu/mediatek: Add probe_defer for smi-larb

2021-09-30 Thread Yong Wu
On Wed, 2021-09-29 at 18:33 +0200, Dafna Hirschfeld wrote: > > On 29.09.21 03:37, Yong Wu wrote: > > Prepare for adding device_link. > > > > The iommu consumer should use device_link to connect with the > > smi-larb(supplier). then the smi-larb should run before t

Re: [PATCH v8 09/12] media: mtk-vcodec: Get rid of mtk_smi_larb_get/put

2021-10-06 Thread Yong Wu
On Thu, 2021-09-30 at 12:57 +0200, Dafna Hirschfeld wrote: > > On 30.09.21 05:28, Yong Wu wrote: > > Hi Dafna, > > > > Thanks very much for the review. > > > > On Wed, 2021-09-29 at 14:13 +0200, Dafna Hirschfeld wrote: > > > > > > On 29.

Re: [PATCH v5 25/32] iommu/mtk: Migrate to aggregate driver

2022-01-14 Thread Yong Wu
On Fri, 2022-01-14 at 15:30 -0600, Stephen Boyd wrote: > Quoting Yong Wu (2022-01-14 01:06:31) > > On Wed, 2022-01-12 at 20:25 -0800, Stephen Boyd wrote: > > > > > > > > [2.654526] [ cut here ] > > > > [2.6555

[PATCH v10 00/13] Clean up "mediatek,larb"

2022-01-16 Thread Yong Wu
the consumer and smi-larb into iommu_add_device from Robin. 3) add DL_FLAG_AUTOREMOVE_CONSUMER even though the smi is built-in from Evan. 4) Remove the shutdown callback in iommu. v1: https://lore.kernel.org/linux-iommu/1546318276-18993-1-git-send-email-yong...@mediatek.com/ Yong Wu (12)

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

2022-01-16 Thread Yong Wu
sumer connects with from iommu id in the "iommus=" property. Signed-off-by: Yong Wu Reviewed-by: Rob Herring Reviewed-by: Evan Green Acked-by: AngeloGioacchino Del Regno --- .../bindings/display/mediatek/mediatek,disp.txt | 9 - .../bindings/media/mediatek,vcod

[PATCH v10 02/13] iommu/mediatek-v1: Free the existed fwspec if the master dev already has

2022-01-16 Thread Yong Wu
return -EINVAL; } ... } Thus, Free the existed fwspec if the master device already has fwspec. This issue is reported at: https://lore.kernel.org/linux-mediatek/trinity-7d9ebdc9-4849-4d93-bfb5-429dcb4ee449-1626253158870@3c-app-gmx-bs01/ Reported-by: Frank Wunderlich Test

[PATCH v10 03/13] iommu/mediatek: Return ENODEV if the device is NULL

2022-01-16 Thread Yong Wu
ase. It's a minor fix, no need add fixes tags. Signed-off-by: Yong Wu Acked-by: Joerg Roedel Reviewed-by: AngeloGioacchino Del Regno --- drivers/iommu/mtk_iommu.c| 2 +- drivers/iommu/mtk_iommu_v1.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iom

[PATCH v10 04/13] iommu/mediatek: Add probe_defer for smi-larb

2022-01-16 Thread Yong Wu
it is not allowed to EXPORT from https://lore.kernel.org/patchwork/patch/1334670/. Signed-off-by: Yong Wu Tested-by: Frank Wunderlich # BPI-R2/MT7623 Acked-by: Joerg Roedel Reviewed-by: AngeloGioacchino Del Regno --- drivers/iommu/mtk_iommu.c| 4 drivers/iommu/mtk_iommu_v1.c | 4

[PATCH v10 05/13] iommu/mediatek: Add device_link between the consumer and the larb devices

2022-01-16 Thread Yong Wu
//lore.kernel.org/linux-mediatek/1564213888.22908.4.camel@mhfsdcap03/ [2] https://lore.kernel.org/patchwork/patch/1086569/ Suggested-by: Tomasz Figa Signed-off-by: Yong Wu Tested-by: Frank Wunderlich # BPI-R2/MT7623 Acked-by: Joerg Roedel Reviewed-by: AngeloGioacchino Del Regno --- drivers/io

[PATCH v10 06/13] media: mtk-jpeg: Get rid of mtk_smi_larb_get/put

2022-01-16 Thread Yong Wu
ve it too. CC: Rick Chang CC: Xia Jiang Signed-off-by: Yong Wu Reviewed-by: Evan Green Acked-by: Rick Chang Reviewed-by: Dafna Hirschfeld Tested-by: Frank Wunderlich # BPI-R2/MT7623 Acked-by: AngeloGioacchino Del Regno --- .../media/platform/mtk-jpeg/mtk_jpeg_core.c

[PATCH v10 07/13] media: mtk-mdp: Get rid of mtk_smi_larb_get/put

2022-01-16 Thread Yong Wu
MediaTek IOMMU has already added the device_link between the consumer and smi-larb device. If the mdp device calls 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

[PATCH v10 08/13] drm/mediatek: Add pm runtime support for ovl and rdma

2022-01-16 Thread Yong Wu
or rdma device. CC: CK Hu Signed-off-by: Yongqiang Niu Signed-off-by: Yong Wu (Yong: Use pm_runtime_resume_and_get instead of pm_runtime_get_sync) Acked-by: Chun-Kuang Hu Tested-by: Frank Wunderlich # BPI-R2/MT7623 Reviewed-by: AngeloGioacchino Del Regno --- drivers/gpu/drm/mediatek/

[PATCH v10 09/13] drm/mediatek: Get rid of mtk_smi_larb_get/put

2022-01-16 Thread Yong Wu
MediaTek IOMMU has already added the device_link between the consumer and smi-larb device. If the drm device calls 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 Ack

[PATCH v10 10/13] media: mtk-vcodec: Get rid of mtk_smi_larb_get/put

2022-01-16 Thread Yong Wu
MediaTek IOMMU has already added the device_link between the consumer and smi-larb device. If the vcodec devices 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 Ack

[PATCH v10 11/13] memory: mtk-smi: Get rid of mtk_smi_larb_get/put

2022-01-16 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 Acked-by: Krzysztof Kozlowski Acked

[PATCH v10 12/13] arm: dts: mediatek: Get rid of mediatek, larb for MM nodes

2022-01-16 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 Tested-by: Frank Wunderlich # BPI-R2/MT7623 --- arch/arm/boot/dts/mt2701.dtsi | 2 -- arch/arm/boot/dts/mt7623n.dtsi | 5

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

2022-01-16 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 Reviewed-by: AngeloGioacchino Del Regno --- arch/arm64/boot/dts/mediatek/mt8173.dtsi | 16 arch/arm64/boot

Re: [PATCH v9 12/15] media: mtk-vcodec: enc: Remove mtk_vcodec_release_enc_pm

2022-01-17 Thread Yong Wu
On Thu, 2022-01-13 at 17:10 +0100, Matthias Brugger wrote: > Hi Hans, > > On 13/01/2022 11:15, Hans Verkuil wrote: > > On 13/01/2022 11:11, AngeloGioacchino Del Regno wrote: > > > Il 11/01/22 11:57, AngeloGioacchino Del Regno ha scritto: > > > > I

[RFC PATCH] component: Add common helpers for compare/release functions

2022-01-28 Thread Yong Wu
The component requires the compare/release functions, there are so many copy in current kernel. Just define three common helpers for them. No functional change. Signed-off-by: Yong Wu --- Base on v5.17-rc1 --- .../gpu/drm/arm/display/komeda/komeda_drv.c| 5 - drivers/gpu/drm/arm

[PATCH v9 00/15] Clean up "mediatek,larb"

2021-11-12 Thread Yong Wu
Evan. 4) Remove the shutdown callback in iommu. v1: https://lore.kernel.org/linux-iommu/1546318276-18993-1-git-send-email-yong...@mediatek.com/ Yong Wu (14): dt-binding: mediatek: Get rid of mediatek, larb for multimedia HW iommu/mediatek-v1: Free the existed fwspec if the master dev alre

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

2021-11-12 Thread Yong Wu
sumer connects with from iommu id in the "iommus=" property. Signed-off-by: Yong Wu Reviewed-by: Rob Herring Reviewed-by: Evan Green --- .../bindings/display/mediatek/mediatek,disp.txt | 9 - .../devicetree/bindings/media/mediatek-jpeg-decoder.yaml | 9 - .../devi

[PATCH v9 02/15] iommu/mediatek-v1: Free the existed fwspec if the master dev already has

2021-11-12 Thread Yong Wu
return -EINVAL; } ... } Thus, Free the existed fwspec if the master device already has fwspec. This issue is reported at: https://lore.kernel.org/linux-mediatek/trinity-7d9ebdc9-4849-4d93-bfb5-429dcb4ee449-1626253158870@3c-app-gmx-bs01/ Reported-by: Frank Wunderlich Tested-b

[PATCH v9 03/15] iommu/mediatek: Return ENODEV if the device is NULL

2021-11-12 Thread Yong Wu
ase. It's a minor fix, no need add fixes tags. Signed-off-by: Yong Wu --- drivers/iommu/mtk_iommu.c| 2 +- drivers/iommu/mtk_iommu_v1.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c index d837adfd1da5..8f5

[PATCH v9 04/15] iommu/mediatek: Add probe_defer for smi-larb

2021-11-12 Thread Yong Wu
it is not allowed to EXPORT from https://lore.kernel.org/patchwork/patch/1334670/. Signed-off-by: Yong Wu Tested-by: Frank Wunderlich # BPI-R2/MT7623 --- drivers/iommu/mtk_iommu.c| 4 drivers/iommu/mtk_iommu_v1.c | 4 2 files changed, 8 insertions(+) diff --git a/drivers/iommu

[PATCH v9 05/15] iommu/mediatek: Add device_link between the consumer and the larb devices

2021-11-12 Thread Yong Wu
//lore.kernel.org/linux-mediatek/1564213888.22908.4.camel@mhfsdcap03/ [2] https://lore.kernel.org/patchwork/patch/1086569/ Suggested-by: Tomasz Figa Signed-off-by: Yong Wu Tested-by: Frank Wunderlich # BPI-R2/MT7623 --- drivers/iommu/mtk_iommu.c| 30 ++ drivers/io

[PATCH v9 06/15] media: mtk-jpeg: Get rid of mtk_smi_larb_get/put

2021-11-12 Thread Yong Wu
t too. CC: Rick Chang CC: Xia Jiang Signed-off-by: Yong Wu Reviewed-by: Evan Green Acked-by: Rick Chang Reviewed-by: Dafna Hirschfeld Tested-by: Frank Wunderlich # BPI-R2/MT7623 --- .../media/platform/mtk-jpeg/mtk_jpeg_core.c | 45 +-- .../media/platform/mtk

[PATCH v9 07/15] media: mtk-mdp: Get rid of mtk_smi_larb_get/put

2021-11-12 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 Rev

[PATCH v9 08/15] drm/mediatek: Add pm runtime support for ovl and rdma

2021-11-12 Thread Yong Wu
or rdma device. CC: CK Hu Signed-off-by: Yongqiang Niu Signed-off-by: Yong Wu (Yong: Use pm_runtime_resume_and_get instead of pm_runtime_get_sync) Acked-by: Chun-Kuang Hu Tested-by: Frank Wunderlich # BPI-R2/MT7623 --- drivers/gpu/drm/mediatek/mtk_disp_ovl.c | 8 +++- driv

[PATCH v9 09/15] drm/mediatek: Get rid of mtk_smi_larb_get/put

2021-11-12 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:

[PATCH v9 10/15] media: mtk-vcodec: Get rid of mtk_smi_larb_get/put

2021-11-12 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 Ack

[PATCH v9 11/15] media: mtk-vcodec: dec: Remove mtk_vcodec_release_dec_pm

2021-11-12 Thread Yong Wu
. No functional change. CC: Tiffany Lin CC: Yunfei Dong Signed-off-by: Yong Wu --- drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c | 8 +--- drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_pm.c | 9 + drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_pm.h | 3 +-- 3 files

[PATCH v9 12/15] media: mtk-vcodec: enc: Remove mtk_vcodec_release_enc_pm

2021-11-12 Thread Yong Wu
After this patchset, mtk_vcodec_release_enc_pm has only one line. then remove that function, use pm_runtime_disable instead. meanwhile, mtk_vcodec_init_enc_pm only operate for the clocks, rename it from the _pm to _clk. No functional change. CC: Tiffany Lin CC: Irui Wang Signed-off-by: Yong

[PATCH v9 13/15] memory: mtk-smi: Get rid of mtk_smi_larb_get/put

2021-11-12 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 Acked-by: Krzysztof Kozlowski Acked

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

2021-11-12 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 Tested-by: Frank Wunderlich # BPI-R2/MT7623 --- arch/arm/boot/dts/mt2701.dtsi | 2 -- arch/arm/boot/dts/mt7623n.dtsi | 5

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

2021-11-12 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 | 6 -- 2

Re: [PATCH v5 25/32] iommu/mtk: Migrate to aggregate driver

2022-01-11 Thread Yong Wu
he aggregate device. > > Cc: Yong Wu > Cc: Joerg Roedel > Cc: Will Deacon > Cc: Daniel Vetter > Cc: "Rafael J. Wysocki" > Cc: Rob Clark > Cc: Russell King > Cc: Saravana Kannan > Signed-off-by: Stephen Boyd When I test this on mt8195 which have two

Re: [PATCH v5 25/32] iommu/mtk: Migrate to aggregate driver

2022-01-12 Thread Yong Wu
On Tue, 2022-01-11 at 16:27 -0800, Stephen Boyd wrote: > Quoting Yong Wu (2022-01-11 04:22:23) > > Hi Stephen, > > > > Thanks for helping update here. > > > > On Thu, 2022-01-06 at 13:45 -0800, Stephen Boyd wrote: > > > Use an aggregate driver instead

Re: [PATCH v5 25/32] iommu/mtk: Migrate to aggregate driver

2022-01-14 Thread Yong Wu
On Wed, 2022-01-12 at 20:25 -0800, Stephen Boyd wrote: > > > > [2.654526] [ cut here ] > > [2.68] refcount_t: addition on 0; use-after-free. > > > > After this patch, the aggregate_driver flow looks ok. But our > > driver > > still aborts like this: > > > > [

Re: [PATCH 09/18] iommu/mediatek-v1: Add IOMMU_DOMAIN_DMA support

2020-08-31 Thread Yong Wu
de(&data->iommu, &dev->of_node->fwnode); ret = iommu_device_register(&data->iommu); if (ret) Then, Tested-by: Yong Wu > > diff --git a/drivers/iommu/mtk_iommu.h b/drivers/iommu/mtk_iommu.h > index 122925dbe547..6253e98d810c 100644 > --- a/drivers/iomm

[PATCH 0/9] dma-buf: heaps: Add MediaTek secure heap

2023-09-10 Thread Yong Wu
-heap: Add proper kref handling on dma-buf heaps dma-heap: Provide accessors so that in-kernel drivers can allocate dmabufs from specific heaps T.J. Mercier (1): dma-buf: heaps: Deduplicate docs and adopt common format Yong Wu (6): dma-buf: heaps: Initialise MediaTek secure heap dma-buf:

[PATCH 1/9] dma-buf: heaps: Deduplicate docs and adopt common format

2023-09-10 Thread Yong Wu
leanup. Remove multiple unused includes. Signed-off-by: T.J. Mercier Signed-off-by: Yong Wu [Yong: Just add a comment for "priv" to mute build warning] --- drivers/dma-buf/dma-heap.c | 29 +++-- include/linux/dma-heap.h | 11 +-- 2 files changed, 12 in

[PATCH 2/9] dma-heap: Add proper kref handling on dma-buf heaps

2023-09-10 Thread Yong Wu
perly free things. Signed-off-by: John Stultz Signed-off-by: T.J. Mercier Signed-off-by: Yong Wu [Yong: Just add comment for "minor" and "refcount"] --- drivers/dma-buf/dma-heap.c | 38 ++ include/linux/dma-heap.h | 6 ++ 2 files cha

[PATCH 4/9] dma-buf: heaps: Initialise MediaTek secure heap

2023-09-10 Thread Yong Wu
Initialise a mtk_svp heap. Currently just add a null heap, Prepare for the later patches. Signed-off-by: Yong Wu --- drivers/dma-buf/heaps/Kconfig | 8 ++ drivers/dma-buf/heaps/Makefile | 1 + drivers/dma-buf/heaps/mtk_secure_heap.c | 99 + 3 files

[PATCH 3/9] dma-heap: Provide accessors so that in-kernel drivers can allocate dmabufs from specific heaps

2023-09-10 Thread Yong Wu
for a pipeline, so it would likely be best for drivers to import and fill DMA-BUFs allocated by userland instead of allocating one themselves, but this is still up for debate. Signed-off-by: John Stultz Signed-off-by: T.J. Mercier Signed-off-by: Yong Wu [Yong: Fix the checkpatch alignment wa

[PATCH 5/9] dma-buf: heaps: mtk_sec_heap: Initialise tee session

2023-09-10 Thread Yong Wu
The TEE probe later than dma-buf heap, and PROBE_DEDER doesn't work here since this is not a platform driver, therefore initialise the TEE context/session while we allocate the first secure buffer. Signed-off-by: Yong Wu --- drivers/dma-buf/heaps/mtk_secure_heap.c

[PATCH 6/9] dma-buf: heaps: mtk_sec_heap: Add tee service call for buffer allocating/freeing

2023-09-10 Thread Yong Wu
Add TEE service call for secure memory allocating/freeing. Signed-off-by: Anan Sun Signed-off-by: Yong Wu --- drivers/dma-buf/heaps/mtk_secure_heap.c | 69 - 1 file changed, 68 insertions(+), 1 deletion(-) diff --git a/drivers/dma-buf/heaps/mtk_secure_heap.c b/drivers

[PATCH 7/9] dma-buf: heaps: mtk_sec_heap: Add dma_ops

2023-09-10 Thread Yong Wu
ned-off-by: Anan Sun Signed-off-by: Yong Wu --- drivers/dma-buf/heaps/mtk_secure_heap.c | 116 1 file changed, 116 insertions(+) diff --git a/drivers/dma-buf/heaps/mtk_secure_heap.c b/drivers/dma-buf/heaps/mtk_secure_heap.c index 14c2a16a7164..daf6cf2121a1 100644 --- a/d

[PATCH 8/9] dt-bindings: reserved-memory: MediaTek: Add reserved memory for SVP

2023-09-10 Thread Yong Wu
This adds the binding for describing a CMA memory for MediaTek SVP(Secure Video Path). Signed-off-by: Yong Wu --- .../mediatek,secure_cma_chunkmem.yaml | 42 +++ 1 file changed, 42 insertions(+) create mode 100644 Documentation/devicetree/bindings/reserved-memory

[PATCH 9/9] dma_buf: heaps: mtk_sec_heap: Add a new CMA heap

2023-09-10 Thread Yong Wu
buffer, then kernel may reuse it. Signed-off-by: Yong Wu --- drivers/dma-buf/heaps/Kconfig | 2 +- drivers/dma-buf/heaps/mtk_secure_heap.c | 121 +++- 2 files changed, 119 insertions(+), 4 deletions(-) diff --git a/drivers/dma-buf/heaps/Kconfig b/drivers/dma-buf/heaps

[PATCH v2 0/8] dma-buf: heaps: Add secure heap

2023-11-11 Thread Yong Wu
re is other way to make UUID more general, please free to tell me. v1: https://lore.kernel.org/linux-mediatek/20230911023038.30649-1-yong...@mediatek.com/ Base on v6.6-rc1. Yong Wu (8): dma-buf: heaps: Initialize a secure heap dma-buf: heaps: secure_heap: Add private heap ops dma-bu

[PATCH v2 1/8] dma-buf: heaps: Initialize a secure heap

2023-11-11 Thread Yong Wu
Initialize a secure heap. Currently just add a null heap, Prepare for the later patches. Signed-off-by: Yong Wu --- drivers/dma-buf/heaps/Kconfig | 7 +++ drivers/dma-buf/heaps/Makefile | 1 + drivers/dma-buf/heaps/secure_heap.c | 98 + 3 files changed

[PATCH v2 2/8] dma-buf: heaps: secure_heap: Add private heap ops

2023-11-11 Thread Yong Wu
For the secure memory, there are two steps: a) Allocate buffers in kernel side; b) Secure that buffer. Different heaps may have different buffer allocation methods and different memory protection methods. Here abstract the memory allocation and securing operations. Signed-off-by: Yong Wu

[PATCH v2 3/8] dma-buf: heaps: secure_heap: Initialize tee session

2023-11-11 Thread Yong Wu
at it doesn't enter TEE to protect the buffer, there may be other ways to protect the buffer. All the MTK chrome projects use this UUID. The UUID is only used in the kernelspace while userspace never use it. The userspace could allocate the secure memory via the existing dma-buf ioctl. Signed-off-b

[PATCH v2 4/8] dma-buf: heaps: secure_heap: Add tee memory service call

2023-11-11 Thread Yong Wu
the ops of secure_the_memory. It seems that secure_heap_tee_service_call could be a more general interface, but it could be a new topic. Signed-off-by: Yong Wu --- drivers/dma-buf/heaps/secure_heap.c | 97 + 1 file changed, 97 insertions(+) diff --git a/drivers/dma-buf/heaps/sec

[PATCH v2 5/8] dma-buf: heaps: secure_heap: Add dma_ops

2023-11-11 Thread Yong Wu
Add the dma_ops for this secure heap. a) For secure buffer, cache_ops/mmap are not allowed, thus return EPERM for them. b) The secure buffer can't be accessed in kernel, thus it doesn't have va/dma_address for it. Use the dma_address property to save the "secure handle". Si

  1   2   >