Skip to contentSkip to conversation

*memory: Cleanup, improve and compile test memory drivers

PATCH Applied Krzysztof Kozlowski 2 participants 55 messages Jul 24, 2020 – Aug 17, 2020

Subsystems (10)
lore
Share & tools
lore

Krzysztof Kozlowski

author maintainer
#0 lore raw

v2 cover *memory: Cleanup, improve and compile test memory drivers

Dear All,

Changes since v1:
1. Few new patches,
2. Please see individual logs (per patch).

The drivers/memory directory contains generic code (of_memory.c) and a bunch of drivers. Changes to generic code were coming usually through different trees with the driver code.

Over last days, memory drivers grew in numbers but not necessarily in quality. They lacked compile testing and code cleanup. Also lacked maintainer.

I would be happy to take care about this part.

If there are no objections, I will collect the patches and push them through arm-soc maintainers.

Driver-specific changes in the patchset were only compile-tested. Tests are welcome. The generic code was tested on ARMv7 Exynos based boards with a exynos5422-dmc memory controller driver.

Best regards,
Krzysztof

Krzysztof Kozlowski (29):
memory: omap-gpmc: Remove unneeded asm/mach-types.h inclusion
memory: omap-gpmc: Remove unused file-scope phys_base and mem_size
memory: omap-gpmc: Include <linux/sizes.h> for SZ_16M
memory: ti-aemif: Rename SS to SSTROBE to avoid name conflicts
memory: jz4780-nemc: Do not enable by default on every compile test
memory: Enable compile testing for most of the drivers
memory: of: Remove unused headers
memory: of: Remove __func__ in device related messages
memory: of: Correct indentation
memory: of: Remove unneeded extern from function declarations
memory: emif-asm-offsets: Add GPLv2 SPDX license header
memory: emif: Put constant in comparison on the right side
memory: emif: Fix whitespace coding style violations
memory: emif: Silence platform_get_irq() error in driver
memory: ti-emif-pm: Fix cast to iomem pointer
memory: renesas-rpc-if: Simplify with PTR_ERR_OR_ZERO
memory: brcmstb_dpfe: Constify the contents of string
memory: brcmstb_dpfe: Remove unneeded braces
memory: mtk-smi: Add argument to function pointer definition
memory: omap-gpmc: Return meaningful error codes in
gpmc_cs_set_timings()
memory: omap-gpmc: Remove GPMC_SET_ONE_CD_MAX macro for safety
memory: omap-gpmc: Fix whitespace issue
memory: pl172: Add GPLv2 SPDX license header
memory: tegra: tegra210-emc: Fix indentation
MAINTAINERS: Add Krzysztof Kozlowski as maintainer of memory
controllers
memory: fsl_ifc: Fix whitespace issues
memory: da8xx-ddrctl: Remove unused 'node' variable
memory: Describe the MEMORY Kconfig entry
memory: samsung: exynos-srom: Describe the Kconfig entry

 MAINTAINERS                                   |   7 +
 drivers/memory/Kconfig                        |  47 ++++--
 drivers/memory/brcmstb_dpfe.c                 |   5 +-
 drivers/memory/da8xx-ddrctl.c                 |   2 -
 drivers/memory/emif-asm-offsets.c             |  10 +-
 drivers/memory/emif.c                         |  23 +--
 drivers/memory/fsl_ifc.c                      |  30 ++--
 drivers/memory/mtk-smi.c                      |   2 +-
 drivers/memory/of_memory.c                    |  28 ++--
 drivers/memory/of_memory.h                    |  21 +--
 drivers/memory/omap-gpmc.c                    | 155 +++++++++++-------
 drivers/memory/pl172.c                        |   5 +-
 drivers/memory/renesas-rpc-if.c               |   4 +-
 drivers/memory/samsung/Kconfig                |   7 +
 drivers/memory/tegra/tegra210-emc-cc-r21021.c |   2 +-
 drivers/memory/ti-aemif.c                     |  16 +-
 drivers/memory/ti-emif-pm.c                   |   2 +-
 17 files changed, 208 insertions(+), 158 deletions(-)
Signature · 1 line
2.17.1
author maintainer
#1 lore raw

PATCH v2 1/29 memory: omap-gpmc: Remove unneeded asm/mach-types.h inclusion

The driver does not use macros from asm/mach-types.h (neither MACH_TYPE nor machine_is_xxx()). Removal of this include allows compile testing on non-ARM architectures which lack this header.

---
 drivers/memory/omap-gpmc.c | 2 --
 1 file changed, 2 deletions(-)
drivers/memory/omap-gpmc.c +0 -2
index eff26c1b1394..fc08b5292932 100644
@@ -32,8 +32,6 @@
 
 #include <linux/platform_data/mtd-nand-omap2.h>
 
-#include <asm/mach-types.h>
-
 #define	DEVICE_NAME		"omap-gpmc"
 
 /* GPMC register offsets */
Signature · 1 line
2.17.1
author maintainer Applied
#2 lore raw

Re: [RFT v2 01/29] memory: omap-gpmc: Remove unneeded asm/mach-types.h inclusion

Quoted 7 lines · Krzysztof Kozlowski

The driver does not use macros from asm/mach-types.h (neither MACH_TYPE nor machine_is_xxx()). Removal of this include allows compile testing on non-ARM architectures which lack this header.

---
 drivers/memory/omap-gpmc.c | 2 --

Applied to drivers/memory tree.

Best regards,
Krzysztof

_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek

author maintainer
#3 lore raw

PATCH v2 2/29 memory: omap-gpmc: Remove unused file-scope phys_base and mem_size

In reply to Krzysztof Kozlowski

The file-scope variables phys_base and mem_size are assigned in gpmc_probe() but never read.

This fixes build error when compile testing on x86_64 architecture:

    drivers/memory/omap-gpmc.c:246:24: error: conflicting types for ‘phys_base’
     static resource_size_t phys_base, mem_size;
    In file included from arch/x86/include/asm/page.h:12:0,
                     from arch/x86/include/asm/thread_info.h:12,
                     from include/linux/thread_info.h:38,
                     from arch/x86/include/asm/preempt.h:7,
                     from include/linux/preempt.h:78,
                     from include/linux/spinlock.h:51,
                     from include/linux/irq.h:14,
                     from drivers/memory/omap-gpmc.c:12:
    arch/x86/include/asm/page_64.h:12:22: note: previous declaration of ‘phys_base’ was here
     extern unsigned long phys_base;
---
 drivers/memory/omap-gpmc.c | 4 ----
 1 file changed, 4 deletions(-)
drivers/memory/omap-gpmc.c +0 -4
index fc08b5292932..8ec2ef2aebdd 100644
@@ -242,7 +242,6 @@ static DEFINE_SPINLOCK(gpmc_mem_lock);
 /* Define chip-selects as reserved by default until probe completes */
 static unsigned int gpmc_cs_num = GPMC_CS_NUM;
 static unsigned int gpmc_nr_waitpins;
-static resource_size_t phys_base, mem_size;
 static unsigned gpmc_capability;
 static void __iomem *gpmc_base;
 
@@ -2357,9 +2356,6 @@ static int gpmc_probe(struct platform_device *pdev)
 	if (res == NULL)
 		return -ENOENT;
 
-	phys_base = res->start;
-	mem_size = resource_size(res);
-
 	gpmc_base = devm_ioremap_resource(&pdev->dev, res);
 	if (IS_ERR(gpmc_base))
 		return PTR_ERR(gpmc_base);
Signature · 1 line
2.17.1
author maintainer Applied
#4 lore raw

Re: [RFT v2 02/29] memory: omap-gpmc: Remove unused file-scope phys_base and mem_size

Quoted 18 lines · Krzysztof Kozlowski

The file-scope variables phys_base and mem_size are assigned in gpmc_probe() but never read.

This fixes build error when compile testing on x86_64 architecture:

    drivers/memory/omap-gpmc.c:246:24: error: conflicting types for ‘phys_base’
     static resource_size_t phys_base, mem_size;
    In file included from arch/x86/include/asm/page.h:12:0,
                     from arch/x86/include/asm/thread_info.h:12,
                     from include/linux/thread_info.h:38,
                     from arch/x86/include/asm/preempt.h:7,
                     from include/linux/preempt.h:78,
                     from include/linux/spinlock.h:51,
                     from include/linux/irq.h:14,
                     from drivers/memory/omap-gpmc.c:12:
    arch/x86/include/asm/page_64.h:12:22: note: previous declaration of ‘phys_base’ was here
     extern unsigned long phys_base;
Quoted 4 lines
---
 drivers/memory/omap-gpmc.c | 4 ----
 1 file changed, 4 deletions(-)

Applied to drivers/memory tree.

Best regards,
Krzysztof

_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek

author maintainer
#5 lore raw

PATCH v2 3/29 memory: omap-gpmc: Include <linux/sizes.h> for SZ_16M

In reply to Krzysztof Kozlowski

The driver uses SZ_16M which is defined in include/linux/sizes.h. On ARM it was pulled by other headers but its inclusion is necessary for compile testing on other architectures.

This fixes build error when compile testing on i386 architecture:

drivers/memory/omap-gpmc.c: In function ‘gpmc_cs_remap’:
drivers/memory/omap-gpmc.c:961:12: error: ‘SZ_16M’ undeclared (first use in this function)

---
 drivers/memory/omap-gpmc.c | 1 +
 1 file changed, 1 insertion(+)
drivers/memory/omap-gpmc.c +1 -0
index 8ec2ef2aebdd..c158b6cae9a9 100644
@@ -29,6 +29,7 @@
 #include <linux/of_platform.h>
 #include <linux/omap-gpmc.h>
 #include <linux/pm_runtime.h>
+#include <linux/sizes.h>
 
 #include <linux/platform_data/mtd-nand-omap2.h>
 
Signature · 1 line
2.17.1
author maintainer
#6 lore raw

Re: [PATCH v2 03/29] memory: omap-gpmc: Include <linux/sizes.h> for SZ_16M

Quoted 4 lines · Krzysztof Kozlowski

The driver uses SZ_16M which is defined in include/linux/sizes.h. On ARM it was pulled by other headers but its inclusion is necessary for compile testing on other architectures.

Quoted 8 lines

This fixes build error when compile testing on i386 architecture:

