Re: [PATCH v2 0/4] Qcom smmu-500 TLB invalidation errata for sdm845

2018-09-24 Thread Vivek Gautam
Hi Bjorn, On Mon, Sep 10, 2018 at 4:08 PM Vivek Gautam wrote: > > +linux-arm-msm > > > On 09/10/2018 11:55 AM, Vivek Gautam wrote: > > Qcom's implementation of arm,mmu-500 on sdm845 has a functional/performance > > errata [1] because of which the TCU cache look ups are stalled during > >

Re: [RFCv2 PATCH 0/7] A General Accelerator Framework, WarpDrive

2018-09-24 Thread Kenneth Lee
On Fri, Sep 21, 2018 at 10:52:01AM -0400, Jerome Glisse wrote: > Received: from popscn.huawei.com [10.3.17.45] by Turing-Arch-b with POP3 > (fetchmail-6.3.26) for (single-drop); Fri, 21 Sep 2018 > 23:00:01 +0800 (CST) > Received: from DGGEMM406-HUB.china.huawei.com (10.3.20.214) by >

Re: [PATCH v16 2/5] iommu/arm-smmu: Invoke pm_runtime during probe, add/remove device

2018-09-24 Thread Vivek Gautam
Hi Robin, Will, On Tue, Sep 18, 2018 at 8:41 AM Vivek Gautam wrote: > > Hi Robin, > > On Fri, Sep 7, 2018 at 3:52 PM Vivek Gautam > wrote: > > > > On Fri, Sep 7, 2018 at 3:22 PM Tomasz Figa wrote: > > > > > > On Fri, Sep 7, 2018 at 6:38 PM Vivek Gautam > > > wrote: > > > > > > > > Hi

Re: [PATCH 4/4] dma-mapping: clear dev->dma_ops in arch_teardown_dma_ops

2018-09-24 Thread Michael Ellerman
Guenter Roeck writes: > Hi, > > On Mon, Aug 27, 2018 at 10:47:11AM +0200, Christoph Hellwig wrote: >> There is no reason to leave the per-device dma_ops around when >> deconfiguring a device, so move this code from arm64 into the >> common code. >> Signed-off-by: Christoph Hellwig >>

Re: [PATCH v3 06/10] iommu/sva: Search mm by PASID

2018-09-24 Thread Lu Baolu
Hi, On 09/21/2018 01:00 AM, Jean-Philippe Brucker wrote: The fault handler will need to find an mm given its PASID. This is the reason we have an IDR for storing address spaces, so hook it up. Signed-off-by: Jean-Philippe Brucker --- drivers/iommu/iommu-sva.c | 26 ++

Re: [PATCH v3 03/10] iommu/sva: Manage process address spaces

