[PATCH v1 1/4] iommu/tegra: gart: Don't unnecessarily allocate registers context

2017-07-05 Thread Dmitry Osipenko
GART looses it's state only in case of a deepest suspend level. Let's not waste memory if machine doesn't support that suspend level. Signed-off-by: Dmitry Osipenko --- drivers/iommu/tegra-gart.c | 36 +--- 1 file changed, 25 insertions(+), 11 del

[PATCH v1 3/4] iommu/tegra: gart: Move PFN validation out of spinlock

2017-07-05 Thread Dmitry Osipenko
Validation of page frame number doesn't require protection with a spinlock, let's move it out of spinlock for consistency. Signed-off-by: Dmitry Osipenko --- drivers/iommu/tegra-gart.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iommu/tegra-gart.c

[PATCH v1 0/4] iommu/tegra: gart: Couple corrections

2017-07-05 Thread Dmitry Osipenko
I've added an experimental support of the GART to the Tegra DRM driver and it ended up with a very positive result. During the testing of the GART driver I've noticed couple of its minor shortcomings, so here the patches to remedy them. Dmitry Osipenko (4): iommu/tegra: g

[PATCH v1 4/4] iommu/tegra: gart: Correct number of unmapped bytes

2017-07-05 Thread Dmitry Osipenko
The iommu_unmap() treats zero bytes number returned by an IOMMU driver as an indicator that unmapping should be stopped. As a result, GART driver unmaps only the first page entry of the whole range, which is incorrect. Signed-off-by: Dmitry Osipenko --- drivers/iommu/tegra-gart.c | 2 +- 1 file

[PATCH v1 2/4] iommu/tegra: gart: Check whether page is already mapped

2017-07-05 Thread Dmitry Osipenko
Due to a bug, multiple devices may try to map the same IOVA region. We can catch that case by checking that 'VALID' bit of the GART's page entry is unset prior to mapping of the page. Signed-off-by: Dmitry Osipenko --- drivers/iommu/tegra-gart.c | 7 +++ 1 file change

[PATCH] iommu: Correct iommu_map / iommu_unmap prototypes

2017-07-05 Thread Dmitry Osipenko
#x27;s correct them for consistency. Signed-off-by: Dmitry Osipenko --- include/linux/iommu.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/iommu.h b/include/linux/iommu.h index 2cb54adc4a33..f1ce8e517d8d 100644 --- a/include/linux/iommu.h +++ b/inclu

Re: [PATCH 3/4] iommu/tegra-gart: Add iommu_group support

2017-07-26 Thread Dmitry Osipenko
ain existing behaviour with respect to the API. > > Signed-off-by: Robin Murphy > --- > drivers/iommu/tegra-gart.c | 19 +++ > 1 file changed, 19 insertions(+) > Tested-by: Dmitry Osipenko -- Dmitry ___ iommu

Re: [PATCH v5 00/21] IOMMU: Tegra GART driver clean up and optimization

2018-11-16 Thread Dmitry Osipenko
On 01.10.2018 1:48, Dmitry Osipenko wrote: > Hello, > > This patch-series integrates the GART (IOMMU) driver with the Memory > Controller driver, that allows to report the name of a faulty memory > client on GART page fault. A major code clean up and performance > optimizati

[PATCH v6 04/21] iommu: Introduce iotlb_sync_map callback

2018-12-09 Thread Dmitry Osipenko
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, optimizing performance of the mapping operation. Signed-off-by: Dmitry

[PATCH v6 00/21] IOMMU: Tegra GART driver clean up and optimization

2018-12-09 Thread Dmitry Osipenko
e for devices would be a better solution, allowing to implement transparent context switching of virtual IOMMU domains. Some very minor code cleanups, reworded commit messages. Dmitry Osipenko (21): iommu/tegra: gart: Remove pr_fmt and clean up includes iommu/tegra: gart: Clean up

[PATCH v6 01/21] iommu/tegra: gart: Remove pr_fmt and clean up includes

2018-12-09 Thread Dmitry Osipenko
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 Acked-by: Thierry Reding --- drivers/iommu/tegra-gart.c | 17 + 1

[PATCH v6 03/21] iommu/tegra: gart: Ignore devices without IOMMU phandle in DT

2018-12-09 Thread Dmitry Osipenko
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. Signed-off-by: Dmitry Osipenko Acked-by: Thierry Reding --- drivers/iommu/tegra-gart.c | 14 +- 1 file changed, 13

[PATCH v6 02/21] iommu/tegra: gart: Clean up driver probe errors handling

2018-12-09 Thread Dmitry Osipenko
Properly clean up allocated resources on the drivers probe failure and remove unneeded checks. Signed-off-by: Dmitry Osipenko Acked-by: Thierry Reding --- drivers/iommu/tegra-gart.c | 16 ++-- 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/drivers/iommu/tegra-gart.c

[PATCH v6 07/21] ARM: dts: tegra20: Update Memory Controller node to the new binding