drivers/memory/omap-gpmc.c: In function ‘gpmc_cs_remap’:
drivers/memory/omap-gpmc.c:961:12: error: ‘SZ_16M’ undeclared (first use in this function)

---
 drivers/memory/omap-gpmc.c | 1 +

Applied (and part of pull request to arm-soc).

Best regards,
Krzysztof

author maintainer
#7 lore raw

PATCH v2 4/29 memory: ti-aemif: Rename SS to SSTROBE to avoid name conflicts

In reply to Krzysztof Kozlowski

SS conflicts with compile test build on i386:

    drivers/memory/ti-aemif.c:40:0: warning: "SS" redefined
    In file included from arch/x86/include/uapi/asm/ptrace.h:6:0,
                     from arch/x86/include/asm/ptrace.h:7,
                     from arch/x86/include/asm/math_emu.h:5,
                     from arch/x86/include/asm/processor.h:13,
                     from include/linux/mutex.h:19,
                     from include/linux/notifier.h:14,
                     from include/linux/clk.h:14,
                     from drivers/memory/ti-aemif.c:12:
    arch/x86/include/uapi/asm/ptrace-abi.h:23:0: note: this is the location of the previous definition
     #define SS   16

Use more descriptive name (SSTROBE) to avoid the conflict.

---
 drivers/memory/ti-aemif.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/memory/ti-aemif.c +8 -8
index db526dbf71ee..159a16f5e7d6 100644
@@ -27,7 +27,7 @@
 #define WSTROBE_SHIFT	20
 #define WSETUP_SHIFT	26
 #define EW_SHIFT	30
-#define SS_SHIFT	31
+#define SSTROBE_SHIFT	31
 
 #define TA(x)		((x) << TA_SHIFT)
 #define RHOLD(x)	((x) << RHOLD_SHIFT)
@@ -37,7 +37,7 @@
 #define WSTROBE(x)	((x) << WSTROBE_SHIFT)
 #define WSETUP(x)	((x) << WSETUP_SHIFT)
 #define EW(x)		((x) << EW_SHIFT)
-#define SS(x)		((x) << SS_SHIFT)
+#define SSTROBE(x)	((x) << SSTROBE_SHIFT)
 
 #define ASIZE_MAX	0x1
 #define TA_MAX		0x3
@@ -48,7 +48,7 @@
 #define WSTROBE_MAX	0x3f
 #define WSETUP_MAX	0xf
 #define EW_MAX		0x1
-#define SS_MAX		0x1
+#define SSTROBE_MAX	0x1
 #define NUM_CS		4
 
 #define TA_VAL(x)	(((x) & TA(TA_MAX)) >> TA_SHIFT)
@@ -59,7 +59,7 @@
 #define WSTROBE_VAL(x)	(((x) & WSTROBE(WSTROBE_MAX)) >> WSTROBE_SHIFT)
 #define WSETUP_VAL(x)	(((x) & WSETUP(WSETUP_MAX)) >> WSETUP_SHIFT)
 #define EW_VAL(x)	(((x) & EW(EW_MAX)) >> EW_SHIFT)
-#define SS_VAL(x)	(((x) & SS(SS_MAX)) >> SS_SHIFT)
+#define SSTROBE_VAL(x)	(((x) & SSTROBE(SSTROBE_MAX)) >> SSTROBE_SHIFT)
 
 #define NRCSR_OFFSET	0x00
 #define AWCCR_OFFSET	0x04
@@ -67,7 +67,7 @@
 
 #define ACR_ASIZE_MASK	0x3
 #define ACR_EW_MASK	BIT(30)
-#define ACR_SS_MASK	BIT(31)
+#define ACR_SSTROBE_MASK	BIT(31)
 #define ASIZE_16BIT	1
 
 #define CONFIG_MASK	(TA(TA_MAX) | \
@@ -77,7 +77,7 @@
 				WHOLD(WHOLD_MAX) | \
 				WSTROBE(WSTROBE_MAX) | \
 				WSETUP(WSETUP_MAX) | \
-				EW(EW_MAX) | SS(SS_MAX) | \
+				EW(EW_MAX) | SSTROBE(SSTROBE_MAX) | \
 				ASIZE_MAX)
 
 /**
@@ -204,7 +204,7 @@ static int aemif_config_abus(struct platform_device *pdev, int csnum)
 	if (data->enable_ew)
 		set |= ACR_EW_MASK;
 	if (data->enable_ss)
-		set |= ACR_SS_MASK;
+		set |= ACR_SSTROBE_MASK;
 
 	val = readl(aemif->base + offset);
 	val &= ~CONFIG_MASK;
@@ -246,7 +246,7 @@ static void aemif_get_hw_params(struct platform_device *pdev, int csnum)
 	data->wstrobe = aemif_cycles_to_nsec(WSTROBE_VAL(val), clk_rate);
 	data->wsetup = aemif_cycles_to_nsec(WSETUP_VAL(val), clk_rate);
 	data->enable_ew = EW_VAL(val);
-	data->enable_ss = SS_VAL(val);
+	data->enable_ss = SSTROBE_VAL(val);
 	data->asize = val & ASIZE_MAX;
 }
 
Signature · 1 line
2.17.1
author maintainer
#8 lore raw

Re: [PATCH v2 04/29] memory: ti-aemif: Rename SS to SSTROBE to avoid name conflicts

Quoted 14 lines · Krzysztof Kozlowski

SS conflicts with compile test build on i386:

    drivers/memory/ti-aemif.c:40:0: warning: "SS" redefined
    In file included from arch/x86/include/uapi/asm/ptrace.h:6:0,
                     from arch/x86/include/asm/ptrace.h:7,
                     from arch/x86/include/asm/math_emu.h:5,
                     from arch/x86/include/asm/processor.h:13,
                     from include/linux/mutex.h:19,
                     from include/linux/notifier.h:14,
                     from include/linux/clk.h:14,
                     from drivers/memory/ti-aemif.c:12:
    arch/x86/include/uapi/asm/ptrace-abi.h:23:0: note: this is the location of the previous definition
     #define SS   16
Quoted 7 lines

Use more descriptive name (SSTROBE) to avoid the conflict.

---
 drivers/memory/ti-aemif.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

Applied (and part of pull request to arm-soc).

Best regards,
Krzysztof

author maintainer
#9 lore raw

PATCH v2 5/29 memory: jz4780-nemc: Do not enable by default on every compile test

In reply to Krzysztof Kozlowski

When compile testing, enable the driver by default only on MIPS architecture.

---

Changes since v1:
1. New patch

---
 drivers/memory/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/memory/Kconfig +1 -1
index efcb4dfaccc2..5a225ca66c4e 100644
@@ -141,7 +141,7 @@ config FSL_IFC
 
 config JZ4780_NEMC
 	bool "Ingenic JZ4780 SoC NEMC driver"
-	default y
+	default y if MIPS
 	depends on MIPS || COMPILE_TEST
 	depends on HAS_IOMEM && OF
 	help
Signature · 1 line
2.17.1
#10 lore raw

Re: [PATCH v2 05/29] memory: jz4780-nemc: Do not enable by default on every compile test

Quoted 10 lines · Krzysztof Kozlowski

When compile testing, enable the driver by default only on MIPS architecture.

---

Changes since v1:
1. New patch

@@ -141,7 +141,7 @@ config FSL_IFC

drivers/memory/Kconfig config FSL_IFC · line 145

Quoted 6 lines

config JZ4780_NEMC
bool "Ingenic JZ4780 SoC NEMC driver"

drivers/memory/Kconfig +1 -1
-       default y
+       default y if MIPS
        depends on MIPS || COMPILE_TEST

Actually I think this should be 'default MACH_INGENIC', and probably also 'depends on MACH_INGENIC || COMPILE_TEST'.

Arnd

author maintainer
#11 lore raw

Re: [PATCH v2 05/29] memory: jz4780-nemc: Do not enable by default on every compile test

Quoted 20 lines · Arnd Bergmann
Quoted 10 lines · Krzysztof Kozlowski

When compile testing, enable the driver by default only on MIPS architecture.

---

Changes since v1:
1. New patch

@@ -141,7 +141,7 @@ config FSL_IFC

drivers/memory/Kconfig config FSL_IFC · line 145

Quoted 6 lines

config JZ4780_NEMC
bool "Ingenic JZ4780 SoC NEMC driver"

drivers/memory/Kconfig +1 -1
-       default y
+       default y if MIPS
        depends on MIPS || COMPILE_TEST
Quoted 2 lines

Actually I think this should be 'default MACH_INGENIC', and probably also 'depends on MACH_INGENIC || COMPILE_TEST'.

Makes sense, especially for default.

For the depends, there is also MTD_NAND_JZ4780 (depending on JZ4780_NEMC) which also requires MIPS. I could fix both then.

Best regards,
Krzysztof

author maintainer
#12 lore raw

PATCH v2 6/29 memory: Enable compile testing for most of the drivers

In reply to Krzysztof Kozlowski

Most of the memory controller drivers do not depend on architecture specific code so can be compile tested to increase build coverage.

When compile tested, do not enable them by default.

---

Changes since v1:
1. When compile tested, do not enable them by default.

---
 drivers/memory/Kconfig | 39 ++++++++++++++++++++++-----------------
 1 file changed, 22 insertions(+), 17 deletions(-)
drivers/memory/Kconfig +22 -17
index 5a225ca66c4e..c37752d5f26d 100644
@@ -26,8 +26,9 @@ config ARM_PL172_MPMC
 
 config ATMEL_SDRAMC
 	bool "Atmel (Multi-port DDR-)SDRAM Controller"
-	default y
-	depends on ARCH_AT91 && OF
+	default y if ARCH_AT91
+	depends on ARCH_AT91 || COMPILE_TEST
+	depends on OF
 	help
 	  This driver is for Atmel SDRAM Controller or Atmel Multi-port
 	  DDR-SDRAM Controller available on Atmel AT91SAM9 and SAMA5 SoCs.
@@ -36,8 +37,9 @@ config ATMEL_SDRAMC
 
 config ATMEL_EBI
 	bool "Atmel EBI driver"
-	default y
-	depends on ARCH_AT91 && OF
+	default y if ARCH_AT91
+	depends on ARCH_AT91 || COMPILE_TEST
+	depends on OF
 	select MFD_SYSCON
 	select MFD_ATMEL_SMC
 	help
@@ -59,7 +61,8 @@ config BT1_L2_CTL
 
 config TI_AEMIF
 	tristate "Texas Instruments AEMIF driver"
-	depends on (ARCH_DAVINCI || ARCH_KEYSTONE) && OF
+	depends on ARCH_DAVINCI || ARCH_KEYSTONE || COMPILE_TEST
+	depends on OF
 	help
 	  This driver is for the AEMIF module available in Texas Instruments
 	  SoCs. AEMIF stands for Asynchronous External Memory Interface and
@@ -70,7 +73,7 @@ config TI_AEMIF
 
 config TI_EMIF
 	tristate "Texas Instruments EMIF driver"
-	depends on ARCH_OMAP2PLUS
+	depends on ARCH_OMAP2PLUS || COMPILE_TEST
 	select DDR
 	help
 	  This driver is for the EMIF module available in Texas Instruments
@@ -82,7 +85,7 @@ config TI_EMIF
 	  temperature changes
 
 config OMAP_GPMC
-	bool
+	bool "Texas Instruments OMAP SoC GPMC driver" if COMPILE_TEST
 	select GPIOLIB
 	help
 	  This driver is for the General Purpose Memory Controller (GPMC)
@@ -106,7 +109,8 @@ config OMAP_GPMC_DEBUG
 
 config TI_EMIF_SRAM
 	tristate "Texas Instruments EMIF SRAM driver"
-	depends on (SOC_AM33XX || SOC_AM43XX) && SRAM
+	depends on SOC_AM33XX || SOC_AM43XX || (ARM && COMPILE_TEST)
+	depends on SRAM
 	help
 	  This driver is for the EMIF module available on Texas Instruments
 	  AM33XX and AM43XX SoCs and is required for PM. Certain parts of
@@ -116,8 +120,9 @@ config TI_EMIF_SRAM
 
 config MVEBU_DEVBUS
 	bool "Marvell EBU Device Bus Controller"
-	default y
-	depends on PLAT_ORION && OF
+	default y if PLAT_ORION
+	depends on PLAT_ORION || COMPILE_TEST
+	depends on OF
 	help
 	  This driver is for the Device Bus controller available in some
 	  Marvell EBU SoCs such as Discovery (mv78xx0), Orion (88f5xxx) and
@@ -126,7 +131,7 @@ config MVEBU_DEVBUS
 
 config FSL_CORENET_CF
 	tristate "Freescale CoreNet Error Reporting"
-	depends on FSL_SOC_BOOKE
+	depends on FSL_SOC_BOOKE || COMPILE_TEST
 	help
 	  Say Y for reporting of errors from the Freescale CoreNet
 	  Coherency Fabric.  Errors reported include accesses to
@@ -135,7 +140,7 @@ config FSL_CORENET_CF
 	  represents a coherency violation.
 
 config FSL_IFC
-	bool
+	bool "Freescale IFC driver" if COMPILE_TEST
 	depends on FSL_SOC || ARCH_LAYERSCAPE || SOC_LS1021A || COMPILE_TEST
 	depends on HAS_IOMEM
 
@@ -150,7 +155,7 @@ config JZ4780_NEMC
 	  memory devices such as NAND and SRAM.
 
 config MTK_SMI
-	bool
+	bool "Mediatek SoC Memory Controller driver" if COMPILE_TEST
 	depends on ARCH_MEDIATEK || COMPILE_TEST
 	help
 	  This driver is for the Memory Controller module in MediaTek SoCs,
@@ -159,7 +164,7 @@ config MTK_SMI
 
 config DA8XX_DDRCTL
 	bool "Texas Instruments da8xx DDR2/mDDR driver"
-	depends on ARCH_DAVINCI_DA8XX
+	depends on ARCH_DAVINCI_DA8XX || COMPILE_TEST
 	help
 	  This driver is for the DDR2/mDDR Memory Controller present on
 	  Texas Instruments da8xx SoCs. It's used to tweak various memory
@@ -167,16 +172,16 @@ config DA8XX_DDRCTL
 
 config PL353_SMC
 	tristate "ARM PL35X Static Memory Controller(SMC) driver"
-	default y
+	default y if ARM
 	depends on ARM
-	depends on ARM_AMBA
+	depends on ARM_AMBA || COMPILE_TEST
 	help
 	  This driver is for the ARM PL351/PL353 Static Memory
 	  Controller(SMC) module.
 
 config RENESAS_RPCIF
 	tristate "Renesas RPC-IF driver"
-	depends on ARCH_RENESAS
+	depends on ARCH_RENESAS || COMPILE_TEST
 	select REGMAP_MMIO
 	help
 	  This supports Renesas R-Car Gen3 RPC-IF which provides either SPI
Signature · 1 line
2.17.1
author maintainer Applied
#13 lore raw

Re: [PATCH v2 06/29] memory: Enable compile testing for most of the drivers

Quoted 7 lines · Krzysztof Kozlowski

Most of the memory controller drivers do not depend on architecture specific code so can be compile tested to increase build coverage.

When compile tested, do not enable them by default.

Quoted 7 lines

---

Changes since v1:
1. When compile tested, do not enable them by default.

---
 drivers/memory/Kconfig | 39 ++++++++++++++++++++++-----------------
 1 file changed, 22 insertions(+), 17 deletions(-)

Applied to drivers/memory tree.

Best regards,
Krzysztof

author maintainer
#14 lore raw

PATCH v2 7/29 memory: of: Remove unused headers

In reply to Krzysztof Kozlowski

The of_memory.c does not use platform_device nor linked list.

---
 drivers/memory/of_memory.c | 2 --
 1 file changed, 2 deletions(-)
drivers/memory/of_memory.c +0 -2
index 71f26eac7350..cfcb91eeccfb 100644
@@ -7,8 +7,6 @@
  */
 
 #include <linux/device.h>
