public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH v2 3/4] mtd: rawnand: brcmnand: pass host struct to bcmnand_ctrl_poll_status
@ 2023-10-12  0:41 dregan
  2023-10-12  7:12 ` Miquel Raynal
  0 siblings, 1 reply; 3+ messages in thread
From: dregan @ 2023-10-12  0:41 UTC (permalink / raw)
  To: Miquel Raynal, bcm-kernel-feedback-list, linux-mtd, f.fainelli,
	rafal, joel.peshkin, computersforpeace, dan.beygelman,
	william.zhang, frieder.schrempf, linux-kernel, vigneshr, richard,
	bbrezillon, kdasu.kdev, dregan, JaimeLiao, Arseniy Krasnov,
	Adam Borowski

pass host struct to bcmnand_ctrl_poll_status instead of ctrl struct,
since real time status requires host, and ctrl is a member of host.

Signed-off-by: David Regan <dregan@mail.com>

---

Changes in v2: added this patch in series
---
 drivers/mtd/nand/raw/brcmnand/brcmnand.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/mtd/nand/raw/brcmnand/brcmnand.c b/drivers/mtd/nand/raw/brcmnand/brcmnand.c
index 440bef477930..8d429eb3b72a 100644
--- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c
+++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c
@@ -1061,10 +1061,11 @@ enum {
 	CS_SELECT_AUTO_DEVICE_ID_CFG		= BIT(30),
 };

-static int bcmnand_ctrl_poll_status(struct brcmnand_controller *ctrl,
+static int bcmnand_ctrl_poll_status(struct brcmnand_host *host,
 				    u32 mask, u32 expected_val,
 				    unsigned long timeout_ms)
 {
+	struct brcmnand_controller *ctrl = host->ctrl;
 	unsigned long limit;
 	u32 val;

@@ -1379,7 +1380,7 @@ static void brcmnand_wp(struct mtd_info *mtd, int wp)
 		 * make sure ctrl/flash ready before and after
 		 * changing state of #WP pin
 		 */
-		ret = bcmnand_ctrl_poll_status(ctrl, NAND_CTRL_RDY |
+		ret = bcmnand_ctrl_poll_status(host, NAND_CTRL_RDY |
 					       NAND_STATUS_READY,
 					       NAND_CTRL_RDY |
 					       NAND_STATUS_READY, 0);
@@ -1389,7 +1390,7 @@ static void brcmnand_wp(struct mtd_info *mtd, int wp)
 		brcmnand_set_wp(ctrl, wp);
 		nand_status_op(chip, NULL);
 		/* NAND_STATUS_WP 0x00 = protected, 0x80 = not protected */
-		ret = bcmnand_ctrl_poll_status(ctrl,
+		ret = bcmnand_ctrl_poll_status(host,
 					       NAND_CTRL_RDY |
 					       NAND_STATUS_READY |
 					       NAND_STATUS_WP,
@@ -1629,13 +1630,13 @@ static void brcmnand_send_cmd(struct brcmnand_host *host, int cmd)
 	 */
 	if (oops_in_progress) {
 		if (ctrl->cmd_pending &&
-			bcmnand_ctrl_poll_status(ctrl, NAND_CTRL_RDY, NAND_CTRL_RDY, 0))
+			bcmnand_ctrl_poll_status(host, NAND_CTRL_RDY, NAND_CTRL_RDY, 0))
 			return;
 	} else
 		BUG_ON(ctrl->cmd_pending != 0);
 	ctrl->cmd_pending = cmd;

-	ret = bcmnand_ctrl_poll_status(ctrl, NAND_CTRL_RDY, NAND_CTRL_RDY, 0);
+	ret = bcmnand_ctrl_poll_status(host, NAND_CTRL_RDY, NAND_CTRL_RDY, 0);
 	WARN_ON(ret);

 	mb(); /* flush previous writes */
@@ -1664,7 +1665,7 @@ static bool brcmstb_nand_wait_for_completion(struct nand_chip *chip)
 	if (mtd->oops_panic_write || ctrl->irq < 0) {
 		/* switch to interrupt polling and PIO mode */
 		disable_ctrl_irqs(ctrl);
-		sts = bcmnand_ctrl_poll_status(ctrl, NAND_CTRL_RDY,
+		sts = bcmnand_ctrl_poll_status(host, NAND_CTRL_RDY,
 					       NAND_CTRL_RDY, 0);
 		err = sts < 0;
 	} else {
--
2.37.3



______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

* Re: [PATCH v2 3/4] mtd: rawnand: brcmnand: pass host struct to bcmnand_ctrl_poll_status
  2023-10-12  0:41 [PATCH v2 3/4] mtd: rawnand: brcmnand: pass host struct to bcmnand_ctrl_poll_status dregan
@ 2023-10-12  7:12 ` Miquel Raynal
  2023-10-12 17:53   ` dregan
  0 siblings, 1 reply; 3+ messages in thread
From: Miquel Raynal @ 2023-10-12  7:12 UTC (permalink / raw)
  To: dregan
  Cc: bcm-kernel-feedback-list, linux-mtd, f.fainelli, rafal,
	joel.peshkin, computersforpeace, dan.beygelman, william.zhang,
	frieder.schrempf, linux-kernel, vigneshr, richard, bbrezillon,
	kdasu.kdev, JaimeLiao, Arseniy Krasnov, Adam Borowski

Hi,

dregan@mail.com wrote on Thu, 12 Oct 2023 02:41:48 +0200:

> pass host struct to bcmnand_ctrl_poll_status instead of ctrl struct,

Capital letter

> since real time status requires host, and ctrl is a member of host.

real time status? I'm sorry this commit log is not very clear.

> 
> Signed-off-by: David Regan <dregan@mail.com>
> 

This new line should be dropped (in all your commit logs)

> ---
> 
> Changes in v2: added this patch in series

The versioning is wrong btw, you should continuously increase the
counter, this is not just your second version. And as I said please use
b4 or git-send-email so patches 2+ are answers of patch 1 and in my
inbox it looks like 4 related patches instead.

Thanks,
Miquèl

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

* Re: [PATCH v2 3/4] mtd: rawnand: brcmnand: pass host struct to bcmnand_ctrl_poll_status
  2023-10-12  7:12 ` Miquel Raynal
