diff mbox

[1/3] mtd: nand_base: Removed unnecessary command masking

Message ID 1362038541-22406-1-git-send-email-shc_work@mail.ru
State Accepted
Commit fb066adadd224d5e46320b3fa7a80311c09be0d9
Headers show

Commit Message

Alexander Shiyan Feb. 28, 2013, 8:02 a.m. UTC
NAND command, passed to cmd_ctrl(), is masked with 0xff. This patch
removes this since masking is not necessary and masking is not performed
in other places for same call.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
 drivers/mtd/nand/nand_base.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

Comments

Brian Norris March 4, 2013, 8:26 p.m. UTC | #1
On Thu, Feb 28, 2013 at 12:02 AM, Alexander Shiyan <shc_work@mail.ru> wrote:
> NAND command, passed to cmd_ctrl(), is masked with 0xff. This patch
> removes this since masking is not necessary and masking is not performed
> in other places for same call.

As I commented on the other thread, this is not a sufficient
explanation. AG-AND (soon to be removed) may use a fake 9-bit command
which could expect this masking, even though masking is not done
everywhere. Please document why the command does not need to be
masked.

Thanks,
Brian
Alexander Shiyan March 5, 2013, 6:16 a.m. UTC | #2
> On Thu, Feb 28, 2013 at 12:02 AM, Alexander Shiyan <shc_work@mail.ru> wrote:
> > NAND command, passed to cmd_ctrl(), is masked with 0xff. This patch
> > removes this since masking is not necessary and masking is not performed
> > in other places for same call.
> 
> As I commented on the other thread, this is not a sufficient
> explanation. AG-AND (soon to be removed) may use a fake 9-bit command
> which could expect this masking, even though masking is not done
> everywhere. Please document why the command does not need to be
> masked.

I think the best if Artem take this part into his patch.
And what about [3/3] part?

---
Artem Bityutskiy March 11, 2013, 8:10 a.m. UTC | #3
On Thu, 2013-02-28 at 12:02 +0400, Alexander Shiyan wrote:
> NAND command, passed to cmd_ctrl(), is masked with 0xff. This patch
> removes this since masking is not necessary and masking is not performed
> in other places for same call.
> 
> Signed-off-by: Alexander Shiyan <shc_work@mail.ru>

Pushed patches 1 and 2 to l2-mtd.git. Did not take patch 3. Thanks!
diff mbox

Patch

diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 4321415..13c89c9 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -631,8 +631,7 @@  static void nand_command_lp(struct mtd_info *mtd, unsigned int command,
 	}
 
 	/* Command latch cycle */
-	chip->cmd_ctrl(mtd, command & 0xff,
-		       NAND_NCE | NAND_CLE | NAND_CTRL_CHANGE);
+	chip->cmd_ctrl(mtd, command, NAND_NCE | NAND_CLE | NAND_CTRL_CHANGE);
 
 	if (column != -1 || page_addr != -1) {
 		int ctrl = NAND_CTRL_CHANGE | NAND_NCE | NAND_ALE;