diff mbox

[RFC,2/3] memory: tegra: add TLB cache line size

Message ID 1443504379-31841-3-git-send-email-tfiga@chromium.org
State Deferred
Headers show

Commit Message

Tomasz Figa Sept. 29, 2015, 5:25 a.m. UTC
From: Vince Hsu <vince.h@nvidia.com>

This patch adds SMMU line size to Tegra SoC data struct to enable SMMU
driver to use this knowledge in code added by further patch.

Also add the missing TLB line number for Tegra124.

Signed-off-by: Vince Hsu <vince.h@nvidia.com>
[tfiga@chromium.org: Rebased, revised commit message.]
Signed-off-by: Tomasz Figa <tfiga@chromium.org>
---
 drivers/memory/tegra/tegra114.c | 1 +
 drivers/memory/tegra/tegra124.c | 3 +++
 drivers/memory/tegra/tegra210.c | 1 +
 drivers/memory/tegra/tegra30.c  | 1 +
 include/soc/tegra/mc.h          | 1 +
 5 files changed, 7 insertions(+)

Comments

Thierry Reding Sept. 29, 2015, 9:43 a.m. UTC | #1
On Tue, Sep 29, 2015 at 02:25:25PM +0900, Tomasz Figa wrote:
> From: Vince Hsu <vince.h@nvidia.com>
> 
> This patch adds SMMU line size to Tegra SoC data struct to enable SMMU
> driver to use this knowledge in code added by further patch.

I think the line size should either be added in the same patch that adds
the feature which uses it, or the commit message should describe what
purpose it will be used for. As it is this commit message leaves too
many questions unanswered.

> Also add the missing TLB line number for Tegra124.
> 
> Signed-off-by: Vince Hsu <vince.h@nvidia.com>
> [tfiga@chromium.org: Rebased, revised commit message.]
> Signed-off-by: Tomasz Figa <tfiga@chromium.org>

> diff --git a/drivers/memory/tegra/tegra124.c b/drivers/memory/tegra/tegra124.c
> index 21e7255..ff12487 100644
> --- a/drivers/memory/tegra/tegra124.c
> +++ b/drivers/memory/tegra/tegra124.c
> @@ -1007,6 +1007,8 @@ static const struct tegra_smmu_soc tegra124_smmu_soc = {
>  	.num_swgroups = ARRAY_SIZE(tegra124_swgroups),
>  	.supports_round_robin_arbitration = true,
>  	.supports_request_limit = true,
> +	.num_tlb_lines = 32,
> +	.tlb_line_size = 32,
>  	.num_asids = 128,
>  };

Oh my... try to fix one platform and break another. Fortunately it seems
like Tegra124 copes much better without TLB because I'm not seeing any
buffer underruns or similar on Tegra124 without this fix.

Anyway, this change is completely unrelated and fixes a regression (even
though it might not be noticeable in many use-cases), so can you please
split it out into a separate patch and add a

	Fixes: 11cec15bf3fb ("iommu/tegra-smmu: Parameterize number of TLB lines")

line to it? That patch went into v4.3-rc1 and it'd be nice to get this
fix in before the final v4.3. Feel free to add my Acked-by/Reviewed-by
as well.

Thierry
Tomasz Figa Sept. 29, 2015, 12:11 p.m. UTC | #2
On Tue, Sep 29, 2015 at 6:43 PM, Thierry Reding
<thierry.reding@gmail.com> wrote:
> On Tue, Sep 29, 2015 at 02:25:25PM +0900, Tomasz Figa wrote:
>> From: Vince Hsu <vince.h@nvidia.com>
>>
>> This patch adds SMMU line size to Tegra SoC data struct to enable SMMU
>> driver to use this knowledge in code added by further patch.
>
> I think the line size should either be added in the same patch that adds
> the feature which uses it, or the commit message should describe what
> purpose it will be used for. As it is this commit message leaves too
> many questions unanswered.

100% agreed. Anyway I just put this patch in this RFC quickly so that
the whole series can be applied and tested in somebody wants to do so.
I'll update commit message in next version.