2018-12-09 Thread Dmitry Osipenko
Device tree binding of Memory Controller has been changed: GART has been squashed into the MC, there are a new mandatory clock and #iommu-cells properties, the compatible has been changed to 'tegra20-mc-gart'. Signed-off-by: Dmitry Osipenko --- arch/arm/boot/dts/tegra20

[PATCH v6 05/21] iommu/tegra: gart: Optimize mapping / unmapping performance

2018-12-09 Thread Dmitry Osipenko
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 flushing after each page entry update. Signed-off-by: Dmitry Osipenko Acked

[PATCH v6 08/21] memory: tegra: Don't invoke Tegra30+ specific memory timing setup on Tegra20

2018-12-09 Thread Dmitry Osipenko
This fixes irrelevant "tegra-mc 7000f000.memory-controller: no memory timings for RAM code 0 registered" warning message during of kernels boot-up on Tegra20. Fixes: a8d502fd3348 ("memory: tegra: Squash tegra20-mc into common tegra-mc driver") Signed-off-by: Dmitry Osipenko

[PATCH v6 09/21] memory: tegra: Adapt to Tegra20 device-tree binding changes

2018-12-09 Thread Dmitry Osipenko
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 changes. Signed-off-by: Dmitry Osipenko --- drivers/memory/tegra/mc.c | 21

[PATCH v6 06/21] dt-bindings: memory: tegra: Squash tegra20-gart into tegra20-mc

2018-12-09 Thread Dmitry Osipenko
w clock property also puts the tegra20-mc binding in line with the bindings of the later Tegra generations. Signed-off-by: Dmitry Osipenko Reviewed-by: Rob Herring --- .../bindings/iommu/nvidia,tegra20-gart.txt| 14 -- .../memory-controllers/nvidia,tegra20-mc.txt | 27 ++

[PATCH v6 10/21] memory: tegra: Read client ID on GART page fault

2018-12-09 Thread Dmitry Osipenko
With the device tree binding changes, now Memory Controller has access to GART registers. Hence it is now possible to read client ID on GART page fault to get information about what memory client causes the fault. Signed-off-by: Dmitry Osipenko --- drivers/memory/tegra/mc.c | 12 ++-- 1

[PATCH v6 11/21] memory: tegra: Use of_device_get_match_data()

2018-12-09 Thread Dmitry Osipenko
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 | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/memory

[PATCH v6 13/21] iommu/tegra: gart: Integrate with Memory Controller driver

2018-12-09 Thread Dmitry Osipenko
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: Dmitry Osipenko --- drivers/iommu/Kconfig | 1 + drivers/iommu

[PATCH v6 16/21] iommu/tegra: gart: Allow only one active domain at a time

2018-12-09 Thread Dmitry Osipenko
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 Acked-by: Thierry Reding --- drivers/iommu/tegra-gart.c | 9 + 1 file changed, 9 insertions(+) diff --git a/drivers/iommu/tegra-gart.c b

[PATCH v6 12/21] memory: tegra: Use relaxed versions of readl/writel

2018-12-09 Thread Dmitry Osipenko
There is no need for inserting of memory barriers to access registers of Memory Controller. Hence use the relaxed versions of the accessors. Signed-off-by: Dmitry Osipenko --- drivers/memory/tegra/mc.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/memory/tegra

[PATCH v6 14/21] iommu/tegra: gart: Fix spinlock recursion

2018-12-09 Thread Dmitry Osipenko
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 Acked-by: Thierry Reding --- drivers/iommu/tegra-gart.c | 24 1 file changed, 16 insertions(+), 8 deletions

[PATCH v6 15/21] iommu/tegra: gart: Fix NULL pointer dereference

2018-12-09 Thread Dmitry Osipenko
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 Acked-by: Thierry Reding --- drivers/iommu/tegra-gart.c | 4 ++-- 1 file changed, 2

[PATCH v6 19/21] iommu/tegra: gart: Don't detach devices from inactive domains

2018-12-09 Thread Dmitry Osipenko
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 Acked-by: Thierry Reding --- drivers/iommu/tegra-gart.c | 8 +--- 1 file changed, 5 insertions(+), 3

[PATCH v6 17/21] iommu/tegra: gart: Don't use managed resources

2018-12-09 Thread Dmitry Osipenko
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 Acked-by: Thierry Reding --- drivers/iommu/tegra-gart.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff

[PATCH v6 21/21] iommu/tegra: gart: Perform code refactoring

2018-12-09 Thread Dmitry Osipenko
f the IOMMU-core. Signed-off-by: Dmitry Osipenko --- drivers/iommu/tegra-gart.c | 244 +++-- 1 file changed, 96 insertions(+), 148 deletions(-) diff --git a/drivers/iommu/tegra-gart.c b/drivers/iommu/tegra-gart.c index 71de54aa845c..c732c6a2a165 100644 --- a/dr