-#include <linux/platform_device.h>
-#include <linux/list.h>
 #include <linux/of.h>
 #include <linux/gfp.h>
 #include <linux/export.h>
Signature · 1 line
2.17.1
author maintainer
#15 lore raw

PATCH v2 8/29 memory: of: Remove __func__ in device related messages

In reply to Krzysztof Kozlowski

Messages printed by generic of_memory code will still be using device context so their location/meaning will be known. Printing __func__ is not needed.

---
 drivers/memory/of_memory.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/memory/of_memory.c +8 -8
index cfcb91eeccfb..8a5b654eca6b 100644
@@ -4,6 +4,7 @@
  *
  * Copyright (C) 2012 Texas Instruments, Inc.
  * Copyright (C) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (C) 2020 Krzysztof Kozlowski <[email protected]>
  */
 
 #include <linux/device.h>
@@ -54,7 +55,7 @@ const struct lpddr2_min_tck *of_get_min_tck(struct device_node *np,
 	return min;
 
 default_min_tck:
-	dev_warn(dev, "%s: using default min-tck values\n", __func__);
+	dev_warn(dev, "Using default min-tck values\n");
 	return &lpddr2_jedec_min_tck;
 }
 EXPORT_SYMBOL(of_get_min_tck);
@@ -114,7 +115,7 @@ const struct lpddr2_timings *of_get_ddr_timings(struct device_node *np_ddr,
 		tim_compat = "jedec,lpddr2-timings";
 		break;
 	default:
-		dev_warn(dev, "%s: un-supported memory type\n", __func__);
+		dev_warn(dev, "Unsupported memory type\n");
 	}
 
 	for_each_child_of_node(np_ddr, np_tim)
@@ -143,7 +144,7 @@ const struct lpddr2_timings *of_get_ddr_timings(struct device_node *np_ddr,
 	return timings;
 
 default_timings:
-	dev_warn(dev, "%s: using default timings\n", __func__);
+	dev_warn(dev, "Using default memory timings\n");
 	*nr_frequencies = ARRAY_SIZE(lpddr2_jedec_timings);
 	return lpddr2_jedec_timings;
 }
@@ -191,8 +192,7 @@ const struct lpddr3_min_tck *of_lpddr3_get_min_tck(struct device_node *np,
 	ret |= of_property_read_u32(np, "tMRD-min-tck", &min->tMRD);
 
 	if (ret) {
-		dev_warn(dev, "%s: errors while parsing min-tck values\n",
-			 __func__);
+		dev_warn(dev, "Errors while parsing min-tck values\n");
 		devm_kfree(dev, min);
 		goto default_min_tck;
 	}
@@ -200,7 +200,7 @@ const struct lpddr3_min_tck *of_lpddr3_get_min_tck(struct device_node *np,
 	return min;
 
 default_min_tck:
-	dev_warn(dev, "%s: using default min-tck values\n", __func__);
+	dev_warn(dev, "Using default min-tck values\n");
 	return NULL;
 }
 EXPORT_SYMBOL(of_lpddr3_get_min_tck);
@@ -262,7 +262,7 @@ const struct lpddr3_timings
 		tim_compat = "jedec,lpddr3-timings";
 		break;
 	default:
-		dev_warn(dev, "%s: un-supported memory type\n", __func__);
+		dev_warn(dev, "Unsupported memory type\n");
 	}
 
 	for_each_child_of_node(np_ddr, np_tim)
@@ -291,7 +291,7 @@ const struct lpddr3_timings
 	return timings;
 
 default_timings:
-	dev_warn(dev, "%s: failed to get timings\n", __func__);
+	dev_warn(dev, "Failed to get timings\n");
 	*nr_frequencies = 0;
 	return NULL;
 }
Signature · 1 line
2.17.1
author maintainer
#16 lore raw

PATCH v2 9/29 memory: of: Correct indentation

In reply to Krzysztof Kozlowski

Correct indentation to match open parenthesis.

---
 drivers/memory/of_memory.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/memory/of_memory.c +6 -4
