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

2021-12-06 Thread Hsin-Yi Wang
On Mon, Dec 6, 2021 at 8:23 PM Hans Verkuil wrote: > > Hi Yong Wu, > > On 12/11/2021 11:54, Yong Wu wrote: > > MediaTek IOMMU block diagram always like below: > > > > M4U > > | > > smi-common > > | > > - > > | | ... > > | | > >

Re: [PATCH 0/3] Allow restricted-dma-pool to customize IO_TLB_SEGSIZE

2021-11-23 Thread Hsin-Yi Wang
On Tue, Nov 23, 2021 at 7:58 PM Robin Murphy wrote: > > On 2021-11-23 11:21, Hsin-Yi Wang wrote: > > Default IO_TLB_SEGSIZE (128) slabs may be not enough for some use cases. > > This series adds support to customize io_tlb_segsize for each > > restricted-dma-pool.

[PATCH 2/3] dt-bindings: Add io-tlb-segsize property for restricted-dma-pool

2021-11-23 Thread Hsin-Yi Wang
Add a io-tlb-segsize property that each restricted-dma-pool can set its own io_tlb_segsize since some use cases require slabs larger than default value (128). Signed-off-by: Hsin-Yi Wang --- .../bindings/reserved-memory/shared-dma-pool.yaml | 8 1 file changed, 8 insertions

[PATCH 3/3] arm64: dts: mt8183: use restricted swiotlb for scp mem

2021-11-23 Thread Hsin-Yi Wang
Use restricted-dma-pool for mtk_scp's reserved memory. And set the io-tlb-segsize to 4096 since the driver needs at least 2560 slabs to allocate memory. Signed-off-by: Hsin-Yi Wang --- arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff

[PATCH 1/3] dma: swiotlb: Allow restricted-dma-pool to customize IO_TLB_SEGSIZE

2021-11-23 Thread Hsin-Yi Wang
Default IO_TLB_SEGSIZE is 128, but some use cases requires more slabs. Otherwise swiotlb_find_slots() will fail. This patch allows each mem pool to decide their own io-tlb-segsize through dt property. Signed-off-by: Hsin-Yi Wang --- include/linux/swiotlb.h | 1 + kernel/dma/swiotlb.c| 34

[PATCH 0/3] Allow restricted-dma-pool to customize IO_TLB_SEGSIZE

2021-11-23 Thread Hsin-Yi Wang
/20190611035344.29814-1-jungo@mediatek.com/ [2] https://elixir.bootlin.com/linux/latest/source/drivers/remoteproc/mtk_scp.c [3] https://patchwork.kernel.org/project/linux-media/cover/20210909112430.61243-1-senozhat...@chromium.org/ Hsin-Yi Wang (3): dma: swiotlb: Allow restricted-dma-pool

Re: [PATCH] memory: mtk-smi: Fix a null dereference for the ostd

2021-10-28 Thread Hsin-Yi Wang
the offset, it is > also a valid value, thus, use the larb->larb_gen->ostd as the condition > inside the "for" loop. > > Signed-off-by: Yong Wu Tested-by: Hsin-Yi Wang After applying this patch, mt8183 is no longer crashing. > --- > Hi Krzysztof, > Could y

Re: [PATCH v2 16/29] iommu/mediatek: Adjust device link when it is sub-common

2021-08-24 Thread Hsin-Yi Wang
On Fri, Aug 13, 2021 at 3:03 PM Yong Wu wrote: > > For MM IOMMU, We always add device link between smi-common and IOMMU HW. > In mt8195, we add smi-sub-common. Thus, if the node is sub-common, we still > need find again to get smi-common, then do device link. > > Signed-off-by: Yong Wu > --- >

Re: [PATCH v2 11/29] iommu/mediatek: Always pm_runtime_get while tlb flush

2021-08-24 Thread Hsin-Yi Wang
On Fri, Aug 13, 2021 at 2:57 PM Yong Wu wrote: > > Prepare for 2 HWs that sharing pgtable in different power-domains. > > The previous SoC don't have PM. Only mt8192 has power-domain, > and it is display's power-domain which nearly always is enabled. > > When there are 2 M4U HWs, it may has

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

2021-05-12 Thread Hsin-Yi Wang
On Sat, Apr 10, 2021 at 5:14 PM Yong Wu wrote: > > 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