[PATCH v6 20/21] iommu/tegra: gart: Simplify clients-tracking code

2018-12-09 Thread Dmitry Osipenko
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 simpler alternative. Signed-off-by: Dmitry Osipenko Acked-by: Th

[PATCH v6 18/21] iommu/tegra: gart: Prepend error/debug messages with "gart:"

2018-12-09 Thread Dmitry Osipenko
iate them from the MC. Signed-off-by: Dmitry Osipenko --- drivers/iommu/tegra-gart.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/iommu/tegra-gart.c b/drivers/iommu/tegra-gart.c index 99afdbf8860c..9d2df43ce50b 100644 --- a/drivers/iommu/tegra-gart.c +++ b/drivers/iommu/tegra-g

Re: [PATCH v6 00/21] IOMMU: Tegra GART driver clean up and optimization

2018-12-11 Thread Dmitry Osipenko
On 11.12.2018 12:53, Joerg Roedel wrote: > On Sun, Dec 09, 2018 at 11:29:29PM +0300, Dmitry Osipenko wrote: >> Dmitry Osipenko (21): >> iommu/tegra: gart: Remove pr_fmt and clean up includes >> iommu/tegra: gart: Clean up driver probe errors handling >> iommu/

Re: [PATCH v6 00/21] IOMMU: Tegra GART driver clean up and optimization

2018-12-12 Thread Dmitry Osipenko
On 12.12.2018 13:43, Joerg Roedel wrote: > Hi Thierry, Hi Dmitry, > > On Wed, Dec 12, 2018 at 11:24:15AM +0100, Thierry Reding wrote: >> So appart from the one issue in the "memory controller integration" >> patch this looks good and I've acked the remaining patches. Once the one >> remaining issu

Re: [PATCH v6 13/21] iommu/tegra: gart: Integrate with Memory Controller driver

2018-12-12 Thread Dmitry Osipenko
On 12.12.2018 13:14, Thierry Reding wrote: > On Sun, Dec 09, 2018 at 11:29:42PM +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

[PATCH v7 01/24] iommu/tegra: gart: Remove pr_fmt and clean up includes

2018-12-12 Thread Dmitry Osipenko
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 Acked-by: Thierry Reding --- drivers/iommu/tegra-gart.c | 17 + 1

[PATCH v7 00/24] Tegra GART driver clean up and optimization

2018-12-12 Thread Dmitry Osipenko
; patch from the series for now because after some more considering it became not exactly apparent whether that is what we need, that was also suggested by Robin Murphy in the review comment. Maybe something like a runtime IOMMU usage for devices would be a better solution, allowing t

[PATCH v7 05/24] iommu/tegra: gart: Optimize mapping / unmapping performance

2018-12-12 Thread Dmitry Osipenko
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 flushing after each page entry update. Signed-off-by: Dmitry Osipenko Acked

[PATCH v7 03/24] iommu/tegra: gart: Ignore devices without IOMMU phandle in DT

2018-12-12 Thread Dmitry Osipenko
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. Signed-off-by: Dmitry Osipenko Acked-by: Thierry Reding --- drivers/iommu/tegra-gart.c | 14 +- 1 file changed, 13

[PATCH v7 02/24] iommu/tegra: gart: Clean up driver probe errors handling

2018-12-12 Thread Dmitry Osipenko
Properly clean up allocated resources on the drivers probe failure and remove unneeded checks. Signed-off-by: Dmitry Osipenko Acked-by: Thierry Reding --- drivers/iommu/tegra-gart.c | 16 ++-- 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/drivers/iommu/tegra-gart.c

[PATCH v7 04/24] iommu: Introduce iotlb_sync_map callback

2018-12-12 Thread Dmitry Osipenko
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, optimizing performance of the mapping operation. Signed-off-by: Dmitry

[PATCH v7 06/24] dt-bindings: memory: tegra: Squash tegra20-gart into tegra20-mc

2018-12-12 Thread Dmitry Osipenko
w clock property also puts the tegra20-mc binding in line with the bindings of the later Tegra generations. Signed-off-by: Dmitry Osipenko Reviewed-by: Rob Herring Acked-by: Thierry Reding --- .../bindings/iommu/nvidia,tegra20-gart.txt| 14 -- .../memory-controlle

[PATCH v7 07/24] ARM: dts: tegra20: Update Memory Controller node to the new binding

2018-12-12 Thread Dmitry Osipenko
Device tree binding of Memory Controller has been changed: GART has been squashed into the MC, there are a new mandatory clock and #iommu-cells properties, the compatible has been changed to 'tegra20-mc-gart'. Signed-off-by: Dmitry Osipenko Acked-by: Thierry Reding --- arch/ar

[PATCH v7 09/24] memory: tegra: Adapt to Tegra20 device-tree binding changes

2018-12-12 Thread Dmitry Osipenko
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 changes. Signed-off-by: Dmitry Osipenko Acked-by: Thierry Reding

