* [PATCH 0/8] mtd: rawnand: qcom: Misc fixes
@ 2023-07-16 14:46 Miquel Raynal
2023-07-16 14:46 ` [PATCH 1/8] mtd: rawnand: qcom: Use the BIT() macro Miquel Raynal
` (7 more replies)
0 siblings, 8 replies; 40+ messages in thread
From: Miquel Raynal @ 2023-07-16 14:46 UTC (permalink / raw)
To: Manivannan Sadhasivam, Md Sadre Alam, Sricharan Ramabadhran
Cc: Richard Weinberger, Vignesh Raghavendra, Tudor Ambarus,
Pratyush Yadav, Michael Walle, linux-mtd, linux-arm-kernel,
Miquel Raynal
Hello,
A recent kernel test robot report made me look at a specific area of
this driver after it has been deeply reworked to implement
exec_op(). While at it, I progressively fixed other things which stoud
out to me, and finished by addressing additional checkpatch.pl --strict
warnings.
This is untested, especially the last patch which needs validation from
the maintainers of the driver.
Thanks,
Miquèl
Miquel Raynal (8):
mtd: rawnand: qcom: Use the BIT() macro
mtd: rawnand: qcom: Use u8 instead of uint8_t
mtd: rawnand: qcom: Fix alignment with open parenthesis
mtd: rawnand: qcom: Fix the spacing
mtd: rawnand: qcom: Fix wrong indentation
mtd: rawnand: qcom: Fix a typo
mtd: rawnand: qcom: Early structure initialization
mtd: rawnand: qcom: Fix address parsing within ->exec_op()
drivers/mtd/nand/raw/qcom_nandc.c | 69 +++++++++++++++----------------
1 file changed, 33 insertions(+), 36 deletions(-)
--
2.34.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 40+ messages in thread
* [PATCH 1/8] mtd: rawnand: qcom: Use the BIT() macro
2023-07-16 14:46 [PATCH 0/8] mtd: rawnand: qcom: Misc fixes Miquel Raynal
@ 2023-07-16 14:46 ` Miquel Raynal
2023-07-17 2:25 ` Manivannan Sadhasivam
` (2 more replies)
2023-07-16 14:46 ` [PATCH 2/8] mtd: rawnand: qcom: Use u8 instead of uint8_t Miquel Raynal
` (6 subsequent siblings)
7 siblings, 3 replies; 40+ messages in thread
From: Miquel Raynal @ 2023-07-16 14:46 UTC (permalink / raw)
To: Manivannan Sadhasivam, Md Sadre Alam, Sricharan Ramabadhran
Cc: Richard Weinberger, Vignesh Raghavendra, Tudor Ambarus,
Pratyush Yadav, Michael Walle, linux-mtd, linux-arm-kernel,
Miquel Raynal
Fix the following checkpatch warning:
"CHECK: Prefer using the BIT macro"
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
drivers/mtd/nand/raw/qcom_nandc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/mtd/nand/raw/qcom_nandc.c b/drivers/mtd/nand/raw/qcom_nandc.c
index b1e69d634d4a..023c8b36426b 100644
--- a/drivers/mtd/nand/raw/qcom_nandc.c
+++ b/drivers/mtd/nand/raw/qcom_nandc.c
@@ -123,8 +123,8 @@
/* NAND_ERASED_CW_DETECT_CFG bits */
#define ERASED_CW_ECC_MASK 1
#define AUTO_DETECT_RES 0
-#define MASK_ECC (1 << ERASED_CW_ECC_MASK)
-#define RESET_ERASED_DET (1 << AUTO_DETECT_RES)
+#define MASK_ECC BIT(ERASED_CW_ECC_MASK)
+#define RESET_ERASED_DET BIT(AUTO_DETECT_RES)
#define ACTIVE_ERASED_DET (0 << AUTO_DETECT_RES)
#define CLR_ERASED_PAGE_DET (RESET_ERASED_DET | MASK_ECC)
#define SET_ERASED_PAGE_DET (ACTIVE_ERASED_DET | MASK_ECC)
--
2.34.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [PATCH 2/8] mtd: rawnand: qcom: Use u8 instead of uint8_t
2023-07-16 14:46 [PATCH 0/8] mtd: rawnand: qcom: Misc fixes Miquel Raynal
2023-07-16 14:46 ` [PATCH 1/8] mtd: rawnand: qcom: Use the BIT() macro Miquel Raynal
@ 2023-07-16 14:46 ` Miquel Raynal
2023-07-17 2:26 ` Manivannan Sadhasivam
` (2 more replies)
2023-07-16 14:46 ` [PATCH 3/8] mtd: rawnand: qcom: Fix alignment with open parenthesis Miquel Raynal
` (5 subsequent siblings)
7 siblings, 3 replies; 40+ messages in thread
From: Miquel Raynal @ 2023-07-16 14:46 UTC (permalink / raw)
To: Manivannan Sadhasivam, Md Sadre Alam, Sricharan Ramabadhran
Cc: Richard Weinberger, Vignesh Raghavendra, Tudor Ambarus,
Pratyush Yadav, Michael Walle, linux-mtd, linux-arm-kernel,
Miquel Raynal
Fix the following checkpatch warning:
"CHECK: Prefer kernel type 'u8' over 'uint8_t'"
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
drivers/mtd/nand/raw/qcom_nandc.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/mtd/nand/raw/qcom_nandc.c b/drivers/mtd/nand/raw/qcom_nandc.c
index 023c8b36426b..0136df01738e 100644
--- a/drivers/mtd/nand/raw/qcom_nandc.c
+++ b/drivers/mtd/nand/raw/qcom_nandc.c
@@ -212,7 +212,7 @@ nandc_set_reg(chip, reg, \
/* Returns the dma address for reg read buffer */
#define reg_buf_dma_addr(chip, vaddr) \
((chip)->reg_read_dma + \
- ((uint8_t *)(vaddr) - (uint8_t *)(chip)->reg_read_buf))
+ ((u8 *)(vaddr) - (u8 *)(chip)->reg_read_buf))
#define QPIC_PER_CW_CMD_ELEMENTS 32
#define QPIC_PER_CW_CMD_SGL 32
@@ -1884,7 +1884,7 @@ static void qcom_nandc_codeword_fixup(struct qcom_nand_host *host, int page)
}
/* implements ecc->read_page() */
-static int qcom_nandc_read_page(struct nand_chip *chip, uint8_t *buf,
+static int qcom_nandc_read_page(struct nand_chip *chip, u8 *buf,
int oob_required, int page)
{
struct qcom_nand_host *host = to_qcom_nand_host(chip);
@@ -1912,7 +1912,7 @@ static int qcom_nandc_read_page(struct nand_chip *chip, uint8_t *buf,
}
/* implements ecc->read_page_raw() */
-static int qcom_nandc_read_page_raw(struct nand_chip *chip, uint8_t *buf,
+static int qcom_nandc_read_page_raw(struct nand_chip *chip, u8 *buf,
int oob_required, int page)
{
struct mtd_info *mtd = nand_to_mtd(chip);
@@ -1958,7 +1958,7 @@ static int qcom_nandc_read_oob(struct nand_chip *chip, int page)
}
/* implements ecc->write_page() */
-static int qcom_nandc_write_page(struct nand_chip *chip, const uint8_t *buf,
+static int qcom_nandc_write_page(struct nand_chip *chip, const u8 *buf,
int oob_required, int page)
{
struct qcom_nand_host *host = to_qcom_nand_host(chip);
@@ -2035,7 +2035,7 @@ static int qcom_nandc_write_page(struct nand_chip *chip, const uint8_t *buf,
/* implements ecc->write_page_raw() */
static int qcom_nandc_write_page_raw(struct nand_chip *chip,
- const uint8_t *buf, int oob_required,
+ const u8 *buf, int oob_required,
int page)
{
struct mtd_info *mtd = nand_to_mtd(chip);
--
2.34.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [PATCH 3/8] mtd: rawnand: qcom: Fix alignment with open parenthesis
2023-07-16 14:46 [PATCH 0/8] mtd: rawnand: qcom: Misc fixes Miquel Raynal
2023-07-16 14:46 ` [PATCH 1/8] mtd: rawnand: qcom: Use the BIT() macro Miquel Raynal
2023-07-16 14:46 ` [PATCH 2/8] mtd: rawnand: qcom: Use u8 instead of uint8_t Miquel Raynal
@ 2023-07-16 14:46 ` Miquel Raynal
2023-07-17 2:27 ` Manivannan Sadhasivam
2023-07-28 2:17 ` Tudor Ambarus
2023-07-16 14:46 ` [PATCH 4/8] mtd: rawnand: qcom: Fix the spacing Miquel Raynal
` (4 subsequent siblings)
7 siblings, 2 replies; 40+ messages in thread
From: Miquel Raynal @ 2023-07-16 14:46 UTC (permalink / raw)
To: Manivannan Sadhasivam, Md Sadre Alam, Sricharan Ramabadhran
Cc: Richard Weinberger, Vignesh Raghavendra, Tudor Ambarus,
Pratyush Yadav, Michael Walle, linux-mtd, linux-arm-kernel,
Miquel Raynal
Fix the following checkpatch warning:
"CHECK: Alignment should match open parenthesis"
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
drivers/mtd/nand/raw/qcom_nandc.c | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/drivers/mtd/nand/raw/qcom_nandc.c b/drivers/mtd/nand/raw/qcom_nandc.c
index 0136df01738e..54a7b49bda87 100644
--- a/drivers/mtd/nand/raw/qcom_nandc.c
+++ b/drivers/mtd/nand/raw/qcom_nandc.c
@@ -2348,7 +2348,7 @@ static int qcom_nand_ooblayout_ecc(struct mtd_info *mtd, int section,
}
static int qcom_nand_ooblayout_free(struct mtd_info *mtd, int section,
- struct mtd_oob_region *oobregion)
+ struct mtd_oob_region *oobregion)
{
struct nand_chip *chip = mtd_to_nand(mtd);
struct qcom_nand_host *host = to_qcom_nand_host(chip);
@@ -2593,7 +2593,7 @@ static int qcom_op_cmd_mapping(struct qcom_nand_controller *nandc, u8 cmd,
/* NAND framework ->exec_op() hooks and related helpers */
static void qcom_parse_instructions(struct nand_chip *chip,
const struct nand_subop *subop,
- struct qcom_op *q_op)
+ struct qcom_op *q_op)
{
struct qcom_nand_controller *nandc = get_qcom_nand_controller(chip);
const struct nand_op_instr *instr = NULL;
@@ -3089,19 +3089,17 @@ static int qcom_nandc_alloc(struct qcom_nand_controller *nandc)
*/
nandc->buf_size = 532;
- nandc->data_buffer = devm_kzalloc(nandc->dev, nandc->buf_size,
- GFP_KERNEL);
+ nandc->data_buffer = devm_kzalloc(nandc->dev, nandc->buf_size, GFP_KERNEL);
if (!nandc->data_buffer)
return -ENOMEM;
- nandc->regs = devm_kzalloc(nandc->dev, sizeof(*nandc->regs),
- GFP_KERNEL);
+ nandc->regs = devm_kzalloc(nandc->dev, sizeof(*nandc->regs), GFP_KERNEL);
if (!nandc->regs)
return -ENOMEM;
- nandc->reg_read_buf = devm_kcalloc(nandc->dev,
- MAX_REG_RD, sizeof(*nandc->reg_read_buf),
- GFP_KERNEL);
+ nandc->reg_read_buf = devm_kcalloc(nandc->dev, MAX_REG_RD,
+ sizeof(*nandc->reg_read_buf),
+ GFP_KERNEL);
if (!nandc->reg_read_buf)
return -ENOMEM;
--
2.34.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [PATCH 4/8] mtd: rawnand: qcom: Fix the spacing
2023-07-16 14:46 [PATCH 0/8] mtd: rawnand: qcom: Misc fixes Miquel Raynal
` (2 preceding siblings ...)
2023-07-16 14:46 ` [PATCH 3/8] mtd: rawnand: qcom: Fix alignment with open parenthesis Miquel Raynal
@ 2023-07-16 14:46 ` Miquel Raynal
2023-07-17 2:28 ` Manivannan Sadhasivam
` (2 more replies)
2023-07-16 14:46 ` [PATCH 5/8] mtd: rawnand: qcom: Fix wrong indentation Miquel Raynal
` (3 subsequent siblings)
7 siblings, 3 replies; 40+ messages in thread
From: Miquel Raynal @ 2023-07-16 14:46 UTC (permalink / raw)
To: Manivannan Sadhasivam, Md Sadre Alam, Sricharan Ramabadhran
Cc: Richard Weinberger, Vignesh Raghavendra, Tudor Ambarus,
Pratyush Yadav, Michael Walle, linux-mtd, linux-arm-kernel,
Miquel Raynal
Fix following checkpatch warning:
"CHECK: Please don't use multiple blank lines"
"CHECK: Please use a blank line after
function/struct/union/enum declarations"
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
drivers/mtd/nand/raw/qcom_nandc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mtd/nand/raw/qcom_nandc.c b/drivers/mtd/nand/raw/qcom_nandc.c
index 54a7b49bda87..554cca3801da 100644
--- a/drivers/mtd/nand/raw/qcom_nandc.c
+++ b/drivers/mtd/nand/raw/qcom_nandc.c
@@ -1997,7 +1997,6 @@ static int qcom_nandc_write_page(struct nand_chip *chip, const u8 *buf,
oob_size = ecc->bytes;
}
-
write_data_dma(nandc, FLASH_BUF_ACC, data_buf, data_size,
i == (ecc->steps - 1) ? NAND_BAM_NO_EOT : 0);
@@ -2373,6 +2372,7 @@ qcom_nandc_calc_ecc_bytes(int step_size, int strength)
{
return strength == 4 ? 12 : 16;
}
+
NAND_ECC_CAPS_SINGLE(qcom_nandc_ecc_caps, qcom_nandc_calc_ecc_bytes,
NANDC_STEP_SIZE, 4, 8);
--
2.34.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [PATCH 5/8] mtd: rawnand: qcom: Fix wrong indentation
2023-07-16 14:46 [PATCH 0/8] mtd: rawnand: qcom: Misc fixes Miquel Raynal
` (3 preceding siblings ...)
2023-07-16 14:46 ` [PATCH 4/8] mtd: rawnand: qcom: Fix the spacing Miquel Raynal
@ 2023-07-16 14:46 ` Miquel Raynal
2023-07-17 2:29 ` Manivannan Sadhasivam
` (2 more replies)
2023-07-16 14:46 ` [PATCH 6/8] mtd: rawnand: qcom: Fix a typo Miquel Raynal
` (2 subsequent siblings)
7 siblings, 3 replies; 40+ messages in thread
From: Miquel Raynal @ 2023-07-16 14:46 UTC (permalink / raw)
To: Manivannan Sadhasivam, Md Sadre Alam, Sricharan Ramabadhran
Cc: Richard Weinberger, Vignesh Raghavendra, Tudor Ambarus,
Pratyush Yadav, Michael Walle, linux-mtd, linux-arm-kernel,
Miquel Raynal
The main "for" loop in qcom_read_status_exec() does guard the following
to if's which are badly indented. Fix the indentation.
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
drivers/mtd/nand/raw/qcom_nandc.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/mtd/nand/raw/qcom_nandc.c b/drivers/mtd/nand/raw/qcom_nandc.c
index 554cca3801da..3adc40ef5cf6 100644
--- a/drivers/mtd/nand/raw/qcom_nandc.c
+++ b/drivers/mtd/nand/raw/qcom_nandc.c
@@ -2722,12 +2722,12 @@ static int qcom_read_status_exec(struct nand_chip *chip,
for (i = 0; i < num_cw; i++) {
flash_status = le32_to_cpu(nandc->reg_read_buf[i]);
- if (flash_status & FS_MPU_ERR)
- host->status &= ~NAND_STATUS_WP;
+ if (flash_status & FS_MPU_ERR)
+ host->status &= ~NAND_STATUS_WP;
- if (flash_status & FS_OP_ERR ||
- (i == (num_cw - 1) && (flash_status & FS_DEVICE_STS_ERR)))
- host->status |= NAND_STATUS_FAIL;
+ if (flash_status & FS_OP_ERR ||
+ (i == (num_cw - 1) && (flash_status & FS_DEVICE_STS_ERR)))
+ host->status |= NAND_STATUS_FAIL;
}
flash_status = host->status;
--
2.34.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [PATCH 6/8] mtd: rawnand: qcom: Fix a typo
2023-07-16 14:46 [PATCH 0/8] mtd: rawnand: qcom: Misc fixes Miquel Raynal
` (4 preceding siblings ...)
2023-07-16 14:46 ` [PATCH 5/8] mtd: rawnand: qcom: Fix wrong indentation Miquel Raynal
@ 2023-07-16 14:46 ` Miquel Raynal
2023-07-17 2:30 ` Manivannan Sadhasivam
` (2 more replies)
2023-07-16 14:46 ` [PATCH 7/8] mtd: rawnand: qcom: Early structure initialization Miquel Raynal
2023-07-16 14:46 ` [PATCH 8/8] mtd: rawnand: qcom: Fix address parsing within ->exec_op() Miquel Raynal
7 siblings, 3 replies; 40+ messages in thread
From: Miquel Raynal @ 2023-07-16 14:46 UTC (permalink / raw)
To: Manivannan Sadhasivam, Md Sadre Alam, Sricharan Ramabadhran
Cc: Richard Weinberger, Vignesh Raghavendra, Tudor Ambarus,
Pratyush Yadav, Michael Walle, linux-mtd, linux-arm-kernel,
Miquel Raynal
Fix the following checkpatch warning:
CHECK: 'tranasction' may be misspelled - perhaps 'transaction'?
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
drivers/mtd/nand/raw/qcom_nandc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mtd/nand/raw/qcom_nandc.c b/drivers/mtd/nand/raw/qcom_nandc.c
index 3adc40ef5cf6..cb6ccaa19224 100644
--- a/drivers/mtd/nand/raw/qcom_nandc.c
+++ b/drivers/mtd/nand/raw/qcom_nandc.c
@@ -3144,7 +3144,7 @@ static int qcom_nandc_alloc(struct qcom_nand_controller *nandc)
/*
* Initially allocate BAM transaction to read ONFI param page.
* After detecting all the devices, this BAM transaction will
- * be freed and the next BAM tranasction will be allocated with
+ * be freed and the next BAM transaction will be allocated with
* maximum codeword size
*/
nandc->max_cwperpage = 1;
--
2.34.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [PATCH 7/8] mtd: rawnand: qcom: Early structure initialization
2023-07-16 14:46 [PATCH 0/8] mtd: rawnand: qcom: Misc fixes Miquel Raynal
` (5 preceding siblings ...)
2023-07-16 14:46 ` [PATCH 6/8] mtd: rawnand: qcom: Fix a typo Miquel Raynal
@ 2023-07-16 14:46 ` Miquel Raynal
2023-07-17 2:31 ` Manivannan Sadhasivam
` (3 more replies)
2023-07-16 14:46 ` [PATCH 8/8] mtd: rawnand: qcom: Fix address parsing within ->exec_op() Miquel Raynal
7 siblings, 4 replies; 40+ messages in thread
From: Miquel Raynal @ 2023-07-16 14:46 UTC (permalink / raw)
To: Manivannan Sadhasivam, Md Sadre Alam, Sricharan Ramabadhran
Cc: Richard Weinberger, Vignesh Raghavendra, Tudor Ambarus,
Pratyush Yadav, Michael Walle, linux-mtd, linux-arm-kernel,
Miquel Raynal
Instead of allocating a structure on the stack with random data and then
expect the callee to perform the initialization (which is, in general,
error prone), prefer zeroing the structure explicitly at allocation and
provide the already zeroed area, so no explicit memset operation is
needed. It is probably safer to do so, so we limit the timeframe when
dirty data could actually be accessed by mistake.
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
drivers/mtd/nand/raw/qcom_nandc.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/drivers/mtd/nand/raw/qcom_nandc.c b/drivers/mtd/nand/raw/qcom_nandc.c
index cb6ccaa19224..4fc8dafa8f03 100644
--- a/drivers/mtd/nand/raw/qcom_nandc.c
+++ b/drivers/mtd/nand/raw/qcom_nandc.c
@@ -2600,8 +2600,6 @@ static void qcom_parse_instructions(struct nand_chip *chip,
unsigned int op_id;
int i;
- memset(q_op, 0, sizeof(*q_op));
-
for (op_id = 0; op_id < subop->ninstrs; op_id++) {
unsigned int offset, naddrs;
const u8 *addrs;
@@ -2681,7 +2679,7 @@ static int qcom_read_status_exec(struct nand_chip *chip,
struct qcom_nand_host *host = to_qcom_nand_host(chip);
struct qcom_nand_controller *nandc = get_qcom_nand_controller(chip);
struct nand_ecc_ctrl *ecc = &chip->ecc;
- struct qcom_op q_op;
+ struct qcom_op q_op = {};
const struct nand_op_instr *instr = NULL;
unsigned int op_id = 0;
unsigned int len = 0;
@@ -2744,7 +2742,7 @@ static int qcom_read_id_type_exec(struct nand_chip *chip, const struct nand_subo
{
struct qcom_nand_controller *nandc = get_qcom_nand_controller(chip);
struct qcom_nand_host *host = to_qcom_nand_host(chip);
- struct qcom_op q_op;
+ struct qcom_op q_op = {};
const struct nand_op_instr *instr = NULL;
unsigned int op_id = 0;
unsigned int len = 0;
@@ -2795,7 +2793,7 @@ static int qcom_misc_cmd_type_exec(struct nand_chip *chip, const struct nand_sub
{
struct qcom_nand_controller *nandc = get_qcom_nand_controller(chip);
struct qcom_nand_host *host = to_qcom_nand_host(chip);
- struct qcom_op q_op;
+ struct qcom_op q_op = {};
int ret = 0;
qcom_parse_instructions(chip, subop, &q_op);
@@ -2838,7 +2836,7 @@ static int qcom_param_page_type_exec(struct nand_chip *chip, const struct nand_
{
struct qcom_nand_host *host = to_qcom_nand_host(chip);
struct qcom_nand_controller *nandc = get_qcom_nand_controller(chip);
- struct qcom_op q_op;
+ struct qcom_op q_op = {};
const struct nand_op_instr *instr = NULL;
unsigned int op_id = 0;
unsigned int len = 0;
@@ -2935,7 +2933,7 @@ static int qcom_erase_cmd_type_exec(struct nand_chip *chip, const struct nand_su
{
struct qcom_nand_host *host = to_qcom_nand_host(chip);
struct qcom_nand_controller *nandc = get_qcom_nand_controller(chip);
- struct qcom_op q_op;
+ struct qcom_op q_op = {};
int ret = 0;
qcom_parse_instructions(chip, subop, &q_op);
--
2.34.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [PATCH 8/8] mtd: rawnand: qcom: Fix address parsing within ->exec_op()
2023-07-16 14:46 [PATCH 0/8] mtd: rawnand: qcom: Misc fixes Miquel Raynal
` (6 preceding siblings ...)
2023-07-16 14:46 ` [PATCH 7/8] mtd: rawnand: qcom: Early structure initialization Miquel Raynal
@ 2023-07-16 14:46 ` Miquel Raynal
2023-07-17 6:38 ` Manivannan Sadhasivam
` (2 more replies)
7 siblings, 3 replies; 40+ messages in thread
From: Miquel Raynal @ 2023-07-16 14:46 UTC (permalink / raw)
To: Manivannan Sadhasivam, Md Sadre Alam, Sricharan Ramabadhran
Cc: Richard Weinberger, Vignesh Raghavendra, Tudor Ambarus,
Pratyush Yadav, Michael Walle, linux-mtd, linux-arm-kernel,
Miquel Raynal, kernel test robot
The naddrs variable is initialized but not used. Fixing this could have
been a matter of dropping the variable, but the right way to do it looks
a bit more complex: we can avoid useless writes to the q_op structure by
using it. In practice we could even have possible out-of-bound bugs with
the existing implementation. Let's fix all that by just performing the
right number of assignments in the addr{1,2}_reg fields.
Fixes: 89550beb098e ("mtd: rawnand: qcom: Implement exec_op()")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202307131959.PdPSC86K-lkp@intel.com/
Closes: https://lore.kernel.org/oe-kbuild-all/202307131730.NOYbcjBr-lkp@intel.com/
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
drivers/mtd/nand/raw/qcom_nandc.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/drivers/mtd/nand/raw/qcom_nandc.c b/drivers/mtd/nand/raw/qcom_nandc.c
index 4fc8dafa8f03..dc8ca60fc2e2 100644
--- a/drivers/mtd/nand/raw/qcom_nandc.c
+++ b/drivers/mtd/nand/raw/qcom_nandc.c
@@ -2616,12 +2616,13 @@ static void qcom_parse_instructions(struct nand_chip *chip,
offset = nand_subop_get_addr_start_off(subop, op_id);
naddrs = nand_subop_get_num_addr_cyc(subop, op_id);
addrs = &instr->ctx.addr.addrs[offset];
- for (i = 0; i < MAX_ADDRESS_CYCLE; i++) {
- if (i < 4)
- q_op->addr1_reg |= (u32)addrs[i] << i * 8;
- else
- q_op->addr2_reg |= addrs[i];
- }
+
+ for (i = 0; i < min_t(unsigned int, 4, naddrs); i++)
+ q_op->addr1_reg |= addrs[i] << (i * 8);
+
+ if (naddrs > 4)
+ q_op->addr2_reg |= addrs[4];
+
q_op->rdy_delay_ns = instr->delay_ns;
break;
--
2.34.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 40+ messages in thread
* Re: [PATCH 1/8] mtd: rawnand: qcom: Use the BIT() macro
2023-07-16 14:46 ` [PATCH 1/8] mtd: rawnand: qcom: Use the BIT() macro Miquel Raynal
@ 2023-07-17 2:25 ` Manivannan Sadhasivam
2023-07-28 2:16 ` Tudor Ambarus
2023-07-28 12:35 ` Miquel Raynal
2 siblings, 0 replies; 40+ messages in thread
From: Manivannan Sadhasivam @ 2023-07-17 2:25 UTC (permalink / raw)
To: Miquel Raynal
Cc: Md Sadre Alam, Sricharan Ramabadhran, Richard Weinberger,
Vignesh Raghavendra, Tudor Ambarus, Pratyush Yadav, Michael Walle,
linux-mtd, linux-arm-kernel
On Sun, Jul 16, 2023 at 04:46:05PM +0200, Miquel Raynal wrote:
> Fix the following checkpatch warning:
> "CHECK: Prefer using the BIT macro"
>
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Acked-by: Manivannan Sadhasivam <mani@kernel.org>
- Mani
> ---
> drivers/mtd/nand/raw/qcom_nandc.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mtd/nand/raw/qcom_nandc.c b/drivers/mtd/nand/raw/qcom_nandc.c
> index b1e69d634d4a..023c8b36426b 100644
> --- a/drivers/mtd/nand/raw/qcom_nandc.c
> +++ b/drivers/mtd/nand/raw/qcom_nandc.c
> @@ -123,8 +123,8 @@
> /* NAND_ERASED_CW_DETECT_CFG bits */
> #define ERASED_CW_ECC_MASK 1
> #define AUTO_DETECT_RES 0
> -#define MASK_ECC (1 << ERASED_CW_ECC_MASK)
> -#define RESET_ERASED_DET (1 << AUTO_DETECT_RES)
> +#define MASK_ECC BIT(ERASED_CW_ECC_MASK)
> +#define RESET_ERASED_DET BIT(AUTO_DETECT_RES)
> #define ACTIVE_ERASED_DET (0 << AUTO_DETECT_RES)
> #define CLR_ERASED_PAGE_DET (RESET_ERASED_DET | MASK_ECC)
> #define SET_ERASED_PAGE_DET (ACTIVE_ERASED_DET | MASK_ECC)
> --
> 2.34.1
>
--
மணிவண்ணன் சதாசிவம்
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: [PATCH 2/8] mtd: rawnand: qcom: Use u8 instead of uint8_t
2023-07-16 14:46 ` [PATCH 2/8] mtd: rawnand: qcom: Use u8 instead of uint8_t Miquel Raynal
@ 2023-07-17 2:26 ` Manivannan Sadhasivam
2023-07-28 2:17 ` Tudor Ambarus
2023-07-28 12:35 ` Miquel Raynal
2 siblings, 0 replies; 40+ messages in thread
From: Manivannan Sadhasivam @ 2023-07-17 2:26 UTC (permalink / raw)
To: Miquel Raynal
Cc: Md Sadre Alam, Sricharan Ramabadhran, Richard Weinberger,
Vignesh Raghavendra, Tudor Ambarus, Pratyush Yadav, Michael Walle,
linux-mtd, linux-arm-kernel
On Sun, Jul 16, 2023 at 04:46:06PM +0200, Miquel Raynal wrote:
> Fix the following checkpatch warning:
> "CHECK: Prefer kernel type 'u8' over 'uint8_t'"
>
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Acked-by: Manivannan Sadhasivam <mani@kernel.org>
- Mani
> ---
> drivers/mtd/nand/raw/qcom_nandc.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/mtd/nand/raw/qcom_nandc.c b/drivers/mtd/nand/raw/qcom_nandc.c
> index 023c8b36426b..0136df01738e 100644
> --- a/drivers/mtd/nand/raw/qcom_nandc.c
> +++ b/drivers/mtd/nand/raw/qcom_nandc.c
> @@ -212,7 +212,7 @@ nandc_set_reg(chip, reg, \
> /* Returns the dma address for reg read buffer */
> #define reg_buf_dma_addr(chip, vaddr) \
> ((chip)->reg_read_dma + \
> - ((uint8_t *)(vaddr) - (uint8_t *)(chip)->reg_read_buf))
> + ((u8 *)(vaddr) - (u8 *)(chip)->reg_read_buf))
>
> #define QPIC_PER_CW_CMD_ELEMENTS 32
> #define QPIC_PER_CW_CMD_SGL 32
> @@ -1884,7 +1884,7 @@ static void qcom_nandc_codeword_fixup(struct qcom_nand_host *host, int page)
> }
>
> /* implements ecc->read_page() */
> -static int qcom_nandc_read_page(struct nand_chip *chip, uint8_t *buf,
> +static int qcom_nandc_read_page(struct nand_chip *chip, u8 *buf,
> int oob_required, int page)
> {
> struct qcom_nand_host *host = to_qcom_nand_host(chip);
> @@ -1912,7 +1912,7 @@ static int qcom_nandc_read_page(struct nand_chip *chip, uint8_t *buf,
> }
>
> /* implements ecc->read_page_raw() */
> -static int qcom_nandc_read_page_raw(struct nand_chip *chip, uint8_t *buf,
> +static int qcom_nandc_read_page_raw(struct nand_chip *chip, u8 *buf,
> int oob_required, int page)
> {
> struct mtd_info *mtd = nand_to_mtd(chip);
> @@ -1958,7 +1958,7 @@ static int qcom_nandc_read_oob(struct nand_chip *chip, int page)
> }
>
> /* implements ecc->write_page() */
> -static int qcom_nandc_write_page(struct nand_chip *chip, const uint8_t *buf,
> +static int qcom_nandc_write_page(struct nand_chip *chip, const u8 *buf,
> int oob_required, int page)
> {
> struct qcom_nand_host *host = to_qcom_nand_host(chip);
> @@ -2035,7 +2035,7 @@ static int qcom_nandc_write_page(struct nand_chip *chip, const uint8_t *buf,
>
> /* implements ecc->write_page_raw() */
> static int qcom_nandc_write_page_raw(struct nand_chip *chip,
> - const uint8_t *buf, int oob_required,
> + const u8 *buf, int oob_required,
> int page)
> {
> struct mtd_info *mtd = nand_to_mtd(chip);
> --
> 2.34.1
>
--
மணிவண்ணன் சதாசிவம்
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: [PATCH 3/8] mtd: rawnand: qcom: Fix alignment with open parenthesis
2023-07-16 14:46 ` [PATCH 3/8] mtd: rawnand: qcom: Fix alignment with open parenthesis Miquel Raynal
@ 2023-07-17 2:27 ` Manivannan Sadhasivam
2023-07-28 2:17 ` Tudor Ambarus
1 sibling, 0 replies; 40+ messages in thread
From: Manivannan Sadhasivam @ 2023-07-17 2:27 UTC (permalink / raw)
To: Miquel Raynal
Cc: Md Sadre Alam, Sricharan Ramabadhran, Richard Weinberger,
Vignesh Raghavendra, Tudor Ambarus, Pratyush Yadav, Michael Walle,
linux-mtd, linux-arm-kernel
On Sun, Jul 16, 2023 at 04:46:07PM +0200, Miquel Raynal wrote:
> Fix the following checkpatch warning:
> "CHECK: Alignment should match open parenthesis"
>
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Acked-by: Manivannan Sadhasivam <mani@kernel.org>
- Mani
> ---
> drivers/mtd/nand/raw/qcom_nandc.c | 16 +++++++---------
> 1 file changed, 7 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/mtd/nand/raw/qcom_nandc.c b/drivers/mtd/nand/raw/qcom_nandc.c
> index 0136df01738e..54a7b49bda87 100644
> --- a/drivers/mtd/nand/raw/qcom_nandc.c
> +++ b/drivers/mtd/nand/raw/qcom_nandc.c
> @@ -2348,7 +2348,7 @@ static int qcom_nand_ooblayout_ecc(struct mtd_info *mtd, int section,
> }
>
> static int qcom_nand_ooblayout_free(struct mtd_info *mtd, int section,
> - struct mtd_oob_region *oobregion)
> + struct mtd_oob_region *oobregion)
> {
> struct nand_chip *chip = mtd_to_nand(mtd);
> struct qcom_nand_host *host = to_qcom_nand_host(chip);
> @@ -2593,7 +2593,7 @@ static int qcom_op_cmd_mapping(struct qcom_nand_controller *nandc, u8 cmd,
> /* NAND framework ->exec_op() hooks and related helpers */
> static void qcom_parse_instructions(struct nand_chip *chip,
> const struct nand_subop *subop,
> - struct qcom_op *q_op)
> + struct qcom_op *q_op)
> {
> struct qcom_nand_controller *nandc = get_qcom_nand_controller(chip);
> const struct nand_op_instr *instr = NULL;
> @@ -3089,19 +3089,17 @@ static int qcom_nandc_alloc(struct qcom_nand_controller *nandc)
> */
> nandc->buf_size = 532;
>
> - nandc->data_buffer = devm_kzalloc(nandc->dev, nandc->buf_size,
> - GFP_KERNEL);
> + nandc->data_buffer = devm_kzalloc(nandc->dev, nandc->buf_size, GFP_KERNEL);
> if (!nandc->data_buffer)
> return -ENOMEM;
>
> - nandc->regs = devm_kzalloc(nandc->dev, sizeof(*nandc->regs),
> - GFP_KERNEL);
> + nandc->regs = devm_kzalloc(nandc->dev, sizeof(*nandc->regs), GFP_KERNEL);
> if (!nandc->regs)
> return -ENOMEM;
>
> - nandc->reg_read_buf = devm_kcalloc(nandc->dev,
> - MAX_REG_RD, sizeof(*nandc->reg_read_buf),
> - GFP_KERNEL);
> + nandc->reg_read_buf = devm_kcalloc(nandc->dev, MAX_REG_RD,
> + sizeof(*nandc->reg_read_buf),
> + GFP_KERNEL);
> if (!nandc->reg_read_buf)
> return -ENOMEM;
>
> --
> 2.34.1
>
--
மணிவண்ணன் சதாசிவம்
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: [PATCH 4/8] mtd: rawnand: qcom: Fix the spacing
2023-07-16 14:46 ` [PATCH 4/8] mtd: rawnand: qcom: Fix the spacing Miquel Raynal
@ 2023-07-17 2:28 ` Manivannan Sadhasivam
2023-07-28 2:18 ` Tudor Ambarus
2023-07-28 12:34 ` Miquel Raynal
2 siblings, 0 replies; 40+ messages in thread
From: Manivannan Sadhasivam @ 2023-07-17 2:28 UTC (permalink / raw)
To: Miquel Raynal
Cc: Md Sadre Alam, Sricharan Ramabadhran, Richard Weinberger,
Vignesh Raghavendra, Tudor Ambarus, Pratyush Yadav, Michael Walle,
linux-mtd, linux-arm-kernel
On Sun, Jul 16, 2023 at 04:46:08PM +0200, Miquel Raynal wrote:
> Fix following checkpatch warning:
> "CHECK: Please don't use multiple blank lines"
> "CHECK: Please use a blank line after
> function/struct/union/enum declarations"
>
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Acked-by: Manivannan Sadhasivam <mani@kernel.org>
- Mani
> ---
> drivers/mtd/nand/raw/qcom_nandc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mtd/nand/raw/qcom_nandc.c b/drivers/mtd/nand/raw/qcom_nandc.c
> index 54a7b49bda87..554cca3801da 100644
> --- a/drivers/mtd/nand/raw/qcom_nandc.c
> +++ b/drivers/mtd/nand/raw/qcom_nandc.c
> @@ -1997,7 +1997,6 @@ static int qcom_nandc_write_page(struct nand_chip *chip, const u8 *buf,
> oob_size = ecc->bytes;
> }
>
> -
> write_data_dma(nandc, FLASH_BUF_ACC, data_buf, data_size,
> i == (ecc->steps - 1) ? NAND_BAM_NO_EOT : 0);
>
> @@ -2373,6 +2372,7 @@ qcom_nandc_calc_ecc_bytes(int step_size, int strength)
> {
> return strength == 4 ? 12 : 16;
> }
> +
> NAND_ECC_CAPS_SINGLE(qcom_nandc_ecc_caps, qcom_nandc_calc_ecc_bytes,
> NANDC_STEP_SIZE, 4, 8);
>
> --
> 2.34.1
>
--
மணிவண்ணன் சதாசிவம்
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: [PATCH 5/8] mtd: rawnand: qcom: Fix wrong indentation
2023-07-16 14:46 ` [PATCH 5/8] mtd: rawnand: qcom: Fix wrong indentation Miquel Raynal
@ 2023-07-17 2:29 ` Manivannan Sadhasivam
2023-07-28 2:20 ` Tudor Ambarus
2023-07-28 12:34 ` Miquel Raynal
2 siblings, 0 replies; 40+ messages in thread
From: Manivannan Sadhasivam @ 2023-07-17 2:29 UTC (permalink / raw)
To: Miquel Raynal
Cc: Md Sadre Alam, Sricharan Ramabadhran, Richard Weinberger,
Vignesh Raghavendra, Tudor Ambarus, Pratyush Yadav, Michael Walle,
linux-mtd, linux-arm-kernel
On Sun, Jul 16, 2023 at 04:46:09PM +0200, Miquel Raynal wrote:
> The main "for" loop in qcom_read_status_exec() does guard the following
> to if's which are badly indented. Fix the indentation.
>
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Acked-by: Manivannan Sadhasivam <mani@kernel.org>
- Mani
> ---
> drivers/mtd/nand/raw/qcom_nandc.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/mtd/nand/raw/qcom_nandc.c b/drivers/mtd/nand/raw/qcom_nandc.c
> index 554cca3801da..3adc40ef5cf6 100644
> --- a/drivers/mtd/nand/raw/qcom_nandc.c
> +++ b/drivers/mtd/nand/raw/qcom_nandc.c
> @@ -2722,12 +2722,12 @@ static int qcom_read_status_exec(struct nand_chip *chip,
> for (i = 0; i < num_cw; i++) {
> flash_status = le32_to_cpu(nandc->reg_read_buf[i]);
>
> - if (flash_status & FS_MPU_ERR)
> - host->status &= ~NAND_STATUS_WP;
> + if (flash_status & FS_MPU_ERR)
> + host->status &= ~NAND_STATUS_WP;
>
> - if (flash_status & FS_OP_ERR ||
> - (i == (num_cw - 1) && (flash_status & FS_DEVICE_STS_ERR)))
> - host->status |= NAND_STATUS_FAIL;
> + if (flash_status & FS_OP_ERR ||
> + (i == (num_cw - 1) && (flash_status & FS_DEVICE_STS_ERR)))
> + host->status |= NAND_STATUS_FAIL;
> }
>
> flash_status = host->status;
> --
> 2.34.1
>
--
மணிவண்ணன் சதாசிவம்
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: [PATCH 6/8] mtd: rawnand: qcom: Fix a typo
2023-07-16 14:46 ` [PATCH 6/8] mtd: rawnand: qcom: Fix a typo Miquel Raynal
@ 2023-07-17 2:30 ` Manivannan Sadhasivam
2023-07-28 2:22 ` Tudor Ambarus
2023-07-28 12:34 ` Miquel Raynal
2 siblings, 0 replies; 40+ messages in thread
From: Manivannan Sadhasivam @ 2023-07-17 2:30 UTC (permalink / raw)
To: Miquel Raynal
Cc: Md Sadre Alam, Sricharan Ramabadhran, Richard Weinberger,
Vignesh Raghavendra, Tudor Ambarus, Pratyush Yadav, Michael Walle,
linux-mtd, linux-arm-kernel
On Sun, Jul 16, 2023 at 04:46:10PM +0200, Miquel Raynal wrote:
> Fix the following checkpatch warning:
> CHECK: 'tranasction' may be misspelled - perhaps 'transaction'?
>
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Acked-by: Manivannan Sadhasivam <mani@kernel.org>
- Mani
> ---
> drivers/mtd/nand/raw/qcom_nandc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mtd/nand/raw/qcom_nandc.c b/drivers/mtd/nand/raw/qcom_nandc.c
> index 3adc40ef5cf6..cb6ccaa19224 100644
> --- a/drivers/mtd/nand/raw/qcom_nandc.c
> +++ b/drivers/mtd/nand/raw/qcom_nandc.c
> @@ -3144,7 +3144,7 @@ static int qcom_nandc_alloc(struct qcom_nand_controller *nandc)
> /*
> * Initially allocate BAM transaction to read ONFI param page.
> * After detecting all the devices, this BAM transaction will
> - * be freed and the next BAM tranasction will be allocated with
> + * be freed and the next BAM transaction will be allocated with
> * maximum codeword size
> */
> nandc->max_cwperpage = 1;
> --
> 2.34.1
>
--
மணிவண்ணன் சதாசிவம்
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: [PATCH 7/8] mtd: rawnand: qcom: Early structure initialization
2023-07-16 14:46 ` [PATCH 7/8] mtd: rawnand: qcom: Early structure initialization Miquel Raynal
@ 2023-07-17 2:31 ` Manivannan Sadhasivam
2023-07-27 15:03 ` Tudor Ambarus
` (2 subsequent siblings)
3 siblings, 0 replies; 40+ messages in thread
From: Manivannan Sadhasivam @ 2023-07-17 2:31 UTC (permalink / raw)
To: Miquel Raynal
Cc: Md Sadre Alam, Sricharan Ramabadhran, Richard Weinberger,
Vignesh Raghavendra, Tudor Ambarus, Pratyush Yadav, Michael Walle,
linux-mtd, linux-arm-kernel
On Sun, Jul 16, 2023 at 04:46:11PM +0200, Miquel Raynal wrote:
> Instead of allocating a structure on the stack with random data and then
> expect the callee to perform the initialization (which is, in general,
> error prone), prefer zeroing the structure explicitly at allocation and
> provide the already zeroed area, so no explicit memset operation is
> needed. It is probably safer to do so, so we limit the timeframe when
> dirty data could actually be accessed by mistake.
>
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Acked-by: Manivannan Sadhasivam <mani@kernel.org>
- Mani
> ---
> drivers/mtd/nand/raw/qcom_nandc.c | 12 +++++-------
> 1 file changed, 5 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/mtd/nand/raw/qcom_nandc.c b/drivers/mtd/nand/raw/qcom_nandc.c
> index cb6ccaa19224..4fc8dafa8f03 100644
> --- a/drivers/mtd/nand/raw/qcom_nandc.c
> +++ b/drivers/mtd/nand/raw/qcom_nandc.c
> @@ -2600,8 +2600,6 @@ static void qcom_parse_instructions(struct nand_chip *chip,
> unsigned int op_id;
> int i;
>
> - memset(q_op, 0, sizeof(*q_op));
> -
> for (op_id = 0; op_id < subop->ninstrs; op_id++) {
> unsigned int offset, naddrs;
> const u8 *addrs;
> @@ -2681,7 +2679,7 @@ static int qcom_read_status_exec(struct nand_chip *chip,
> struct qcom_nand_host *host = to_qcom_nand_host(chip);
> struct qcom_nand_controller *nandc = get_qcom_nand_controller(chip);
> struct nand_ecc_ctrl *ecc = &chip->ecc;
> - struct qcom_op q_op;
> + struct qcom_op q_op = {};
> const struct nand_op_instr *instr = NULL;
> unsigned int op_id = 0;
> unsigned int len = 0;
> @@ -2744,7 +2742,7 @@ static int qcom_read_id_type_exec(struct nand_chip *chip, const struct nand_subo
> {
> struct qcom_nand_controller *nandc = get_qcom_nand_controller(chip);
> struct qcom_nand_host *host = to_qcom_nand_host(chip);
> - struct qcom_op q_op;
> + struct qcom_op q_op = {};
> const struct nand_op_instr *instr = NULL;
> unsigned int op_id = 0;
> unsigned int len = 0;
> @@ -2795,7 +2793,7 @@ static int qcom_misc_cmd_type_exec(struct nand_chip *chip, const struct nand_sub
> {
> struct qcom_nand_controller *nandc = get_qcom_nand_controller(chip);
> struct qcom_nand_host *host = to_qcom_nand_host(chip);
> - struct qcom_op q_op;
> + struct qcom_op q_op = {};
> int ret = 0;
>
> qcom_parse_instructions(chip, subop, &q_op);
> @@ -2838,7 +2836,7 @@ static int qcom_param_page_type_exec(struct nand_chip *chip, const struct nand_
> {
> struct qcom_nand_host *host = to_qcom_nand_host(chip);
> struct qcom_nand_controller *nandc = get_qcom_nand_controller(chip);
> - struct qcom_op q_op;
> + struct qcom_op q_op = {};
> const struct nand_op_instr *instr = NULL;
> unsigned int op_id = 0;
> unsigned int len = 0;
> @@ -2935,7 +2933,7 @@ static int qcom_erase_cmd_type_exec(struct nand_chip *chip, const struct nand_su
> {
> struct qcom_nand_host *host = to_qcom_nand_host(chip);
> struct qcom_nand_controller *nandc = get_qcom_nand_controller(chip);
> - struct qcom_op q_op;
> + struct qcom_op q_op = {};
> int ret = 0;
>
> qcom_parse_instructions(chip, subop, &q_op);
> --
> 2.34.1
>
--
மணிவண்ணன் சதாசிவம்
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: [PATCH 8/8] mtd: rawnand: qcom: Fix address parsing within ->exec_op()
2023-07-16 14:46 ` [PATCH 8/8] mtd: rawnand: qcom: Fix address parsing within ->exec_op() Miquel Raynal
@ 2023-07-17 6:38 ` Manivannan Sadhasivam
2023-07-27 14:59 ` Miquel Raynal
2023-07-28 2:27 ` Tudor Ambarus
2023-07-28 12:34 ` Miquel Raynal
2 siblings, 1 reply; 40+ messages in thread
From: Manivannan Sadhasivam @ 2023-07-17 6:38 UTC (permalink / raw)
To: Miquel Raynal
Cc: Md Sadre Alam, Sricharan Ramabadhran, Richard Weinberger,
Vignesh Raghavendra, Tudor Ambarus, Pratyush Yadav, Michael Walle,
linux-mtd, linux-arm-kernel, kernel test robot
On Sun, Jul 16, 2023 at 04:46:12PM +0200, Miquel Raynal wrote:
> The naddrs variable is initialized but not used. Fixing this could have
> been a matter of dropping the variable, but the right way to do it looks
> a bit more complex: we can avoid useless writes to the q_op structure by
> using it. In practice we could even have possible out-of-bound bugs with
> the existing implementation. Let's fix all that by just performing the
> right number of assignments in the addr{1,2}_reg fields.
>
> Fixes: 89550beb098e ("mtd: rawnand: qcom: Implement exec_op()")
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202307131959.PdPSC86K-lkp@intel.com/
> Closes: https://lore.kernel.org/oe-kbuild-all/202307131730.NOYbcjBr-lkp@intel.com/
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
LGTM! But I'm relying on Sadre to test it.
Acked-by: Manivannan Sadhasivam <mani@kernel.org>
- Mani
> ---
> drivers/mtd/nand/raw/qcom_nandc.c | 13 +++++++------
> 1 file changed, 7 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/mtd/nand/raw/qcom_nandc.c b/drivers/mtd/nand/raw/qcom_nandc.c
> index 4fc8dafa8f03..dc8ca60fc2e2 100644
> --- a/drivers/mtd/nand/raw/qcom_nandc.c
> +++ b/drivers/mtd/nand/raw/qcom_nandc.c
> @@ -2616,12 +2616,13 @@ static void qcom_parse_instructions(struct nand_chip *chip,
> offset = nand_subop_get_addr_start_off(subop, op_id);
> naddrs = nand_subop_get_num_addr_cyc(subop, op_id);
> addrs = &instr->ctx.addr.addrs[offset];
> - for (i = 0; i < MAX_ADDRESS_CYCLE; i++) {
> - if (i < 4)
> - q_op->addr1_reg |= (u32)addrs[i] << i * 8;
> - else
> - q_op->addr2_reg |= addrs[i];
> - }
> +
> + for (i = 0; i < min_t(unsigned int, 4, naddrs); i++)
> + q_op->addr1_reg |= addrs[i] << (i * 8);
> +
> + if (naddrs > 4)
> + q_op->addr2_reg |= addrs[4];
> +
> q_op->rdy_delay_ns = instr->delay_ns;
> break;
>
> --
> 2.34.1
>
--
மணிவண்ணன் சதாசிவம்
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: [PATCH 8/8] mtd: rawnand: qcom: Fix address parsing within ->exec_op()
2023-07-17 6:38 ` Manivannan Sadhasivam
@ 2023-07-27 14:59 ` Miquel Raynal
2023-07-28 2:31 ` Tudor Ambarus
2023-07-28 2:33 ` Sricharan Ramabadhran
0 siblings, 2 replies; 40+ messages in thread
From: Miquel Raynal @ 2023-07-27 14:59 UTC (permalink / raw)
To: Manivannan Sadhasivam
Cc: Md Sadre Alam, Sricharan Ramabadhran, Richard Weinberger,
Vignesh Raghavendra, Tudor Ambarus, Pratyush Yadav, Michael Walle,
linux-mtd, linux-arm-kernel, kernel test robot
Hi Sadre,
mani@kernel.org wrote on Mon, 17 Jul 2023 12:08:43 +0530:
> On Sun, Jul 16, 2023 at 04:46:12PM +0200, Miquel Raynal wrote:
> > The naddrs variable is initialized but not used. Fixing this could have
> > been a matter of dropping the variable, but the right way to do it looks
> > a bit more complex: we can avoid useless writes to the q_op structure by
> > using it. In practice we could even have possible out-of-bound bugs with
> > the existing implementation. Let's fix all that by just performing the
> > right number of assignments in the addr{1,2}_reg fields.
> >
> > Fixes: 89550beb098e ("mtd: rawnand: qcom: Implement exec_op()")
> > Reported-by: kernel test robot <lkp@intel.com>
> > Closes: https://lore.kernel.org/oe-kbuild-all/202307131959.PdPSC86K-lkp@intel.com/
> > Closes: https://lore.kernel.org/oe-kbuild-all/202307131730.NOYbcjBr-lkp@intel.com/
> > Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
>
> LGTM! But I'm relying on Sadre to test it.
>
> Acked-by: Manivannan Sadhasivam <mani@kernel.org>
I don't think I've received feedback from Sadre, I would like to close
these issues, can you please test and give us feedback?
Thanks a lot,
Miquèl
>
> - Mani
>
> > ---
> > drivers/mtd/nand/raw/qcom_nandc.c | 13 +++++++------
> > 1 file changed, 7 insertions(+), 6 deletions(-)
> >
> > diff --git a/drivers/mtd/nand/raw/qcom_nandc.c b/drivers/mtd/nand/raw/qcom_nandc.c
> > index 4fc8dafa8f03..dc8ca60fc2e2 100644
> > --- a/drivers/mtd/nand/raw/qcom_nandc.c
> > +++ b/drivers/mtd/nand/raw/qcom_nandc.c
> > @@ -2616,12 +2616,13 @@ static void qcom_parse_instructions(struct nand_chip *chip,
> > offset = nand_subop_get_addr_start_off(subop, op_id);
> > naddrs = nand_subop_get_num_addr_cyc(subop, op_id);
> > addrs = &instr->ctx.addr.addrs[offset];
> > - for (i = 0; i < MAX_ADDRESS_CYCLE; i++) {
> > - if (i < 4)
> > - q_op->addr1_reg |= (u32)addrs[i] << i * 8;
> > - else
> > - q_op->addr2_reg |= addrs[i];
> > - }
> > +
> > + for (i = 0; i < min_t(unsigned int, 4, naddrs); i++)
> > + q_op->addr1_reg |= addrs[i] << (i * 8);
> > +
> > + if (naddrs > 4)
> > + q_op->addr2_reg |= addrs[4];
> > +
> > q_op->rdy_delay_ns = instr->delay_ns;
> > break;
> >
> > --
> > 2.34.1
> >
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: [PATCH 7/8] mtd: rawnand: qcom: Early structure initialization
2023-07-16 14:46 ` [PATCH 7/8] mtd: rawnand: qcom: Early structure initialization Miquel Raynal
2023-07-17 2:31 ` Manivannan Sadhasivam
@ 2023-07-27 15:03 ` Tudor Ambarus
2023-07-27 15:14 ` Miquel Raynal
2023-07-28 2:23 ` Tudor Ambarus
2023-07-28 12:34 ` Miquel Raynal
3 siblings, 1 reply; 40+ messages in thread
From: Tudor Ambarus @ 2023-07-27 15:03 UTC (permalink / raw)
To: Miquel Raynal, Manivannan Sadhasivam, Md Sadre Alam,
Sricharan Ramabadhran
Cc: Richard Weinberger, Vignesh Raghavendra, Pratyush Yadav,
Michael Walle, linux-mtd, linux-arm-kernel
On 7/16/23 15:46, Miquel Raynal wrote:
> Instead of allocating a structure on the stack with random data and then
> expect the callee to perform the initialization (which is, in general,
> error prone), prefer zeroing the structure explicitly at allocation and
> provide the already zeroed area, so no explicit memset operation is
> needed. It is probably safer to do so, so we limit the timeframe when
> dirty data could actually be accessed by mistake.
Why is zeroed data considered safe or sane?
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: [PATCH 7/8] mtd: rawnand: qcom: Early structure initialization
2023-07-27 15:03 ` Tudor Ambarus
@ 2023-07-27 15:14 ` Miquel Raynal
0 siblings, 0 replies; 40+ messages in thread
From: Miquel Raynal @ 2023-07-27 15:14 UTC (permalink / raw)
To: Tudor Ambarus
Cc: Manivannan Sadhasivam, Md Sadre Alam, Sricharan Ramabadhran,
Richard Weinberger, Vignesh Raghavendra, Pratyush Yadav,
Michael Walle, linux-mtd, linux-arm-kernel
Hi Tudor,
tudor.ambarus@linaro.org wrote on Thu, 27 Jul 2023 16:03:40 +0100:
> On 7/16/23 15:46, Miquel Raynal wrote:
> > Instead of allocating a structure on the stack with random data and then
> > expect the callee to perform the initialization (which is, in general,
> > error prone), prefer zeroing the structure explicitly at allocation and
> > provide the already zeroed area, so no explicit memset operation is
> > needed. It is probably safer to do so, so we limit the timeframe when
> > dirty data could actually be accessed by mistake.
>
> Why is zeroed data considered safe or sane?
I believe allocating structures like that on the stack will make their
content inherit from previous values used there, which is generally a
bad idea if we expect the structure to be zeroed, which is the case
here.
This structure is meant to be zeroed before being used, so instead of
carrying stale data that will be wiped off later, I prefer to have it
zeroed earlier. Reducing the time when one could access stale data or
write something that will be reset does not sound totally useless to
me, in particular given the number of changes this driver has been
subject to recently.
Thanks,
Miquèl
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: [PATCH 1/8] mtd: rawnand: qcom: Use the BIT() macro
2023-07-16 14:46 ` [PATCH 1/8] mtd: rawnand: qcom: Use the BIT() macro Miquel Raynal
2023-07-17 2:25 ` Manivannan Sadhasivam
@ 2023-07-28 2:16 ` Tudor Ambarus
2023-07-28 12:35 ` Miquel Raynal
2 siblings, 0 replies; 40+ messages in thread
From: Tudor Ambarus @ 2023-07-28 2:16 UTC (permalink / raw)
To: Miquel Raynal, Manivannan Sadhasivam, Md Sadre Alam,
Sricharan Ramabadhran
Cc: Richard Weinberger, Vignesh Raghavendra, Pratyush Yadav,
Michael Walle, linux-mtd, linux-arm-kernel
On 7/16/23 15:46, Miquel Raynal wrote:
> Fix the following checkpatch warning:
> "CHECK: Prefer using the BIT macro"
>
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Tudor Ambarus <tudor.ambarus@linaro.org>
> ---
> drivers/mtd/nand/raw/qcom_nandc.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mtd/nand/raw/qcom_nandc.c b/drivers/mtd/nand/raw/qcom_nandc.c
> index b1e69d634d4a..023c8b36426b 100644
> --- a/drivers/mtd/nand/raw/qcom_nandc.c
> +++ b/drivers/mtd/nand/raw/qcom_nandc.c
> @@ -123,8 +123,8 @@
> /* NAND_ERASED_CW_DETECT_CFG bits */
> #define ERASED_CW_ECC_MASK 1
> #define AUTO_DETECT_RES 0
> -#define MASK_ECC (1 << ERASED_CW_ECC_MASK)
> -#define RESET_ERASED_DET (1 << AUTO_DETECT_RES)
> +#define MASK_ECC BIT(ERASED_CW_ECC_MASK)
> +#define RESET_ERASED_DET BIT(AUTO_DETECT_RES)
> #define ACTIVE_ERASED_DET (0 << AUTO_DETECT_RES)
> #define CLR_ERASED_PAGE_DET (RESET_ERASED_DET | MASK_ECC)
> #define SET_ERASED_PAGE_DET (ACTIVE_ERASED_DET | MASK_ECC)
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: [PATCH 2/8] mtd: rawnand: qcom: Use u8 instead of uint8_t
2023-07-16 14:46 ` [PATCH 2/8] mtd: rawnand: qcom: Use u8 instead of uint8_t Miquel Raynal
2023-07-17 2:26 ` Manivannan Sadhasivam
@ 2023-07-28 2:17 ` Tudor Ambarus
2023-07-28 12:35 ` Miquel Raynal
2 siblings, 0 replies; 40+ messages in thread
From: Tudor Ambarus @ 2023-07-28 2:17 UTC (permalink / raw)
To: Miquel Raynal, Manivannan Sadhasivam, Md Sadre Alam,
Sricharan Ramabadhran
Cc: Richard Weinberger, Vignesh Raghavendra, Pratyush Yadav,
Michael Walle, linux-mtd, linux-arm-kernel
On 7/16/23 15:46, Miquel Raynal wrote:
> Fix the following checkpatch warning:
> "CHECK: Prefer kernel type 'u8' over 'uint8_t'"
>
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Tudor Ambarus <tudor.ambarus@linaro.org>
> ---
> drivers/mtd/nand/raw/qcom_nandc.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/mtd/nand/raw/qcom_nandc.c b/drivers/mtd/nand/raw/qcom_nandc.c
> index 023c8b36426b..0136df01738e 100644
> --- a/drivers/mtd/nand/raw/qcom_nandc.c
> +++ b/drivers/mtd/nand/raw/qcom_nandc.c
> @@ -212,7 +212,7 @@ nandc_set_reg(chip, reg, \
> /* Returns the dma address for reg read buffer */
> #define reg_buf_dma_addr(chip, vaddr) \
> ((chip)->reg_read_dma + \
> - ((uint8_t *)(vaddr) - (uint8_t *)(chip)->reg_read_buf))
> + ((u8 *)(vaddr) - (u8 *)(chip)->reg_read_buf))
>
> #define QPIC_PER_CW_CMD_ELEMENTS 32
> #define QPIC_PER_CW_CMD_SGL 32
> @@ -1884,7 +1884,7 @@ static void qcom_nandc_codeword_fixup(struct qcom_nand_host *host, int page)
> }
>
> /* implements ecc->read_page() */
> -static int qcom_nandc_read_page(struct nand_chip *chip, uint8_t *buf,
> +static int qcom_nandc_read_page(struct nand_chip *chip, u8 *buf,
> int oob_required, int page)
> {
> struct qcom_nand_host *host = to_qcom_nand_host(chip);
> @@ -1912,7 +1912,7 @@ static int qcom_nandc_read_page(struct nand_chip *chip, uint8_t *buf,
> }
>
> /* implements ecc->read_page_raw() */
> -static int qcom_nandc_read_page_raw(struct nand_chip *chip, uint8_t *buf,
> +static int qcom_nandc_read_page_raw(struct nand_chip *chip, u8 *buf,
> int oob_required, int page)
> {
> struct mtd_info *mtd = nand_to_mtd(chip);
> @@ -1958,7 +1958,7 @@ static int qcom_nandc_read_oob(struct nand_chip *chip, int page)
> }
>
> /* implements ecc->write_page() */
> -static int qcom_nandc_write_page(struct nand_chip *chip, const uint8_t *buf,
> +static int qcom_nandc_write_page(struct nand_chip *chip, const u8 *buf,
> int oob_required, int page)
> {
> struct qcom_nand_host *host = to_qcom_nand_host(chip);
> @@ -2035,7 +2035,7 @@ static int qcom_nandc_write_page(struct nand_chip *chip, const uint8_t *buf,
>
> /* implements ecc->write_page_raw() */
> static int qcom_nandc_write_page_raw(struct nand_chip *chip,
> - const uint8_t *buf, int oob_required,
> + const u8 *buf, int oob_required,
> int page)
> {
> struct mtd_info *mtd = nand_to_mtd(chip);
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: [PATCH 3/8] mtd: rawnand: qcom: Fix alignment with open parenthesis
2023-07-16 14:46 ` [PATCH 3/8] mtd: rawnand: qcom: Fix alignment with open parenthesis Miquel Raynal
2023-07-17 2:27 ` Manivannan Sadhasivam
@ 2023-07-28 2:17 ` Tudor Ambarus
1 sibling, 0 replies; 40+ messages in thread
From: Tudor Ambarus @ 2023-07-28 2:17 UTC (permalink / raw)
To: Miquel Raynal, Manivannan Sadhasivam, Md Sadre Alam,
Sricharan Ramabadhran
Cc: Richard Weinberger, Vignesh Raghavendra, Pratyush Yadav,
Michael Walle, linux-mtd, linux-arm-kernel
On 7/16/23 15:46, Miquel Raynal wrote:
> Fix the following checkpatch warning:
> "CHECK: Alignment should match open parenthesis"
>
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Tudor Ambarus <tudor.ambarus@linaro.org>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: [PATCH 4/8] mtd: rawnand: qcom: Fix the spacing
2023-07-16 14:46 ` [PATCH 4/8] mtd: rawnand: qcom: Fix the spacing Miquel Raynal
2023-07-17 2:28 ` Manivannan Sadhasivam
@ 2023-07-28 2:18 ` Tudor Ambarus
2023-07-28 12:34 ` Miquel Raynal
2 siblings, 0 replies; 40+ messages in thread
From: Tudor Ambarus @ 2023-07-28 2:18 UTC (permalink / raw)
To: Miquel Raynal, Manivannan Sadhasivam, Md Sadre Alam,
Sricharan Ramabadhran
Cc: Richard Weinberger, Vignesh Raghavendra, Pratyush Yadav,
Michael Walle, linux-mtd, linux-arm-kernel
On 7/16/23 15:46, Miquel Raynal wrote:
> Fix following checkpatch warning:
> "CHECK: Please don't use multiple blank lines"
> "CHECK: Please use a blank line after
> function/struct/union/enum declarations"
>
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Tudor Ambarus <tudor.ambarus@linaro.org>
> ---
> drivers/mtd/nand/raw/qcom_nandc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mtd/nand/raw/qcom_nandc.c b/drivers/mtd/nand/raw/qcom_nandc.c
> index 54a7b49bda87..554cca3801da 100644
> --- a/drivers/mtd/nand/raw/qcom_nandc.c
> +++ b/drivers/mtd/nand/raw/qcom_nandc.c
> @@ -1997,7 +1997,6 @@ static int qcom_nandc_write_page(struct nand_chip *chip, const u8 *buf,
> oob_size = ecc->bytes;
> }
>
> -
> write_data_dma(nandc, FLASH_BUF_ACC, data_buf, data_size,
> i == (ecc->steps - 1) ? NAND_BAM_NO_EOT : 0);
>
> @@ -2373,6 +2372,7 @@ qcom_nandc_calc_ecc_bytes(int step_size, int strength)
> {
> return strength == 4 ? 12 : 16;
> }
> +
> NAND_ECC_CAPS_SINGLE(qcom_nandc_ecc_caps, qcom_nandc_calc_ecc_bytes,
> NANDC_STEP_SIZE, 4, 8);
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: [PATCH 5/8] mtd: rawnand: qcom: Fix wrong indentation
2023-07-16 14:46 ` [PATCH 5/8] mtd: rawnand: qcom: Fix wrong indentation Miquel Raynal
2023-07-17 2:29 ` Manivannan Sadhasivam
@ 2023-07-28 2:20 ` Tudor Ambarus
2023-07-28 12:34 ` Miquel Raynal
2 siblings, 0 replies; 40+ messages in thread
From: Tudor Ambarus @ 2023-07-28 2:20 UTC (permalink / raw)
To: Miquel Raynal, Manivannan Sadhasivam, Md Sadre Alam,
Sricharan Ramabadhran
Cc: Richard Weinberger, Vignesh Raghavendra, Pratyush Yadav,
Michael Walle, linux-mtd, linux-arm-kernel
On 7/16/23 15:46, Miquel Raynal wrote:
> The main "for" loop in qcom_read_status_exec() does guard the following
> to if's which are badly indented. Fix the indentation.
>
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Tudor Ambarus <tudor.ambarus@linaro.org>
> ---
> drivers/mtd/nand/raw/qcom_nandc.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/mtd/nand/raw/qcom_nandc.c b/drivers/mtd/nand/raw/qcom_nandc.c
> index 554cca3801da..3adc40ef5cf6 100644
> --- a/drivers/mtd/nand/raw/qcom_nandc.c
> +++ b/drivers/mtd/nand/raw/qcom_nandc.c
> @@ -2722,12 +2722,12 @@ static int qcom_read_status_exec(struct nand_chip *chip,
> for (i = 0; i < num_cw; i++) {
> flash_status = le32_to_cpu(nandc->reg_read_buf[i]);
>
> - if (flash_status & FS_MPU_ERR)
> - host->status &= ~NAND_STATUS_WP;
> + if (flash_status & FS_MPU_ERR)
> + host->status &= ~NAND_STATUS_WP;
>
> - if (flash_status & FS_OP_ERR ||
> - (i == (num_cw - 1) && (flash_status & FS_DEVICE_STS_ERR)))
> - host->status |= NAND_STATUS_FAIL;
> + if (flash_status & FS_OP_ERR ||
> + (i == (num_cw - 1) && (flash_status & FS_DEVICE_STS_ERR)))
> + host->status |= NAND_STATUS_FAIL;
> }
>
> flash_status = host->status;
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: [PATCH 6/8] mtd: rawnand: qcom: Fix a typo
2023-07-16 14:46 ` [PATCH 6/8] mtd: rawnand: qcom: Fix a typo Miquel Raynal
2023-07-17 2:30 ` Manivannan Sadhasivam
@ 2023-07-28 2:22 ` Tudor Ambarus
2023-07-28 12:34 ` Miquel Raynal
2 siblings, 0 replies; 40+ messages in thread
From: Tudor Ambarus @ 2023-07-28 2:22 UTC (permalink / raw)
To: Miquel Raynal, Manivannan Sadhasivam, Md Sadre Alam,
Sricharan Ramabadhran
Cc: Richard Weinberger, Vignesh Raghavendra, Pratyush Yadav,
Michael Walle, linux-mtd, linux-arm-kernel
On 7/16/23 15:46, Miquel Raynal wrote:
> Fix the following checkpatch warning:
> CHECK: 'tranasction' may be misspelled - perhaps 'transaction'?
>
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Tudor Ambarus <tudor.ambarus@linaro.org>
> ---
> drivers/mtd/nand/raw/qcom_nandc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mtd/nand/raw/qcom_nandc.c b/drivers/mtd/nand/raw/qcom_nandc.c
> index 3adc40ef5cf6..cb6ccaa19224 100644
> --- a/drivers/mtd/nand/raw/qcom_nandc.c
> +++ b/drivers/mtd/nand/raw/qcom_nandc.c
> @@ -3144,7 +3144,7 @@ static int qcom_nandc_alloc(struct qcom_nand_controller *nandc)
> /*
> * Initially allocate BAM transaction to read ONFI param page.
> * After detecting all the devices, this BAM transaction will
> - * be freed and the next BAM tranasction will be allocated with
> + * be freed and the next BAM transaction will be allocated with
> * maximum codeword size
> */
> nandc->max_cwperpage = 1;
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: [PATCH 7/8] mtd: rawnand: qcom: Early structure initialization
2023-07-16 14:46 ` [PATCH 7/8] mtd: rawnand: qcom: Early structure initialization Miquel Raynal
2023-07-17 2:31 ` Manivannan Sadhasivam
2023-07-27 15:03 ` Tudor Ambarus
@ 2023-07-28 2:23 ` Tudor Ambarus
2023-07-28 12:34 ` Miquel Raynal
3 siblings, 0 replies; 40+ messages in thread
From: Tudor Ambarus @ 2023-07-28 2:23 UTC (permalink / raw)
To: Miquel Raynal, Manivannan Sadhasivam, Md Sadre Alam,
Sricharan Ramabadhran
Cc: Richard Weinberger, Vignesh Raghavendra, Pratyush Yadav,
Michael Walle, linux-mtd, linux-arm-kernel
On 7/16/23 15:46, Miquel Raynal wrote:
> Instead of allocating a structure on the stack with random data and then
> expect the callee to perform the initialization (which is, in general,
> error prone), prefer zeroing the structure explicitly at allocation and
> provide the already zeroed area, so no explicit memset operation is
> needed. It is probably safer to do so, so we limit the timeframe when
> dirty data could actually be accessed by mistake.
>
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Tudor Ambarus <tudor.ambarus@linaro.org>
> ---
> drivers/mtd/nand/raw/qcom_nandc.c | 12 +++++-------
> 1 file changed, 5 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/mtd/nand/raw/qcom_nandc.c b/drivers/mtd/nand/raw/qcom_nandc.c
> index cb6ccaa19224..4fc8dafa8f03 100644
> --- a/drivers/mtd/nand/raw/qcom_nandc.c
> +++ b/drivers/mtd/nand/raw/qcom_nandc.c
> @@ -2600,8 +2600,6 @@ static void qcom_parse_instructions(struct nand_chip *chip,
> unsigned int op_id;
> int i;
>
> - memset(q_op, 0, sizeof(*q_op));
> -
> for (op_id = 0; op_id < subop->ninstrs; op_id++) {
> unsigned int offset, naddrs;
> const u8 *addrs;
> @@ -2681,7 +2679,7 @@ static int qcom_read_status_exec(struct nand_chip *chip,
> struct qcom_nand_host *host = to_qcom_nand_host(chip);
> struct qcom_nand_controller *nandc = get_qcom_nand_controller(chip);
> struct nand_ecc_ctrl *ecc = &chip->ecc;
> - struct qcom_op q_op;
> + struct qcom_op q_op = {};
> const struct nand_op_instr *instr = NULL;
> unsigned int op_id = 0;
> unsigned int len = 0;
> @@ -2744,7 +2742,7 @@ static int qcom_read_id_type_exec(struct nand_chip *chip, const struct nand_subo
> {
> struct qcom_nand_controller *nandc = get_qcom_nand_controller(chip);
> struct qcom_nand_host *host = to_qcom_nand_host(chip);
> - struct qcom_op q_op;
> + struct qcom_op q_op = {};
> const struct nand_op_instr *instr = NULL;
> unsigned int op_id = 0;
> unsigned int len = 0;
> @@ -2795,7 +2793,7 @@ static int qcom_misc_cmd_type_exec(struct nand_chip *chip, const struct nand_sub
> {
> struct qcom_nand_controller *nandc = get_qcom_nand_controller(chip);
> struct qcom_nand_host *host = to_qcom_nand_host(chip);
> - struct qcom_op q_op;
> + struct qcom_op q_op = {};
> int ret = 0;
>
> qcom_parse_instructions(chip, subop, &q_op);
> @@ -2838,7 +2836,7 @@ static int qcom_param_page_type_exec(struct nand_chip *chip, const struct nand_
> {
> struct qcom_nand_host *host = to_qcom_nand_host(chip);
> struct qcom_nand_controller *nandc = get_qcom_nand_controller(chip);
> - struct qcom_op q_op;
> + struct qcom_op q_op = {};
> const struct nand_op_instr *instr = NULL;
> unsigned int op_id = 0;
> unsigned int len = 0;
> @@ -2935,7 +2933,7 @@ static int qcom_erase_cmd_type_exec(struct nand_chip *chip, const struct nand_su
> {
> struct qcom_nand_host *host = to_qcom_nand_host(chip);
> struct qcom_nand_controller *nandc = get_qcom_nand_controller(chip);
> - struct qcom_op q_op;
> + struct qcom_op q_op = {};
> int ret = 0;
>
> qcom_parse_instructions(chip, subop, &q_op);
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: [PATCH 8/8] mtd: rawnand: qcom: Fix address parsing within ->exec_op()
2023-07-16 14:46 ` [PATCH 8/8] mtd: rawnand: qcom: Fix address parsing within ->exec_op() Miquel Raynal
2023-07-17 6:38 ` Manivannan Sadhasivam
@ 2023-07-28 2:27 ` Tudor Ambarus
2023-07-28 12:34 ` Miquel Raynal
2 siblings, 0 replies; 40+ messages in thread
From: Tudor Ambarus @ 2023-07-28 2:27 UTC (permalink / raw)
To: Miquel Raynal, Manivannan Sadhasivam, Md Sadre Alam,
Sricharan Ramabadhran
Cc: Richard Weinberger, Vignesh Raghavendra, Pratyush Yadav,
Michael Walle, linux-mtd, linux-arm-kernel, kernel test robot
On 7/16/23 15:46, Miquel Raynal wrote:
> The naddrs variable is initialized but not used. Fixing this could have
> been a matter of dropping the variable, but the right way to do it looks
> a bit more complex: we can avoid useless writes to the q_op structure by
> using it. In practice we could even have possible out-of-bound bugs with
> the existing implementation. Let's fix all that by just performing the
> right number of assignments in the addr{1,2}_reg fields.
>
> Fixes: 89550beb098e ("mtd: rawnand: qcom: Implement exec_op()")
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202307131959.PdPSC86K-lkp@intel.com/
> Closes: https://lore.kernel.org/oe-kbuild-all/202307131730.NOYbcjBr-lkp@intel.com/
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Tudor Ambarus <tudor.ambarus@linaro.org>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: [PATCH 8/8] mtd: rawnand: qcom: Fix address parsing within ->exec_op()
2023-07-27 14:59 ` Miquel Raynal
@ 2023-07-28 2:31 ` Tudor Ambarus
2023-07-28 7:56 ` Miquel Raynal
2023-07-28 2:33 ` Sricharan Ramabadhran
1 sibling, 1 reply; 40+ messages in thread
From: Tudor Ambarus @ 2023-07-28 2:31 UTC (permalink / raw)
To: Miquel Raynal, Manivannan Sadhasivam
Cc: Md Sadre Alam, Sricharan Ramabadhran, Richard Weinberger,
Vignesh Raghavendra, Pratyush Yadav, Michael Walle, linux-mtd,
linux-arm-kernel, kernel test robot
Hi, Miquel,
On 7/27/23 15:59, Miquel Raynal wrote:
> Hi Sadre,
>
> mani@kernel.org wrote on Mon, 17 Jul 2023 12:08:43 +0530:
>
>> On Sun, Jul 16, 2023 at 04:46:12PM +0200, Miquel Raynal wrote:
>>> The naddrs variable is initialized but not used. Fixing this could have
>>> been a matter of dropping the variable, but the right way to do it looks
>>> a bit more complex: we can avoid useless writes to the q_op structure by
>>> using it. In practice we could even have possible out-of-bound bugs with
>>> the existing implementation. Let's fix all that by just performing the
>>> right number of assignments in the addr{1,2}_reg fields.
>>>
>>> Fixes: 89550beb098e ("mtd: rawnand: qcom: Implement exec_op()")
>>> Reported-by: kernel test robot <lkp@intel.com>
>>> Closes: https://lore.kernel.org/oe-kbuild-all/202307131959.PdPSC86K-lkp@intel.com/
>>> Closes: https://lore.kernel.org/oe-kbuild-all/202307131730.NOYbcjBr-lkp@intel.com/
>>> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
>> LGTM! But I'm relying on Sadre to test it.
>>
>> Acked-by: Manivannan Sadhasivam <mani@kernel.org>
> I don't think I've received feedback from Sadre, I would like to close
> these issues, can you please test and give us feedback?
All patches are pretty straight forward. Let the 0-day bot run with them
and then apply all if no further feedback.
Cheers,
ta
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: [PATCH 8/8] mtd: rawnand: qcom: Fix address parsing within ->exec_op()
2023-07-27 14:59 ` Miquel Raynal
2023-07-28 2:31 ` Tudor Ambarus
@ 2023-07-28 2:33 ` Sricharan Ramabadhran
2023-07-28 4:14 ` Sricharan Ramabadhran
1 sibling, 1 reply; 40+ messages in thread
From: Sricharan Ramabadhran @ 2023-07-28 2:33 UTC (permalink / raw)
To: Miquel Raynal, Manivannan Sadhasivam
Cc: Md Sadre Alam, Richard Weinberger, Vignesh Raghavendra,
Tudor Ambarus, Pratyush Yadav, Michael Walle, linux-mtd,
linux-arm-kernel, kernel test robot
Hi Miquel,
On 7/27/2023 8:29 PM, Miquel Raynal wrote:
> Hi Sadre,
>
> mani@kernel.org wrote on Mon, 17 Jul 2023 12:08:43 +0530:
>
>> On Sun, Jul 16, 2023 at 04:46:12PM +0200, Miquel Raynal wrote:
>>> The naddrs variable is initialized but not used. Fixing this could have
>>> been a matter of dropping the variable, but the right way to do it looks
>>> a bit more complex: we can avoid useless writes to the q_op structure by
>>> using it. In practice we could even have possible out-of-bound bugs with
>>> the existing implementation. Let's fix all that by just performing the
>>> right number of assignments in the addr{1,2}_reg fields.
>>>
>>> Fixes: 89550beb098e ("mtd: rawnand: qcom: Implement exec_op()")
>>> Reported-by: kernel test robot <lkp@intel.com>
>>> Closes: https://lore.kernel.org/oe-kbuild-all/202307131959.PdPSC86K-lkp@intel.com/
>>> Closes: https://lore.kernel.org/oe-kbuild-all/202307131730.NOYbcjBr-lkp@intel.com/
>>> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
>>
>> LGTM! But I'm relying on Sadre to test it.
>>
>> Acked-by: Manivannan Sadhasivam <mani@kernel.org>
>
> I don't think I've received feedback from Sadre, I would like to close
> these issues, can you please test and give us feedback?
>
Sorry for the delay in response. Testing this, will respond back
shortly today.
Regards,
Sricharan
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: [PATCH 8/8] mtd: rawnand: qcom: Fix address parsing within ->exec_op()
2023-07-28 2:33 ` Sricharan Ramabadhran
@ 2023-07-28 4:14 ` Sricharan Ramabadhran
2023-07-28 7:55 ` Miquel Raynal
0 siblings, 1 reply; 40+ messages in thread
From: Sricharan Ramabadhran @ 2023-07-28 4:14 UTC (permalink / raw)
To: Miquel Raynal, Manivannan Sadhasivam
Cc: Md Sadre Alam, Richard Weinberger, Vignesh Raghavendra,
Tudor Ambarus, Pratyush Yadav, Michael Walle, linux-mtd,
linux-arm-kernel, kernel test robot
Hi Miquel,
On 7/28/2023 8:03 AM, Sricharan Ramabadhran wrote:
> Hi Miquel,
>
> On 7/27/2023 8:29 PM, Miquel Raynal wrote:
>> Hi Sadre,
>>
>> mani@kernel.org wrote on Mon, 17 Jul 2023 12:08:43 +0530:
>>
>>> On Sun, Jul 16, 2023 at 04:46:12PM +0200, Miquel Raynal wrote:
>>>> The naddrs variable is initialized but not used. Fixing this could have
>>>> been a matter of dropping the variable, but the right way to do it
>>>> looks
>>>> a bit more complex: we can avoid useless writes to the q_op
>>>> structure by
>>>> using it. In practice we could even have possible out-of-bound bugs
>>>> with
>>>> the existing implementation. Let's fix all that by just performing the
>>>> right number of assignments in the addr{1,2}_reg fields.
>>>>
>>>> Fixes: 89550beb098e ("mtd: rawnand: qcom: Implement exec_op()")
>>>> Reported-by: kernel test robot <lkp@intel.com>
>>>> Closes:
>>>> https://lore.kernel.org/oe-kbuild-all/202307131959.PdPSC86K-lkp@intel.com/
>>>>
>>>> Closes:
>>>> https://lore.kernel.org/oe-kbuild-all/202307131730.NOYbcjBr-lkp@intel.com/
>>>>
>>>> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
>>>
>>> LGTM! But I'm relying on Sadre to test it.
>>>
>>> Acked-by: Manivannan Sadhasivam <mani@kernel.org>
>>
>> I don't think I've received feedback from Sadre, I would like to close
>> these issues, can you please test and give us feedback?
>>
>
> Sorry for the delay in response. Testing this, will respond back
> shortly today.
Tested this series on ipq8074-hk01 board.
Tested bootcheck, both /dev/mtd and /dev/mtdblock for data integrity.
All looks fine. So,
Tested-by: Sricharan Ramabadhran <quic_srichara@quicinc.com>
Regards,
Sricharan
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: [PATCH 8/8] mtd: rawnand: qcom: Fix address parsing within ->exec_op()
2023-07-28 4:14 ` Sricharan Ramabadhran
@ 2023-07-28 7:55 ` Miquel Raynal
0 siblings, 0 replies; 40+ messages in thread
From: Miquel Raynal @ 2023-07-28 7:55 UTC (permalink / raw)
To: Sricharan Ramabadhran
Cc: Manivannan Sadhasivam, Md Sadre Alam, Richard Weinberger,
Vignesh Raghavendra, Tudor Ambarus, Pratyush Yadav, Michael Walle,
linux-mtd, linux-arm-kernel, kernel test robot
Hi Sricharan,
quic_srichara@quicinc.com wrote on Fri, 28 Jul 2023 09:44:37 +0530:
> Hi Miquel,
>
> On 7/28/2023 8:03 AM, Sricharan Ramabadhran wrote:
> > Hi Miquel,
> >
> > On 7/27/2023 8:29 PM, Miquel Raynal wrote:
> >> Hi Sadre,
> >>
> >> mani@kernel.org wrote on Mon, 17 Jul 2023 12:08:43 +0530:
> >>
> >>> On Sun, Jul 16, 2023 at 04:46:12PM +0200, Miquel Raynal wrote:
> >>>> The naddrs variable is initialized but not used. Fixing this could have
> >>>> been a matter of dropping the variable, but the right way to do it >>>> looks
> >>>> a bit more complex: we can avoid useless writes to the q_op >>>> structure by
> >>>> using it. In practice we could even have possible out-of-bound bugs >>>> with
> >>>> the existing implementation. Let's fix all that by just performing the
> >>>> right number of assignments in the addr{1,2}_reg fields.
> >>>>
> >>>> Fixes: 89550beb098e ("mtd: rawnand: qcom: Implement exec_op()")
> >>>> Reported-by: kernel test robot <lkp@intel.com>
> >>>> Closes: >>>> https://lore.kernel.org/oe-kbuild-all/202307131959.PdPSC86K-lkp@intel.com/ >>>>
> >>>> Closes: >>>> https://lore.kernel.org/oe-kbuild-all/202307131730.NOYbcjBr-lkp@intel.com/ >>>>
> >>>> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> >>>
> >>> LGTM! But I'm relying on Sadre to test it.
> >>>
> >>> Acked-by: Manivannan Sadhasivam <mani@kernel.org>
> >>
> >> I don't think I've received feedback from Sadre, I would like to close
> >> these issues, can you please test and give us feedback?
> >>
> >
> > Sorry for the delay in response. Testing this, will respond back
> > shortly today.
>
> Tested this series on ipq8074-hk01 board.
> Tested bootcheck, both /dev/mtd and /dev/mtdblock for data integrity.
> All looks fine. So,
>
> Tested-by: Sricharan Ramabadhran <quic_srichara@quicinc.com>
Thanks for the test! I'll take the series now then.
Thanks,
Miquèl
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: [PATCH 8/8] mtd: rawnand: qcom: Fix address parsing within ->exec_op()
2023-07-28 2:31 ` Tudor Ambarus
@ 2023-07-28 7:56 ` Miquel Raynal
0 siblings, 0 replies; 40+ messages in thread
From: Miquel Raynal @ 2023-07-28 7:56 UTC (permalink / raw)
To: Tudor Ambarus
Cc: Manivannan Sadhasivam, Md Sadre Alam, Sricharan Ramabadhran,
Richard Weinberger, Vignesh Raghavendra, Pratyush Yadav,
Michael Walle, linux-mtd, linux-arm-kernel, kernel test robot
Hi Tudor,
tudor.ambarus@linaro.org wrote on Fri, 28 Jul 2023 03:31:41 +0100:
> Hi, Miquel,
>
> On 7/27/23 15:59, Miquel Raynal wrote:
> > Hi Sadre,
> >
> > mani@kernel.org wrote on Mon, 17 Jul 2023 12:08:43 +0530:
> >
> >> On Sun, Jul 16, 2023 at 04:46:12PM +0200, Miquel Raynal wrote:
> >>> The naddrs variable is initialized but not used. Fixing this could have
> >>> been a matter of dropping the variable, but the right way to do it looks
> >>> a bit more complex: we can avoid useless writes to the q_op structure by
> >>> using it. In practice we could even have possible out-of-bound bugs with
> >>> the existing implementation. Let's fix all that by just performing the
> >>> right number of assignments in the addr{1,2}_reg fields.
> >>>
> >>> Fixes: 89550beb098e ("mtd: rawnand: qcom: Implement exec_op()")
> >>> Reported-by: kernel test robot <lkp@intel.com>
> >>> Closes: https://lore.kernel.org/oe-kbuild-all/202307131959.PdPSC86K-lkp@intel.com/
> >>> Closes: https://lore.kernel.org/oe-kbuild-all/202307131730.NOYbcjBr-lkp@intel.com/
> >>> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> >> LGTM! But I'm relying on Sadre to test it.
> >>
> >> Acked-by: Manivannan Sadhasivam <mani@kernel.org>
> > I don't think I've received feedback from Sadre, I would like to close
> > these issues, can you please test and give us feedback?
>
> All patches are pretty straight forward. Let the 0-day bot run with them
> and then apply all if no further feedback.
Thanks a lot for all the review! Fortunately I just received the
Tested-by, otherwise I agree most patches are simple enough (besides
the last one maybe) and 0-day might have done a good first iteration.
Thanks,
Miquèl
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: [PATCH 8/8] mtd: rawnand: qcom: Fix address parsing within ->exec_op()
2023-07-16 14:46 ` [PATCH 8/8] mtd: rawnand: qcom: Fix address parsing within ->exec_op() Miquel Raynal
2023-07-17 6:38 ` Manivannan Sadhasivam
2023-07-28 2:27 ` Tudor Ambarus
@ 2023-07-28 12:34 ` Miquel Raynal
2 siblings, 0 replies; 40+ messages in thread
From: Miquel Raynal @ 2023-07-28 12:34 UTC (permalink / raw)
To: Miquel Raynal, Manivannan Sadhasivam, Md Sadre Alam,
Sricharan Ramabadhran
Cc: Richard Weinberger, Vignesh Raghavendra, Tudor Ambarus,
Pratyush Yadav, Michael Walle, linux-mtd, linux-arm-kernel,
kernel test robot
On Sun, 2023-07-16 at 14:46:12 UTC, Miquel Raynal wrote:
> The naddrs variable is initialized but not used. Fixing this could have
> been a matter of dropping the variable, but the right way to do it looks
> a bit more complex: we can avoid useless writes to the q_op structure by
> using it. In practice we could even have possible out-of-bound bugs with
> the existing implementation. Let's fix all that by just performing the
> right number of assignments in the addr{1,2}_reg fields.
>
> Fixes: 89550beb098e ("mtd: rawnand: qcom: Implement exec_op()")
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202307131959.PdPSC86K-lkp@intel.com/
> Closes: https://lore.kernel.org/oe-kbuild-all/202307131730.NOYbcjBr-lkp@intel.com/
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> Acked-by: Manivannan Sadhasivam <mani@kernel.org>
> Reviewed-by: Tudor Ambarus <tudor.ambarus@linaro.org>
Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next.
Miquel
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: [PATCH 7/8] mtd: rawnand: qcom: Early structure initialization
2023-07-16 14:46 ` [PATCH 7/8] mtd: rawnand: qcom: Early structure initialization Miquel Raynal
` (2 preceding siblings ...)
2023-07-28 2:23 ` Tudor Ambarus
@ 2023-07-28 12:34 ` Miquel Raynal
3 siblings, 0 replies; 40+ messages in thread
From: Miquel Raynal @ 2023-07-28 12:34 UTC (permalink / raw)
To: Miquel Raynal, Manivannan Sadhasivam, Md Sadre Alam,
Sricharan Ramabadhran
Cc: Richard Weinberger, Vignesh Raghavendra, Tudor Ambarus,
Pratyush Yadav, Michael Walle, linux-mtd, linux-arm-kernel
On Sun, 2023-07-16 at 14:46:11 UTC, Miquel Raynal wrote:
> Instead of allocating a structure on the stack with random data and then
> expect the callee to perform the initialization (which is, in general,
> error prone), prefer zeroing the structure explicitly at allocation and
> provide the already zeroed area, so no explicit memset operation is
> needed. It is probably safer to do so, so we limit the timeframe when
> dirty data could actually be accessed by mistake.
>
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> Acked-by: Manivannan Sadhasivam <mani@kernel.org>
> Reviewed-by: Tudor Ambarus <tudor.ambarus@linaro.org>
Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next.
Miquel
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: [PATCH 6/8] mtd: rawnand: qcom: Fix a typo
2023-07-16 14:46 ` [PATCH 6/8] mtd: rawnand: qcom: Fix a typo Miquel Raynal
2023-07-17 2:30 ` Manivannan Sadhasivam
2023-07-28 2:22 ` Tudor Ambarus
@ 2023-07-28 12:34 ` Miquel Raynal
2 siblings, 0 replies; 40+ messages in thread
From: Miquel Raynal @ 2023-07-28 12:34 UTC (permalink / raw)
To: Miquel Raynal, Manivannan Sadhasivam, Md Sadre Alam,
Sricharan Ramabadhran
Cc: Richard Weinberger, Vignesh Raghavendra, Tudor Ambarus,
Pratyush Yadav, Michael Walle, linux-mtd, linux-arm-kernel
On Sun, 2023-07-16 at 14:46:10 UTC, Miquel Raynal wrote:
> Fix the following checkpatch warning:
> CHECK: 'tranasction' may be misspelled - perhaps 'transaction'?
>
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> Acked-by: Manivannan Sadhasivam <mani@kernel.org>
> Reviewed-by: Tudor Ambarus <tudor.ambarus@linaro.org>
Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next.
Miquel
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: [PATCH 5/8] mtd: rawnand: qcom: Fix wrong indentation
2023-07-16 14:46 ` [PATCH 5/8] mtd: rawnand: qcom: Fix wrong indentation Miquel Raynal
2023-07-17 2:29 ` Manivannan Sadhasivam
2023-07-28 2:20 ` Tudor Ambarus
@ 2023-07-28 12:34 ` Miquel Raynal
2 siblings, 0 replies; 40+ messages in thread
From: Miquel Raynal @ 2023-07-28 12:34 UTC (permalink / raw)
To: Miquel Raynal, Manivannan Sadhasivam, Md Sadre Alam,
Sricharan Ramabadhran
Cc: Richard Weinberger, Vignesh Raghavendra, Tudor Ambarus,
Pratyush Yadav, Michael Walle, linux-mtd, linux-arm-kernel
On Sun, 2023-07-16 at 14:46:09 UTC, Miquel Raynal wrote:
> The main "for" loop in qcom_read_status_exec() does guard the following
> to if's which are badly indented. Fix the indentation.
>
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> Acked-by: Manivannan Sadhasivam <mani@kernel.org>
> Reviewed-by: Tudor Ambarus <tudor.ambarus@linaro.org>
Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next.
Miquel
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: [PATCH 4/8] mtd: rawnand: qcom: Fix the spacing
2023-07-16 14:46 ` [PATCH 4/8] mtd: rawnand: qcom: Fix the spacing Miquel Raynal
2023-07-17 2:28 ` Manivannan Sadhasivam
2023-07-28 2:18 ` Tudor Ambarus
@ 2023-07-28 12:34 ` Miquel Raynal
2 siblings, 0 replies; 40+ messages in thread
From: Miquel Raynal @ 2023-07-28 12:34 UTC (permalink / raw)
To: Miquel Raynal, Manivannan Sadhasivam, Md Sadre Alam,
Sricharan Ramabadhran
Cc: Richard Weinberger, Vignesh Raghavendra, Tudor Ambarus,
Pratyush Yadav, Michael Walle, linux-mtd, linux-arm-kernel
On Sun, 2023-07-16 at 14:46:08 UTC, Miquel Raynal wrote:
> Fix following checkpatch warning:
> "CHECK: Please don't use multiple blank lines"
> "CHECK: Please use a blank line after
> function/struct/union/enum declarations"
>
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> Acked-by: Manivannan Sadhasivam <mani@kernel.org>
> Reviewed-by: Tudor Ambarus <tudor.ambarus@linaro.org>
Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next.
Miquel
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: [PATCH 2/8] mtd: rawnand: qcom: Use u8 instead of uint8_t
2023-07-16 14:46 ` [PATCH 2/8] mtd: rawnand: qcom: Use u8 instead of uint8_t Miquel Raynal
2023-07-17 2:26 ` Manivannan Sadhasivam
2023-07-28 2:17 ` Tudor Ambarus
@ 2023-07-28 12:35 ` Miquel Raynal
2 siblings, 0 replies; 40+ messages in thread
From: Miquel Raynal @ 2023-07-28 12:35 UTC (permalink / raw)
To: Miquel Raynal, Manivannan Sadhasivam, Md Sadre Alam,
Sricharan Ramabadhran
Cc: Richard Weinberger, Vignesh Raghavendra, Tudor Ambarus,
Pratyush Yadav, Michael Walle, linux-mtd, linux-arm-kernel
On Sun, 2023-07-16 at 14:46:06 UTC, Miquel Raynal wrote:
> Fix the following checkpatch warning:
> "CHECK: Prefer kernel type 'u8' over 'uint8_t'"
>
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> Acked-by: Manivannan Sadhasivam <mani@kernel.org>
> Reviewed-by: Tudor Ambarus <tudor.ambarus@linaro.org>
Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next.
Miquel
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 40+ messages in thread
* Re: [PATCH 1/8] mtd: rawnand: qcom: Use the BIT() macro
2023-07-16 14:46 ` [PATCH 1/8] mtd: rawnand: qcom: Use the BIT() macro Miquel Raynal
2023-07-17 2:25 ` Manivannan Sadhasivam
2023-07-28 2:16 ` Tudor Ambarus
@ 2023-07-28 12:35 ` Miquel Raynal
2 siblings, 0 replies; 40+ messages in thread
From: Miquel Raynal @ 2023-07-28 12:35 UTC (permalink / raw)
To: Miquel Raynal, Manivannan Sadhasivam, Md Sadre Alam,
Sricharan Ramabadhran
Cc: Richard Weinberger, Vignesh Raghavendra, Tudor Ambarus,
Pratyush Yadav, Michael Walle, linux-mtd, linux-arm-kernel
On Sun, 2023-07-16 at 14:46:05 UTC, Miquel Raynal wrote:
> Fix the following checkpatch warning:
> "CHECK: Prefer using the BIT macro"
>
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> Acked-by: Manivannan Sadhasivam <mani@kernel.org>
> Reviewed-by: Tudor Ambarus <tudor.ambarus@linaro.org>
Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next.
Miquel
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 40+ messages in thread
end of thread, other threads:[~2023-07-28 12:37 UTC | newest]
Thread overview: 40+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-16 14:46 [PATCH 0/8] mtd: rawnand: qcom: Misc fixes Miquel Raynal
2023-07-16 14:46 ` [PATCH 1/8] mtd: rawnand: qcom: Use the BIT() macro Miquel Raynal
2023-07-17 2:25 ` Manivannan Sadhasivam
2023-07-28 2:16 ` Tudor Ambarus
2023-07-28 12:35 ` Miquel Raynal
2023-07-16 14:46 ` [PATCH 2/8] mtd: rawnand: qcom: Use u8 instead of uint8_t Miquel Raynal
2023-07-17 2:26 ` Manivannan Sadhasivam
2023-07-28 2:17 ` Tudor Ambarus
2023-07-28 12:35 ` Miquel Raynal
2023-07-16 14:46 ` [PATCH 3/8] mtd: rawnand: qcom: Fix alignment with open parenthesis Miquel Raynal
2023-07-17 2:27 ` Manivannan Sadhasivam
2023-07-28 2:17 ` Tudor Ambarus
2023-07-16 14:46 ` [PATCH 4/8] mtd: rawnand: qcom: Fix the spacing Miquel Raynal
2023-07-17 2:28 ` Manivannan Sadhasivam
2023-07-28 2:18 ` Tudor Ambarus
2023-07-28 12:34 ` Miquel Raynal
2023-07-16 14:46 ` [PATCH 5/8] mtd: rawnand: qcom: Fix wrong indentation Miquel Raynal
2023-07-17 2:29 ` Manivannan Sadhasivam
2023-07-28 2:20 ` Tudor Ambarus
2023-07-28 12:34 ` Miquel Raynal
2023-07-16 14:46 ` [PATCH 6/8] mtd: rawnand: qcom: Fix a typo Miquel Raynal
2023-07-17 2:30 ` Manivannan Sadhasivam
2023-07-28 2:22 ` Tudor Ambarus
2023-07-28 12:34 ` Miquel Raynal
2023-07-16 14:46 ` [PATCH 7/8] mtd: rawnand: qcom: Early structure initialization Miquel Raynal
2023-07-17 2:31 ` Manivannan Sadhasivam
2023-07-27 15:03 ` Tudor Ambarus
2023-07-27 15:14 ` Miquel Raynal
2023-07-28 2:23 ` Tudor Ambarus
2023-07-28 12:34 ` Miquel Raynal
2023-07-16 14:46 ` [PATCH 8/8] mtd: rawnand: qcom: Fix address parsing within ->exec_op() Miquel Raynal
2023-07-17 6:38 ` Manivannan Sadhasivam
2023-07-27 14:59 ` Miquel Raynal
2023-07-28 2:31 ` Tudor Ambarus
2023-07-28 7:56 ` Miquel Raynal
2023-07-28 2:33 ` Sricharan Ramabadhran
2023-07-28 4:14 ` Sricharan Ramabadhran
2023-07-28 7:55 ` Miquel Raynal
2023-07-28 2:27 ` Tudor Ambarus
2023-07-28 12:34 ` Miquel Raynal
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).