>
>> Also add the missing TLB line number for Tegra124.
>>
>> Signed-off-by: Vince Hsu <vince.h@nvidia.com>
>> [tfiga@chromium.org: Rebased, revised commit message.]
>> Signed-off-by: Tomasz Figa <tfiga@chromium.org>
>
>> diff --git a/drivers/memory/tegra/tegra124.c b/drivers/memory/tegra/tegra124.c
>> index 21e7255..ff12487 100644
>> --- a/drivers/memory/tegra/tegra124.c
>> +++ b/drivers/memory/tegra/tegra124.c
>> @@ -1007,6 +1007,8 @@ static const struct tegra_smmu_soc tegra124_smmu_soc = {
>>       .num_swgroups = ARRAY_SIZE(tegra124_swgroups),
>>       .supports_round_robin_arbitration = true,
>>       .supports_request_limit = true,
>> +     .num_tlb_lines = 32,
>> +     .tlb_line_size = 32,
>>       .num_asids = 128,
>>  };
>
> Oh my... try to fix one platform and break another. Fortunately it seems
> like Tegra124 copes much better without TLB because I'm not seeing any
> buffer underruns or similar on Tegra124 without this fix.
>
> Anyway, this change is completely unrelated and fixes a regression (even
> though it might not be noticeable in many use-cases), so can you please
> split it out into a separate patch and add a
>
>         Fixes: 11cec15bf3fb ("iommu/tegra-smmu: Parameterize number of TLB lines")
>
> line to it? That patch went into v4.3-rc1 and it'd be nice to get this
> fix in before the final v4.3. Feel free to add my Acked-by/Reviewed-by
> as well.

Sounds good to me. We also have a patch adding locking around page
table get/put in map/unmap, which fixes a race between concurrent maps
and unmaps within the same page table. I'll send both soon.

Best regards,
Tomasz
--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/memory/tegra/tegra114.c b/drivers/memory/tegra/tegra114.c
index ba8fff3..173d2dd 100644
--- a/drivers/memory/tegra/tegra114.c
+++ b/drivers/memory/tegra/tegra114.c
@@ -920,6 +920,7 @@  static const struct tegra_smmu_soc tegra114_smmu_soc = {
 	.supports_round_robin_arbitration = false,
 	.supports_request_limit = false,
 	.num_tlb_lines = 32,
+	.tlb_line_size = 16,
 	.num_asids = 4,
 };
 
diff --git a/drivers/memory/tegra/tegra124.c b/drivers/memory/tegra/tegra124.c
index 21e7255..ff12487 100644
--- a/drivers/memory/tegra/tegra124.c
+++ b/drivers/memory/tegra/tegra124.c
@@ -1007,6 +1007,8 @@  static const struct tegra_smmu_soc tegra124_smmu_soc = {
 	.num_swgroups = ARRAY_SIZE(tegra124_swgroups),
 	.supports_round_robin_arbitration = true,
 	.supports_request_limit = true,
+	.num_tlb_lines = 32,
+	.tlb_line_size = 32,
 	.num_asids = 128,
 };
 
@@ -1031,6 +1033,7 @@  static const struct tegra_smmu_soc tegra132_smmu_soc = {
 	.supports_round_robin_arbitration = true,
 	.supports_request_limit = true,
 	.num_tlb_lines = 32,
+	.tlb_line_size = 32,
 	.num_asids = 128,
 };
 
diff --git a/drivers/memory/tegra/tegra210.c b/drivers/memory/tegra/tegra210.c
index 5e144ab..bf6a9c1 100644
--- a/drivers/memory/tegra/tegra210.c
+++ b/drivers/memory/tegra/tegra210.c
@@ -1067,6 +1067,7 @@  static const struct tegra_smmu_soc tegra210_smmu_soc = {
 	.supports_round_robin_arbitration = true,
 	.supports_request_limit = true,
 	.num_tlb_lines = 32,
+	.tlb_line_size = 32,
 	.num_asids = 128,
 };
 
diff --git a/drivers/memory/tegra/tegra30.c b/drivers/memory/tegra/tegra30.c
index b447378..08951db 100644
--- a/drivers/memory/tegra/tegra30.c
+++ b/drivers/memory/tegra/tegra30.c
@@ -942,6 +942,7 @@  static const struct tegra_smmu_soc tegra30_smmu_soc = {
 	.supports_round_robin_arbitration = false,
 	.supports_request_limit = false,
 	.num_tlb_lines = 16,
+	.tlb_line_size = 16,
 	.num_asids = 4,
 };
 
diff --git a/include/soc/tegra/mc.h b/include/soc/tegra/mc.h
index 44202ff..a6dbb35 100644
--- a/include/soc/tegra/mc.h
+++ b/include/soc/tegra/mc.h
@@ -62,6 +62,7 @@  struct tegra_smmu_soc {
 	bool supports_request_limit;
 
 	unsigned int num_tlb_lines;
+	unsigned int tlb_line_size;
 	unsigned int num_asids;
 };