[PATCH v7 08/24] memory: tegra: Don't invoke Tegra30+ specific memory timing setup on Tegra20

2018-12-12 Thread Dmitry Osipenko
This fixes irrelevant "tegra-mc 7000f000.memory-controller: no memory timings for RAM code 0 registered" warning message during of kernels boot-up on Tegra20. Fixes: a8d502fd3348 ("memory: tegra: Squash tegra20-mc into common tegra-mc driver") Signed-off-by: Dmitry Osipenko

[PATCH v7 10/24] memory: tegra: Read client ID on GART page fault

2018-12-12 Thread Dmitry Osipenko
With the device tree binding changes, now Memory Controller has access to GART registers. Hence it is now possible to read client ID on GART page fault to get information about what memory client causes the fault. Signed-off-by: Dmitry Osipenko Acked-by: Thierry Reding --- drivers/memory/tegra

[PATCH v7 11/24] memory: tegra: Use of_device_get_match_data()

2018-12-12 Thread Dmitry Osipenko
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 Acked-by: Thierry Reding --- drivers/memory/tegra/mc.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff

[PATCH v7 12/24] memory: tegra: Use relaxed versions of readl/writel

2018-12-12 Thread Dmitry Osipenko
There is no need for inserting of memory barriers to access registers of Memory Controller. Hence use the relaxed versions of the accessors. Signed-off-by: Dmitry Osipenko Acked-by: Thierry Reding --- drivers/memory/tegra/mc.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff

[PATCH v7 13/24] iommu/tegra: gart: Integrate with Memory Controller driver

2018-12-12 Thread Dmitry Osipenko
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 on Tegra30+. Signed-off-by: Dmitry Osipenko --- drivers/iommu/Kconfig | 1 + drivers/iommu

[PATCH v7 14/24] memory: tegra: Do not try to probe SMMU on Tegra20

2018-12-12 Thread Dmitry Osipenko
Tegra20 doesn't have SMMU. Move out checking of the SMMU presence from the SMMU driver into the Memory Controller driver. This change makes code consistent in regards to how GART/SMMU presence checking is performed. Signed-off-by: Dmitry Osipenko --- drivers/iommu/tegra-smmu.c | 4 dr

[PATCH v7 17/24] iommu/tegra: gart: Fix spinlock recursion

2018-12-12 Thread Dmitry Osipenko
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 Acked-by: Thierry Reding --- drivers/iommu/tegra-gart.c | 24 1 file changed, 16 insertions(+), 8 deletions

[PATCH v7 15/24] memory: tegra: Do not ask for IRQ sharing

2018-12-12 Thread Dmitry Osipenko
Memory Controller driver never shared IRQ with any other driver and very unlikely that it will. Hence there is no need to request IRQ sharing and the corresponding flag can be dropped safely. Signed-off-by: Dmitry Osipenko --- drivers/memory/tegra/mc.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH v7 18/24] iommu/tegra: gart: Fix NULL pointer dereference

2018-12-12 Thread Dmitry Osipenko
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 Acked-by: Thierry Reding --- drivers/iommu/tegra-gart.c | 4 ++-- 1 file changed, 2

[PATCH v7 16/24] memory: tegra: Clean up error messages

2018-12-12 Thread Dmitry Osipenko
Make all messages to start with a lower case and don't unnecessarily go over 80 chars in the code. Signed-off-by: Dmitry Osipenko --- drivers/memory/tegra/mc.c | 15 --- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/memory/tegra/mc.c b/drivers/memory/

[PATCH v7 19/24] iommu/tegra: gart: Allow only one active domain at a time

2018-12-12 Thread Dmitry Osipenko
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 Acked-by: Thierry Reding --- drivers/iommu/tegra-gart.c | 9 + 1 file changed, 9 insertions(+) diff --git a/drivers/iommu/tegra-gart.c b

[PATCH v7 20/24] iommu/tegra: gart: Don't use managed resources

2018-12-12 Thread Dmitry Osipenko
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 Acked-by: Thierry Reding --- drivers/iommu/tegra-gart.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff

[PATCH v7 24/24] iommu/tegra: gart: Perform code refactoring

2018-12-12 Thread Dmitry Osipenko
f the IOMMU-core. Now the GART translation is kept disabled while GART is suspended. Signed-off-by: Dmitry Osipenko Acked-by: Thierry Reding --- drivers/iommu/tegra-gart.c | 253 +++-- 1 file changed, 105 insertions(+), 148 deletions(-) diff --git a/drivers/iommu/

[PATCH v7 21/24] iommu/tegra: gart: Prepend error/debug messages with "gart:"

2018-12-12 Thread Dmitry Osipenko
iate them from the MC. Signed-off-by: Dmitry Osipenko Acked-by: Thierry Reding --- drivers/iommu/tegra-gart.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/iommu/tegra-gart.c b/drivers/iommu/tegra-gart.c index 2e0e6aff8f70..a3ce6918577d 100644 --- a/drivers/iommu/tegra-gart.c ++