index 8a5b654eca6b..67b811cb2cb9 100644
@@ -26,7 +26,7 @@
  * default min timings provided by JEDEC.
  */
 const struct lpddr2_min_tck *of_get_min_tck(struct device_node *np,
-		struct device *dev)
+					    struct device *dev)
 {
 	int			ret = 0;
 	struct lpddr2_min_tck	*min;
@@ -61,7 +61,7 @@ const struct lpddr2_min_tck *of_get_min_tck(struct device_node *np,
 EXPORT_SYMBOL(of_get_min_tck);
 
 static int of_do_get_timings(struct device_node *np,
-		struct lpddr2_timings *tim)
+			     struct lpddr2_timings *tim)
 {
 	int ret;
 
@@ -83,7 +83,7 @@ static int of_do_get_timings(struct device_node *np,
 	ret |= of_property_read_u32(np, "tZQinit", &tim->tZQinit);
 	ret |= of_property_read_u32(np, "tRAS-max-ns", &tim->tRAS_max_ns);
 	ret |= of_property_read_u32(np, "tDQSCK-max-derated",
-		&tim->tDQSCK_max_derated);
+				    &tim->tDQSCK_max_derated);
 
 	return ret;
 }
@@ -102,7 +102,9 @@ static int of_do_get_timings(struct device_node *np,
  * while populating, returns default timings provided by JEDEC.
  */
 const struct lpddr2_timings *of_get_ddr_timings(struct device_node *np_ddr,
-		struct device *dev, u32 device_type, u32 *nr_frequencies)
+						struct device *dev,
+						u32 device_type,
+						u32 *nr_frequencies)
 {
 	struct lpddr2_timings	*timings = NULL;
 	u32			arr_sz = 0, i = 0;
Signature · 1 line
2.17.1
author maintainer
#17 lore raw

PATCH v2 10/29 memory: of: Remove unneeded extern from function declarations

In reply to Krzysztof Kozlowski

Function declarations in headers do not need to come with extern keyword. Remove them to make the declaration slightly shorter.

---
 drivers/memory/of_memory.h | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)
drivers/memory/of_memory.h +11 -10
index e39ecc4c733d..4a99b232ab0a 100644
@@ -3,22 +3,23 @@
  * OpenFirmware helpers for memory drivers
  *
  * Copyright (C) 2012 Texas Instruments, Inc.
+ * Copyright (C) 2020 Krzysztof Kozlowski <[email protected]>
  */
 
 #ifndef __LINUX_MEMORY_OF_REG_H
 #define __LINUX_MEMORY_OF_REG_H
 
 #if defined(CONFIG_OF) && defined(CONFIG_DDR)
-extern const struct lpddr2_min_tck *of_get_min_tck(struct device_node *np,
-		struct device *dev);
-extern const struct lpddr2_timings
-	*of_get_ddr_timings(struct device_node *np_ddr, struct device *dev,
-	u32 device_type, u32 *nr_frequencies);
-extern const struct lpddr3_min_tck
-	*of_lpddr3_get_min_tck(struct device_node *np, struct device *dev);
-extern const struct lpddr3_timings
-	*of_lpddr3_get_ddr_timings(struct device_node *np_ddr,
-	struct device *dev, u32 device_type, u32 *nr_frequencies);
+const struct lpddr2_min_tck *of_get_min_tck(struct device_node *np,
+					    struct device *dev);
+const struct lpddr2_timings *of_get_ddr_timings(struct device_node *np_ddr,
+						struct device *dev,
+						u32 device_type, u32 *nr_frequencies);
+const struct lpddr3_min_tck *of_lpddr3_get_min_tck(struct device_node *np,
+						   struct device *dev);
+const struct lpddr3_timings *
+of_lpddr3_get_ddr_timings(struct device_node *np_ddr,
+			  struct device *dev, u32 device_type, u32 *nr_frequencies);
 #else
 static inline const struct lpddr2_min_tck
 	*of_get_min_tck(struct device_node *np, struct device *dev)
Signature · 1 line
2.17.1
author maintainer
#18 lore raw

PATCH v2 11/29 memory: emif-asm-offsets: Add GPLv2 SPDX license header

In reply to Krzysztof Kozlowski

Add GPLv2 license header and remove GPL boiler plate text.

---

Changes since v1:
1. Use "GPL-2.0" instead of "GPL-2.0-only". It's shorter.

---
 drivers/memory/emif-asm-offsets.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)
drivers/memory/emif-asm-offsets.c +1 -9
index db8043019ec6..4b98d1854cd7 100644
@@ -1,16 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * TI AM33XX EMIF PM Assembly Offsets
  *
  * Copyright (C) 2016-2017 Texas Instruments Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation version 2.
- *
- * This program is distributed "as is" WITHOUT ANY WARRANTY of any
- * kind, whether express or implied; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
  */
 #include <linux/ti-emif-sram.h>
 
Signature · 1 line
2.17.1
author maintainer
#19 lore raw

Re: [PATCH v2 11/29] memory: emif-asm-offsets: Add GPLv2 SPDX license header

Quoted 4 lines · Krzysztof Kozlowski

Add GPLv2 license header and remove GPL boiler plate text.

Quoted 8 lines

---

Changes since v1:
1. Use "GPL-2.0" instead of "GPL-2.0-only". It's shorter.

---
 drivers/memory/emif-asm-offsets.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

Applied (and part of pull request to arm-soc).

Best regards,
Krzysztof

author maintainer
#20 lore raw

PATCH v2 12/29 memory: emif: Put constant in comparison on the right side

In reply to Krzysztof Kozlowski

Fixes checkpatch warning:

WARNING: Comparisons should place the constant on the right side of the test

---
 drivers/memory/emif.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/memory/emif.c +1 -1
index 58a82eea5850..97bad1588bba 100644
@@ -282,7 +282,7 @@ static void set_lpmode(struct emif_data *emif, u8 lpmode)
 	 * the EMIF_PWR_MGMT_CTRL[10:8] REG_LP_MODE bit field to 0x4.
 	 */
 	if ((emif->plat_data->ip_rev == EMIF_4D) &&
-	    (EMIF_LP_MODE_PWR_DN == lpmode)) {
+	    (lpmode == EMIF_LP_MODE_PWR_DN)) {
 		WARN_ONCE(1,
 			  "REG_LP_MODE = LP_MODE_PWR_DN(4) is prohibited by"
 			  "erratum i743 switch to LP_MODE_SELF_REFRESH(2)\n");
Signature · 1 line
2.17.1
author maintainer
#21 lore raw

Re: [PATCH v2 12/29] memory: emif: Put constant in comparison on the right side

Quoted 9 lines · Krzysztof Kozlowski

Fixes checkpatch warning:

WARNING: Comparisons should place the constant on the right side of the test

---
 drivers/memory/emif.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied (and part of pull request to arm-soc).

Best regards,
Krzysztof

author maintainer
#22 lore raw

PATCH v2 13/29 memory: emif: Fix whitespace coding style violations

In reply to Krzysztof Kozlowski

Make the code and printed messages slightly more readable. Fixes checkpatch warnings:

WARNING: quoted string split across lines
ERROR: space prohibited before that ',' (ctx:WxW)

---
 drivers/memory/emif.c | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)
drivers/memory/emif.c +7 -9
index 97bad1588bba..1241a87081f8 100644
@@ -284,8 +284,7 @@ static void set_lpmode(struct emif_data *emif, u8 lpmode)
 	if ((emif->plat_data->ip_rev == EMIF_4D) &&
 	    (lpmode == EMIF_LP_MODE_PWR_DN)) {
 		WARN_ONCE(1,
-			  "REG_LP_MODE = LP_MODE_PWR_DN(4) is prohibited by"
-			  "erratum i743 switch to LP_MODE_SELF_REFRESH(2)\n");
+			  "REG_LP_MODE = LP_MODE_PWR_DN(4) is prohibited by erratum i743 switch to LP_MODE_SELF_REFRESH(2)\n");
 		/* rollback LP_MODE to Self-refresh mode */
 		lpmode = EMIF_LP_MODE_SELF_REFRESH;
 	}
@@ -714,7 +713,7 @@ static u32 get_ext_phy_ctrl_2_intelliphy_4d5(void)
 	u32 fifo_we_slave_ratio;
 
 	fifo_we_slave_ratio =  DIV_ROUND_CLOSEST(
-		EMIF_INTELLI_PHY_DQS_GATE_OPENING_DELAY_PS * 256 , t_ck);
+		EMIF_INTELLI_PHY_DQS_GATE_OPENING_DELAY_PS * 256, t_ck);
 
 	return fifo_we_slave_ratio | fifo_we_slave_ratio << 11 |
 		fifo_we_slave_ratio << 22;
@@ -725,7 +724,7 @@ static u32 get_ext_phy_ctrl_3_intelliphy_4d5(void)
 	u32 fifo_we_slave_ratio;
 
 	fifo_we_slave_ratio =  DIV_ROUND_CLOSEST(
-		EMIF_INTELLI_PHY_DQS_GATE_OPENING_DELAY_PS * 256 , t_ck);
+		EMIF_INTELLI_PHY_DQS_GATE_OPENING_DELAY_PS * 256, t_ck);
 
 	return fifo_we_slave_ratio >> 10 | fifo_we_slave_ratio << 1 |
 		fifo_we_slave_ratio << 12 | fifo_we_slave_ratio << 23;
@@ -736,7 +735,7 @@ static u32 get_ext_phy_ctrl_4_intelliphy_4d5(void)
 	u32 fifo_we_slave_ratio;
 
 	fifo_we_slave_ratio =  DIV_ROUND_CLOSEST(
-		EMIF_INTELLI_PHY_DQS_GATE_OPENING_DELAY_PS * 256 , t_ck);
+		EMIF_INTELLI_PHY_DQS_GATE_OPENING_DELAY_PS * 256, t_ck);
 
 	return fifo_we_slave_ratio >> 9 | fifo_we_slave_ratio << 2 |
 		fifo_we_slave_ratio << 13;
