Hi all,
This is a follow up patch set for the Exynos5 Dynamic Memory Controller
driver v13 [1]. The patches are for Krzysztof's branch [2]
for-v5.4-5.5/memory-samsung-dmc
and/or linux-next where Dan Carpenter reported the issue (patch 1/2).
There are a few fixes captured during static analysis and a new
binding for 'samsung,K3QF2F20DB' LPDDR3 memory.
Regards,
Lukasz Luba
[1] https://lkml.org/lkml/2019/8/21/283
[2] https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux.git/log/?h=for-v5.4-5.5/memory-samsung-dmc
Lukasz Luba (2):
memory: samsung: exynos5422-dmc: Fix kfree() of devm-allocated memory
and missing static
dt-bindings: ddr: Add bindings for Samsung LPDDR3 memories
Documentation/devicetree/bindings/ddr/lpddr3.txt | 10 +++++++---
drivers/memory/samsung/exynos5422-dmc.c | 6 ++----
2 files changed, 9 insertions(+), 7 deletions(-)
--
2.17.1
Add compatible for Samsung k3qf2f20db LPDDR3 memory bindings.
Suggested to based on at25.txt compatible section.
Introduce minor fixes in the old documentation.
Suggested-by: Krzysztof Kozlowski <[email protected]>
Signed-off-by: Lukasz Luba <[email protected]>
---
Documentation/devicetree/bindings/ddr/lpddr3.txt | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/Documentation/devicetree/bindings/ddr/lpddr3.txt b/Documentation/devicetree/bindings/ddr/lpddr3.txt
index 3b2485b84b3f..a0eda35a86ee 100644
--- a/Documentation/devicetree/bindings/ddr/lpddr3.txt
+++ b/Documentation/devicetree/bindings/ddr/lpddr3.txt
@@ -1,7 +1,10 @@
* LPDDR3 SDRAM memories compliant to JEDEC JESD209-3C
Required properties:
-- compatible : Should be - "jedec,lpddr3"
+- compatible : Should be "<vendor>,<type>", and generic value "jedec,lpddr3".
+ Example "<vendor>,<type>" values:
+ "samsung,K3QF2F20DB"
+
- density : <u32> representing density in Mb (Mega bits)
- io-width : <u32> representing bus width. Possible values are 8, 16, 32, 64
- #address-cells: Must be set to 1
@@ -43,7 +46,7 @@ Child nodes:
Example:
samsung_K3QF2F20DB: lpddr3 {
- compatible = "Samsung,K3QF2F20DB", "jedec,lpddr3";
+ compatible = "samsung,K3QF2F20DB", "jedec,lpddr3";
density = <16384>;
io-width = <32>;
#address-cells = <1>;
@@ -73,7 +76,8 @@ samsung_K3QF2F20DB: lpddr3 {
timings_samsung_K3QF2F20DB_800mhz: lpddr3-timings@800000000 {
compatible = "jedec,lpddr3-timings";
- reg = <800000000>; /* workaround: it shows max-freq */
+ /* workaround: 'reg' shows max-freq */
+ reg = <800000000>;
min-freq = <100000000>;
tRFC = <65000>;
tRRD = <6000>;
--
2.17.1
Fix issues captured by static checkers: used kfree() and missing 'static'
in the private function.
Fixes Smatch warning:
drivers/memory/samsung/exynos5422-dmc.c:272
exynos5_init_freq_table() warn: passing devm_ allocated variable to kfree. 'dmc->opp'
Fixes Sparse warning:
drivers/memory/samsung/exynos5422-dmc.c:736:1:
warning: symbol 'exynos5_dmc_align_init_freq' was not declared.
Reported-by: kbuild test robot <[email protected]>
Reported-by: Dan Carpenter <[email protected]>
Reported-by: Krzysztof Kozlowski <[email protected]>
Signed-off-by: Lukasz Luba <[email protected]>
---
drivers/memory/samsung/exynos5422-dmc.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/memory/samsung/exynos5422-dmc.c b/drivers/memory/samsung/exynos5422-dmc.c
index 8c2ec29a7d57..1b54fc8c912e 100644
--- a/drivers/memory/samsung/exynos5422-dmc.c
+++ b/drivers/memory/samsung/exynos5422-dmc.c
@@ -258,7 +258,7 @@ static int exynos5_init_freq_table(struct exynos5_dmc *dmc,
opp = dev_pm_opp_find_freq_floor(dmc->dev, &freq);
if (IS_ERR(opp))
- goto err_free_tables;
+ goto err_opp;
dmc->opp[idx - i].freq_hz = freq;
dmc->opp[idx - i].volt_uv = dev_pm_opp_get_voltage(opp);
@@ -268,8 +268,6 @@ static int exynos5_init_freq_table(struct exynos5_dmc *dmc,
return 0;
-err_free_tables:
- kfree(dmc->opp);
err_opp:
dev_pm_opp_of_remove_table(dmc->dev);
@@ -732,7 +730,7 @@ static struct devfreq_dev_profile exynos5_dmc_df_profile = {
* statistics engine which supports only registered values. Thus, some alignment
* must be made.
*/
-unsigned long
+static unsigned long
exynos5_dmc_align_init_freq(struct exynos5_dmc *dmc,
unsigned long bootloader_init_freq)
{
--
2.17.1
Thanks! Looks good.
regards,
dan carpenter
On Thu, Sep 19, 2019 at 11:26:41AM +0200, Lukasz Luba wrote:
> Add compatible for Samsung k3qf2f20db LPDDR3 memory bindings.
> Suggested to based on at25.txt compatible section.
> Introduce minor fixes in the old documentation.
>
> Suggested-by: Krzysztof Kozlowski <[email protected]>
> Signed-off-by: Lukasz Luba <[email protected]>
> ---
> Documentation/devicetree/bindings/ddr/lpddr3.txt | 10 +++++++---
> 1 file changed, 7 insertions(+), 3 deletions(-)
Thanks, applied.
Best regards,
Krzysztof
On Thu, Sep 19, 2019 at 11:26:40AM +0200, Lukasz Luba wrote:
> Fix issues captured by static checkers: used kfree() and missing 'static'
> in the private function.
>
> Fixes Smatch warning:
> drivers/memory/samsung/exynos5422-dmc.c:272
> exynos5_init_freq_table() warn: passing devm_ allocated variable to kfree. 'dmc->opp'
>
> Fixes Sparse warning:
> drivers/memory/samsung/exynos5422-dmc.c:736:1:
> warning: symbol 'exynos5_dmc_align_init_freq' was not declared.
>
> Reported-by: kbuild test robot <[email protected]>
> Reported-by: Dan Carpenter <[email protected]>
> Reported-by: Krzysztof Kozlowski <[email protected]>
> Signed-off-by: Lukasz Luba <[email protected]>
> ---
> drivers/memory/samsung/exynos5422-dmc.c | 6 ++----
Thanks, applied.
Best regards,
Krzysztof