[PATCH v7 23/24] iommu/tegra: gart: Simplify clients-tracking code

2018-12-12 Thread Dmitry Osipenko
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 simpler alternative. Signed-off-by: Dmitry Osipenko Acked-by: Th

[PATCH v7 22/24] iommu/tegra: gart: Don't detach devices from inactive domains

2018-12-12 Thread Dmitry Osipenko
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 Acked-by: Thierry Reding --- drivers/iommu/tegra-gart.c | 8 +--- 1 file changed, 5 insertions(+), 3

Re: [PATCH v7 00/24] Tegra GART driver clean up and optimization

2018-12-17 Thread Dmitry Osipenko
On 17.12.2018 12:14, Joerg Roedel wrote: > On Wed, Dec 12, 2018 at 11:38:43PM +0300, Dmitry Osipenko wrote: >> Dmitry Osipenko (24): >> iommu/tegra: gart: Remove pr_fmt and clean up includes >> iommu/tegra: gart: Clean up driver probe errors handling >> iommu/

Re: [PATCH v7 00/24] Tegra GART driver clean up and optimization

2019-01-15 Thread Dmitry Osipenko
17.12.2018 12:14, Joerg Roedel пишет: > On Wed, Dec 12, 2018 at 11:38:43PM +0300, Dmitry Osipenko wrote: >> Dmitry Osipenko (24): >> iommu/tegra: gart: Remove pr_fmt and clean up includes >> iommu/tegra: gart: Clean up driver probe errors handling >> iommu/tegra: g

Re: [PATCH v7 00/24] Tegra GART driver clean up and optimization

2019-01-16 Thread Dmitry Osipenko
16.01.2019 15:55, Joerg Roedel пишет: > On Tue, Jan 15, 2019 at 07:33:54PM +0300, Dmitry Osipenko wrote: >> Should I expect that the patches will appear in the IOMMU git and in >> -next consequently? Please let me know if there is any problem with >> the applying of the

Re: [PATCH 1/5] iommu/tegra-smmu: Fix domain_alloc

2019-01-17 Thread Dmitry Osipenko
16.01.2019 23:50, Navneet Kumar пишет: > * Allocate dma iova cookie for a domain while adding dma iommu > devices. > * Perform a stricter check for domain type parameter. > Commit message should tell what exactly is getting "fixed". Apparently you're trying to support T132 ARM64 here. > Signed-

Re: [PATCH 2/5] iommu/tegra-smmu: Use non-secure register for flushing

2019-01-17 Thread Dmitry Osipenko
16.01.2019 23:50, Navneet Kumar пишет: > Use PTB_ASID instead of SMMU_CONFIG to flush smmu. > PTB_ASID can be accessed from non-secure mode, SMMU_CONFIG cannot be. > Using SMMU_CONFIG could pose a problem when kernel doesn't have secure > mode access enabled from boot. > > Signed-off-by: Navneet K

Re: [PATCH 2/5] iommu/tegra-smmu: Use non-secure register for flushing

2019-01-24 Thread Dmitry Osipenko
24.01.2019 21:29, navneet kumar пишет: > On 1/17/19 7:25 AM, Dmitry Osipenko wrote: >> 16.01.2019 23:50, Navneet Kumar пишет: >>> Use PTB_ASID instead of SMMU_CONFIG to flush smmu. >>> PTB_ASID can be accessed from non-secure mode, SMMU_CONFIG cannot be. >>> Us

Re: [PATCH 2/3] iommu: Document iommu_ops.iotlb_sync_map()

2019-02-20 Thread Dmitry Osipenko
y it got lost after a rebase. The kerneldoc comment is correct, thank you! BTW, for some reason gmail marked this series as a spam, maybe you need to check the email headers and whatnot. Reviewed-by: Dmitry Osipenko ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

[PATCH v1 0/3] IOMMU: Tegra SMMU fixes

2019-03-06 Thread Dmitry Osipenko
Hello, This small series primarily fixes a bug that affects Terga30 and Terga114 platforms, it also carries two patches that improve SMMU functionality and clean up code a tad. Dmitry Osipenko (3): iommu/tegra-smmu: Fix invalid ASID bits on Tegra30/114 iommu/tegra-smmu: Properly release

[PATCH v1 3/3] iommu/tegra-smmu: Respect IOMMU API read-write protections

2019-03-06 Thread Dmitry Osipenko
Set PTE read/write attributes accordingly to the the protections requested by IOMMU API. Signed-off-by: Dmitry Osipenko --- drivers/iommu/tegra-smmu.c | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers/iommu/tegra-smmu.c b/drivers/iommu/tegra-smmu.c index

[PATCH v1 1/3] iommu/tegra-smmu: Fix invalid ASID bits on Tegra30/114

