firmware: tegra: Do not warn on missing memory-region property
PATCH 1/1 firmware: tegra: Do not warn on missing memory-region property
From: Thierry Reding <[email protected]>
The IPC shared memory can reside in system memory or SRAM. In the latter case the memory-region property is expected not to be present, so do not warn about it.
--- drivers/firmware/tegra/bpmp-tegra186.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/firmware/tegra/bpmp-tegra186.c +4 -1
@@ -198,7 +198,10 @@ static int tegra186_bpmp_dram_init(struct tegra_bpmp *bpmp) err =of_reserved_mem_region_to_resource (bpmp->dev->of_node,0 , &res);if (err <0 ) { -dev_warn (bpmp->dev,"failed to parse memory region: %d\n" , err); +if (err != -ENODEV ) +dev_warn (bpmp->dev, +"failed to parse memory region: %d\n" , err); +return err; }
Signature · 1 line
2.50.0
Quoted 6 lines · Thierry Reding
From: Thierry Reding <[email protected]>
The IPC shared memory can reside in system memory or SRAM. In the latter case the memory-region property is expected not to be present, so do not warn about it.
Then shouldn't the only warning be you couldn't find either one? The exact reason shouldn't be that important.
Quoted 27 lines
Reported-by Jonathan Hunter <[email protected]>Fixes dbe4efea38d0 ("firmware: tegra: bpmp: Use of_reserved_mem_region_to_resource() for "memory-region"")Signed-off-by Thierry Reding <[email protected]>--- drivers/firmware/tegra/bpmp-tegra186.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)drivers/firmware/tegra/bpmp-tegra186.c +4
-2@@ -198,7 +198,10 @@ static int tegra186_bpmp_dram_init(struct tegra_bpmp *bpmp) err =of_reserved_mem_region_to_resource (bpmp->dev->of_node,0 , &res);if (err <0 ) { -dev_warn (bpmp->dev,"failed to parse memory region: %d\n" , err); +if (err != -ENODEV ) +dev_warn (bpmp->dev, +"failed to parse memory region: %d\n" , err); +return err; } --2.50.0
Quoted 10 lines · Rob Herring
Quoted 6 lines · Thierry Reding
From: Thierry Reding <[email protected]>
The IPC shared memory can reside in system memory or SRAM. In the latter case the memory-region property is expected not to be present, so do not warn about it.
Then shouldn't the only warning be you couldn't find either one? The exact reason shouldn't be that important.
This code is checking if it exists in system memory. If this fails, then we try SRAM, but that is checked in a different function. So at this point we only know it is not present in system memory. So here we only want to warn if the 'memory-region' property exists but parsing it fails.
Quoted 13 lines
Quoted 13 lines
Reported-by Jonathan Hunter <[email protected]>Fixes dbe4efea38d0 ("firmware: tegra: bpmp: Use of_reserved_mem_region_to_resource() for "memory-region"")Signed-off-by Thierry Reding <[email protected]>--- drivers/firmware/tegra/bpmp-tegra186.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)drivers/firmware/tegra/bpmp-tegra186.c +0
-0@@ -198,7 +198,10 @@ static int tegra186_bpmp_dram_init(struct tegra_bpmp *bpmp)
Quoted 9 lines
drivers/firmware/tegra/bpmp-tegra186.c static int tegra186_bpmp_dram_init(struct tegra_bpmp *bpmp) · line 206
Quoted 9 lines
drivers/firmware/tegra/bpmp-tegra186.c +4
-1err =of_reserved_mem_region_to_resource (bpmp->dev->of_node,0 , &res);if (err <0 ) { -dev_warn (bpmp->dev,"failed to parse memory region: %d\n" , err); +if (err != -ENODEV ) +dev_warn (bpmp->dev, +"failed to parse memory region: %d\n" , err); +return err; }
Thanks
Jon
Signature · 1 line
nvpublic