2018-09-24 Thread Lu Baolu
Hi, On 09/21/2018 01:00 AM, Jean-Philippe Brucker wrote: Allocate IOMMU mm structures and bind them to devices. Four operations are added to IOMMU drivers: * mm_alloc(): to create an io_mm structure and perform architecture- specific operations required to grab the process (for instance on

Re: [PATCH v4 16/20] iommu/tegra: gart: Don't use managed resources

2018-09-24 Thread Dmitry Osipenko
On 9/24/18 1:52 PM, Thierry Reding wrote: > On Mon, Sep 24, 2018 at 03:41:49AM +0300, Dmitry Osipenko wrote: >> GART is a part of the Memory Controller driver that is always built-in, >> hence there is no benefit from the use of managed resources. >> >> Signed-off-by: Dmitry Osipenko >> --- >>

Re: [PATCH v4 03/20] iommu/tegra: gart: Ignore devices without IOMMU phandle in DT

2018-09-24 Thread Dmitry Osipenko
On 9/24/18 1:05 PM, Thierry Reding wrote: > On Mon, Sep 24, 2018 at 03:41:36AM +0300, Dmitry Osipenko wrote: >> GART can't handle all devices, hence ignore devices that aren't related >> to GART. IOMMU phandle must be explicitly assign to devices in the device >> tree. > > I think technically the

Re: [PATCH v4 11/20] memory: tegra: Use of_device_get_match_data()

2018-09-24 Thread Dmitry Osipenko
On 9/24/18 1:13 PM, Thierry Reding wrote: > On Mon, Sep 24, 2018 at 03:41:44AM +0300, Dmitry Osipenko wrote: >> There is no need to match device with the DT node since it was already >> matched, use of_device_get_match_data() helper to get the match-data. >> >> Signed-off-by: Dmitry Osipenko >>

Re: [PATCH v4 12/20] iommu/tegra: gart: Integrate with Memory Controller driver

2018-09-24 Thread Dmitry Osipenko
On 9/24/18 1:23 PM, Thierry Reding wrote: > On Mon, Sep 24, 2018 at 03:41:45AM +0300, Dmitry Osipenko wrote: >> The device-tree binding has been changed. There is no separate GART device >> anymore, it is squashed into the Memory Controller. Integrate GART module >> with the MC in a way it is done

Re: [PATCH v4 17/20] iommu/tegra: gart: Prepend error/debug messages with "GART:"

2018-09-24 Thread Dmitry Osipenko
On 9/24/18 1:57 PM, Thierry Reding wrote: > On Mon, Sep 24, 2018 at 03:41:50AM +0300, Dmitry Osipenko wrote: >> GART became a part of Memory Controller, hence now the drivers device >> is Memory Controller and not GART. As a result all printed messages are >> prepended with the "tegra-mc

Re: [PATCH v4 18/20] iommu/tegra: gart: Don't detach devices from inactive domains

2018-09-24 Thread Dmitry Osipenko
On 9/24/18 2:00 PM, Thierry Reding wrote: > On Mon, Sep 24, 2018 at 03:41:51AM +0300, Dmitry Osipenko wrote: >> There could be unlimited number of allocated domains, but only one domain >> can be active at a time. Hence devices must be detached only from the >> active domain. >> >> Signed-off-by:

Re: [PATCH v4 19/20] iommu/tegra: gart: Simplify clients-tracking code

2018-09-24 Thread Dmitry Osipenko
On 9/24/18 2:10 PM, Thierry Reding wrote: > On Mon, Sep 24, 2018 at 03:41:52AM +0300, Dmitry Osipenko wrote: >> GART is a simple IOMMU provider that has single address space. There is >> no need to setup global clients list and manage it for tracking of the >> active domain, hence lot's of code

Re: [PATCH v4 20/20] iommu/tegra: gart: Perform code refactoring

2018-09-24 Thread Dmitry Osipenko
On 9/24/18 2:34 PM, Thierry Reding wrote: > On Mon, Sep 24, 2018 at 03:41:53AM +0300, Dmitry Osipenko wrote: >> Perform a major code cleanup to make it more readable and as a result >> easier to maintain. I removed some redundant safety-checks in the code >> and some debug code that isn't actually

Re: [PATCH v8 0/7] Add non-strict mode support for iommu-dma

2018-09-24 Thread John Garry
On 21/09/2018 12:03, Robin Murphy wrote: On 21/09/18 10:29, Robin Murphy wrote: Hi John, On 2018-09-21 10:20 AM, John Garry wrote: On 20/09/2018 17:10, Robin Murphy wrote: Hi all, Hopefully this is the last spin of the series - I've now dropped my light touch and fixed up all the various

Re: [PATCH v4 09/20] memory: tegra: Adapt to Tegra20 device-tree binding changes

2018-09-24 Thread Dmitry Osipenko
On 9/24/18 1:02 PM, Thierry Reding wrote: On Mon, Sep 24, 2018 at 03:41:42AM +0300, Dmitry Osipenko wrote: The tegra20-mc device-tree binding has been changed, GART has been squashed into Memory Controller and now the clock property is mandatory for Tegra20, the DT compatible has been changed

Re: [PATCH v3 01/10] iommu: Introduce Shared Virtual Addressing API

2018-09-24 Thread Jean-Philippe Brucker
On 23/09/2018 03:39, Lu Baolu wrote: >> +int iommu_sva_init_device(struct device *dev, unsigned long features, >> +    unsigned int min_pasid, unsigned int max_pasid) >> +{ >> + int ret; >> + struct iommu_sva_param *param; >> + struct iommu_domain *domain =

Re: [PATCH v3 02/10] iommu/sva: Bind process address spaces to devices

2018-09-24 Thread Jean-Philippe Brucker
On 23/09/2018 04:05, Lu Baolu wrote: > Hi, > > On 09/21/2018 01:00 AM, Jean-Philippe Brucker wrote: >> Add bind() and unbind() operations to the IOMMU API. Bind() returns a >> PASID that drivers can program in hardware, to let their devices access an >> mm. This patch only adds skeletons for the

Re: [PATCH v4 20/20] iommu/tegra: gart: Perform code refactoring

2018-09-24 Thread Thierry Reding
On Mon, Sep 24, 2018 at 03:41:53AM +0300, Dmitry Osipenko wrote: > Perform a major code cleanup to make it more readable and as a result > easier to maintain. I removed some redundant safety-checks in the code > and some debug code that isn't actually very useful for debugging, like > enormous

Re: [PATCH v4 19/20] iommu/tegra: gart: Simplify clients-tracking code

2018-09-24 Thread Thierry Reding
On Mon, Sep 24, 2018 at 03:41:52AM +0300, Dmitry Osipenko wrote: > GART is a simple IOMMU provider that has single address space. There is > no need to setup global clients list and manage it for tracking of the > active domain, hence lot's of code could be safely removed and replaced > with a

Re: [PATCH v4 18/20] iommu/tegra: gart: Don't detach devices from inactive domains

2018-09-24 Thread Thierry Reding
On Mon, Sep 24, 2018 at 03:41:51AM +0300, Dmitry Osipenko wrote: > There could be unlimited number of allocated domains, but only one domain > can be active at a time. Hence devices must be detached only from the > active domain. > > Signed-off-by: Dmitry Osipenko > --- >

Re: [PATCH v4 17/20] iommu/tegra: gart: Prepend error/debug messages with "GART:"

2018-09-24 Thread Thierry Reding
On Mon, Sep 24, 2018 at 03:41:50AM +0300, Dmitry Osipenko wrote: > GART became a part of Memory Controller, hence now the drivers device > is Memory Controller and not GART. As a result all printed messages are > prepended with the "tegra-mc 7000f000.memory-controller:", so let's > prepend GART's

Re: [PATCH v4 16/20] iommu/tegra: gart: Don't use managed resources

2018-09-24 Thread Thierry Reding
On Mon, Sep 24, 2018 at 03:41:49AM +0300, Dmitry Osipenko wrote: > GART is a part of the Memory Controller driver that is always built-in, > hence there is no benefit from the use of managed resources. > > Signed-off-by: Dmitry Osipenko > --- > drivers/iommu/tegra-gart.c | 12 +++- > 1

Re: [PATCH v4 15/20] iommu/tegra: gart: Allow only one active domain at a time

2018-09-24 Thread Thierry Reding
On Mon, Sep 24, 2018 at 03:41:48AM +0300, Dmitry Osipenko wrote: > GART has a single address space that is shared by all devices, hence only > one domain could be active at a time. > > Signed-off-by: Dmitry Osipenko > --- > drivers/iommu/tegra-gart.c | 9 + > 1 file changed, 9

Re: [PATCH v4 13/20] iommu/tegra: gart: Fix spinlock recursion

2018-09-24 Thread Thierry Reding
On Mon, Sep 24, 2018 at 03:41:46AM +0300, Dmitry Osipenko wrote: > Fix spinlock recursion bug that happens on IOMMU domain destruction if > any of the allocated domains have devices attached to them. > > Signed-off-by: Dmitry Osipenko > --- > drivers/iommu/tegra-gart.c | 24

Re: [PATCH v4 14/20] iommu/tegra: gart: Fix NULL pointer dereference

2018-09-24 Thread Thierry Reding
On Mon, Sep 24, 2018 at 03:41:47AM +0300, Dmitry Osipenko wrote: > Fix NULL pointer dereference on IOMMU domain destruction that happens > because clients list is being iterated unsafely and its elements are > getting deleted during the iteration. > > Signed-off-by: Dmitry Osipenko > --- >

Re: [PATCH v4 12/20] iommu/tegra: gart: Integrate with Memory Controller driver

2018-09-24 Thread Thierry Reding
On Mon, Sep 24, 2018 at 03:41:45AM +0300, Dmitry Osipenko wrote: > The device-tree binding has been changed. There is no separate GART device > anymore, it is squashed into the Memory Controller. Integrate GART module > with the MC in a way it is done for the SMMU of Tegra30+. > > Signed-off-by:

Re: [PATCH v4 11/20] memory: tegra: Use of_device_get_match_data()

2018-09-24 Thread Thierry Reding
On Mon, Sep 24, 2018 at 03:41:44AM +0300, Dmitry Osipenko wrote: > There is no need to match device with the DT node since it was already > matched, use of_device_get_match_data() helper to get the match-data. > > Signed-off-by: Dmitry Osipenko > --- > drivers/memory/tegra/mc.c | 10 ++

Re: [PATCH v4 05/20] iommu/tegra: gart: Optimize mapping / unmapping performance

2018-09-24 Thread Thierry Reding
On Mon, Sep 24, 2018 at 03:41:38AM +0300, Dmitry Osipenko wrote: > Currently GART writes one page entry at a time. More optimal would be to > aggregate the writes and flush BUS buffer in the end, this gives map/unmap > 10-40% performance boost (depending on size of mapping) in comparison to >

Re: [PATCH v4 04/20] iommu: Introduce iotlb_sync_map callback

2018-09-24 Thread Thierry Reding
On Mon, Sep 24, 2018 at 03:41:37AM +0300, Dmitry Osipenko wrote: > Introduce iotlb_sync_map() callback that is invoked in the end of > iommu_map(). This new callback allows IOMMU drivers to avoid syncing > after mapping of each contiguous chunk and sync only when the whole > mapping is completed,

Re: [PATCH v4 03/20] iommu/tegra: gart: Ignore devices without IOMMU phandle in DT

2018-09-24 Thread Thierry Reding
On Mon, Sep 24, 2018 at 03:41:36AM +0300, Dmitry Osipenko wrote: > GART can't handle all devices, hence ignore devices that aren't related > to GART. IOMMU phandle must be explicitly assign to devices in the device > tree. I think technically the GART can indeed handle all devices since it is

Re: [PATCH v4 02/20] iommu/tegra: gart: Clean up driver probe errors handling

2018-09-24 Thread Thierry Reding
On Mon, Sep 24, 2018 at 03:41:35AM +0300, Dmitry Osipenko wrote: > Properly clean up allocated resources on the drivers probe failure and > remove unneeded checks. > > Signed-off-by: Dmitry Osipenko > --- > drivers/iommu/tegra-gart.c | 16 ++-- > 1 file changed, 10 insertions(+), 6

Re: [PATCH v4 01/20] iommu/tegra: gart: Remove pr_fmt and clean up includes

2018-09-24 Thread Thierry Reding
On Mon, Sep 24, 2018 at 03:41:34AM +0300, Dmitry Osipenko wrote: > Remove unneeded headers inclusion and sort the headers in alphabet order. > Remove pr_fmt macro since there is no pr_*() in the code and it doesn't > affect dev_*() functions. > > Signed-off-by: Dmitry Osipenko > --- >

Re: [PATCH v4 09/20] memory: tegra: Adapt to Tegra20 device-tree binding changes

2018-09-24 Thread Thierry Reding
On Mon, Sep 24, 2018 at 03:41:42AM +0300, Dmitry Osipenko wrote: > The tegra20-mc device-tree binding has been changed, GART has been > squashed into Memory Controller and now the clock property is mandatory > for Tegra20, the DT compatible has been changed as well. Adapt driver to > the DT

Re: [PATCH v4 06/20] dt-bindings: memory: tegra: Squash tegra20-gart into tegra20-mc

2018-09-24 Thread Thierry Reding
On Mon, Sep 24, 2018 at 03:41:39AM +0300, Dmitry Osipenko wrote: > Splitting GART and Memory Controller wasn't a good decision that was made > back in the day. Given that the GART driver wasn't ever been used by > anything in the kernel, we decided that it will be better to correct the > mistakes

Linux 4.19-rc5: Missing iommu fix

2018-09-24 Thread Sedat Dilek
Hi Greg, thanks and congrats for this release. Me and several other people have an issue with "intel_iommu=on" (see [1]) and a patch is pending in [2]. Unfortunately, it is not in linux-iommu Git. Hope this will soon happen. Just want to inform you and let people know if they have a similiar

Re: [PATCH 04/13] iommu/io-pgtable-arm-v7s: Extend MediaTek 4GB mode

2018-09-24 Thread Yong Wu
On Thu, 2018-09-20 at 18:31 +0100, Robin Murphy wrote: > On 03/09/18 07:01, Yong Wu wrote: > > MediaTek extend the arm v7s descriptor to support the dram over 4GB. > > > > In the mt2712 and mt8173, it's called "4GB mode", the physical address > > is from 0x4000_ to 0x1_3fff_, but from EMI

Re: [Linux-4.19] ThinkPad T470 not booting with "intel_iommu=on"

2018-09-24 Thread Sedat Dilek
On Sat, Sep 22, 2018 at 5:58 PM, Sedat Dilek wrote: > On Sat, Sep 22, 2018 at 1:40 PM, Jordan Glover > wrote: >> Hi, >> >> This is already reported at: >> https://bugs.freedesktop.org/show_bug.cgi?id=107783 >> >> There is also patch posted which fixes this issue: >>

[PATCH v2 14/14] iommu/mediatek: Switch to SPDX license identifier

2018-09-24 Thread Yong Wu
Switch to SPDX license identifier for MediaTek iommu/smi and their header files. Signed-off-by: Yong Wu Reviewed-by: Rob Herring --- drivers/iommu/mtk_iommu.c | 10 +- drivers/iommu/mtk_iommu.h | 10 +- drivers/iommu/mtk_iommu_v1.c

[PATCH v2 12/14] iommu/mediatek: Add shutdown callback

2018-09-24 Thread Yong Wu
In the reboot burning test, if some Multimedia HW has something wrong, It may keep send the invalid request to IOMMU. In order to avoid affect the reboot flow, we add the shutdown callback to disable M4U HW when shutdown. Signed-off-by: Yong Wu --- drivers/iommu/mtk_iommu.c | 6 ++ 1 file

[PATCH v2 13/14] memory: mtk-smi: Get rid of need_larbid

2018-09-24 Thread Yong Wu
The "mediatek,larb-id" has already been parsed in MTK IOMMU driver. It's no need to parse it again in SMI driver. Only clean some codes. This patch is fit for all the current mt2701, mt2712, mt8173 and mt8183. Signed-off-by: Yong Wu --- drivers/memory/mtk-smi.c | 27 ++-

[PATCH v2 09/14] memory: mtk-smi: Use a struct for the platform data for smi-common

2018-09-24 Thread Yong Wu
Use a struct as the platform special data instead of the enumeration. Also there is a minor change that moving the position of "enum mtk_smi_gen" definition, this is because we expect define "struct mtk_smi_common_plat" before it is referred. This is a prepare patch for adding bus_sel for

[PATCH v2 10/14] memory: mtk-smi: Add bus_sel for mt8183

2018-09-24 Thread Yong Wu
There are 2 mmu cells in a M4U HW. we could adjust some larbs entering mmu0 or mmu1 to balance the bandwidth via the smi-common register SMI_BUS_SEL(0x220)(Each larb occupy 2 bits). In mt8183, For better performance, we switch larb1/2/3/7 to enter mmu1 while the others still keep enter mmu0. In

[PATCH v2 08/14] memory: mtk-smi: Invoke pm runtime_callback to enable clocks

2018-09-24 Thread Yong Wu
This patch only move the clk_prepare_enable and config_port into the runtime suspend/resume callback. It doesn't change the code content and sequence. This is a prepare patch for adjusting SMI_BUS_SEL for mt8183. (SMI_BUS_SEL need to be restored after smi-common resume every time.) Also it gives

[PATCH v2 11/14] iommu/mediatek: Add VLD_PA_RANGE register backup when suspend

2018-09-24 Thread Yong Wu
The register VLD_PA_RNG(0x118) was forgot to backup while adding 4GB mode support for mt2712. this patch add it. Fixes: 30e2fccf9512 ("iommu/mediatek: Enlarge the validate PA range for 4GB mode") Signed-off-by: Yong Wu --- drivers/iommu/mtk_iommu.c | 2 ++ drivers/iommu/mtk_iommu.h | 1 + 2

[PATCH v2 07/14] iommu/mediatek: Add mmu1 support

2018-09-24 Thread Yong Wu
Normally the M4U HW connect EMI with smi. the diagram is like below: EMI | M4U | smi-common | - ||| |... larb0 larb1 larb2 larb3 Actually there are 2 mmu cells

[PATCH v2 06/14] iommu/mediatek: Add mt8183 IOMMU support

2018-09-24 Thread Yong Wu
The M4U IP blocks in mt8183 is MediaTek's generation2 M4U which use the ARM Short-descriptor like mt8173, and most of the HW registers are the same. Here list main changes in mt8183: 1) mt8183 has only one M4U HW like mt8173. 2) mt8183 don't have its "bclk" clock, the M4U use the EMI clock which

[PATCH v2 05/14] iommu/io-pgtable-arm-v7s: Extend MediaTek 4GB Mode

2018-09-24 Thread Yong Wu
MediaTek extend the arm v7s descriptor to support the dram over 4GB. In the mt2712 and mt8173, it's called "4GB mode", the physical address is from 0x4000_ to 0x1_3fff_, but from EMI point of view, it is remapped to high address from 0x1__ to 0x1__, the bit32 is always

[PATCH v2 03/14] memory: mtk-smi: Use a general config_port interface

2018-09-24 Thread Yong Wu
The config_port of mt2712 and mt8183 are the same. Use a general config_port interface instead. In addition, in mt2712, larb8 and larb9 are the bdpsys larbs which are not the normal larb, their register space are different from the normal one. thus, we can not call the general config_port. In

[PATCH v2 04/14] iommu/io-pgtable-arm-v7s: Add paddr_to_iopte and iopte_to_paddr helpers

2018-09-24 Thread Yong Wu
Add two helper functions: paddr_to_iopte and iopte_to_paddr. Signed-off-by: Yong Wu --- drivers/iommu/io-pgtable-arm-v7s.c | 45 -- 1 file changed, 33 insertions(+), 12 deletions(-) diff --git a/drivers/iommu/io-pgtable-arm-v7s.c

[PATCH v2 02/14] iommu/mediatek: Use a struct as the platform data

2018-09-24 Thread Yong Wu
Use a struct as the platform special data instead of the enumeration. This is a prepare patch for adding mt8183 iommu support. Signed-off-by: Yong Wu --- drivers/iommu/mtk_iommu.c | 24 drivers/iommu/mtk_iommu.h | 6 +- 2 files changed, 21 insertions(+), 9

[PATCH v2 01/14] dt-bindings: mediatek: Add binding for mt8183 IOMMU and SMI

2018-09-24 Thread Yong Wu
This patch adds decriptions for mt8183 IOMMU and SMI. mt8183 has only one M4U like mt8173 and is also MTK IOMMU gen2 which uses ARM Short-Descriptor translation table format. The mt8183 M4U-SMI HW diagram is as below: EMI |

[PATCH v2 00/14] MT8183 IOMMU SUPPORT

2018-09-24 Thread Yong Wu
This patchset mainly adds support for mt8183 IOMMU and SMI. mt8183 has only one M4U like mt8173 and is also MTK IOMMU gen2 which uses ARM Short-Descriptor translation table format. The mt8183 M4U-SMI HW diagram is as below: EMI |