2019-03-06 Thread Dmitry Osipenko
on Tegra30. Cc: stable Signed-off-by: Dmitry Osipenko --- drivers/iommu/tegra-smmu.c | 25 ++--- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/drivers/iommu/tegra-smmu.c b/drivers/iommu/tegra-smmu.c index 5182c7d6171e..8d30653cd13a 100644 --- a/drivers/iommu/teg

[PATCH v1 2/3] iommu/tegra-smmu: Properly release domain resources

2019-03-06 Thread Dmitry Osipenko
Release all memory allocations associated with a released domain and emit warning if domain is in-use at the time of destruction. Signed-off-by: Dmitry Osipenko --- drivers/iommu/tegra-smmu.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/iommu/tegra-smmu.c b/drivers/iommu/tegra

Re: [PATCH v5 33/38] staging: tegra-vde: fix common struct sg_table related issues

2020-05-14 Thread Dmitry Osipenko
; > - size = iommu_map_sg(vde->domain, addr, sgt->sgl, sgt->nents, > - IOMMU_READ | IOMMU_WRITE); > + size = iommu_map_sgtable(vde->domain, addr, sgt, > + IOMMU_READ | IOMMU_WRITE); > if (!size) { >

[PATCH v1] iommu/tegra-smmu: Add missing locks around mapping operations

2020-05-24 Thread Dmitry Osipenko
ppens while running multiple graphics tests in parallel on Tegra30, i.e. by having multiple threads racing with each other in the Host1x's submission and completion code paths, performing IOVA mappings and unmappings in parallel. Cc: Signed-off-by: Dmitry Osipenko --- drivers/iommu/tegra-s

Re: [PATCH v1] iommu/tegra-smmu: Add missing locks around mapping operations

2020-05-25 Thread Dmitry Osipenko
25.05.2020 11:35, Thierry Reding пишет: > On Sun, May 24, 2020 at 09:37:55PM +0300, Dmitry Osipenko wrote: >> The mapping operations of the Tegra SMMU driver are subjected to a race >> condition issues because SMMU Address Space isn't allocated and freed >> atomically

Re: [PATCH v1] iommu/tegra-smmu: Add missing locks around mapping operations

2020-05-25 Thread Dmitry Osipenko
25.05.2020 15:20, Thierry Reding пишет: ... > Do we have a good way to find out how bad exactly the contention would > be when using a mutex? I'm now having a second thought about it. We don't need to care about that scenario at all because it's a software-design defect of the upstream Host1x driv

[PATCH v2] iommu/tegra-smmu: Add missing locks around mapping operations

2020-05-25 Thread Dmitry Osipenko
ppens while running multiple graphics tests in parallel on Tegra30, i.e. by having multiple threads racing with each other in the Host1x's submission and completion code paths, performing IOVA mappings and unmappings in parallel. Cc: Signed-off-by: Dmitry Osipenko --- Changelog: v2: -

Re: [PATCH v2] iommu/tegra-smmu: Add missing locks around mapping operations

2020-06-15 Thread Dmitry Osipenko
25.05.2020 22:54, Dmitry Osipenko пишет: > The mapping operations of the Tegra SMMU driver are subjected to a race > condition issues because SMMU Address Space isn't allocated and freed > atomically, while it should be. This patch makes the mapping operations > atomic, it fixe

Re: [PATCH] media: staging: tegra-vde: Disable building with COMPILE_TEST

2019-08-26 Thread Dmitry Osipenko
Hello Yue, 26.08.2019 16:31, YueHaibing пишет: > If COMPILE_TEST is y and IOMMU_SUPPORT is n, selecting TEGRA_VDE > to m will set IOMMU_IOVA to m, this fails the building of > TEGRA_HOST1X and DRM_TEGRA which is y like this: > > drivers/gpu/host1x/cdma.o: In function `host1x_cdma_init': > cdma.c:

Re: [PATCH] media: staging: tegra-vde: Disable building with COMPILE_TEST

2019-08-26 Thread Dmitry Osipenko
26.08.2019 18:18, Dmitry Osipenko пишет: > Hello Yue, > > 26.08.2019 16:31, YueHaibing пишет: >> If COMPILE_TEST is y and IOMMU_SUPPORT is n, selecting TEGRA_VDE >> to m will set IOMMU_IOVA to m, this fails the building of >> TEGRA_HOST1X and DRM_TEGRA which is y l

Re: [PATCH] media: staging: tegra-vde: Disable building with COMPILE_TEST

2019-08-29 Thread Dmitry Osipenko
29.08.2019 15:40, Thierry Reding пишет: > On Thu, Aug 29, 2019 at 01:39:32PM +0200, Hans Verkuil wrote: >> On 8/26/19 3:31 PM, YueHaibing wrote: >>> If COMPILE_TEST is y and IOMMU_SUPPORT is n, selecting TEGRA_VDE >>> to m will set IOMMU_IOVA to m, this fails the building of >>> TEGRA_HOST1X and DR

Re: [PATCH] media: staging: tegra-vde: Disable building with COMPILE_TEST

2019-09-06 Thread Dmitry Osipenko
29.08.2019 18:49, Thierry Reding пишет: > On Thu, Aug 29, 2019 at 04:58:22PM +0300, Dmitry Osipenko wrote: >> 29.08.2019 15:40, Thierry Reding пишет: >>> On Thu, Aug 29, 2019 at 01:39:32PM +0200, Hans Verkuil wrote: >>>> On 8/26/19 3:31 PM, YueHaibing wrote:

Re: [PATCH] media: staging: tegra-vde: Fix build error

2019-09-20 Thread Dmitry Osipenko
20.09.2019 22:32, Arnd Bergmann пишет: > On Thu, Jul 25, 2019 at 2:24 PM Dmitry Osipenko wrote: >> >> 25.07.2019 5:41, YueHaibing пишет: >>> If IOMMU_SUPPORT is not set, and COMPILE_TEST is y, >>> IOMMU_IOVA may be set to m. So building will fails: >>> &

Re: [RFC 1/3] memory: Introduce memory controller mini-framework

2019-10-31 Thread Dmitry Osipenko
15.10.2019 19:29, Thierry Reding пишет: > From: Thierry Reding > > This new framework is currently nothing more than a registry of memory > controllers, with the goal being to order device probing. One use-case > where this is useful, for example, is a memory controller device which > needs to pr

Re: [RFC 1/3] memory: Introduce memory controller mini-framework

2019-11-01 Thread Dmitry Osipenko
01.11.2019 13:18, Thierry Reding пишет: > On Thu, Oct 31, 2019 at 06:11:33PM +0300, Dmitry Osipenko wrote: >> 15.10.2019 19:29, Thierry Reding пишет: >>> From: Thierry Reding >>> >>> This new framework is currently nothing more than a registry of memory >

Re: [PATCH v1 0/4] iommu/tegra: gart: Couple corrections

2017-07-29 Thread Dmitry Osipenko
On 25.07.2017 17:43, Joerg Roedel wrote: > On Wed, Jul 05, 2017 at 07:29:44PM +0300, Dmitry Osipenko wrote: >> I've added an experimental support of the GART to the Tegra DRM driver >> and it ended up with a very positive result. During the testing of the >> GART driver

Re: [PATCH v1 0/4] iommu/tegra: gart: Couple corrections

2017-07-29 Thread Dmitry Osipenko
On 29.07.2017 14:04, Dmitry Osipenko wrote: > On 25.07.2017 17:43, Joerg Roedel wrote: >> On Wed, Jul 05, 2017 at 07:29:44PM +0300, Dmitry Osipenko wrote: >>> I've added an experimental support of the GART to the Tegra DRM driver >>> and it ended up with a very pos

Re: [PATCH 2/2] iommu/tegra-gart: Add support for struct iommu_device

2017-08-16 Thread Dmitry Osipenko
del > --- > drivers/iommu/tegra-gart.c | 26 ++ > 1 file changed, 26 insertions(+) > Reviewed-by: Dmitry Osipenko Tested-by: Dmitry Osipenko > diff --git a/drivers/iommu/tegra-gart.c b/drivers/iommu/tegra-gart.c > index 29bafc6..b62f790 100644 > --- a/

Re: [PATCH 2/2] iommu/tegra-gart: Add support for struct iommu_device

2017-08-17 Thread Dmitry Osipenko
On 17.08.2017 16:52, Thierry Reding wrote: > On Thu, Aug 17, 2017 at 01:21:52AM +0300, Dmitry Osipenko wrote: >> Hello Joerg, >> >> On 10.08.2017 01:29, Joerg Roedel wrote: >>> From: Joerg Roedel >>> >>> Add a struct iommu_device to each tegra-ga

Re: [PATCH v1 2/4] iommu/tegra: gart: Check whether page is already mapped

2017-09-26 Thread Dmitry Osipenko
On 26.09.2017 14:06, Thierry Reding wrote: > On Wed, Jul 05, 2017 at 07:29:46PM +0300, Dmitry Osipenko wrote: >> Due to a bug, multiple devices may try to map the same IOVA region. We can >> catch that case by checking that 'VALID' bit of the GART's page entry is &g

Re: [PATCH v1 1/4] iommu/tegra: gart: Don't unnecessarily allocate registers context

2017-09-26 Thread Dmitry Osipenko
On 26.09.2017 14:19, Thierry Reding wrote: > On Wed, Jul 05, 2017 at 07:29:45PM +0300, Dmitry Osipenko wrote: >> GART looses it's state only in case of a deepest suspend level. Let's not >> waste memory if machine doesn't support that suspend level. >&g

Re: [PATCH v1 2/4] iommu/tegra: gart: Check whether page is already mapped

2017-09-26 Thread Dmitry Osipenko
On 26.09.2017 19:07, Thierry Reding wrote: > On Tue, Sep 26, 2017 at 04:49:52PM +0300, Dmitry Osipenko wrote: >> On 26.09.2017 14:06, Thierry Reding wrote: >>> On Wed, Jul 05, 2017 at 07:29:46PM +0300, Dmitry Osipenko wrote: >>>> Due to a bug, multiple devices may t

[PATCH v2 2/2] iommu/tegra: gart: Move PFN validation out of spinlock

2017-10-03 Thread Dmitry Osipenko
Validation of page frame number doesn't require protection with a spinlock, let's move it out of spinlock for consistency. Signed-off-by: Dmitry Osipenko Acked-by: Thierry Reding --- drivers/iommu/tegra-gart.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git

[PATCH v2 1/2] iommu/tegra: gart: Optionally check for overwriting of page mappings

2017-10-03 Thread Dmitry Osipenko
icitly by a new CONFIG_TEGRA_IOMMU_GART_DEBUG option. Signed-off-by: Dmitry Osipenko --- drivers/iommu/Kconfig | 9 + drivers/iommu/tegra-gart.c | 16 +++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig index f3a21343e636..851156a489

[PATCH v2 0/2] TEGRA GART cleanup and new debug option

2017-10-03 Thread Dmitry Osipenko
t is not entirely correct. - Replaced "Correct number of unmapped bytes" and "Check whether page is already mapped" patches with a new GART debug Kconfig option patch. Dmitry Osipenko (2): iommu/tegra: gart: Optionally check for overwriting of page mappings

[PATCH v2 1/2] iommu/tegra: gart: Add optional debug checking for overwriting of page mappings

2017-10-03 Thread Dmitry Osipenko
icitly by a new CONFIG_TEGRA_IOMMU_GART_DEBUG option. Signed-off-by: Dmitry Osipenko --- drivers/iommu/Kconfig | 9 + drivers/iommu/tegra-gart.c | 16 +++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig index f3a21343e636..851156a489

Re: [PATCH v2 1/2] iommu/tegra: gart: Add optional debug checking for overwriting of page mappings

2017-10-03 Thread Dmitry Osipenko
On 04.10.2017 04:02, Dmitry Osipenko wrote: > Due to a bug in IOVA allocator, page mapping could accidentally overwritten. > We can catch this case by checking 'VALID' bit of GART's page entry prior to > mapping of a page. Since that check introduces a noticeable performanc

Re: [PATCH v2 1/2] iommu/tegra: gart: Optionally check for overwriting of page mappings

2017-10-12 Thread Dmitry Osipenko
On 10.10.2017 12:53, Joerg Roedel wrote: > On Wed, Oct 04, 2017 at 04:02:31AM +0300, Dmitry Osipenko wrote: >> Due to a bug in IOVA allocator, page mapping could accidentally overwritten. >> We can catch this case by checking 'VALID' bit of GART's page entry prior

Re: [PATCH v2 1/2] iommu/tegra: gart: Optionally check for overwriting of page mappings

2017-10-13 Thread Dmitry Osipenko
On 13.10.2017 11:38, Joerg Roedel wrote: > On Thu, Oct 12, 2017 at 05:27:26PM +0300, Dmitry Osipenko wrote: >> I'm not talking about any specific bug, but in general if allocator re-maps >> already mapped region or unmaps the wrong-and-used region. I had those >&

[PATCH v1 1/4] iommu/tegra: gart: Add debugging facility

2018-04-09 Thread Dmitry Osipenko
debug' parameter. Signed-off-by: Dmitry Osipenko --- drivers/iommu/tegra-gart.c | 13 + 1 file changed, 13 insertions(+) diff --git a/drivers/iommu/tegra-gart.c b/drivers/iommu/tegra-gart.c index b62f790ad1ba..4c0abdcd1ad2 100644 --- a/drivers/iommu/tegra-gart.c +++ b/drivers/iom

[PATCH v1 3/4] iommu/tegra: gart: Constify number of GART pages

2018-04-09 Thread Dmitry Osipenko
GART has a fixed aperture size, hence the number of pages is constant. Signed-off-by: Dmitry Osipenko --- drivers/iommu/tegra-gart.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/iommu/tegra-gart.c b/drivers/iommu/tegra-gart.c index 89ec24c6952c

[PATCH v1 0/4] Tegra GART fixes and improvements

2018-04-09 Thread Dmitry Osipenko
GART driver wasn't ever been utilized in upstream, but finally this should change sometime soon with Tegra's DRM driver rework. In general GART driver works fine, though there are couple things that could be improved. Dmitry Osipenko (4): iommu/tegra: gart: Add debugging facility i

[PATCH v1 2/4] iommu/tegra: gart: Fix gart_iommu_unmap()

2018-04-09 Thread Dmitry Osipenko
It must return the number of unmapped bytes on success, returning 0 means that unmapping failed and in result only one page is unmapped. Signed-off-by: Dmitry Osipenko --- drivers/iommu/tegra-gart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/tegra-gart.c b

  1   2   3   4   >