@@ -975,8 +974,7 @@ static irqreturn_t handle_temp_alert(void __iomem *base, struct emif_data *emif)
 				EMIF_CUSTOM_CONFIG_EXTENDED_TEMP_PART)) {
 		if (emif->temperature_level >= SDRAM_TEMP_HIGH_DERATE_REFRESH) {
 			dev_err(emif->dev,
-				"%s:NOT Extended temperature capable memory."
-				"Converting MR4=0x%02x as shutdown event\n",
+				"%s:NOT Extended temperature capable memory. Converting MR4=0x%02x as shutdown event\n",
 				__func__, emif->temperature_level);
 			/*
 			 * Temperature far too high - do kernel_power_off()
@@ -1318,9 +1316,9 @@ static void __init_or_module of_get_ddr_info(struct device_node *np_emif,
 	if (of_find_property(np_emif, "cal-resistor-per-cs", &len))
 		dev_info->cal_resistors_per_cs = true;
 
-	if (of_device_is_compatible(np_ddr , "jedec,lpddr2-s4"))
+	if (of_device_is_compatible(np_ddr, "jedec,lpddr2-s4"))
 		dev_info->type = DDR_TYPE_LPDDR2_S4;
-	else if (of_device_is_compatible(np_ddr , "jedec,lpddr2-s2"))
+	else if (of_device_is_compatible(np_ddr, "jedec,lpddr2-s2"))
 		dev_info->type = DDR_TYPE_LPDDR2_S2;
 
 	of_property_read_u32(np_ddr, "density", &density);
Signature · 1 line
2.17.1
author maintainer
#23 lore raw

Re: [PATCH v2 13/29] memory: emif: Fix whitespace coding style violations

Quoted 11 lines · Krzysztof Kozlowski

Make the code and printed messages slightly more readable. Fixes checkpatch warnings:

WARNING: quoted string split across lines
ERROR: space prohibited before that ',' (ctx:WxW)

---
 drivers/memory/emif.c | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

Applied (and part of pull request to arm-soc).

Best regards,
Krzysztof

author maintainer
#24 lore raw

PATCH v2 14/29 memory: emif: Silence platform_get_irq() error in driver

In reply to Krzysztof Kozlowski

The platform_get_irq() already prints error message so there is no need to do it again in the driver.

---
 drivers/memory/emif.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/memory/emif.c +1 -4
index 1241a87081f8..1bf0656d5e9a 100644
@@ -1561,11 +1561,8 @@ static int __init_or_module emif_probe(struct platform_device *pdev)
 		goto error;
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0) {
-		dev_err(emif->dev, "%s: error getting IRQ resource - %d\n",
-			__func__, irq);
+	if (irq < 0)
 		goto error;
-	}
 
 	emif_onetime_settings(emif);
 	emif_debugfs_init(emif);
Signature · 1 line
2.17.1
author maintainer
#25 lore raw

Re: [PATCH v2 14/29] memory: emif: Silence platform_get_irq() error in driver

Quoted 8 lines · Krzysztof Kozlowski

The platform_get_irq() already prints error message so there is no need to do it again in the driver.

---
 drivers/memory/emif.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Applied (and part of pull request to arm-soc).

Best regards,
Krzysztof

author maintainer
#26 lore raw

PATCH v2 15/29 memory: ti-emif-pm: Fix cast to iomem pointer

In reply to Krzysztof Kozlowski

Cast pointer to iomem memory properly to fix sparse warning:

drivers/memory/ti-emif-pm.c:251:38: warning: incorrect type in argument 1 (different address spaces)
drivers/memory/ti-emif-pm.c:251:38: expected void const volatile [noderef] __iomem *addr
drivers/memory/ti-emif-pm.c:251:38: got void *

---
 drivers/memory/ti-emif-pm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/memory/ti-emif-pm.c +1 -1
index 9c90f815ad3a..6c747c1e98cb 100644
@@ -248,7 +248,7 @@ MODULE_DEVICE_TABLE(of, ti_emif_of_match);
 static int ti_emif_resume(struct device *dev)
 {
 	unsigned long tmp =
-			__raw_readl((void *)emif_instance->ti_emif_sram_virt);
+			__raw_readl((void __iomem *)emif_instance->ti_emif_sram_virt);
 
 	/*
 	 * Check to see if what we are copying is already present in the
Signature · 1 line
2.17.1
author maintainer
#27 lore raw

Re: [PATCH v2 15/29] memory: ti-emif-pm: Fix cast to iomem pointer

Quoted 10 lines · Krzysztof Kozlowski

Cast pointer to iomem memory properly to fix sparse warning:

drivers/memory/ti-emif-pm.c:251:38: warning: incorrect type in argument 1 (different address spaces)
drivers/memory/ti-emif-pm.c:251:38: expected void const volatile [noderef] __iomem *addr
drivers/memory/ti-emif-pm.c:251:38: got void *

---
 drivers/memory/ti-emif-pm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied (and part of pull request to arm-soc).

Best regards,
Krzysztof

author maintainer
#28 lore raw

PATCH v2 16/29 memory: renesas-rpc-if: Simplify with PTR_ERR_OR_ZERO

In reply to Krzysztof Kozlowski

Use PTR_ERR_OR_ZERO to make the code a little bit simpler.

---
 drivers/memory/renesas-rpc-if.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/memory/renesas-rpc-if.c +1 -3
index 88f51ec8f1d1..f2a33a1af836 100644
@@ -199,10 +199,8 @@ int rpcif_sw_init(struct rpcif *rpc, struct device *dev)
 		rpc->dirmap = NULL;
 
 	rpc->rstc = devm_reset_control_get_exclusive(&pdev->dev, NULL);
-	if (IS_ERR(rpc->rstc))
-		return PTR_ERR(rpc->rstc);
 
-	return 0;
+	return PTR_ERR_OR_ZERO(rpc->rstc);
 }
 EXPORT_SYMBOL(rpcif_sw_init);
 
Signature · 1 line
2.17.1
author maintainer Applied
#29 lore raw

Re: [PATCH v2 16/29] memory: renesas-rpc-if: Simplify with PTR_ERR_OR_ZERO

Quoted 5 lines · Krzysztof Kozlowski

Use PTR_ERR_OR_ZERO to make the code a little bit simpler.

---
 drivers/memory/renesas-rpc-if.c | 4 +---

Applied.

Best regards,
Krzysztof

_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek

author maintainer
#30 lore raw

PATCH v2 17/29 memory: brcmstb_dpfe: Constify the contents of string

In reply to Krzysztof Kozlowski

The string itself can be made const for safety.

---
 drivers/memory/brcmstb_dpfe.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/memory/brcmstb_dpfe.c +1 -1
index 82b415be18d1..5942380f343b 100644
@@ -188,7 +188,7 @@ struct brcmstb_dpfe_priv {
 	struct mutex lock;
 };
 
-static const char *error_text[] = {
+static const char * const error_text[] = {
 	"Success", "Header code incorrect", "Unknown command or argument",
 	"Incorrect checksum", "Malformed command", "Timed out",
 };
Signature · 1 line
2.17.1
author maintainer
#31 lore raw

Re: [PATCH v2 17/29] memory: brcmstb_dpfe: Constify the contents of string

Quoted 8 lines · Krzysztof Kozlowski

The string itself can be made const for safety.

---
 drivers/memory/brcmstb_dpfe.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied (and part of pull request to arm-soc).

Best regards,
Krzysztof

author maintainer
#32 lore raw

PATCH v2 18/29 memory: brcmstb_dpfe: Remove unneeded braces

In reply to Krzysztof Kozlowski

Single statement blocks don't need braces. Fixes checkpatch warning:

WARNING: braces {} are not necessary for single statement blocks

---
 drivers/memory/brcmstb_dpfe.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/memory/brcmstb_dpfe.c +1 -2
index 5942380f343b..604f0e3fb112 100644
@@ -379,9 +379,8 @@ static void __iomem *get_msg_ptr(struct brcmstb_dpfe_priv *priv, u32 response,
 	void __iomem *ptr = NULL;
 
 	/* There is no need to use this function for API v3 or later. */
-	if (unlikely(priv->dpfe_api->version >= 3)) {
+	if (unlikely(priv->dpfe_api->version >= 3))
 		return NULL;
-	}
 
 	msg_type = (response >> DRAM_MSG_TYPE_OFFSET) & DRAM_MSG_TYPE_MASK;
 	offset = (response >> DRAM_MSG_ADDR_OFFSET) & DRAM_MSG_ADDR_MASK;
Signature · 1 line
2.17.1
author maintainer
#33 lore raw

Re: [PATCH v2 18/29] memory: brcmstb_dpfe: Remove unneeded braces

Quoted 10 lines · Krzysztof Kozlowski

Single statement blocks don't need braces. Fixes checkpatch warning:

WARNING: braces {} are not necessary for single statement blocks

---
 drivers/memory/brcmstb_dpfe.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Applied (and part of pull request to arm-soc).

Best regards,
Krzysztof

author maintainer
#34 lore raw

PATCH v2 19/29 memory: mtk-smi: Add argument to function pointer definition

In reply to Krzysztof Kozlowski

Fix checkpatch warning:
WARNING: function definition argument 'struct device *' should also have an identifier name

---
 drivers/memory/mtk-smi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/memory/mtk-smi.c +1 -1
index 109c7e51d551..c21262502581 100644
@@ -60,7 +60,7 @@ struct mtk_smi_common_plat {
 
 struct mtk_smi_larb_gen {
 	int port_in_larb[MTK_LARB_NR_MAX + 1];
-	void (*config_port)(struct device *);
+	void (*config_port)(struct device *dev);
 	unsigned int			larb_direct_to_common_mask;
 	bool				has_gals;
 };
Signature · 1 line
2.17.1
author maintainer
#35 lore raw

Re: [PATCH v2 19/29] memory: mtk-smi: Add argument to function pointer definition

Quoted 7 lines · Krzysztof Kozlowski

Fix checkpatch warning:
WARNING: function definition argument 'struct device *' should also have an identifier name

---
 drivers/memory/mtk-smi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied (and part of pull request to arm-soc).

Best regards,
Krzysztof

author maintainer
#36 lore raw

PATCH v2 20/29 memory: omap-gpmc: Return meaningful error codes in gpmc_cs_set_timings()

In reply to Krzysztof Kozlowski

The callers of gpmc_cs_set_timings() expect to receive -ERRNO on errors and they pass further what they have received.

However gpmc_cs_set_timings() was returning -1 (equal to -EPERM) which does not make sense in this context.

---

Not tested

Changes since v1:
1. New patch

---
 drivers/memory/omap-gpmc.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/memory/omap-gpmc.c +3 -3
index c158b6cae9a9..1e370142dfca 100644
@@ -638,7 +638,7 @@ static int set_gpmc_timing_reg(int cs, int reg, int st_bit, int end_bit, int max
 #define GPMC_SET_ONE_CD_MAX(reg, st, end, max, field, cd)  \
 	if (set_gpmc_timing_reg(cs, (reg), (st), (end), (max), \
 	    t->field, (cd), #field) < 0)                       \
-		return -1
+		return -ENXIO
 
 #define GPMC_SET_ONE(reg, st, end, field) \
 	GPMC_SET_ONE_CD_MAX(reg, st, end, 0, field, GPMC_CD_FCLK)
@@ -708,7 +708,7 @@ int gpmc_cs_set_timings(int cs, const struct gpmc_timings *t,
 
 	div = gpmc_calc_divider(t->sync_clk);
 	if (div < 0)
-		return div;
+		return -EINVAL;
 
 	/*
 	 * See if we need to change the divider for waitmonitoringtime.
@@ -733,7 +733,7 @@ int gpmc_cs_set_timings(int cs, const struct gpmc_timings *t,
 			       __func__,
 			       t->wait_monitoring
 			       );
-			return -1;
+			return -ENXIO;
 		}
 	}
 
Signature · 1 line
2.17.1
author maintainer Applied
#37 lore raw

Re: [RFT v2 20/29] memory: omap-gpmc: Return meaningful error codes in gpmc_cs_set_timings()

Quoted 9 lines · Krzysztof Kozlowski

The callers of gpmc_cs_set_timings() expect to receive -ERRNO on errors and they pass further what they have received.

However gpmc_cs_set_timings() was returning -1 (equal to -EPERM) which does not make sense in this context.

---

Applied to drivers/memory tree.

Best regards,
Krzysztof

author maintainer
#38 lore raw

PATCH v2 21/29 memory: omap-gpmc: Remove GPMC_SET_ONE_CD_MAX macro for safety

In reply to Krzysztof Kozlowski

The GPMC_SET_ONE_CD_MAX macro uses return statement and variable 'cs' coming from called scope. This is not a good practice. Also checkpatch complained:

WARNING: Macros with flow control statements should be avoided
ERROR: Macros starting with if should be enclosed by a do - while
loop to avoid possible if/else logic defects

Since GPMC_SET_ONE_CD_MAX macro just calls one function, it can be open coded. The difference with original code is that function will exit on error not after every register set, but after a group of sets.

---

Not tested

Changes since v1:
1. Drop the macro, after comments from Arnd.

---
 drivers/memory/omap-gpmc.c | 137 +++++++++++++++++++++++++------------
 1 file changed, 93 insertions(+), 44 deletions(-)
drivers/memory/omap-gpmc.c +93 -44
index 1e370142dfca..2a2d0297e071 100644
@@ -635,14 +635,6 @@ static int set_gpmc_timing_reg(int cs, int reg, int st_bit, int end_bit, int max
 	return 0;
 }
 
-#define GPMC_SET_ONE_CD_MAX(reg, st, end, max, field, cd)  \
-	if (set_gpmc_timing_reg(cs, (reg), (st), (end), (max), \
-	    t->field, (cd), #field) < 0)                       \
-		return -ENXIO
-
-#define GPMC_SET_ONE(reg, st, end, field) \
-	GPMC_SET_ONE_CD_MAX(reg, st, end, 0, field, GPMC_CD_FCLK)
-
 /**
  * gpmc_calc_waitmonitoring_divider - calculate proper GPMCFCLKDIVIDER based on WAITMONITORINGTIME
  * WAITMONITORINGTIME will be _at least_ as long as desired, i.e.
@@ -703,7 +695,7 @@ int gpmc_calc_divider(unsigned int sync_clk)
 int gpmc_cs_set_timings(int cs, const struct gpmc_timings *t,
 			const struct gpmc_settings *s)
 {
-	int div;
+	int div, ret;
 	u32 l;
 
 	div = gpmc_calc_divider(t->sync_clk);
@@ -737,53 +729,110 @@ int gpmc_cs_set_timings(int cs, const struct gpmc_timings *t,
 		}
 	}
 
-	GPMC_SET_ONE(GPMC_CS_CONFIG2,  0,  3, cs_on);
-	GPMC_SET_ONE(GPMC_CS_CONFIG2,  8, 12, cs_rd_off);
-	GPMC_SET_ONE(GPMC_CS_CONFIG2, 16, 20, cs_wr_off);
+	ret = 0;
+	ret |= set_gpmc_timing_reg(cs, GPMC_CS_CONFIG2, 0, 3, 0, t->cs_on,
+				   GPMC_CD_FCLK, "cs_on");
+	ret |= set_gpmc_timing_reg(cs, GPMC_CS_CONFIG2, 8, 12, 0, t->cs_rd_off,
+				   GPMC_CD_FCLK, "cs_rd_off");
+	ret |= set_gpmc_timing_reg(cs, GPMC_CS_CONFIG2, 16, 20, 0, t->cs_wr_off,
+				   GPMC_CD_FCLK, "cs_wr_off");
+	if (ret)
+		return -ENXIO;
+
+	ret |= set_gpmc_timing_reg(cs, GPMC_CS_CONFIG3, 0, 3, 0, t->adv_on,
+				   GPMC_CD_FCLK, "adv_on");
+	ret |= set_gpmc_timing_reg(cs, GPMC_CS_CONFIG3, 8, 12, 0, t->adv_rd_off,
+				   GPMC_CD_FCLK, "adv_rd_off");
+	ret |= set_gpmc_timing_reg(cs, GPMC_CS_CONFIG3, 16, 20, 0, t->adv_wr_off,
+				   GPMC_CD_FCLK, "adv_wr_off");
+	if (ret)
+		return -ENXIO;
 
-	GPMC_SET_ONE(GPMC_CS_CONFIG3,  0,  3, adv_on);
-	GPMC_SET_ONE(GPMC_CS_CONFIG3,  8, 12, adv_rd_off);
-	GPMC_SET_ONE(GPMC_CS_CONFIG3, 16, 20, adv_wr_off);
 	if (gpmc_capability & GPMC_HAS_MUX_AAD) {
-		GPMC_SET_ONE(GPMC_CS_CONFIG3,  4,  6, adv_aad_mux_on);
-		GPMC_SET_ONE(GPMC_CS_CONFIG3, 24, 26, adv_aad_mux_rd_off);
-		GPMC_SET_ONE(GPMC_CS_CONFIG3, 28, 30, adv_aad_mux_wr_off);
+		ret |= set_gpmc_timing_reg(cs, GPMC_CS_CONFIG3, 4, 6, 0,
+					   t->adv_aad_mux_on, GPMC_CD_FCLK,
+					   "adv_aad_mux_on");
+		ret |= set_gpmc_timing_reg(cs, GPMC_CS_CONFIG3, 24, 26, 0,
+					   t->adv_aad_mux_rd_off, GPMC_CD_FCLK,
+					   "adv_aad_mux_rd_off");
+		ret |= set_gpmc_timing_reg(cs, GPMC_CS_CONFIG3, 28, 30, 0,
+					   t->adv_aad_mux_wr_off, GPMC_CD_FCLK,
+					   "adv_aad_mux_wr_off");
+		if (ret)
+			return -ENXIO;
 	}
 
-	GPMC_SET_ONE(GPMC_CS_CONFIG4,  0,  3, oe_on);
-	GPMC_SET_ONE(GPMC_CS_CONFIG4,  8, 12, oe_off);
+	ret |= set_gpmc_timing_reg(cs, GPMC_CS_CONFIG4, 0, 3, 0, t->oe_on,
+				   GPMC_CD_FCLK, "oe_on");
+	ret |= set_gpmc_timing_reg(cs, GPMC_CS_CONFIG4, 8, 12, 0, t->oe_off,
+				   GPMC_CD_FCLK, "oe_off");
 	if (gpmc_capability & GPMC_HAS_MUX_AAD) {
-		GPMC_SET_ONE(GPMC_CS_CONFIG4,  4,  6, oe_aad_mux_on);
-		GPMC_SET_ONE(GPMC_CS_CONFIG4, 13, 15, oe_aad_mux_off);
+		ret |= set_gpmc_timing_reg(cs, GPMC_CS_CONFIG4, 4, 6, 0,
+					   t->oe_aad_mux_on, GPMC_CD_FCLK,
+					   "oe_aad_mux_on");
+		ret |= set_gpmc_timing_reg(cs, GPMC_CS_CONFIG4, 13, 15, 0,
+					   t->oe_aad_mux_off, GPMC_CD_FCLK,
+					   "oe_aad_mux_off");
+	}
+	ret |= set_gpmc_timing_reg(cs, GPMC_CS_CONFIG4, 16, 19, 0, t->we_on,
+				   GPMC_CD_FCLK, "we_on");
+	ret |= set_gpmc_timing_reg(cs, GPMC_CS_CONFIG4, 24, 28, 0, t->we_off,
+				   GPMC_CD_FCLK, "we_off");
+	if (ret)
+		return -ENXIO;
+
+	ret |= set_gpmc_timing_reg(cs, GPMC_CS_CONFIG5, 0, 4, 0, t->rd_cycle,
+				   GPMC_CD_FCLK, "rd_cycle");
+	ret |= set_gpmc_timing_reg(cs, GPMC_CS_CONFIG5, 8, 12, 0, t->wr_cycle,
+				   GPMC_CD_FCLK, "wr_cycle");
+	ret |= set_gpmc_timing_reg(cs, GPMC_CS_CONFIG5, 16, 20, 0, t->access,
+				   GPMC_CD_FCLK, "access");
+	ret |= set_gpmc_timing_reg(cs, GPMC_CS_CONFIG5, 24, 27, 0,
+				   t->page_burst_access, GPMC_CD_FCLK,
+				   "page_burst_access");
+	if (ret)
+		return -ENXIO;
+
+	ret |= set_gpmc_timing_reg(cs, GPMC_CS_CONFIG6, 0, 3, 0,
+				   t->bus_turnaround, GPMC_CD_FCLK,
+				   "bus_turnaround");
+	ret |= set_gpmc_timing_reg(cs, GPMC_CS_CONFIG6, 8, 11, 0,
+				   t->cycle2cycle_delay, GPMC_CD_FCLK,
+				   "cycle2cycle_delay");
+	if (ret)
+		return -ENXIO;
+
+	if (gpmc_capability & GPMC_HAS_WR_DATA_MUX_BUS) {
+		ret |= set_gpmc_timing_reg(cs, GPMC_CS_CONFIG6, 16, 19, 0,
+					   t->wr_data_mux_bus, GPMC_CD_FCLK,
+					   "wr_data_mux_bus");
+		if (ret)
+			return -ENXIO;
+	}
+	if (gpmc_capability & GPMC_HAS_WR_ACCESS) {
+		ret |= set_gpmc_timing_reg(cs, GPMC_CS_CONFIG6, 24, 28, 0,
+					   t->wr_access, GPMC_CD_FCLK,
+					   "wr_access");
+		if (ret)
+			return -ENXIO;
 	}
-	GPMC_SET_ONE(GPMC_CS_CONFIG4, 16, 19, we_on);
-	GPMC_SET_ONE(GPMC_CS_CONFIG4, 24, 28, we_off);
-
-	GPMC_SET_ONE(GPMC_CS_CONFIG5,  0,  4, rd_cycle);
-	GPMC_SET_ONE(GPMC_CS_CONFIG5,  8, 12, wr_cycle);
-	GPMC_SET_ONE(GPMC_CS_CONFIG5, 16, 20, access);
-
-	GPMC_SET_ONE(GPMC_CS_CONFIG5, 24, 27, page_burst_access);
-
-	GPMC_SET_ONE(GPMC_CS_CONFIG6, 0, 3, bus_turnaround);
-	GPMC_SET_ONE(GPMC_CS_CONFIG6, 8, 11, cycle2cycle_delay);
-
-	if (gpmc_capability & GPMC_HAS_WR_DATA_MUX_BUS)
-		GPMC_SET_ONE(GPMC_CS_CONFIG6, 16, 19, wr_data_mux_bus);
-	if (gpmc_capability & GPMC_HAS_WR_ACCESS)
-		GPMC_SET_ONE(GPMC_CS_CONFIG6, 24, 28, wr_access);
 
 	l = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1);
 	l &= ~0x03;
 	l |= (div - 1);
 	gpmc_cs_write_reg(cs, GPMC_CS_CONFIG1, l);
 
-	GPMC_SET_ONE_CD_MAX(GPMC_CS_CONFIG1, 18, 19,
-			    GPMC_CONFIG1_WAITMONITORINGTIME_MAX,
-			    wait_monitoring, GPMC_CD_CLK);
-	GPMC_SET_ONE_CD_MAX(GPMC_CS_CONFIG1, 25, 26,
-			    GPMC_CONFIG1_CLKACTIVATIONTIME_MAX,
-			    clk_activation, GPMC_CD_FCLK);
+	ret = 0;
+	ret |= set_gpmc_timing_reg(cs, GPMC_CS_CONFIG1, 18, 19,
+				   GPMC_CONFIG1_WAITMONITORINGTIME_MAX,
+				   t->wait_monitoring, GPMC_CD_CLK,
+				   "wait_monitoring");
+	ret |= set_gpmc_timing_reg(cs, GPMC_CS_CONFIG1, 25, 26,
+				   GPMC_CONFIG1_CLKACTIVATIONTIME_MAX,
+				   t->clk_activation, GPMC_CD_FCLK,
+				   "clk_activation");
+	if (ret)
+		return -ENXIO;
 
 #ifdef CONFIG_OMAP_GPMC_DEBUG
 	pr_info("GPMC CS%d CLK period is %lu ns (div %d)\n",
Signature · 1 line
2.17.1
author maintainer Applied
#39 lore raw

Re: [RFT v2 21/29] memory: omap-gpmc: Remove GPMC_SET_ONE_CD_MAX macro for safety

Quoted 8 lines · Krzysztof Kozlowski

The GPMC_SET_ONE_CD_MAX macro uses return statement and variable 'cs' coming from called scope. This is not a good practice. Also checkpatch complained:

WARNING: Macros with flow control statements should be avoided
ERROR: Macros starting with if should be enclosed by a do - while
loop to avoid possible if/else logic defects

Quoted 8 lines

Since GPMC_SET_ONE_CD_MAX macro just calls one function, it can be open coded. The difference with original code is that function will exit on error not after every register set, but after a group of sets.

---

Applied.

Best regards,
Krzysztof

_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek

author maintainer
#40 lore raw

PATCH v2 22/29 memory: omap-gpmc: Fix whitespace issue

In reply to Krzysztof Kozlowski

Fix minor whitespace and comment issues. No functional changes.

---

Changes since v1:
1. Adjust entire comment, as suggested by Arnd.

---
 drivers/memory/omap-gpmc.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/memory/omap-gpmc.c +4 -3
index 2a2d0297e071..2675ea4e37fe 100644
@@ -1005,7 +1005,7 @@ static int gpmc_cs_remap(int cs, u32 base)
 	 * Make sure we ignore any device offsets from the GPMC partition
 	 * allocated for the chip select and that the new base confirms
 	 * to the GPMC 16MB minimum granularity.
-	 */ 
+	 */
 	base &= ~(SZ_16M - 1);
 
 	gpmc_cs_get_memconf(cs, &old_base, &size);
@@ -1800,10 +1800,11 @@ static int gpmc_calc_common_timings(struct gpmc_timings *gpmc_t,
 	return 0;
 }
 
-/* TODO: remove this function once all peripherals are confirmed to
+/*
+ * TODO: remove this function once all peripherals are confirmed to
  * work with generic timing. Simultaneously gpmc_cs_set_timings()
  * has to be modified to handle timings in ps instead of ns
-*/
+ */
 static void gpmc_convert_ps_to_ns(struct gpmc_timings *t)
 {
 	t->cs_on /= 1000;
Signature · 1 line
2.17.1
author maintainer
#41 lore raw

Re: [PATCH v2 22/29] memory: omap-gpmc: Fix whitespace issue

Quoted 5 lines · Krzysztof Kozlowski

Fix minor whitespace and comment issues. No functional changes.

---

Applied (and part of pull request to arm-soc).

For the other omap-gpmc testing is welcomed.

Best regards,
Krzysztof

author maintainer
#42 lore raw

PATCH v2 23/29 memory: pl172: Add GPLv2 SPDX license header

In reply to Krzysztof Kozlowski

Add GPLv2 license header and remove GPL boiler plate text.

---
 drivers/memory/pl172.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/memory/pl172.c +1 -4
index ff57195b4e37..084891eb29cc 100644
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Memory controller driver for ARM PrimeCell PL172
  * PrimeCell MultiPort Memory Controller (PL172)
@@ -6,10 +7,6 @@
  *
  * Based on:
  * TI AEMIF driver, Copyright (C) 2010 - 2013 Texas Instruments Inc.
- *
- * This file is licensed under the terms of the GNU General Public
- * License version 2. This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
  */
 
 #include <linux/amba/bus.h>
Signature · 1 line
2.17.1
author maintainer
#43 lore raw

Re: [PATCH v2 23/29] memory: pl172: Add GPLv2 SPDX license header

Quoted 6 lines · Krzysztof Kozlowski

Add GPLv2 license header and remove GPL boiler plate text.

---
 drivers/memory/pl172.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Applied (and part of pull request to arm-soc).

Best regards,
Krzysztof

author maintainer
#44 lore raw

PATCH v2 24/29 memory: tegra: tegra210-emc: Fix indentation

In reply to Krzysztof Kozlowski

Use tabs instead of spaces for indentation.

---
 drivers/memory/tegra/tegra210-emc-cc-r21021.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/memory/tegra/tegra210-emc-cc-r21021.c +1 -1
index ff55a17896fa..d60bdea3af3f 100644
@@ -1044,7 +1044,7 @@ static void tegra210_emc_r21021_set_clock(struct tegra210_emc *emc, u32 clksrc)
 			   !opt_cc_short_zcal && opt_short_zcal) {
 			value = (value & ~(EMC_ZCAL_WAIT_CNT_ZCAL_WAIT_CNT_MASK <<
 					   EMC_ZCAL_WAIT_CNT_ZCAL_WAIT_CNT_SHIFT)) |
-			        ((zq_wait_long & EMC_ZCAL_WAIT_CNT_ZCAL_WAIT_CNT_MASK) <<
+				((zq_wait_long & EMC_ZCAL_WAIT_CNT_ZCAL_WAIT_CNT_MASK) <<
 						 EMC_MRS_WAIT_CNT_SHORT_WAIT_SHIFT);
 		} else if (offset == EMC_ZCAL_INTERVAL && opt_zcal_en_cc) {
 			value = 0; /* EMC_ZCAL_INTERVAL reset value. */
Signature · 1 line
2.17.1
author maintainer Applied
#45 lore raw

Re: [PATCH v2 24/29] memory: tegra: tegra210-emc: Fix indentation

Quoted 5 lines · Krzysztof Kozlowski

Use tabs instead of spaces for indentation.

---
 drivers/memory/tegra/tegra210-emc-cc-r21021.c | 2 +-

Applied.

Best regards,
Krzysztof

_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek

author maintainer
#46 lore raw

PATCH v2 25/29 MAINTAINERS: Add Krzysztof Kozlowski as maintainer of memory controllers

In reply to Krzysztof Kozlowski

The generic parts of memory controllers (of_memory.[ch]) lacked any care. The memory controller drivers were not abandoned (usually picked up by architecture maintainers) but in such case I can take care about them as well.

---
 MAINTAINERS | 7 +++++++
 1 file changed, 7 insertions(+)
MAINTAINERS +7 -0
index f4557bc43bd5..cba0ed77775b 100644
@@ -11158,6 +11158,13 @@ F:	Documentation/core-api/boot-time-mm.rst
 F:	include/linux/memblock.h
 F:	mm/memblock.c
 
+MEMORY CONTROLLER DRIVERS
+M:	Krzysztof Kozlowski <[email protected]>
+L:	[email protected]
+S:	Maintained
+F:	Documentation/devicetree/bindings/memory-controllers/
+F:	drivers/memory/
+
 MEMORY FREQUENCY SCALING DRIVERS FOR NVIDIA TEGRA
 M:	Dmitry Osipenko <[email protected]>
 L:	[email protected]
Signature · 1 line
2.17.1
author maintainer
#47 lore raw

PATCH v2 26/29 memory: fsl_ifc: Fix whitespace issues

In reply to Krzysztof Kozlowski

Fix minor whitespace and comment issues. Do not break message strings. No functional changes.

---

Changes since v1:
1. New patch

---
 drivers/memory/fsl_ifc.c | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)
drivers/memory/fsl_ifc.c +15 -15
index a2c971743ffe..89f99b5b6450 100644
@@ -53,6 +53,7 @@ int fsl_ifc_find(phys_addr_t addr_base)
 
 	for (i = 0; i < fsl_ifc_ctrl_dev->banks; i++) {
 		u32 cspr = ifc_in32(&fsl_ifc_ctrl_dev->gregs->cspr_cs[i].cspr);
+
 		if (cspr & CSPR_V && (cspr & CSPR_BA) ==
 				convert_ifc_address(addr_base))
 			return i;
@@ -153,8 +154,8 @@ static irqreturn_t fsl_ifc_ctrl_irq(int irqno, void *data)
 	/* read for chip select error */
 	cs_err = ifc_in32(&ifc->cm_evter_stat);
 	if (cs_err) {
-		dev_err(ctrl->dev, "transaction sent to IFC is not mapped to"
-				"any memory bank 0x%08X\n", cs_err);
+		dev_err(ctrl->dev, "transaction sent to IFC is not mapped to any memory bank 0x%08X\n",
+			cs_err);
 		/* clear the chip select error */
 		ifc_out32(IFC_CM_EVTER_STAT_CSER, &ifc->cm_evter_stat);
 
@@ -163,24 +164,24 @@ static irqreturn_t fsl_ifc_ctrl_irq(int irqno, void *data)
 		err_addr = ifc_in32(&ifc->cm_erattr1);
 
 		if (status & IFC_CM_ERATTR0_ERTYP_READ)
-			dev_err(ctrl->dev, "Read transaction error"
-				"CM_ERATTR0 0x%08X\n", status);
+			dev_err(ctrl->dev, "Read transaction error CM_ERATTR0 0x%08X\n",
+				status);
 		else
-			dev_err(ctrl->dev, "Write transaction error"
-				"CM_ERATTR0 0x%08X\n", status);
+			dev_err(ctrl->dev, "Write transaction error CM_ERATTR0 0x%08X\n",
+				status);
 
 		err_axiid = (status & IFC_CM_ERATTR0_ERAID) >>
 					IFC_CM_ERATTR0_ERAID_SHIFT;
-		dev_err(ctrl->dev, "AXI ID of the error"
-					"transaction 0x%08X\n", err_axiid);
+		dev_err(ctrl->dev, "AXI ID of the error transaction 0x%08X\n",
+			err_axiid);
 
 		err_srcid = (status & IFC_CM_ERATTR0_ESRCID) >>
 					IFC_CM_ERATTR0_ESRCID_SHIFT;
-		dev_err(ctrl->dev, "SRC ID of the error"
-					"transaction 0x%08X\n", err_srcid);
+		dev_err(ctrl->dev, "SRC ID of the error transaction 0x%08X\n",
+			err_srcid);
 
-		dev_err(ctrl->dev, "Transaction Address corresponding to error"
-					"ERADDR 0x%08X\n", err_addr);
+		dev_err(ctrl->dev, "Transaction Address corresponding to error ERADDR 0x%08X\n",
+			err_addr);
 
 		ret = IRQ_HANDLED;
 	}
@@ -199,7 +200,7 @@ static irqreturn_t fsl_ifc_ctrl_irq(int irqno, void *data)
  * the resources needed for the controller only.  The
  * resources for the NAND banks themselves are allocated
  * in the chip probe function.
-*/
+ */
 static int fsl_ifc_ctrl_probe(struct platform_device *dev)
 {
 	int ret = 0;
@@ -250,8 +251,7 @@ static int fsl_ifc_ctrl_probe(struct platform_device *dev)
 	/* get the Controller level irq */
 	fsl_ifc_ctrl_dev->irq = irq_of_parse_and_map(dev->dev.of_node, 0);
 	if (fsl_ifc_ctrl_dev->irq == 0) {
-		dev_err(&dev->dev, "failed to get irq resource "
-							"for IFC\n");
+		dev_err(&dev->dev, "failed to get irq resource for IFC\n");
 		ret = -ENODEV;
 		goto err;
 	}
Signature · 1 line
2.17.1
author maintainer
#48 lore raw

Re: [PATCH v2 26/29] memory: fsl_ifc: Fix whitespace issues

Quoted 5 lines · Krzysztof Kozlowski

Fix minor whitespace and comment issues. Do not break message strings. No functional changes.

Quoted 7 lines

---

Changes since v1:
1. New patch

---
 drivers/memory/fsl_ifc.c | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)

Applied (and part of pull request to arm-soc).

Best regards,
Krzysztof

author maintainer
#49 lore raw

PATCH v2 27/29 memory: da8xx-ddrctl: Remove unused 'node' variable

In reply to Krzysztof Kozlowski

The variable 'node' is not used. Remove it to silence compile warning:

drivers/memory/da8xx-ddrctl.c: In function 'da8xx_ddrctl_probe':
drivers/memory/da8xx-ddrctl.c:105:22: warning: variable 'node' set but not used [-Wunused-but-set-variable]

---

Changes since v1:
1. New patch

---
 drivers/memory/da8xx-ddrctl.c | 2 --
 1 file changed, 2 deletions(-)
drivers/memory/da8xx-ddrctl.c +0 -2
index e8f9b3f461f5..872addd0ec60 100644
@@ -102,14 +102,12 @@ static int da8xx_ddrctl_probe(struct platform_device *pdev)
 {
 	const struct da8xx_ddrctl_config_knob *knob;
 	const struct da8xx_ddrctl_setting *setting;
-	struct device_node *node;
 	struct resource *res;
 	void __iomem *ddrctl;
 	struct device *dev;
 	u32 reg;
 
 	dev = &pdev->dev;
-	node = dev->of_node;
 
 	setting = da8xx_ddrctl_get_board_settings();
 	if (!setting) {
Signature · 1 line
2.17.1
author maintainer
#50 lore raw

Re: [PATCH v2 27/29] memory: da8xx-ddrctl: Remove unused 'node' variable

Quoted 7 lines · Krzysztof Kozlowski

The variable 'node' is not used. Remove it to silence compile warning:

drivers/memory/da8xx-ddrctl.c: In function 'da8xx_ddrctl_probe':
drivers/memory/da8xx-ddrctl.c:105:22: warning: variable 'node' set but not used [-Wunused-but-set-variable]

Quoted 7 lines

---

Changes since v1:
1. New patch

---
 drivers/memory/da8xx-ddrctl.c | 2 --
 1 file changed, 2 deletions(-)

Applied (and part of pull request to arm-soc).

Best regards,
Krzysztof

author maintainer
#51 lore raw

PATCH v2 28/29 memory: Describe the MEMORY Kconfig entry

In reply to Krzysztof Kozlowski

Write short description about the entire memory controllers section.

---

Changes since v1:
1. New patch

---
 drivers/memory/Kconfig | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/memory/Kconfig +6 -0
index c37752d5f26d..ec735794aeaf 100644
@@ -5,6 +5,12 @@
 
 menuconfig MEMORY
 	bool "Memory Controller drivers"
+	help
+	  This option allows to enable specific memory controller drivers,
+	  useful mostly on embedded systems.  These could be controllers
+	  for DRAM (SDR, DDR), ROM, SRAM and others.  The drivers features
+	  vary from memory tuning and frequency scaling to enabling
+	  access to attached peripherals through memory bus.
 
 if MEMORY
 
Signature · 1 line
2.17.1
author maintainer
#52 lore raw

PATCH v2 29/29 memory: samsung: exynos-srom: Describe the Kconfig entry

In reply to Krzysztof Kozlowski

Write short description about the Exynos SROM controller driver.

---

Changes since v1:
1. New patch

---
 drivers/memory/samsung/Kconfig | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/memory/samsung/Kconfig +7 -0
index 20a8406ce786..8e240f078afc 100644
@@ -23,5 +23,12 @@ config EXYNOS5422_DMC
 config EXYNOS_SROM
 	bool "Exynos SROM controller driver" if COMPILE_TEST
 	depends on (ARM && ARCH_EXYNOS) || (COMPILE_TEST && HAS_IOMEM)
+	help
+	  This adds driver for Samsung Exynos SoC SROM controller.  The driver
+	  in basic operation mode only saves and restores SROM registers
+	  during suspend.  If however appropriate device tree configuration
+	  is provided, the driver enables support for external memory
+	  or external devices.
+	  If unsure, say Y on devices with Samsung Exynos SocS.
 
 endif
Signature · 1 line
2.17.1
#53 lore raw
In reply to Krzysztof Kozlowski
Quoted 16 lines · Krzysztof Kozlowski

Dear All,

Changes since v1:
1. Few new patches,
2. Please see individual logs (per patch).

The drivers/memory directory contains generic code (of_memory.c) and a bunch of drivers. Changes to generic code were coming usually through different trees with the driver code.

Over last days, memory drivers grew in numbers but not necessarily in quality. They lacked compile testing and code cleanup. Also lacked maintainer.

Quoted 8 lines

I would be happy to take care about this part.

If there are no objections, I will collect the patches and push them through arm-soc maintainers.

Driver-specific changes in the patchset were only compile-tested. Tests are welcome. The generic code was tested on ARMv7 Exynos based boards with a exynos5422-dmc memory controller driver.

Looks all good. Can you send a pull request for the patches that you don't expect to need testing for, while you still wait for more feedback on the others?

As the merge window (and my vacation) is getting closer, I would like to have most of the patches for v5.9 queued up.

Arnd

Arnd

author maintainer
#54 lore raw
Quoted 26 lines · Arnd Bergmann
Quoted 16 lines · Krzysztof Kozlowski

Dear All,

Changes since v1:
1. Few new patches,
2. Please see individual logs (per patch).

The drivers/memory directory contains generic code (of_memory.c) and a bunch of drivers. Changes to generic code were coming usually through different trees with the driver code.

Over last days, memory drivers grew in numbers but not necessarily in quality. They lacked compile testing and code cleanup. Also lacked maintainer.

Quoted 8 lines

I would be happy to take care about this part.

If there are no objections, I will collect the patches and push them through arm-soc maintainers.

Driver-specific changes in the patchset were only compile-tested. Tests are welcome. The generic code was tested on ARMv7 Exynos based boards with a exynos5422-dmc memory controller driver.

Quoted 6 lines

Looks all good. Can you send a pull request for the patches that you don't expect to need testing for, while you still wait for more feedback on the others?

As the merge window (and my vacation) is getting closer, I would like to have most of the patches for v5.9 queued up.

Sure, I'll prepare a pull.

Thanks!

Best regards,
Krzysztof