On Tue, Jul 07, 2020 at 10:00:14PM -0700, Krishna Reddy wrote:
> ioremap smmu mmio region before calling into implementation init.
> This is necessary to allow mapped address available during vendor
> specific implementation init.
>
> Signed-off-by: Krishna Reddy
Reviewed-b
On Wed, Jul 22, 2020 at 04:43:07PM +0200, Christoph Hellwig wrote:
> Split out a cma_alloc_aligned helper to deal with the "interesting"
> calling conventions for cma_alloc, which then allows to the main
> function to be written straight forward. This also takes advantage
> of the fact that NULL d
don't feel that it hurts to check the dev pointer
as we do now, but if you are confident with this version:
Reviewed-by: Nicolin Chen
Thanks
___
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
ly limits those devices capable of 32+ bits addressing.
So this patch sets default segment_boundary_mask to ULONG_MAX.
Signed-off-by: Nicolin Chen
---
Changelog:
v2->v3
* Resent -- no change
v2 was sent 4 months ago https://lkml.org/lkml/2020/4/6/881
but it has not got replied yet
be also added to the same
IOMMU group so as to share an asid. Otherwise, the asid register may
get overwritten every time a new device is attached.
Signed-off-by: Nicolin Chen
---
drivers/iommu/tegra-smmu.c | 11 +++
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/drivers
IOVA might not be always 4KB aligned. So tegra_smmu_iova_to_phys
function needs to add on the lower 12-bit offset from input iova.
Signed-off-by: Nicolin Chen
---
drivers/iommu/tegra-smmu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iommu/tegra-smmu.c b/drivers
These are a series of small fixes for tegra-smmu driver.
They might not be critial bugs as current mainline does
not enable a lot of clients, but be nicer to have since
we are going to enable the DMA domain for other clients
in the near future.
Nicolin Chen (3):
iommu/tegra-smmu: Do not use
Hi Guillaume,
On Thu, Feb 04, 2021 at 11:10:15AM +, Guillaume Tucker wrote:
> Hi Nicolin,
>
> A regression was detected by kernelci.org in IGT's drm_read tests
> on mainline, it was first seen on 17th December 2020. You can
> find some details here:
>
> https://kernelci.org/test/case/id/6
Hi Guillaume,
On Thu, Feb 04, 2021 at 09:24:23PM -0800, Nicolin Chen wrote:
> > Please let us know if you need any help debugging this issue or
> > to try a fix on this platform.
>
> Yes, I don't have any Tegra124 platform to run. It'd be very nice
> if you can
illa kernel + debug patch
2. Vanilla kernel + Reverted + debug patch
Thank you
Nicolin
>From dce84731e12900b0e98dffc0ff981638a0bb3405 Mon Sep 17 00:00:00 2001
From: Nicolin Chen
Date: Fri, 5 Feb 2021 01:41:07 -0800
Subject: [PATCH] iommu: debug tegra-smmu v2
Signed-off-by: Nicolin Chen
---
ar
to revert my
previous change, not necessarily being a complete revert though.
I attached my partial reverting change in this email. Would it be
possible for you to run one more test for me to confirm it? It'd
keep the tests passing while eliminating all error prints above.
If the fix works, I'l
ication]
Fixes: 25938c73cd79 ("iommu/tegra-smmu: Rework tegra_smmu_probe_device()")
Reported-by: Guillaume Tucker
Signed-off-by: Nicolin Chen
---
Guillaume, would you please give a "Tested-by" to this change? Thanks!
drivers/iommu/tegra-smmu.c | 72 +
Hi Dmitry,
On Sat, Feb 20, 2021 at 08:16:22AM +0300, Dmitry Osipenko wrote:
> 19.02.2021 01:07, Nicolin Chen пишет:
> > Commit 25938c73cd79 ("iommu/tegra-smmu: Rework tegra_smmu_probe_device()")
> > removed certain hack in the tegra_smmu_probe() by relying on IOMMU core t
On Tue, Feb 23, 2021 at 08:10:41AM +0300, Dmitry Osipenko wrote:
> 23.02.2021 05:13, Nicolin Chen пишет:
> > Hi Dmitry,
> >
> > On Sat, Feb 20, 2021 at 08:16:22AM +0300, Dmitry Osipenko wrote:
> >> 19.02.2021 01:07, Nicolin Chen пишет:
> >>> Comm
On Sat, Feb 27, 2021 at 12:59:17PM +0300, Dmitry Osipenko wrote:
> 25.02.2021 09:27, Nicolin Chen пишет:
> ...
> >> The partially revert should be okay, but it's not clear to me what makes
> >> difference for T124 since I don't see that problem on T30, which also
IOVASIZEATTR
#1023 - #1023 0x122e5e0000xf000 0x1000 0x5
}
}
Total PDE count: 1
Total PTE count: 1
Signed-off-by: Nicolin Chen
---
Changelog
v2:
* Expanded mutex range to the entire function
* Added as->lock to protect paget
On Wed, Mar 10, 2021 at 11:38:47PM +0300, Dmitry Osipenko wrote:
> 10.03.2021 06:36, Nicolin Chen пишет:
> > This patch dumps all active mapping entries from pagetable
> > to a debugfs directory named "mappings".
> >
> > Ataching an example:
> >
On Wed, Mar 10, 2021 at 11:22:57PM +0300, Dmitry Osipenko wrote:
> 10.03.2021 22:13, Dmitry Osipenko пишет:
> > I found that this patch introduced a serious regression on Tegra30 using
> > today's linux-next. Tegra30 has two 3d h/w blocks connected in SLI and
> > only one of the blocks is now attac
On Thu, Mar 11, 2021 at 03:06:25PM +0300, Dmitry Osipenko wrote:
> 11.03.2021 01:17, Nicolin Chen пишет:
> > On Wed, Mar 10, 2021 at 11:22:57PM +0300, Dmitry Osipenko wrote:
> >> 10.03.2021 22:13, Dmitry Osipenko пишет:
> >>> I found that this patch introduced a serio
On Thu, Mar 11, 2021 at 05:04:06PM +0300, Dmitry Osipenko wrote:
> 10.03.2021 06:36, Nicolin Chen пишет:
> ...
> > +static int tegra_smmu_mappings_show(struct seq_file *s, void *data)
> > +{
> > + struct tegra_smmu_group_debug *group_debug = s->private;
> > +
ra30 and now GPU
> works properly once again.
>
> Fixes: 765a9d1d02b2 ("iommu/tegra-smmu: Fix mc errors on tegra124-nyan")
> Signed-off-by: Dmitry Osipenko
Tested-by: Nicolin Chen
___
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
| ATTR | PHYS | IOVA
| SIZE
[#1023, #1023] | 0x5 | 0x000111a8d000 | 0xf000
| 0x1000
}
}
Total PDE count: 1
Total PTE count: 1
Signed-off-by: Nicolin Chen
---
Changelog
v3:
* Fixed PHYS and IOVA print formats
* Changed variables to unsi
On Sun, Mar 14, 2021 at 06:08:00PM +0300, Dmitry Osipenko wrote:
> 14.03.2021 11:06, Nicolin Chen пишет:
> > + for (pd_index = 0; pd_index < SMMU_NUM_PDE; pd_index++) {
> > + struct page *pt_page;
> > + u32 *addr;
> > + int i;
>
&g
| ATTR | PHYS | IOVA
| SIZE
[#1023, #1023] | 0x5 | 0x000111a8d000 | 0xf000
| 0x1000
}
}
Total PDE count: 1
Total PTE count: 1
Signed-off-by: Nicolin Chen
---
Changelog
v4:
* Changed %d to %u for unsigned variables
* Fixed print fo
On Mon, Mar 15, 2021 at 09:53:09PM +0300, Dmitry Osipenko wrote:
> 15.03.2021 06:35, Nicolin Chen пишет:
> > This patch dumps all active mapping entries from pagetable
> > to a debugfs directory named "mappings".
> >
> > Ataching an example:
>
> At
| ATTR | PHYS | IOVA
| SIZE
[#1023, #1023] | 0x5 | 0x000111a8d000 | 0xf000
| 0x1000
}
}
Total PDE count: 1
Total PTE count: 1
Tested-by: Dmitry Osipenko
Reviewed-by: Dmitry Osipenko
Signed-off-by: Nicolin Chen
---
Changelog
v5:
* Fi
On Mon, Mar 29, 2021 at 02:32:56AM +0300, Dmitry Osipenko wrote:
> The previous commit fixes problem where display client was attaching too
> early to IOMMU during kernel boot in a multi-platform kernel configuration
> which enables CONFIG_ARM_DMA_USE_IOMMU=y. The workaround that helped to
> defer
On Tue, Mar 16, 2021 at 12:16:43PM +0100, Thierry Reding wrote:
> > +struct tegra_smmu_group_debug {
> > + const struct tegra_smmu_swgroup *group;
> > + void *priv;
>
> This always stores the address space, so why not make this:
>
> struct tegra_smmu_as *as;
>
> ? While at it, perhaps
ich works good enough in practice because by that time h/w is already
> stopped.
>
> Signed-off-by: Dmitry Osipenko
For both patches:
Acked-by: Nicolin Chen
Tested-by: Nicolin Chen
The WAR looks good to me. Perhaps Thierry would give some input.
Another topic:
I think this may help wo
ped as->count check
* Added WARN_ON when as->count mismatches pd[pd_index]
v1: https://lkml.org/lkml/2020/9/26/70
Nicolin Chen (6):
iommu/tegra-smmu: Rename struct iommu_group *group to *grp
iommu/tegra-smmu: Rename struct tegra_smmu_group_soc *soc to
*group_soc
iommu/tegra-smmu:
There are both tegra_smmu_soc and tegra_smmu_group_soc using "soc"
for their pointer instances. This patch renames the one of struct
tegra_smmu_group_soc from "soc" to "group_soc" to distinguish it.
Signed-off-by: Nicolin Chen
---
drivers/iommu/tegra-smmu.c
nd" function.
Note that we already have "swgroup" being used for an unsigned
int type variable that is inside struct tegra_smmu_swgroup, so
it's not able to use "swgroup" but only something like "swgrp".
Signed-off-by: Nicolin Chen
---
drivers/iommu/tegra-sm
t;grp" as a cleanup.
Signed-off-by: Nicolin Chen
---
drivers/iommu/tegra-smmu.c | 16
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/iommu/tegra-smmu.c b/drivers/iommu/tegra-smmu.c
index 0a281833f611..6ebae635d3aa 100644
--- a/drivers/iommu/tegra-smmu.c
+
tions together.
Signed-off-by: Nicolin Chen
---
drivers/iommu/tegra-smmu.c | 94 +++---
1 file changed, 78 insertions(+), 16 deletions(-)
diff --git a/drivers/iommu/tegra-smmu.c b/drivers/iommu/tegra-smmu.c
index 8fd4985ac91e..68c34a4a0ecc 100644
--- a/drivers/iommu/
This patch changes in struct tegra_smmu_group to use swgrp
pointer instead of swgroup, as a preparational change for
the "mappings" debugfs feature.
Signed-off-by: Nicolin Chen
---
drivers/iommu/tegra-smmu.c | 12
1 file changed, 8 insertions(+), 4 deletions(-)
di
| ATTR | PHYS | IOVA
| SIZE
[#1022, #1023] | 0x5 | 0x00010bbf1000 | 0xe000
| 0x2000
}
}
Total PDE count: 1
Total PTE count: 2
Signed-off-by: Nicolin Chen
---
drivers/iommu/tegra-smmu.c | 145 ++
On Tue, Sep 14, 2021 at 04:29:15PM +0300, Dmitry Osipenko wrote:
> 14.09.2021 04:38, Nicolin Chen пишет:
> > +static unsigned long pd_pt_index_iova(unsigned int pd_index, unsigned int
> > pt_index)
> > +{
> > + return ((dma_addr_t)pd_index & (SMMU_
On Tue, Sep 14, 2021 at 10:20:30PM +0300, Dmitry Osipenko wrote:
> 14.09.2021 21:49, Nicolin Chen пишет:
> > On Tue, Sep 14, 2021 at 04:29:15PM +0300, Dmitry Osipenko wrote:
> >> 14.09.2021 04:38, Nicolin Chen пишет:
> >>> +static unsigned long pd_pt_index_iova(u
On Wed, Sep 15, 2021 at 03:09:48PM +0300, Dmitry Osipenko wrote:
> 15.09.2021 07:38, Nicolin Chen пишет:
> > On Tue, Sep 14, 2021 at 10:20:30PM +0300, Dmitry Osipenko wrote:
> >> 14.09.2021 21:49, Nicolin Chen пишет:
> >>> On Tue, Sep 14, 2021 at 04:29:15P
references with the
macros defined with SMMU_PTE_SHIFT.
Signed-off-by: Nicolin Chen
---
drivers/iommu/tegra-smmu.c | 14 ++
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/drivers/iommu/tegra-smmu.c b/drivers/iommu/tegra-smmu.c
index 046add7acb61..789d21c01b77 100644
--- a
The "num_tlb_lines" might not be a power-of-2 value, being 48 on
Tegra210 for example. So the current way of calculating tlb_mask
using the num_tlb_lines is not correct: tlb_mask=0x5f in case of
num_tlb_lines=48, which will trim a setting of 0x30 (48) to 0x10.
Signed-off-by: Ni
The "num_tlb_lines" might not be a power-of-2 value, being 48 on
Tegra210 for example. So the current way of calculating tlb_mask
using the num_tlb_lines is not correct: tlb_mask=0x5f in case of
num_tlb_lines=48, which will trim a setting of 0x30 (48) to 0x10.
Signed-off-by: Nicolin C
These two patches fix ACTIVE_TLB_LINES field setting in tegra-smmu
driver for Tegra210 platforms.
This resend in series groups two previous seperate changes that're
corelated, being pointed out by Thierry. Also adding his Acked-by.
Nicolin Chen (2):
iommu/tegra-smmu: Fix tlb_mask
m
According to Tegra210 TRM, the default value of TLB_ACTIVE_LINES
field of register MC_SMMU_TLB_CONFIG_0 is 0x30. So num_tlb_lines
should be 48 (0x30) rather than 32 (0x20).
Signed-off-by: Nicolin Chen
Acked-by: Thierry Reding
---
drivers/memory/tegra/tegra210.c | 2 +-
1 file changed, 1
IOVA
#1023 0x50x159f5d0000xf000
}
}
Total PDE count: 1
Total PTE count: 1
Signed-off-by: Nicolin Chen
---
drivers/iommu/tegra-smmu.c | 130 +++--
1 file changed, 125 insertions(+), 5 deletions(-)
diff --git a/drivers/iommu/t
llows us to get the mc->smmu pointer via dev_get_drvdata() by
calling driver_find_device_by_fwnode().
So this patch uses iommu_fwspec in .probe_device() and related code
for a client that does not exist in the DTB, especially a PCI one.
Signed-off-by: Nicolin Chen
---
drivers/iommu
->list
for other devices to match.
This patch simply unwraps the function to clean it up.
Signed-off-by: Nicolin Chen
---
drivers/iommu/tegra-smmu.c | 19 ---
1 file changed, 4 insertions(+), 15 deletions(-)
diff --git a/drivers/iommu/tegra-smmu.c b/drivers/iommu/tegra
This patch simply adds support for PCI devices.
Signed-off-by: Nicolin Chen
---
drivers/iommu/tegra-smmu.c | 17 -
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/drivers/iommu/tegra-smmu.c b/drivers/iommu/tegra-smmu.c
index 97a7185b4578..9dbc5d7183cc 100644
--- a
This is used to protect potential race condition at use_count.
since probes of client drivers, calling attach_dev(), may run
concurrently.
Signed-off-by: Nicolin Chen
---
drivers/iommu/tegra-smmu.c | 34 +-
1 file changed, 21 insertions(+), 13 deletions(-)
diff
ppings
Each of the four parts is sort of functional independent, so we may
apply them separately or incrementally depending on the reviews.
Nicolin Chen (5):
iommu/tegra-smmu: Unwrap tegra_smmu_group_get
iommu/tegra-smmu: Expend mutex protection range
iommu/tegra-smmu: Use iommu_fwspec in .
Hi Dmitry,
Thank you for the review and comments!
On Sat, Sep 26, 2020 at 05:48:17PM +0300, Dmitry Osipenko wrote:
> 26.09.2020 11:07, Nicolin Chen пишет:
> ...
> > + /* NULL smmu pointer means that SMMU driver is not probed yet */
> > + if (unlikely(!smmu))
> > +
Hi Dmitry,
Thank you for the review.
On Sat, Sep 26, 2020 at 05:48:54PM +0300, Dmitry Osipenko wrote:
> 26.09.2020 11:07, Nicolin Chen пишет:
> ...
> > +static int tegra_smmu_mappings_show(struct seq_file *s, void *data)
> > +{
> > + struct tegra_smmu_group_debug *
Hi Thierry,
Thanks for the review.
On Mon, Sep 28, 2020 at 09:13:56AM +0200, Thierry Reding wrote:
> > -static struct iommu_group *tegra_smmu_group_get(struct tegra_smmu *smmu,
> > - unsigned int swgroup)
> > +static struct iommu_group *tegra_smmu_device_
On Mon, Sep 28, 2020 at 09:52:12AM +0200, Thierry Reding wrote:
> On Sat, Sep 26, 2020 at 01:07:17AM -0700, Nicolin Chen wrote:
> > @@ -13,6 +13,7 @@
> > #include
> > #include
> > #include
> > +#include
>
> Why is this needed? I don't see any
On Sun, Sep 27, 2020 at 01:18:15AM +0300, Dmitry Osipenko wrote:
> 26.09.2020 11:07, Nicolin Chen пишет:
> ...
> > +#ifdef CONFIG_PCI
> > + if (!iommu_present(&pci_bus_type)) {
>
> Is this iommu_present() check really needed?
>
> > + pci_request_
On Mon, Sep 28, 2020 at 09:55:45AM +0200, Thierry Reding wrote:
> On Sat, Sep 26, 2020 at 01:07:18AM -0700, Nicolin Chen wrote:
> > +#ifdef CONFIG_PCI
> > + if (!iommu_present(&pci_bus_type)) {
> > + pci_request_acs();
> > + err = bus_set_iommu
->list
for other devices to match.
This patch simply unwraps the function to clean it up.
Signed-off-by: Nicolin Chen
---
Changelog
v1->v2:
* Changed type of swgroup to "unsigned int", following Thierry's
commnets.
drivers/iommu/tegra-smmu.c | 19 --
This is used to protect potential race condition at use_count.
since probes of client drivers, calling attach_dev(), may run
concurrently.
Signed-off-by: Nicolin Chen
---
Changelog
v1->v2:
* N/A
drivers/iommu/tegra-smmu.c | 34 +-
1 file changed, 21 inserti
ize.
Nicolin Chen (2):
iommu/tegra-smmu: Unwrap tegra_smmu_group_get
iommu/tegra-smmu: Expend mutex protection range
drivers/iommu/tegra-smmu.c | 53 ++
1 file changed, 25 insertions(+), 28 deletions(-)
--
2.1
On Tue, Sep 29, 2020 at 03:17:58AM +0300, Dmitry Osipenko wrote:
> ...
> > static bool tegra_smmu_capable(enum iommu_cap cap)
> > @@ -420,17 +413,21 @@ static int tegra_smmu_as_prepare(struct tegra_smmu
> > *smmu,
> > struct tegra_smmu_as *as)
> > {
> > u32 value
This is used to protect potential race condition at use_count.
since probes of client drivers, calling attach_dev(), may run
concurrently.
Signed-off-by: Nicolin Chen
---
Changelog
v2->v3:
* Renamed label "err_unlock" to "unlock"
v1->v2:
* N/A
drive
pplied first,
since the other three changes need some extra time to finalize.
Nicolin Chen (2):
iommu/tegra-smmu: Unwrap tegra_smmu_group_get
iommu/tegra-smmu: Expend mutex protection range
drivers/iommu/tegra-smmu.c | 53 ++
1 file changed, 25 i
->list
for other devices to match.
This patch simply unwraps the function to clean it up.
Signed-off-by: Nicolin Chen
---
Changelog
v2->v3:
* N/A
v1->v2:
* Changed type of swgroup to "unsigned int", following Thierry's
commnets.
drivers/iommu/tegra-smmu.c | 19
On Tue, Sep 29, 2020 at 07:06:37AM +0300, Dmitry Osipenko wrote:
> ...
> >> As I mentioned in another reply, I think tegra_smmu_find() should be all
> >> you need in this case.
> >
> > This function is used by .probe_device() where its dev pointer is
> > an SMMU client. IIUC, tegra_smmu_find() nee
On Tue, Sep 29, 2020 at 07:03:36AM +0100, Christoph Hellwig wrote:
> On Mon, Sep 28, 2020 at 09:52:47PM -0700, Nicolin Chen wrote:
> > This is used to protect potential race condition at use_count.
> > since probes of client drivers, calling attach_dev(), may run
> > concurr
arated first two changs of V1 so they may get applied first,
since the other three changes need some extra time to finalize.
Nicolin Chen (2):
iommu/tegra-smmu: Unwrap tegra_smmu_group_get
iommu/tegra-smmu: Expand mutex protection range
drivers/iommu/tegra-smmu.c | 53 +
->list
for other devices to match.
This patch simply unwraps the function to clean it up.
Signed-off-by: Nicolin Chen
---
Changelog
v2->v4:
* N/A
v1->v2:
* Changed type of swgroup to "unsigned int", following Thierry's
commnets.
drivers/iommu/tegra-smmu.c | 19
This is used to protect potential race condition at use_count.
since probes of client drivers, calling attach_dev(), may run
concurrently.
Signed-off-by: Nicolin Chen
---
Changelog
v3->v4:
* Fixed typo "Expend" => "Expand"
v2->v3:
* Renamed label "err_
This patch simply adds support for PCI devices. Also reverses
bus_set_iommu in tegra_smmu_remove().
Signed-off-by: Nicolin Chen
---
Changelog
v1->v2
* Added error-out labels in tegra_smmu_probe()
* Dropped pci_request_acs() since IOMMU core would call it.
drivers/iommu/tegra-smmu.c |
This can be used by both tegra-smmu and tegra20-devfreq drivers.
Suggested-by: Dmitry Osipenko
Signed-off-by: Nicolin Chen
---
Changelog
v1->v2
* N/A
drivers/memory/tegra/mc.c | 23 +++
include/soc/tegra/mc.h| 1 +
2 files changed, 24 insertions(+)
diff --gi
emoving DT polling code, tegra_smmu_find/tegra_smmu_configure()
3) Calling tegra_get_memory_controller() in .probe_device() instead
4) Also dropping the hack in .probe() that's no longer needed.
Signed-off-by: Nicolin Chen
---
Changelog
v1->v2
* Replaced in .probe_device() tegra_smmu
ain code
Prvious versions
v1: https://lkml.org/lkml/2020/9/26/66
Nicolin Chen (3):
memory: tegra: Add helper function tegra_get_memory_controller
iommu/tegra-smmu: Rework .probe_device and .attach_dev
iommu/tegra-smmu: Add PCI support
drivers/iommu/tegra-smmu
On Tue, Sep 29, 2020 at 08:42:52PM +0300, Dmitry Osipenko wrote:
> 29.09.2020 09:13, Nicolin Chen пишет:
> > This is used to protect potential race condition at use_count.
> > since probes of client drivers, calling attach_dev(), may run
> > concurrently.
> >
>
On Wed, Sep 30, 2020 at 08:10:00AM +0300, Dmitry Osipenko wrote:
> 30.09.2020 03:30, Nicolin Chen пишет:
> ...
> > +#ifdef CONFIG_PCI
> > + if (!iommu_present(&pci_bus_type)) {
>
> Could you please explain why this check is needed?
That's referencing what
Hi Dmitry,
On Wed, Sep 30, 2020 at 08:10:07AM +0300, Dmitry Osipenko wrote:
> 30.09.2020 03:30, Nicolin Chen пишет:
> > - group->group = iommu_group_alloc();
> > + group->group = pci ? pci_device_group(dev) : iommu_group_alloc();
>
> This will be nicer to write
On Wed, Sep 30, 2020 at 08:10:35AM +0300, Dmitry Osipenko wrote:
> 30.09.2020 03:30, Nicolin Chen пишет:
> > void tegra_smmu_remove(struct tegra_smmu *smmu)
> > {
> > + bus_set_iommu(&platform_bus_type, NULL);
>
> Why only platform_bus? Is this really needed a
On Wed, Sep 30, 2020 at 08:24:02AM +0300, Dmitry Osipenko wrote:
> 30.09.2020 03:30, Nicolin Chen пишет:
> > + /*
> > +* IOMMU core allows -ENODEV return to carry on. So bypass any call
> > +* from bus_set_iommu() during tegra_smmu_probe(), as a device will
> &g
On Wed, Sep 30, 2020 at 08:39:54AM +0300, Dmitry Osipenko wrote:
> 30.09.2020 03:30, Nicolin Chen пишет:
> > static int tegra_smmu_attach_dev(struct iommu_domain *domain,
> > struct device *dev)
> > {
> > + struct iommu_fwspec *fwspec
On Wed, Sep 30, 2020 at 08:12:10AM +0300, Dmitry Osipenko wrote:
> 30.09.2020 03:30, Nicolin Chen пишет:
> ...
> > int tegra_mc_write_emem_configuration(struct tegra_mc *mc, unsigned long
> > rate);
> > unsigned int tegra_mc_get_emem_device_count(struct tegra_mc *m
On Wed, Sep 30, 2020 at 08:11:52AM +0300, Dmitry Osipenko wrote:
> 30.09.2020 03:30, Nicolin Chen пишет:
> > + /* An invalid mc pointer means mc and smmu drivers are not ready */
> > + if (IS_ERR_OR_NULL(mc))
>
> tegra_get_memory_controller() doesn't return NULL.
We
On Wed, Sep 30, 2020 at 08:20:50AM +0300, Dmitry Osipenko wrote:
> 30.09.2020 08:10, Dmitry Osipenko пишет:
> > 30.09.2020 03:30, Nicolin Chen пишет:
> >> static void tegra_smmu_release_device(struct device *dev)
> >
> > The tegra_get_memory_controller() uses o
On Wed, Sep 30, 2020 at 09:10:38AM +0300, Dmitry Osipenko wrote:
> 30.09.2020 08:49, Nicolin Chen пишет:
> > On Wed, Sep 30, 2020 at 08:11:52AM +0300, Dmitry Osipenko wrote:
> >> 30.09.2020 03:30, Nicolin Chen пишет:
> >>> + /* An invalid mc pointer means mc
On Wed, Sep 30, 2020 at 08:59:45AM +0300, Dmitry Osipenko wrote:
> 30.09.2020 08:41, Nicolin Chen пишет:
> > On Wed, Sep 30, 2020 at 08:39:54AM +0300, Dmitry Osipenko wrote:
> >> 30.09.2020 03:30, Nicolin Chen пишет:
> >>> static int tegra_smmu_attach_d
On Wed, Sep 30, 2020 at 08:20:50AM +0300, Dmitry Osipenko wrote:
> 30.09.2020 08:10, Dmitry Osipenko пишет:
> > 30.09.2020 03:30, Nicolin Chen пишет:
> >> static void tegra_smmu_release_device(struct device *dev)
> >
> > The tegra_get_memory_controller() uses o
On Wed, Sep 30, 2020 at 09:32:20AM +0300, Dmitry Osipenko wrote:
> 30.09.2020 08:44, Nicolin Chen пишет:
> > On Wed, Sep 30, 2020 at 08:12:10AM +0300, Dmitry Osipenko wrote:
> >> 30.09.2020 03:30, Nicolin Chen пишет:
> >> ...
> >>> int tegra_mc_write
On Wed, Sep 30, 2020 at 09:01:09AM +0300, Dmitry Osipenko wrote:
> 30.09.2020 08:34, Nicolin Chen пишет:
> > On Wed, Sep 30, 2020 at 08:10:35AM +0300, Dmitry Osipenko wrote:
> >> 30.09.2020 03:30, Nicolin Chen пишет:
> >>> void tegra_smmu_
On Wed, Sep 30, 2020 at 08:58:50AM +0300, Dmitry Osipenko wrote:
> 30.09.2020 08:29, Nicolin Chen пишет:
> > Hi Dmitry,
> >
> > On Wed, Sep 30, 2020 at 08:10:07AM +0300, Dmitry Osipenko wrote:
> >> 30.09.2020 03:30, Nicolin Chen пишет:
> >>> - group-&
Hi Krzysztof,
On Wed, Sep 30, 2020 at 09:21:39AM +0200, Krzysztof Kozlowski wrote:
> On Wed, 30 Sep 2020 at 02:35, Nicolin Chen wrote:
> >
> > This can be used by both tegra-smmu and tegra20-devfreq drivers.
> >
> > Suggested-by: Dmitry Osipenko
>
This patch simply adds support for PCI devices.
Signed-off-by: Nicolin Chen
---
Changelog
v2->v3
* Replaced ternary conditional operator with if-else in .device_group()
* Dropped change in tegra_smmu_remove()
v1->v2
* Added error-out labels in tegra_smmu_probe()
* Dropped pci_reque
Updated changes by following Dmitry's comments
v1->v2
* Added PATCH-1 suggested by Dmitry
* Reworked PATCH-2 to unify certain code
Dmitry Osipenko (1):
memory: tegra: Add devm_tegra_get_memory_controller()
Nicolin Chen (2):
iommu/tegra-smmu: Rework .probe_device and .attach_dev
From: Dmitry Osipenko
Multiple Tegra drivers need to retrieve Memory Controller and hence there
is quite some duplication of the retrieval code among the drivers. Let's
add a new common helper for the retrieval of the MC.
Signed-off-by: Dmitry Osipenko
Signed-off-by: Nicolin
ng DT polling code, tegra_smmu_find/tegra_smmu_configure()
3) Calling devm_tegra_get_memory_controller() in .probe_device()
4) Also dropping the hack in .probe() that's no longer needed.
Signed-off-by: Nicolin Chen
---
Changelog
v2->v3
* Used devm_tegra_get_memory_controller() to
On Wed, Sep 30, 2020 at 11:21:14AM +0200, Krzysztof Kozlowski wrote:
> On Wed, 30 Sep 2020 at 10:48, Nicolin Chen wrote:
> >
> > Previously the driver relies on bus_set_iommu() in .probe() to call
> > in .probe_device() function so each client can poll iommus property
&g
On Wed, Sep 30, 2020 at 11:07:32AM +0200, Krzysztof Kozlowski wrote:
> "On Wed, 30 Sep 2020 at 10:48, Nicolin Chen wrote:
> >
> > From: Dmitry Osipenko
> >
> > Multiple Tegra drivers need to retrieve Memory Controller and hence there
> > is quite some dupli
On Wed, Sep 30, 2020 at 05:53:20PM +0300, Dmitry Osipenko wrote:
> ...
> > +#ifdef CONFIG_PCI
> > + if (!iommu_present(&pci_bus_type)) {
>
>
> In the previous reply you said that you're borrowing this check from the
> arm-smmu driver, but arm-smmu also has a similar check for
> platform_bus_typ
On Wed, Sep 30, 2020 at 05:31:31PM +0200, Thierry Reding wrote:
> On Wed, Sep 30, 2020 at 01:42:57AM -0700, Nicolin Chen wrote:
> > Previously the driver relies on bus_set_iommu() in .probe() to call
> > in .probe_device() function so each client can poll iommus property
> >
On Wed, Sep 30, 2020 at 06:09:43PM +0300, Dmitry Osipenko wrote:
> ...
> > static int tegra_smmu_attach_dev(struct iommu_domain *domain,
> > struct device *dev)
> > {
> > + struct iommu_fwspec *fwspec = dev_iommu_fwspec_get(dev);
> > struct tegra_smmu *smmu = de
On Thu, Oct 01, 2020 at 12:24:25AM +0300, Dmitry Osipenko wrote:
> ...
> >> It looks to me like the only reason why you need this new global API is
> >> because PCI devices may not have a device tree node with a phandle to
> >> the IOMMU. However, SMMU support for PCI will only be enabled if the
>
On Thu, Oct 01, 2020 at 12:56:46AM +0300, Dmitry Osipenko wrote:
> 01.10.2020 00:32, Nicolin Chen пишет:
> > On Thu, Oct 01, 2020 at 12:24:25AM +0300, Dmitry Osipenko wrote:
> >> ...
> >>>> It looks to me like the only reason why you need this new global API is
&
On Thu, Oct 01, 2020 at 05:06:19AM +0300, Dmitry Osipenko wrote:
> 01.10.2020 04:26, Nicolin Chen пишет:
> > On Thu, Oct 01, 2020 at 12:56:46AM +0300, Dmitry Osipenko wrote:
> >> 01.10.2020 00:32, Nicolin Chen пишет:
> >>> On Thu, Oct 01, 2020 at 12:24:25A
101 - 200 of 374 matches
Mail list logo