All of lore.kernel.org
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Naga Sureshkumar Relli <nagasure@xilinx.com>
Cc: Boris Brezillon <boris.brezillon@bootlin.com>,
	"richard@nod.at" <richard@nod.at>,
	"dwmw2@infradead.org" <dwmw2@infradead.org>,
	"computersforpeace@gmail.com" <computersforpeace@gmail.com>,
	"marek.vasut@gmail.com" <marek.vasut@gmail.com>,
	"kyungmin.park@samsung.com" <kyungmin.park@samsung.com>,
	"absahu@codeaurora.org" <absahu@codeaurora.org>,
	"peterpandong@micron.com" <peterpandong@micron.com>,
	"frieder.schrempf@exceet.de" <frieder.schrempf@exceet.de>,
	"linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Michal Simek <michals@xilinx.com>,
	"nagasureshkumarrelli@gmail.com" <nagasureshkumarrelli@gmail.com>
Subject: Re: [LINUX PATCH v10 2/2] mtd: rawnand: arasan: Add support for Arasan NAND Flash Controller
Date: Tue, 21 Aug 2018 09:31:25 +0200	[thread overview]
Message-ID: <20180821093125.05fb46a4@xps13> (raw)
In-Reply-To: <MWHPR02MB26235AF18211E3FB39076396AF310@MWHPR02MB2623.namprd02.prod.outlook.com>

Hi Naga,

> > And why is it an s32 and not a u32?  
> To monitor NAND_CMD_STATUS.
> Sometimes core will just send status command without reading back the status data and later
> It will try to read one byte using ->exec_op().
> So Arasan has FLASH_STS register and whenever we initiate a status command, the controller
> Will update this register with the value returned by the flash device.
> So we need to return this value when core is asking about 1 byte status value without issuing the command.
> And in driver we are using memset(nfc_op, 0, sizeof(struct anfc_op)), this will make cmnds[4] to zeros but 0x0 is also
> NAND_CMD_READ0, so inorder to differentiate whether to give status data or not, I just assigned 
> 	nfc_op->cmnds[0] = NAND_CMD_NONE;
> 
> May be this case we can now eliminate as per your suggestion(defining a separate hook for each pattern) and thanks for that.
> >   
> > > +	u32 type;
> > > +	u32 len;
> > > +	u32 naddrs;
> > > +	u32 col;
> > > +	u32 row;
> > > +	unsigned int data_instr_idx;
> > > +	unsigned int rdy_timeout_ms;
> > > +	unsigned int rdy_delay_ns;
> > > +	const struct nand_op_instr *data_instr; };  
> > 
> > Please make sure you actually need to redefine all these fields. Looks like some them could be
> > extracted directly from the nand_op_instr objects.  
> Ok, all these values are getting updated in anfc_parse_instructions()

In anfc_parse_instructions():

+			nfc_op->data_instr = instr;
+			nfc_op->type = NAND_OP_DATA_IN_INSTR;

This looks pointless.

+			nfc_op->data_instr_idx = op_id;
+			break;
+		case NAND_OP_DATA_OUT_INSTR:
+			nfc_op->data_instr = instr;
+			nfc_op->type = NAND_OP_DATA_IN_INSTR;
+			nfc_op->data_instr_idx = op_id;
+			break;
+		case NAND_OP_WAITRDY_INSTR:
+			nfc_op->rdy_timeout_ms = instr->ctx.waitrdy.timeout_ms;

This one also.

+			nfc_op->rdy_delay_ns = instr->delay_ns;

And this one too.

Once you'll have a per pattern callback, I suppose you won't need it
anymore.

> >   
> > > +
> > > +/**
> > > + * struct anfc_nand_chip - Defines the nand chip related information
> > > + * @node:		used to store NAND chips into a list.
> > > + * @chip:		NAND chip information structure.
> > > + * @bch:		Bch / Hamming mode enable/disable.
> > > + * @bchmode:		Bch mode.  
> > 
> > What's the difference between bch and bchmode?  
> @bch -> to select error correction method(either BCH or Hamming)
> @bchmode -> to select ECC correctability (4/8/12/24 bit ECC)

Then something like "strength" or "ecc_strength" would be more
meaningful.


Thanks,
Miquèl

  reply	other threads:[~2018-08-21  7:31 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-17 13:19 [LINUX PATCH v10 0/2] Add support for Arasan NAND Flash controller Naga Sureshkumar Relli
2018-08-17 13:19 ` [LINUX PATCH v10 1/2] dt-bindings: mtd: arasan: Add device tree binding documentation Naga Sureshkumar Relli
2018-08-20 12:33   ` Boris Brezillon
2018-08-21  5:47     ` Naga Sureshkumar Relli
2018-08-21  5:59       ` Boris Brezillon
2018-08-21  9:22         ` Naga Sureshkumar Relli
2018-08-21  9:52           ` Miquel Raynal
2018-08-21 10:44             ` Naga Sureshkumar Relli
2018-08-21 10:52               ` Boris Brezillon
2018-08-21 11:10           ` Boris Brezillon
2018-08-17 13:19 ` [LINUX PATCH v10 2/2] mtd: rawnand: arasan: Add support for Arasan NAND Flash Controller Naga Sureshkumar Relli
2018-08-17 14:37   ` Miquel Raynal
2018-08-18  4:48     ` Naga Sureshkumar Relli
2018-08-17 15:30   ` kbuild test robot
2018-08-17 17:59   ` Boris Brezillon
2018-08-18  5:49     ` Naga Sureshkumar Relli
2018-08-20  8:53       ` Boris Brezillon
2018-08-20 10:49         ` Naga Sureshkumar Relli
2018-08-20 12:10           ` Boris Brezillon
2018-08-20 12:21             ` Naga Sureshkumar Relli
2018-08-20 12:24               ` Boris Brezillon
2018-08-20 16:40   ` Boris Brezillon
2018-08-21  6:40     ` Naga Sureshkumar Relli
2018-08-21  7:31       ` Miquel Raynal [this message]
2018-09-11  5:23     ` Naga Sureshkumar Relli
2018-09-22  7:53       ` Miquel Raynal
2018-09-22  8:13         ` Boris Brezillon
2018-09-24  8:42           ` Naga Sureshkumar Relli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180821093125.05fb46a4@xps13 \
    --to=miquel.raynal@bootlin.com \
    --cc=absahu@codeaurora.org \
    --cc=boris.brezillon@bootlin.com \
    --cc=computersforpeace@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=frieder.schrempf@exceet.de \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=marek.vasut@gmail.com \
    --cc=michals@xilinx.com \
    --cc=nagasure@xilinx.com \
    --cc=nagasureshkumarrelli@gmail.com \
    --cc=peterpandong@micron.com \
    --cc=richard@nod.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.