@ 2023-10-12 17:53   ` dregan
  0 siblings, 0 replies; 3+ messages in thread
From: dregan @ 2023-10-12 17:53 UTC (permalink / raw)
  To: Miquel Raynal
  Cc: bcm-kernel-feedback-list, linux-mtd, f.fainelli, rafal,
	joel.peshkin, computersforpeace, dan.beygelman, william.zhang,
	frieder.schrempf, linux-kernel, vigneshr, richard, bbrezillon,
	kdasu.kdev, JaimeLiao, Arseniy Krasnov, Adam Borowski

Hi Miquel,

>
> Hi,
> 
> dregan@mail.com wrote on Thu, 12 Oct 2023 02:41:48 +0200:
> 
> > pass host struct to bcmnand_ctrl_poll_status instead of ctrl struct,
> 
> Capital letter

Will fix.

> 
> > since real time status requires host, and ctrl is a member of host.
> 
> real time status? I'm sorry this commit log is not very clear.

I can use this as the explanation:

Pass host struct to bcmnand_ctrl_poll_status instead of ctrl struct
since real time status requires host, and ctrl is a member of host.
Real time status is required for low level commands vs cached status
since the NAND controller will not do an automatic status read at the
end of a low level command as it would with a higher level command.

> 
> > 
> > Signed-off-by: David Regan <dregan@mail.com>
> > 
> 
> This new line should be dropped (in all your commit logs)

I'll remove these.

> 
> > ---
> > 
> > Changes in v2: added this patch in series
> 
> The versioning is wrong btw, you should continuously increase the
> counter, this is not just your second version. And as I said please use
> b4 or git-send-email so patches 2+ are answers of patch 1 and in my
> inbox it looks like 4 related patches instead.

Looks like I still need to work on this.

> 
> Thanks,
> Miquèl
> 

Thanks!

-Dave

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

end of thread, other threads:[~2023-10-12 17:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-12  0:41 [PATCH v2 3/4] mtd: rawnand: brcmnand: pass host struct to bcmnand_ctrl_poll_status dregan
2023-10-12  7:12 ` Miquel Raynal
2023-10-12 17:53   ` dregan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox