All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/9] nvmem: patches (set 1) for 5.14
@ 2021-06-11  8:33 Srinivas Kandagatla
  2021-06-11  8:33 ` [PATCH 1/9] nvmem: sprd: Add missing MODULE_DEVICE_TABLE Srinivas Kandagatla
                   ` (9 more replies)
  0 siblings, 10 replies; 27+ messages in thread
From: Srinivas Kandagatla @ 2021-06-11  8:33 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel, Srinivas Kandagatla

Hi Greg,

Here are some nvmem patches for 5.14 which includes
- these are mostly minor fixes in provider drivers like missing
  MODULE_DEVICE_TABLE and improve comments
- fix in core for missing of_node_put.
- setting correct provider type in sunxi sid provider

thanks for you help,
srini

Bixuan Cui (1):
  nvmem: sprd: Add missing MODULE_DEVICE_TABLE

Christophe JAILLET (2):
  nvmem: sprd: Fix an error message
  nvmem: core: add a missing of_node_put

Douglas Anderson (2):
  nvmem: core: constify nvmem_cell_read_variable_common() return value
  nvmem: qfprom: Improve the comment about regulator setting

Rajendra Nayak (1):
  nvmem: qfprom: minor nit fixes

Samuel Holland (1):
  nvmem: sunxi_sid: Set type to OTP

Srinivas Kandagatla (1):
  nvmem: qcom-spmi-sdam: add missing MODULE_DEVICE_TABLE

Zou Wei (1):
  nvmem: sc27xx: Add missing MODULE_DEVICE_TABLE

 drivers/nvmem/core.c           | 19 +++++++++++--------
 drivers/nvmem/qcom-spmi-sdam.c |  1 +
 drivers/nvmem/qfprom.c         |  9 +++++----
 drivers/nvmem/sc27xx-efuse.c   |  1 +
 drivers/nvmem/sprd-efuse.c     |  3 ++-
 drivers/nvmem/sunxi_sid.c      |  1 +
 6 files changed, 21 insertions(+), 13 deletions(-)

-- 
2.21.0


^ permalink raw reply	[flat|nested] 27+ messages in thread

* [PATCH 1/9] nvmem: sprd: Add missing MODULE_DEVICE_TABLE
  2021-06-11  8:33 [PATCH 0/9] nvmem: patches (set 1) for 5.14 Srinivas Kandagatla
@ 2021-06-11  8:33 ` Srinivas Kandagatla
  2021-06-11  8:55   ` Greg KH
  2021-06-11  8:33 ` [PATCH 2/9] nvmem: qcom-spmi-sdam: add " Srinivas Kandagatla
                   ` (8 subsequent siblings)
  9 siblings, 1 reply; 27+ messages in thread
From: Srinivas Kandagatla @ 2021-06-11  8:33 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel, Bixuan Cui, Hulk Robot, Srinivas Kandagatla

From: Bixuan Cui <cuibixuan@huawei.com>

This patch adds missing MODULE_DEVICE_TABLE definition which generates
correct modalias for automatic loading of this driver when it is built
as an external module.

Fixes: 096030e7f449 ("nvmem: sprd: Add Spreadtrum SoCs eFuse support")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Bixuan Cui <cuibixuan@huawei.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
 drivers/nvmem/sprd-efuse.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/nvmem/sprd-efuse.c b/drivers/nvmem/sprd-efuse.c
index 59523245db8a..5d394559edf2 100644
--- a/drivers/nvmem/sprd-efuse.c
+++ b/drivers/nvmem/sprd-efuse.c
@@ -425,6 +425,7 @@ static const struct of_device_id sprd_efuse_of_match[] = {
 	{ .compatible = "sprd,ums312-efuse", .data = &ums312_data },
 	{ }
 };
+MODULE_DEVICE_TABLE(of, sprd_efuse_of_match);
 
 static struct platform_driver sprd_efuse_driver = {
 	.probe = sprd_efuse_probe,
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH 2/9] nvmem: qcom-spmi-sdam: add missing MODULE_DEVICE_TABLE
  2021-06-11  8:33 [PATCH 0/9] nvmem: patches (set 1) for 5.14 Srinivas Kandagatla
  2021-06-11  8:33 ` [PATCH 1/9] nvmem: sprd: Add missing MODULE_DEVICE_TABLE Srinivas Kandagatla
@ 2021-06-11  8:33 ` Srinivas Kandagatla
  2021-06-11  8:55   ` Greg KH
  2021-06-11  8:33 ` [PATCH 3/9] nvmem: sc27xx: Add " Srinivas Kandagatla
                   ` (7 subsequent siblings)
  9 siblings, 1 reply; 27+ messages in thread
From: Srinivas Kandagatla @ 2021-06-11  8:33 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel, Srinivas Kandagatla

Fix module loading by adding missing MODULE_DEVICE_TABLE.

Fixes: 40ce9798794f ("nvmem: add QTI SDAM driver")
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
 drivers/nvmem/qcom-spmi-sdam.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/nvmem/qcom-spmi-sdam.c b/drivers/nvmem/qcom-spmi-sdam.c
index 4fcb63507ecd..8499892044b7 100644
--- a/drivers/nvmem/qcom-spmi-sdam.c
+++ b/drivers/nvmem/qcom-spmi-sdam.c
@@ -166,6 +166,7 @@ static const struct of_device_id sdam_match_table[] = {
 	{ .compatible = "qcom,spmi-sdam" },
 	{},
 };
+MODULE_DEVICE_TABLE(of, sdam_match_table);
 
 static struct platform_driver sdam_driver = {
 	.driver = {
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH 3/9] nvmem: sc27xx: Add missing MODULE_DEVICE_TABLE
  2021-06-11  8:33 [PATCH 0/9] nvmem: patches (set 1) for 5.14 Srinivas Kandagatla
  2021-06-11  8:33 ` [PATCH 1/9] nvmem: sprd: Add missing MODULE_DEVICE_TABLE Srinivas Kandagatla
  2021-06-11  8:33 ` [PATCH 2/9] nvmem: qcom-spmi-sdam: add " Srinivas Kandagatla
@ 2021-06-11  8:33 ` Srinivas Kandagatla
  2021-06-11  8:55   ` Greg KH
  2021-06-11  8:33 ` [PATCH 4/9] nvmem: sprd: Fix an error message Srinivas Kandagatla
                   ` (6 subsequent siblings)
  9 siblings, 1 reply; 27+ messages in thread
From: Srinivas Kandagatla @ 2021-06-11  8:33 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel, Zou Wei, Hulk Robot, Srinivas Kandagatla

From: Zou Wei <zou_wei@huawei.com>

This patch adds missing MODULE_DEVICE_TABLE definition which generates
correct modalias for automatic loading of this driver when it is built
as an external module.

Fixes: 19c54468f222 ("nvmem: Add Spreadtrum SC27XX efuse support")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zou Wei <zou_wei@huawei.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
 drivers/nvmem/sc27xx-efuse.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/nvmem/sc27xx-efuse.c b/drivers/nvmem/sc27xx-efuse.c
index c825fc902d10..7f9bd2195b97 100644
--- a/drivers/nvmem/sc27xx-efuse.c
+++ b/drivers/nvmem/sc27xx-efuse.c
@@ -262,6 +262,7 @@ static const struct of_device_id sc27xx_efuse_of_match[] = {
 	{ .compatible = "sprd,sc2730-efuse", .data = &sc2730_edata},
 	{ }
 };
+MODULE_DEVICE_TABLE(of, sc27xx_efuse_of_match);
 
 static struct platform_driver sc27xx_efuse_driver = {
 	.probe = sc27xx_efuse_probe,
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH 4/9] nvmem: sprd: Fix an error message
  2021-06-11  8:33 [PATCH 0/9] nvmem: patches (set 1) for 5.14 Srinivas Kandagatla
                   ` (2 preceding siblings ...)
  2021-06-11  8:33 ` [PATCH 3/9] nvmem: sc27xx: Add " Srinivas Kandagatla
@ 2021-06-11  8:33 ` Srinivas Kandagatla
  2021-06-11  8:56   ` Greg KH
  2021-06-11  8:33 ` [PATCH 5/9] nvmem: core: add a missing of_node_put Srinivas Kandagatla
                   ` (5 subsequent siblings)
  9 siblings, 1 reply; 27+ messages in thread
From: Srinivas Kandagatla @ 2021-06-11  8:33 UTC (permalink / raw)
  To: gregkh
  Cc: linux-kernel, Christophe JAILLET, Chunyan Zhang, Srinivas Kandagatla

From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

'ret' is known to be 0 here.
The expected error status is stored in 'status', so use it instead.

Also change %d in %u, because status is an u32, not a int.

Fixes: 096030e7f449 ("nvmem: sprd: Add Spreadtrum SoCs eFuse support")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Acked-by: Chunyan Zhang <zhang.lyra@gmail.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
 drivers/nvmem/sprd-efuse.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nvmem/sprd-efuse.c b/drivers/nvmem/sprd-efuse.c
index 5d394559edf2..e3e721d4c205 100644
--- a/drivers/nvmem/sprd-efuse.c
+++ b/drivers/nvmem/sprd-efuse.c
@@ -234,7 +234,7 @@ static int sprd_efuse_raw_prog(struct sprd_efuse *efuse, u32 blk, bool doub,
 	status = readl(efuse->base + SPRD_EFUSE_ERR_FLAG);
 	if (status) {
 		dev_err(efuse->dev,
-			"write error status %d of block %d\n", ret, blk);
+			"write error status %u of block %d\n", status, blk);
 
 		writel(SPRD_EFUSE_ERR_CLR_MASK,
 		       efuse->base + SPRD_EFUSE_ERR_CLR);
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH 5/9] nvmem: core: add a missing of_node_put
  2021-06-11  8:33 [PATCH 0/9] nvmem: patches (set 1) for 5.14 Srinivas Kandagatla
                   ` (3 preceding siblings ...)
  2021-06-11  8:33 ` [PATCH 4/9] nvmem: sprd: Fix an error message Srinivas Kandagatla
@ 2021-06-11  8:33 ` Srinivas Kandagatla
  2021-06-11  8:57   ` Greg KH
  2021-06-11  8:33 ` [PATCH 6/9] nvmem: sunxi_sid: Set type to OTP Srinivas Kandagatla
                   ` (4 subsequent siblings)
  9 siblings, 1 reply; 27+ messages in thread
From: Srinivas Kandagatla @ 2021-06-11  8:33 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel, Christophe JAILLET, Srinivas Kandagatla

From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

'for_each_child_of_node' performs an of_node_get on each iteration, so a
return from the middle of the loop requires an of_node_put.

Fixes: e888d445ac33 ("nvmem: resolve cells from DT at registration time")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
 drivers/nvmem/core.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c
index bca671ff4e54..f9c9c9859919 100644
--- a/drivers/nvmem/core.c
+++ b/drivers/nvmem/core.c
@@ -686,15 +686,17 @@ static int nvmem_add_cells_from_of(struct nvmem_device *nvmem)
 			continue;
 		if (len < 2 * sizeof(u32)) {
 			dev_err(dev, "nvmem: invalid reg on %pOF\n", child);
+			of_node_put(child);
 			return -EINVAL;
 		}
 
 		cell = kzalloc(sizeof(*cell), GFP_KERNEL);
-		if (!cell)
+		if (!cell) {
+			of_node_put(child);
 			return -ENOMEM;
+		}
 
 		cell->nvmem = nvmem;
-		cell->np = of_node_get(child);
 		cell->offset = be32_to_cpup(addr++);
 		cell->bytes = be32_to_cpup(addr);
 		cell->name = kasprintf(GFP_KERNEL, "%pOFn", child);
@@ -715,11 +717,12 @@ static int nvmem_add_cells_from_of(struct nvmem_device *nvmem)
 				cell->name, nvmem->stride);
 			/* Cells already added will be freed later. */
 			kfree_const(cell->name);
-			of_node_put(cell->np);
 			kfree(cell);
+			of_node_put(child);
 			return -EINVAL;
 		}
 
+		cell->np = of_node_get(child);
 		nvmem_cell_add(cell);
 	}
 
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH 6/9] nvmem: sunxi_sid: Set type to OTP
  2021-06-11  8:33 [PATCH 0/9] nvmem: patches (set 1) for 5.14 Srinivas Kandagatla
                   ` (4 preceding siblings ...)
  2021-06-11  8:33 ` [PATCH 5/9] nvmem: core: add a missing of_node_put Srinivas Kandagatla
@ 2021-06-11  8:33 ` Srinivas Kandagatla
  2021-06-11  8:33 ` [PATCH 7/9] nvmem: qfprom: minor nit fixes Srinivas Kandagatla
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 27+ messages in thread
From: Srinivas Kandagatla @ 2021-06-11  8:33 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel, Samuel Holland, Chen-Yu Tsai, Srinivas Kandagatla

From: Samuel Holland <samuel@sholland.org>

This device currently reports an "Unknown" type in sysfs.
Since it is an eFuse hardware device, set its type to OTP.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Acked-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
 drivers/nvmem/sunxi_sid.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/nvmem/sunxi_sid.c b/drivers/nvmem/sunxi_sid.c
index e26ef1bbf198..275b9155e473 100644
--- a/drivers/nvmem/sunxi_sid.c
+++ b/drivers/nvmem/sunxi_sid.c
@@ -142,6 +142,7 @@ static int sunxi_sid_probe(struct platform_device *pdev)
 
 	nvmem_cfg->dev = dev;
 	nvmem_cfg->name = "sunxi-sid";
+	nvmem_cfg->type = NVMEM_TYPE_OTP;
 	nvmem_cfg->read_only = true;
 	nvmem_cfg->size = cfg->size;
 	nvmem_cfg->word_size = 1;
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH 7/9] nvmem: qfprom: minor nit fixes
  2021-06-11  8:33 [PATCH 0/9] nvmem: patches (set 1) for 5.14 Srinivas Kandagatla
                   ` (5 preceding siblings ...)
  2021-06-11  8:33 ` [PATCH 6/9] nvmem: sunxi_sid: Set type to OTP Srinivas Kandagatla
@ 2021-06-11  8:33 ` Srinivas Kandagatla
  2021-06-11  8:33 ` [PATCH 8/9] nvmem: core: constify nvmem_cell_read_variable_common() return value Srinivas Kandagatla
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 27+ messages in thread
From: Srinivas Kandagatla @ 2021-06-11  8:33 UTC (permalink / raw)
  To: gregkh
  Cc: linux-kernel, Rajendra Nayak, Douglas Anderson, Srinivas Kandagatla

From: Rajendra Nayak <rnayak@codeaurora.org>

Fix a missed newline, change an 'if' to 'else if' and update
a comment which is stale after the merge of '5a1bea2a: nvmem:
qfprom: Add support for fuseblowing on sc7280'

Signed-off-by: Rajendra Nayak <rnayak@codeaurora.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
 drivers/nvmem/qfprom.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/nvmem/qfprom.c b/drivers/nvmem/qfprom.c
index d6d3f24685a8..1ba666bcb900 100644
--- a/drivers/nvmem/qfprom.c
+++ b/drivers/nvmem/qfprom.c
@@ -122,6 +122,7 @@ static const struct qfprom_soc_compatible_data sc7280_qfprom = {
 	.keepout = sc7280_qfprom_keepout,
 	.nkeepout = ARRAY_SIZE(sc7280_qfprom_keepout)
 };
+
 /**
  * qfprom_disable_fuse_blowing() - Undo enabling of fuse blowing.
  * @priv: Our driver data.
@@ -195,7 +196,7 @@ static int qfprom_enable_fuse_blowing(const struct qfprom_priv *priv,
 	}
 
 	/*
-	 * Hardware requires 1.8V min for fuse blowing; this may be
+	 * Hardware requires a min voltage for fuse blowing; this may be
 	 * a rail shared do don't specify a max--regulator constraints
 	 * will handle.
 	 */
@@ -399,7 +400,7 @@ static int qfprom_probe(struct platform_device *pdev)
 
 		if (major_version == 7 && minor_version == 8)
 			priv->soc_data = &qfprom_7_8_data;
-		if (major_version == 7 && minor_version == 15)
+		else if (major_version == 7 && minor_version == 15)
 			priv->soc_data = &qfprom_7_15_data;
 
 		priv->vcc = devm_regulator_get(&pdev->dev, "vcc");
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH 8/9] nvmem: core: constify nvmem_cell_read_variable_common() return value
  2021-06-11  8:33 [PATCH 0/9] nvmem: patches (set 1) for 5.14 Srinivas Kandagatla
                   ` (6 preceding siblings ...)
  2021-06-11  8:33 ` [PATCH 7/9] nvmem: qfprom: minor nit fixes Srinivas Kandagatla
@ 2021-06-11  8:33 ` Srinivas Kandagatla
  2021-06-11  8:33 ` [PATCH 9/9] nvmem: qfprom: Improve the comment about regulator setting Srinivas Kandagatla
  2021-06-11  8:58 ` [PATCH 0/9] nvmem: patches (set 1) for 5.14 Greg KH
  9 siblings, 0 replies; 27+ messages in thread
From: Srinivas Kandagatla @ 2021-06-11  8:33 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel, Douglas Anderson, Stephen Boyd, Srinivas Kandagatla

From: Douglas Anderson <dianders@chromium.org>

The caller doesn't modify the memory pointed to by the pointer so it
can be const.

Suggested-by: Stephen Boyd <swboyd@chromium.org>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
 drivers/nvmem/core.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c
index f9c9c9859919..4868aa876e1b 100644
--- a/drivers/nvmem/core.c
+++ b/drivers/nvmem/core.c
@@ -1609,9 +1609,9 @@ int nvmem_cell_read_u64(struct device *dev, const char *cell_id, u64 *val)
 }
 EXPORT_SYMBOL_GPL(nvmem_cell_read_u64);
 
-static void *nvmem_cell_read_variable_common(struct device *dev,
-					     const char *cell_id,
-					     size_t max_len, size_t *len)
+static const void *nvmem_cell_read_variable_common(struct device *dev,
+						   const char *cell_id,
+						   size_t max_len, size_t *len)
 {
 	struct nvmem_cell *cell;
 	int nbits;
@@ -1655,7 +1655,7 @@ int nvmem_cell_read_variable_le_u32(struct device *dev, const char *cell_id,
 				    u32 *val)
 {
 	size_t len;
-	u8 *buf;
+	const u8 *buf;
 	int i;
 
 	buf = nvmem_cell_read_variable_common(dev, cell_id, sizeof(*val), &len);
@@ -1686,7 +1686,7 @@ int nvmem_cell_read_variable_le_u64(struct device *dev, const char *cell_id,
 				    u64 *val)
 {
 	size_t len;
-	u8 *buf;
+	const u8 *buf;
 	int i;
 
 	buf = nvmem_cell_read_variable_common(dev, cell_id, sizeof(*val), &len);
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* [PATCH 9/9] nvmem: qfprom: Improve the comment about regulator setting
  2021-06-11  8:33 [PATCH 0/9] nvmem: patches (set 1) for 5.14 Srinivas Kandagatla
                   ` (7 preceding siblings ...)
  2021-06-11  8:33 ` [PATCH 8/9] nvmem: core: constify nvmem_cell_read_variable_common() return value Srinivas Kandagatla
@ 2021-06-11  8:33 ` Srinivas Kandagatla
  2021-06-11  8:58 ` [PATCH 0/9] nvmem: patches (set 1) for 5.14 Greg KH
  9 siblings, 0 replies; 27+ messages in thread
From: Srinivas Kandagatla @ 2021-06-11  8:33 UTC (permalink / raw)
  To: gregkh
  Cc: linux-kernel, Douglas Anderson, Joe Perches, Stephen Boyd,
	Srinivas Kandagatla

From: Douglas Anderson <dianders@chromium.org>

In review feedback Joe Perches found the existing comment
confusing. Let's use something based on the wording proposed by Joe.

Suggested-by: Joe Perches <joe@perches.com>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
 drivers/nvmem/qfprom.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/nvmem/qfprom.c b/drivers/nvmem/qfprom.c
index 1ba666bcb900..81fbad5e939d 100644
--- a/drivers/nvmem/qfprom.c
+++ b/drivers/nvmem/qfprom.c
@@ -196,9 +196,9 @@ static int qfprom_enable_fuse_blowing(const struct qfprom_priv *priv,
 	}
 
 	/*
-	 * Hardware requires a min voltage for fuse blowing; this may be
-	 * a rail shared do don't specify a max--regulator constraints
-	 * will handle.
+	 * Hardware requires a minimum voltage for fuse blowing.
+	 * This may be a shared rail so don't specify a maximum.
+	 * Regulator constraints will cap to the actual maximum.
 	 */
 	ret = regulator_set_voltage(priv->vcc, qfprom_blow_uV, INT_MAX);
 	if (ret) {
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 27+ messages in thread

* Re: [PATCH 1/9] nvmem: sprd: Add missing MODULE_DEVICE_TABLE
  2021-06-11  8:33 ` [PATCH 1/9] nvmem: sprd: Add missing MODULE_DEVICE_TABLE Srinivas Kandagatla
@ 2021-06-11  8:55   ` Greg KH
  2021-06-11  9:09     ` Srinivas Kandagatla
  0 siblings, 1 reply; 27+ messages in thread
From: Greg KH @ 2021-06-11  8:55 UTC (permalink / raw)
  To: Srinivas Kandagatla; +Cc: linux-kernel, Bixuan Cui, Hulk Robot

On Fri, Jun 11, 2021 at 09:33:40AM +0100, Srinivas Kandagatla wrote:
> From: Bixuan Cui <cuibixuan@huawei.com>
> 
> This patch adds missing MODULE_DEVICE_TABLE definition which generates
> correct modalias for automatic loading of this driver when it is built
> as an external module.
> 
> Fixes: 096030e7f449 ("nvmem: sprd: Add Spreadtrum SoCs eFuse support")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Bixuan Cui <cuibixuan@huawei.com>
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> ---
>  drivers/nvmem/sprd-efuse.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/nvmem/sprd-efuse.c b/drivers/nvmem/sprd-efuse.c
> index 59523245db8a..5d394559edf2 100644
> --- a/drivers/nvmem/sprd-efuse.c
> +++ b/drivers/nvmem/sprd-efuse.c
> @@ -425,6 +425,7 @@ static const struct of_device_id sprd_efuse_of_match[] = {
>  	{ .compatible = "sprd,ums312-efuse", .data = &ums312_data },
>  	{ }
>  };
> +MODULE_DEVICE_TABLE(of, sprd_efuse_of_match);

Why is this needed?  Do you have reports of this module not being
properly auto-loaded?

I have been rejecting these types of patches from the "Hulk Robot" as
they were just blindly going through the tree and not determining if
this actually is a thing that needed to be fixed.

Also, if it is a real fix, shouldn't it also go to the stable kernel
trees?  If so, you didn't mark it as such :(

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 2/9] nvmem: qcom-spmi-sdam: add missing MODULE_DEVICE_TABLE
  2021-06-11  8:33 ` [PATCH 2/9] nvmem: qcom-spmi-sdam: add " Srinivas Kandagatla
@ 2021-06-11  8:55   ` Greg KH
  0 siblings, 0 replies; 27+ messages in thread
From: Greg KH @ 2021-06-11  8:55 UTC (permalink / raw)
  To: Srinivas Kandagatla; +Cc: linux-kernel

On Fri, Jun 11, 2021 at 09:33:41AM +0100, Srinivas Kandagatla wrote:
> Fix module loading by adding missing MODULE_DEVICE_TABLE.
> 
> Fixes: 40ce9798794f ("nvmem: add QTI SDAM driver")
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> ---
>  drivers/nvmem/qcom-spmi-sdam.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/nvmem/qcom-spmi-sdam.c b/drivers/nvmem/qcom-spmi-sdam.c
> index 4fcb63507ecd..8499892044b7 100644
> --- a/drivers/nvmem/qcom-spmi-sdam.c
> +++ b/drivers/nvmem/qcom-spmi-sdam.c
> @@ -166,6 +166,7 @@ static const struct of_device_id sdam_match_table[] = {
>  	{ .compatible = "qcom,spmi-sdam" },
>  	{},
>  };
> +MODULE_DEVICE_TABLE(of, sdam_match_table);
>  
>  static struct platform_driver sdam_driver = {
>  	.driver = {
> -- 
> 2.21.0
> 

Same comment as patch 1/9

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 3/9] nvmem: sc27xx: Add missing MODULE_DEVICE_TABLE
  2021-06-11  8:33 ` [PATCH 3/9] nvmem: sc27xx: Add " Srinivas Kandagatla
@ 2021-06-11  8:55   ` Greg KH
  0 siblings, 0 replies; 27+ messages in thread
From: Greg KH @ 2021-06-11  8:55 UTC (permalink / raw)
  To: Srinivas Kandagatla; +Cc: linux-kernel, Zou Wei, Hulk Robot

On Fri, Jun 11, 2021 at 09:33:42AM +0100, Srinivas Kandagatla wrote:
> From: Zou Wei <zou_wei@huawei.com>
> 
> This patch adds missing MODULE_DEVICE_TABLE definition which generates
> correct modalias for automatic loading of this driver when it is built
> as an external module.
> 
> Fixes: 19c54468f222 ("nvmem: Add Spreadtrum SC27XX efuse support")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Zou Wei <zou_wei@huawei.com>
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> ---
>  drivers/nvmem/sc27xx-efuse.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/nvmem/sc27xx-efuse.c b/drivers/nvmem/sc27xx-efuse.c
> index c825fc902d10..7f9bd2195b97 100644
> --- a/drivers/nvmem/sc27xx-efuse.c
> +++ b/drivers/nvmem/sc27xx-efuse.c
> @@ -262,6 +262,7 @@ static const struct of_device_id sc27xx_efuse_of_match[] = {
>  	{ .compatible = "sprd,sc2730-efuse", .data = &sc2730_edata},
>  	{ }
>  };
> +MODULE_DEVICE_TABLE(of, sc27xx_efuse_of_match);
>  
>  static struct platform_driver sc27xx_efuse_driver = {
>  	.probe = sc27xx_efuse_probe,
> -- 
> 2.21.0
> 

Same comment as patch 1/9

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 4/9] nvmem: sprd: Fix an error message
  2021-06-11  8:33 ` [PATCH 4/9] nvmem: sprd: Fix an error message Srinivas Kandagatla
@ 2021-06-11  8:56   ` Greg KH
  2021-06-11  9:05     ` Srinivas Kandagatla
  0 siblings, 1 reply; 27+ messages in thread
From: Greg KH @ 2021-06-11  8:56 UTC (permalink / raw)
  To: Srinivas Kandagatla; +Cc: linux-kernel, Christophe JAILLET, Chunyan Zhang

On Fri, Jun 11, 2021 at 09:33:43AM +0100, Srinivas Kandagatla wrote:
> From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> 
> 'ret' is known to be 0 here.
> The expected error status is stored in 'status', so use it instead.
> 
> Also change %d in %u, because status is an u32, not a int.
> 
> Fixes: 096030e7f449 ("nvmem: sprd: Add Spreadtrum SoCs eFuse support")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> Acked-by: Chunyan Zhang <zhang.lyra@gmail.com>
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> ---
>  drivers/nvmem/sprd-efuse.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/nvmem/sprd-efuse.c b/drivers/nvmem/sprd-efuse.c
> index 5d394559edf2..e3e721d4c205 100644
> --- a/drivers/nvmem/sprd-efuse.c
> +++ b/drivers/nvmem/sprd-efuse.c
> @@ -234,7 +234,7 @@ static int sprd_efuse_raw_prog(struct sprd_efuse *efuse, u32 blk, bool doub,
>  	status = readl(efuse->base + SPRD_EFUSE_ERR_FLAG);
>  	if (status) {
>  		dev_err(efuse->dev,
> -			"write error status %d of block %d\n", ret, blk);
> +			"write error status %u of block %d\n", status, blk);

Shouldn't this be %pe and not %u?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 5/9] nvmem: core: add a missing of_node_put
  2021-06-11  8:33 ` [PATCH 5/9] nvmem: core: add a missing of_node_put Srinivas Kandagatla
@ 2021-06-11  8:57   ` Greg KH
  2021-06-11  9:10     ` Srinivas Kandagatla
  0 siblings, 1 reply; 27+ messages in thread
From: Greg KH @ 2021-06-11  8:57 UTC (permalink / raw)
  To: Srinivas Kandagatla; +Cc: linux-kernel, Christophe JAILLET

On Fri, Jun 11, 2021 at 09:33:44AM +0100, Srinivas Kandagatla wrote:
> From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> 
> 'for_each_child_of_node' performs an of_node_get on each iteration, so a
> return from the middle of the loop requires an of_node_put.
> 
> Fixes: e888d445ac33 ("nvmem: resolve cells from DT at registration time")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> ---
>  drivers/nvmem/core.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)

Looks like this needs to go to the stable kernel trees, so when your
resend this series, please add the proper "cc: stable" line to the
signed-off-by area as is documented.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 0/9] nvmem: patches (set 1) for 5.14
  2021-06-11  8:33 [PATCH 0/9] nvmem: patches (set 1) for 5.14 Srinivas Kandagatla
                   ` (8 preceding siblings ...)
  2021-06-11  8:33 ` [PATCH 9/9] nvmem: qfprom: Improve the comment about regulator setting Srinivas Kandagatla
@ 2021-06-11  8:58 ` Greg KH
  9 siblings, 0 replies; 27+ messages in thread
From: Greg KH @ 2021-06-11  8:58 UTC (permalink / raw)
  To: Srinivas Kandagatla; +Cc: linux-kernel

On Fri, Jun 11, 2021 at 09:33:39AM +0100, Srinivas Kandagatla wrote:
> Hi Greg,
> 
> Here are some nvmem patches for 5.14 which includes
> - these are mostly minor fixes in provider drivers like missing
>   MODULE_DEVICE_TABLE and improve comments
> - fix in core for missing of_node_put.
> - setting correct provider type in sunxi sid provider

I took the last 4 patches of this series.  See the review comments on
the first 5 for what should be done with them.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 4/9] nvmem: sprd: Fix an error message
  2021-06-11  8:56   ` Greg KH
@ 2021-06-11  9:05     ` Srinivas Kandagatla
  2021-06-11  9:17       ` Greg KH
  0 siblings, 1 reply; 27+ messages in thread
From: Srinivas Kandagatla @ 2021-06-11  9:05 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-kernel, Christophe JAILLET, Chunyan Zhang



On 11/06/2021 09:56, Greg KH wrote:
> On Fri, Jun 11, 2021 at 09:33:43AM +0100, Srinivas Kandagatla wrote:
>> From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
>>
>> 'ret' is known to be 0 here.
>> The expected error status is stored in 'status', so use it instead.
>>
>> Also change %d in %u, because status is an u32, not a int.
>>
>> Fixes: 096030e7f449 ("nvmem: sprd: Add Spreadtrum SoCs eFuse support")
>> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
>> Acked-by: Chunyan Zhang <zhang.lyra@gmail.com>
>> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
>> ---
>>   drivers/nvmem/sprd-efuse.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/nvmem/sprd-efuse.c b/drivers/nvmem/sprd-efuse.c
>> index 5d394559edf2..e3e721d4c205 100644
>> --- a/drivers/nvmem/sprd-efuse.c
>> +++ b/drivers/nvmem/sprd-efuse.c
>> @@ -234,7 +234,7 @@ static int sprd_efuse_raw_prog(struct sprd_efuse *efuse, u32 blk, bool doub,
>>   	status = readl(efuse->base + SPRD_EFUSE_ERR_FLAG);
>>   	if (status) {
>>   		dev_err(efuse->dev,
>> -			"write error status %d of block %d\n", ret, blk);
>> +			"write error status %u of block %d\n", status, blk);
> 
> Shouldn't this be %pe and not %u?

This is not error pointer its status value read back from a register.

I think %u should be good here.

--srini
> 
> thanks,
> 
> greg k-h
> 

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 1/9] nvmem: sprd: Add missing MODULE_DEVICE_TABLE
  2021-06-11  8:55   ` Greg KH
@ 2021-06-11  9:09     ` Srinivas Kandagatla
  0 siblings, 0 replies; 27+ messages in thread
From: Srinivas Kandagatla @ 2021-06-11  9:09 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-kernel, Bixuan Cui, Hulk Robot



On 11/06/2021 09:55, Greg KH wrote:
> On Fri, Jun 11, 2021 at 09:33:40AM +0100, Srinivas Kandagatla wrote:
>> From: Bixuan Cui <cuibixuan@huawei.com>
>>
>> This patch adds missing MODULE_DEVICE_TABLE definition which generates
>> correct modalias for automatic loading of this driver when it is built
>> as an external module.
>>
>> Fixes: 096030e7f449 ("nvmem: sprd: Add Spreadtrum SoCs eFuse support")
>> Reported-by: Hulk Robot <hulkci@huawei.com>
>> Signed-off-by: Bixuan Cui <cuibixuan@huawei.com>
>> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
>> ---
>>   drivers/nvmem/sprd-efuse.c | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/nvmem/sprd-efuse.c b/drivers/nvmem/sprd-efuse.c
>> index 59523245db8a..5d394559edf2 100644
>> --- a/drivers/nvmem/sprd-efuse.c
>> +++ b/drivers/nvmem/sprd-efuse.c
>> @@ -425,6 +425,7 @@ static const struct of_device_id sprd_efuse_of_match[] = {
>>   	{ .compatible = "sprd,ums312-efuse", .data = &ums312_data },
>>   	{ }
>>   };
>> +MODULE_DEVICE_TABLE(of, sprd_efuse_of_match);
> 
> Why is this needed?  Do you have reports of this module not being
> properly auto-loaded?
> 
> I have been rejecting these types of patches from the "Hulk Robot" as
> they were just blindly going through the tree and not determining if
> this actually is a thing that needed to be fixed.

I will keep that in mind and I guess we can drop these 3 patches for now 
until someone reports the real issue.

--srini

> 
> Also, if it is a real fix, shouldn't it also go to the stable kernel
> trees?  If so, you didn't mark it as such :(
> 
> thanks,
> 
> greg k-h
> 

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 5/9] nvmem: core: add a missing of_node_put
  2021-06-11  8:57   ` Greg KH
@ 2021-06-11  9:10     ` Srinivas Kandagatla
  0 siblings, 0 replies; 27+ messages in thread
From: Srinivas Kandagatla @ 2021-06-11  9:10 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-kernel, Christophe JAILLET



On 11/06/2021 09:57, Greg KH wrote:
> On Fri, Jun 11, 2021 at 09:33:44AM +0100, Srinivas Kandagatla wrote:
>> From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
>>
>> 'for_each_child_of_node' performs an of_node_get on each iteration, so a
>> return from the middle of the loop requires an of_node_put.
>>
>> Fixes: e888d445ac33 ("nvmem: resolve cells from DT at registration time")
>> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
>> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
>> ---
>>   drivers/nvmem/core.c | 9 ++++++---
>>   1 file changed, 6 insertions(+), 3 deletions(-)
> 
> Looks like this needs to go to the stable kernel trees, so when your
> resend this series, please add the proper "cc: stable" line to the
> signed-off-by area as is documented.

I agree, I missed that, will resend this one out with cc: Stable


--srini
> 
> thanks,
> 
> greg k-h
> 

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 4/9] nvmem: sprd: Fix an error message
  2021-06-11  9:05     ` Srinivas Kandagatla
@ 2021-06-11  9:17       ` Greg KH
  2021-06-11  9:45         ` Greg KH
  0 siblings, 1 reply; 27+ messages in thread
From: Greg KH @ 2021-06-11  9:17 UTC (permalink / raw)
  To: Srinivas Kandagatla; +Cc: linux-kernel, Christophe JAILLET, Chunyan Zhang

On Fri, Jun 11, 2021 at 10:05:40AM +0100, Srinivas Kandagatla wrote:
> 
> 
> On 11/06/2021 09:56, Greg KH wrote:
> > On Fri, Jun 11, 2021 at 09:33:43AM +0100, Srinivas Kandagatla wrote:
> > > From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> > > 
> > > 'ret' is known to be 0 here.
> > > The expected error status is stored in 'status', so use it instead.
> > > 
> > > Also change %d in %u, because status is an u32, not a int.
> > > 
> > > Fixes: 096030e7f449 ("nvmem: sprd: Add Spreadtrum SoCs eFuse support")
> > > Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> > > Acked-by: Chunyan Zhang <zhang.lyra@gmail.com>
> > > Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> > > ---
> > >   drivers/nvmem/sprd-efuse.c | 2 +-
> > >   1 file changed, 1 insertion(+), 1 deletion(-)
> > > 
> > > diff --git a/drivers/nvmem/sprd-efuse.c b/drivers/nvmem/sprd-efuse.c
> > > index 5d394559edf2..e3e721d4c205 100644
> > > --- a/drivers/nvmem/sprd-efuse.c
> > > +++ b/drivers/nvmem/sprd-efuse.c
> > > @@ -234,7 +234,7 @@ static int sprd_efuse_raw_prog(struct sprd_efuse *efuse, u32 blk, bool doub,
> > >   	status = readl(efuse->base + SPRD_EFUSE_ERR_FLAG);
> > >   	if (status) {
> > >   		dev_err(efuse->dev,
> > > -			"write error status %d of block %d\n", ret, blk);
> > > +			"write error status %u of block %d\n", status, blk);
> > 
> > Shouldn't this be %pe and not %u?
> 
> This is not error pointer its status value read back from a register.
> 
> I think %u should be good here.

Argh, you are right, my fault.  For some reason I thought this worked
for integers as well.  Don't we have such a printk modifier somewhere to
turn error values into strings?  Let me dig...


thanks

greg k-h

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 4/9] nvmem: sprd: Fix an error message
  2021-06-11  9:17       ` Greg KH
@ 2021-06-11  9:45         ` Greg KH
  2021-06-11  9:48           ` Greg KH
                             ` (2 more replies)
  0 siblings, 3 replies; 27+ messages in thread
From: Greg KH @ 2021-06-11  9:45 UTC (permalink / raw)
  To: Srinivas Kandagatla; +Cc: linux-kernel, Christophe JAILLET, Chunyan Zhang

On Fri, Jun 11, 2021 at 11:17:50AM +0200, Greg KH wrote:
> On Fri, Jun 11, 2021 at 10:05:40AM +0100, Srinivas Kandagatla wrote:
> > 
> > 
> > On 11/06/2021 09:56, Greg KH wrote:
> > > On Fri, Jun 11, 2021 at 09:33:43AM +0100, Srinivas Kandagatla wrote:
> > > > From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> > > > 
> > > > 'ret' is known to be 0 here.
> > > > The expected error status is stored in 'status', so use it instead.
> > > > 
> > > > Also change %d in %u, because status is an u32, not a int.
> > > > 
> > > > Fixes: 096030e7f449 ("nvmem: sprd: Add Spreadtrum SoCs eFuse support")
> > > > Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> > > > Acked-by: Chunyan Zhang <zhang.lyra@gmail.com>
> > > > Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> > > > ---
> > > >   drivers/nvmem/sprd-efuse.c | 2 +-
> > > >   1 file changed, 1 insertion(+), 1 deletion(-)
> > > > 
> > > > diff --git a/drivers/nvmem/sprd-efuse.c b/drivers/nvmem/sprd-efuse.c
> > > > index 5d394559edf2..e3e721d4c205 100644
> > > > --- a/drivers/nvmem/sprd-efuse.c
> > > > +++ b/drivers/nvmem/sprd-efuse.c
> > > > @@ -234,7 +234,7 @@ static int sprd_efuse_raw_prog(struct sprd_efuse *efuse, u32 blk, bool doub,
> > > >   	status = readl(efuse->base + SPRD_EFUSE_ERR_FLAG);
> > > >   	if (status) {
> > > >   		dev_err(efuse->dev,
> > > > -			"write error status %d of block %d\n", ret, blk);
> > > > +			"write error status %u of block %d\n", status, blk);
> > > 
> > > Shouldn't this be %pe and not %u?
> > 
> > This is not error pointer its status value read back from a register.
> > 
> > I think %u should be good here.
> 
> Argh, you are right, my fault.  For some reason I thought this worked
> for integers as well.  Don't we have such a printk modifier somewhere to
> turn error values into strings?  Let me dig...

Ah, errname() will do it.

Looks like no one uses it, so nevermind, sorry for the noise.  I'll go
apply this one now.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 4/9] nvmem: sprd: Fix an error message
  2021-06-11  9:45         ` Greg KH
@ 2021-06-11  9:48           ` Greg KH
  2021-06-11 10:17             ` Srinivas Kandagatla
  2021-06-11 10:09           ` Srinivas Kandagatla
  2021-06-11 10:10           ` Marion & Christophe JAILLET
  2 siblings, 1 reply; 27+ messages in thread
From: Greg KH @ 2021-06-11  9:48 UTC (permalink / raw)
  To: Srinivas Kandagatla; +Cc: linux-kernel, Christophe JAILLET, Chunyan Zhang

On Fri, Jun 11, 2021 at 11:45:25AM +0200, Greg KH wrote:
> On Fri, Jun 11, 2021 at 11:17:50AM +0200, Greg KH wrote:
> > On Fri, Jun 11, 2021 at 10:05:40AM +0100, Srinivas Kandagatla wrote:
> > > 
> > > 
> > > On 11/06/2021 09:56, Greg KH wrote:
> > > > On Fri, Jun 11, 2021 at 09:33:43AM +0100, Srinivas Kandagatla wrote:
> > > > > From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> > > > > 
> > > > > 'ret' is known to be 0 here.
> > > > > The expected error status is stored in 'status', so use it instead.
> > > > > 
> > > > > Also change %d in %u, because status is an u32, not a int.
> > > > > 
> > > > > Fixes: 096030e7f449 ("nvmem: sprd: Add Spreadtrum SoCs eFuse support")
> > > > > Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> > > > > Acked-by: Chunyan Zhang <zhang.lyra@gmail.com>
> > > > > Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> > > > > ---
> > > > >   drivers/nvmem/sprd-efuse.c | 2 +-
> > > > >   1 file changed, 1 insertion(+), 1 deletion(-)
> > > > > 
> > > > > diff --git a/drivers/nvmem/sprd-efuse.c b/drivers/nvmem/sprd-efuse.c
> > > > > index 5d394559edf2..e3e721d4c205 100644
> > > > > --- a/drivers/nvmem/sprd-efuse.c
> > > > > +++ b/drivers/nvmem/sprd-efuse.c
> > > > > @@ -234,7 +234,7 @@ static int sprd_efuse_raw_prog(struct sprd_efuse *efuse, u32 blk, bool doub,
> > > > >   	status = readl(efuse->base + SPRD_EFUSE_ERR_FLAG);
> > > > >   	if (status) {
> > > > >   		dev_err(efuse->dev,
> > > > > -			"write error status %d of block %d\n", ret, blk);
> > > > > +			"write error status %u of block %d\n", status, blk);
> > > > 
> > > > Shouldn't this be %pe and not %u?
> > > 
> > > This is not error pointer its status value read back from a register.
> > > 
> > > I think %u should be good here.
> > 
> > Argh, you are right, my fault.  For some reason I thought this worked
> > for integers as well.  Don't we have such a printk modifier somewhere to
> > turn error values into strings?  Let me dig...
> 
> Ah, errname() will do it.
> 
> Looks like no one uses it, so nevermind, sorry for the noise.  I'll go
> apply this one now.

Does not apply to my tree :(


^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 4/9] nvmem: sprd: Fix an error message
  2021-06-11  9:45         ` Greg KH
  2021-06-11  9:48           ` Greg KH
@ 2021-06-11 10:09           ` Srinivas Kandagatla
  2021-06-11 10:10           ` Marion & Christophe JAILLET
  2 siblings, 0 replies; 27+ messages in thread
From: Srinivas Kandagatla @ 2021-06-11 10:09 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-kernel, Christophe JAILLET, Chunyan Zhang



On 11/06/2021 10:45, Greg KH wrote:
> On Fri, Jun 11, 2021 at 11:17:50AM +0200, Greg KH wrote:
>> On Fri, Jun 11, 2021 at 10:05:40AM +0100, Srinivas Kandagatla wrote:
>>>
>>>
>>> On 11/06/2021 09:56, Greg KH wrote:
>>>> On Fri, Jun 11, 2021 at 09:33:43AM +0100, Srinivas Kandagatla wrote:
>>>>> From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
>>>>>
>>>>> 'ret' is known to be 0 here.
>>>>> The expected error status is stored in 'status', so use it instead.
>>>>>
>>>>> Also change %d in %u, because status is an u32, not a int.
>>>>>
>>>>> Fixes: 096030e7f449 ("nvmem: sprd: Add Spreadtrum SoCs eFuse support")
>>>>> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
>>>>> Acked-by: Chunyan Zhang <zhang.lyra@gmail.com>
>>>>> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
>>>>> ---
>>>>>    drivers/nvmem/sprd-efuse.c | 2 +-
>>>>>    1 file changed, 1 insertion(+), 1 deletion(-)
>>>>>
>>>>> diff --git a/drivers/nvmem/sprd-efuse.c b/drivers/nvmem/sprd-efuse.c
>>>>> index 5d394559edf2..e3e721d4c205 100644
>>>>> --- a/drivers/nvmem/sprd-efuse.c
>>>>> +++ b/drivers/nvmem/sprd-efuse.c
>>>>> @@ -234,7 +234,7 @@ static int sprd_efuse_raw_prog(struct sprd_efuse *efuse, u32 blk, bool doub,
>>>>>    	status = readl(efuse->base + SPRD_EFUSE_ERR_FLAG);
>>>>>    	if (status) {
>>>>>    		dev_err(efuse->dev,
>>>>> -			"write error status %d of block %d\n", ret, blk);
>>>>> +			"write error status %u of block %d\n", status, blk);
>>>>
>>>> Shouldn't this be %pe and not %u?
>>>
>>> This is not error pointer its status value read back from a register.
>>>
>>> I think %u should be good here.
>>
>> Argh, you are right, my fault.  For some reason I thought this worked
>> for integers as well.  Don't we have such a printk modifier somewhere to
>> turn error values into strings?  Let me dig...
> 
> Ah, errname() will do it.
> 
Thanks for looking this up,
looks like errname is more of stringfy rather than translating it in to 
proper description like strerror() does.

It would do something like:
  errname(EIO) -> "EIO"
  errname(-EIO) -> "-EIO"


> Looks like no one uses it, so nevermind, sorry for the noise.  I'll go
> apply this one now.


Noticed that It does not apply to your tree, I will resend it along with 
other patch.


thanks,
srini
> 
> thanks,
> 
> greg k-h
> 

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 4/9] nvmem: sprd: Fix an error message
  2021-06-11  9:45         ` Greg KH
  2021-06-11  9:48           ` Greg KH
  2021-06-11 10:09           ` Srinivas Kandagatla
@ 2021-06-11 10:10           ` Marion & Christophe JAILLET
  2021-06-11 10:17             ` Greg KH
  2 siblings, 1 reply; 27+ messages in thread
From: Marion & Christophe JAILLET @ 2021-06-11 10:10 UTC (permalink / raw)
  To: Greg KH, Srinivas Kandagatla, Dan Carpenter; +Cc: linux-kernel, Chunyan Zhang


Le 11/06/2021 à 11:45, Greg KH a écrit :
> On Fri, Jun 11, 2021 at 11:17:50AM +0200, Greg KH wrote:
>> On Fri, Jun 11, 2021 at 10:05:40AM +0100, Srinivas Kandagatla wrote:
>>>
>>> On 11/06/2021 09:56, Greg KH wrote:
>>>> On Fri, Jun 11, 2021 at 09:33:43AM +0100, Srinivas Kandagatla wrote:
>>>>> From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
>>>>>
>>>>> 'ret' is known to be 0 here.
>>>>> The expected error status is stored in 'status', so use it instead.
>>>>>
>>>>> Also change %d in %u, because status is an u32, not a int.
>>>>>
>>>>> Fixes: 096030e7f449 ("nvmem: sprd: Add Spreadtrum SoCs eFuse support")
>>>>> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
>>>>> Acked-by: Chunyan Zhang <zhang.lyra@gmail.com>
>>>>> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
>>>>> ---
>>>>>    drivers/nvmem/sprd-efuse.c | 2 +-
>>>>>    1 file changed, 1 insertion(+), 1 deletion(-)
>>>>>
>>>>> diff --git a/drivers/nvmem/sprd-efuse.c b/drivers/nvmem/sprd-efuse.c
>>>>> index 5d394559edf2..e3e721d4c205 100644
>>>>> --- a/drivers/nvmem/sprd-efuse.c
>>>>> +++ b/drivers/nvmem/sprd-efuse.c
>>>>> @@ -234,7 +234,7 @@ static int sprd_efuse_raw_prog(struct sprd_efuse *efuse, u32 blk, bool doub,
>>>>>    	status = readl(efuse->base + SPRD_EFUSE_ERR_FLAG);
>>>>>    	if (status) {
>>>>>    		dev_err(efuse->dev,
>>>>> -			"write error status %d of block %d\n", ret, blk);
>>>>> +			"write error status %u of block %d\n", status, blk);
>>>> Shouldn't this be %pe and not %u?
>>> This is not error pointer its status value read back from a register.
>>>
>>> I think %u should be good here.
>> Argh, you are right, my fault.  For some reason I thought this worked
>> for integers as well.  Don't we have such a printk modifier somewhere to
>> turn error values into strings?  Let me dig...
> Ah, errname() will do it.
>
> Looks like no one uses it, so nevermind, sorry for the noise.  I'll go
> apply this one now.
>
> thanks,
>
> greg k-h

Hi,

errname() depends on CONFIG_SYMBOLIC_ERRNAME.
Is this widely used?
If not, using errname() directly would loose the error code.
(note that %pe already deals with it)

Dan Capenter already spoke about a potential %e extension, but I don't 
think anyone did anything yet.

CJ


^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 4/9] nvmem: sprd: Fix an error message
  2021-06-11  9:48           ` Greg KH
@ 2021-06-11 10:17             ` Srinivas Kandagatla
  0 siblings, 0 replies; 27+ messages in thread
From: Srinivas Kandagatla @ 2021-06-11 10:17 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-kernel, Christophe JAILLET, Chunyan Zhang



On 11/06/2021 10:48, Greg KH wrote:
> On Fri, Jun 11, 2021 at 11:45:25AM +0200, Greg KH wrote:
>> On Fri, Jun 11, 2021 at 11:17:50AM +0200, Greg KH wrote:
>>> On Fri, Jun 11, 2021 at 10:05:40AM +0100, Srinivas Kandagatla wrote:
>>>>
>>>>
>>>> On 11/06/2021 09:56, Greg KH wrote:
>>>>> On Fri, Jun 11, 2021 at 09:33:43AM +0100, Srinivas Kandagatla wrote:
>>>>>> From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
>>>>>>
>>>>>> 'ret' is known to be 0 here.
>>>>>> The expected error status is stored in 'status', so use it instead.
>>>>>>
>>>>>> Also change %d in %u, because status is an u32, not a int.
>>>>>>
>>>>>> Fixes: 096030e7f449 ("nvmem: sprd: Add Spreadtrum SoCs eFuse support")
>>>>>> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
>>>>>> Acked-by: Chunyan Zhang <zhang.lyra@gmail.com>
>>>>>> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
>>>>>> ---
>>>>>>    drivers/nvmem/sprd-efuse.c | 2 +-
>>>>>>    1 file changed, 1 insertion(+), 1 deletion(-)
>>>>>>
>>>>>> diff --git a/drivers/nvmem/sprd-efuse.c b/drivers/nvmem/sprd-efuse.c
>>>>>> index 5d394559edf2..e3e721d4c205 100644
>>>>>> --- a/drivers/nvmem/sprd-efuse.c
>>>>>> +++ b/drivers/nvmem/sprd-efuse.c
>>>>>> @@ -234,7 +234,7 @@ static int sprd_efuse_raw_prog(struct sprd_efuse *efuse, u32 blk, bool doub,
>>>>>>    	status = readl(efuse->base + SPRD_EFUSE_ERR_FLAG);
>>>>>>    	if (status) {
>>>>>>    		dev_err(efuse->dev,
>>>>>> -			"write error status %d of block %d\n", ret, blk);
>>>>>> +			"write error status %u of block %d\n", status, blk);
>>>>>
>>>>> Shouldn't this be %pe and not %u?
>>>>
>>>> This is not error pointer its status value read back from a register.
>>>>
>>>> I think %u should be good here.
>>>
>>> Argh, you are right, my fault.  For some reason I thought this worked
>>> for integers as well.  Don't we have such a printk modifier somewhere to
>>> turn error values into strings?  Let me dig...
>>
>> Ah, errname() will do it.
>>
>> Looks like no one uses it, so nevermind, sorry for the noise.  I'll go
>> apply this one now.
> 
> Does not apply to my tree :(

Looks like its already in your tree since May 7th.

--srini
> 

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 4/9] nvmem: sprd: Fix an error message
  2021-06-11 10:10           ` Marion & Christophe JAILLET
@ 2021-06-11 10:17             ` Greg KH
  2021-06-11 10:20               ` Srinivas Kandagatla
  0 siblings, 1 reply; 27+ messages in thread
From: Greg KH @ 2021-06-11 10:17 UTC (permalink / raw)
  To: Marion & Christophe JAILLET
  Cc: Srinivas Kandagatla, Dan Carpenter, linux-kernel, Chunyan Zhang

On Fri, Jun 11, 2021 at 12:10:58PM +0200, Marion & Christophe JAILLET wrote:
> 
> Le 11/06/2021 à 11:45, Greg KH a écrit :
> > On Fri, Jun 11, 2021 at 11:17:50AM +0200, Greg KH wrote:
> > > On Fri, Jun 11, 2021 at 10:05:40AM +0100, Srinivas Kandagatla wrote:
> > > > 
> > > > On 11/06/2021 09:56, Greg KH wrote:
> > > > > On Fri, Jun 11, 2021 at 09:33:43AM +0100, Srinivas Kandagatla wrote:
> > > > > > From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> > > > > > 
> > > > > > 'ret' is known to be 0 here.
> > > > > > The expected error status is stored in 'status', so use it instead.
> > > > > > 
> > > > > > Also change %d in %u, because status is an u32, not a int.
> > > > > > 
> > > > > > Fixes: 096030e7f449 ("nvmem: sprd: Add Spreadtrum SoCs eFuse support")
> > > > > > Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> > > > > > Acked-by: Chunyan Zhang <zhang.lyra@gmail.com>
> > > > > > Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> > > > > > ---
> > > > > >    drivers/nvmem/sprd-efuse.c | 2 +-
> > > > > >    1 file changed, 1 insertion(+), 1 deletion(-)
> > > > > > 
> > > > > > diff --git a/drivers/nvmem/sprd-efuse.c b/drivers/nvmem/sprd-efuse.c
> > > > > > index 5d394559edf2..e3e721d4c205 100644
> > > > > > --- a/drivers/nvmem/sprd-efuse.c
> > > > > > +++ b/drivers/nvmem/sprd-efuse.c
> > > > > > @@ -234,7 +234,7 @@ static int sprd_efuse_raw_prog(struct sprd_efuse *efuse, u32 blk, bool doub,
> > > > > >    	status = readl(efuse->base + SPRD_EFUSE_ERR_FLAG);
> > > > > >    	if (status) {
> > > > > >    		dev_err(efuse->dev,
> > > > > > -			"write error status %d of block %d\n", ret, blk);
> > > > > > +			"write error status %u of block %d\n", status, blk);
> > > > > Shouldn't this be %pe and not %u?
> > > > This is not error pointer its status value read back from a register.
> > > > 
> > > > I think %u should be good here.
> > > Argh, you are right, my fault.  For some reason I thought this worked
> > > for integers as well.  Don't we have such a printk modifier somewhere to
> > > turn error values into strings?  Let me dig...
> > Ah, errname() will do it.
> > 
> > Looks like no one uses it, so nevermind, sorry for the noise.  I'll go
> > apply this one now.
> > 
> > thanks,
> > 
> > greg k-h
> 
> Hi,
> 
> errname() depends on CONFIG_SYMBOLIC_ERRNAME.
> Is this widely used?

It is set by default if you enable CONFIG_PRINTK

> If not, using errname() directly would loose the error code.
> (note that %pe already deals with it)
> 
> Dan Capenter already spoke about a potential %e extension, but I don't think
> anyone did anything yet.

That would be a fun and simple beginner task for someone to do.  Maybe
I'll mention it to this new round of interns that have just started...

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [PATCH 4/9] nvmem: sprd: Fix an error message
  2021-06-11 10:17             ` Greg KH
@ 2021-06-11 10:20               ` Srinivas Kandagatla
  0 siblings, 0 replies; 27+ messages in thread
From: Srinivas Kandagatla @ 2021-06-11 10:20 UTC (permalink / raw)
  To: Greg KH, Marion & Christophe JAILLET
  Cc: Dan Carpenter, linux-kernel, Chunyan Zhang



On 11/06/2021 11:17, Greg KH wrote:
> On Fri, Jun 11, 2021 at 12:10:58PM +0200, Marion & Christophe JAILLET wrote:
>>
>> Le 11/06/2021 à 11:45, Greg KH a écrit :
>>> On Fri, Jun 11, 2021 at 11:17:50AM +0200, Greg KH wrote:
>>>> On Fri, Jun 11, 2021 at 10:05:40AM +0100, Srinivas Kandagatla wrote:
>>>>>
>>>>> On 11/06/2021 09:56, Greg KH wrote:
>>>>>> On Fri, Jun 11, 2021 at 09:33:43AM +0100, Srinivas Kandagatla wrote:
>>>>>>> From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
>>>>>>>
>>>>>>> 'ret' is known to be 0 here.
>>>>>>> The expected error status is stored in 'status', so use it instead.
>>>>>>>
>>>>>>> Also change %d in %u, because status is an u32, not a int.
>>>>>>>
>>>>>>> Fixes: 096030e7f449 ("nvmem: sprd: Add Spreadtrum SoCs eFuse support")
>>>>>>> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
>>>>>>> Acked-by: Chunyan Zhang <zhang.lyra@gmail.com>
>>>>>>> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
>>>>>>> ---
>>>>>>>     drivers/nvmem/sprd-efuse.c | 2 +-
>>>>>>>     1 file changed, 1 insertion(+), 1 deletion(-)
>>>>>>>
>>>>>>> diff --git a/drivers/nvmem/sprd-efuse.c b/drivers/nvmem/sprd-efuse.c
>>>>>>> index 5d394559edf2..e3e721d4c205 100644
>>>>>>> --- a/drivers/nvmem/sprd-efuse.c
>>>>>>> +++ b/drivers/nvmem/sprd-efuse.c
>>>>>>> @@ -234,7 +234,7 @@ static int sprd_efuse_raw_prog(struct sprd_efuse *efuse, u32 blk, bool doub,
>>>>>>>     	status = readl(efuse->base + SPRD_EFUSE_ERR_FLAG);
>>>>>>>     	if (status) {
>>>>>>>     		dev_err(efuse->dev,
>>>>>>> -			"write error status %d of block %d\n", ret, blk);
>>>>>>> +			"write error status %u of block %d\n", status, blk);
>>>>>> Shouldn't this be %pe and not %u?
>>>>> This is not error pointer its status value read back from a register.
>>>>>
>>>>> I think %u should be good here.
>>>> Argh, you are right, my fault.  For some reason I thought this worked
>>>> for integers as well.  Don't we have such a printk modifier somewhere to
>>>> turn error values into strings?  Let me dig...
>>> Ah, errname() will do it.
>>>
>>> Looks like no one uses it, so nevermind, sorry for the noise.  I'll go
>>> apply this one now.
>>>
>>> thanks,
>>>
>>> greg k-h
>>
>> Hi,
>>
>> errname() depends on CONFIG_SYMBOLIC_ERRNAME.
>> Is this widely used?
> 
> It is set by default if you enable CONFIG_PRINTK
> 
>> If not, using errname() directly would loose the error code.
>> (note that %pe already deals with it)
>>
>> Dan Capenter already spoke about a potential %e extension, but I don't think
>> anyone did anything yet.
> 
> That would be a fun and simple beginner task for someone to do.  Maybe
> I'll mention it to this new round of interns that have just started...

There seems to be some work on this side in the past.

http://lkml.iu.edu/hypermail/linux/kernel/1309.2/01027.html

This should be a good starting point.


--srini
> 
> thanks,
> 
> greg k-h
> 

^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2021-06-11 10:20 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-11  8:33 [PATCH 0/9] nvmem: patches (set 1) for 5.14 Srinivas Kandagatla
2021-06-11  8:33 ` [PATCH 1/9] nvmem: sprd: Add missing MODULE_DEVICE_TABLE Srinivas Kandagatla
2021-06-11  8:55   ` Greg KH
2021-06-11  9:09     ` Srinivas Kandagatla
2021-06-11  8:33 ` [PATCH 2/9] nvmem: qcom-spmi-sdam: add " Srinivas Kandagatla
2021-06-11  8:55   ` Greg KH
2021-06-11  8:33 ` [PATCH 3/9] nvmem: sc27xx: Add " Srinivas Kandagatla
2021-06-11  8:55   ` Greg KH
2021-06-11  8:33 ` [PATCH 4/9] nvmem: sprd: Fix an error message Srinivas Kandagatla
2021-06-11  8:56   ` Greg KH
2021-06-11  9:05     ` Srinivas Kandagatla
2021-06-11  9:17       ` Greg KH
2021-06-11  9:45         ` Greg KH
2021-06-11  9:48           ` Greg KH
2021-06-11 10:17             ` Srinivas Kandagatla
2021-06-11 10:09           ` Srinivas Kandagatla
2021-06-11 10:10           ` Marion & Christophe JAILLET
2021-06-11 10:17             ` Greg KH
2021-06-11 10:20               ` Srinivas Kandagatla
2021-06-11  8:33 ` [PATCH 5/9] nvmem: core: add a missing of_node_put Srinivas Kandagatla
2021-06-11  8:57   ` Greg KH
2021-06-11  9:10     ` Srinivas Kandagatla
2021-06-11  8:33 ` [PATCH 6/9] nvmem: sunxi_sid: Set type to OTP Srinivas Kandagatla
2021-06-11  8:33 ` [PATCH 7/9] nvmem: qfprom: minor nit fixes Srinivas Kandagatla
2021-06-11  8:33 ` [PATCH 8/9] nvmem: core: constify nvmem_cell_read_variable_common() return value Srinivas Kandagatla
2021-06-11  8:33 ` [PATCH 9/9] nvmem: qfprom: Improve the comment about regulator setting Srinivas Kandagatla
2021-06-11  8:58 ` [PATCH 0/9] nvmem: patches (set 1) for 5.14 Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.