public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mtd: rawnand: denali: remove ->erase hook
@ 2019-01-21  4:52 Masahiro Yamada
  2019-01-21  8:10 ` Boris Brezillon
  2019-01-25 12:36 ` Miquel Raynal
  0 siblings, 2 replies; 3+ messages in thread
From: Masahiro Yamada @ 2019-01-21  4:52 UTC (permalink / raw)
  To: linux-mtd, Boris Brezillon, Miquel Raynal
  Cc: Masahiro Yamada, Brian Norris, linux-kernel, Marek Vasut,
	Richard Weinberger, David Woodhouse, Boris Brezillon

Commit f9ebd1bb4103 ("mtd: rawnand: Deprecate ->erase()") discouraged
the use of this hook, so I am happy to follow the suggestion.

Although the Denali IP provides a special MAP10 command for erasing,
using it would not buy us much. The Denali IP actually works with the
generic erasing by single_erase() + ->cmdfunc hook (nand_command_lp)
+ ->cmd_ctrl hook (denali_cmd_ctrl).

This method is also deprecated, but denali_erase() can go away
irrespective of ->exec_op conversion.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 drivers/mtd/nand/raw/denali.c | 21 ---------------------
 1 file changed, 21 deletions(-)

diff --git a/drivers/mtd/nand/raw/denali.c b/drivers/mtd/nand/raw/denali.c
index 6e8edc9..21320b1 100644
--- a/drivers/mtd/nand/raw/denali.c
+++ b/drivers/mtd/nand/raw/denali.c
@@ -37,9 +37,6 @@
 #define DENALI_MAP11_ADDR	((DENALI_MAP11) | 1)	/* address cycle */
 #define DENALI_MAP11_DATA	((DENALI_MAP11) | 2)	/* data cycle */
 
-/* MAP10 commands */
-#define DENALI_ERASE		0x01
-
 #define DENALI_BANK(denali)	((denali)->active_bank << 24)
 
 #define DENALI_INVALID_BANK	-1
@@ -903,23 +900,6 @@ static int denali_waitfunc(struct nand_chip *chip)
 	return irq_status & INTR__INT_ACT ? 0 : NAND_STATUS_FAIL;
 }
 
-static int denali_erase(struct nand_chip *chip, int page)
-{
-	struct denali_nand_info *denali = mtd_to_denali(nand_to_mtd(chip));
-	uint32_t irq_status;
-
-	denali_reset_irq(denali);
-
-	denali->host_write(denali, DENALI_MAP10 | DENALI_BANK(denali) | page,
-			   DENALI_ERASE);
-
-	/* wait for erase to complete or failure to occur */
-	irq_status = denali_wait_for_irq(denali,
-					 INTR__ERASE_COMP | INTR__ERASE_FAIL);
-
-	return irq_status & INTR__ERASE_COMP ? 0 : -EIO;
-}
-
 static int denali_setup_data_interface(struct nand_chip *chip, int chipnr,
 				       const struct nand_data_interface *conf)
 {
@@ -1244,7 +1224,6 @@ static int denali_attach_chip(struct nand_chip *chip)
 	chip->ecc.write_page_raw = denali_write_page_raw;
 	chip->ecc.read_oob = denali_read_oob;
 	chip->ecc.write_oob = denali_write_oob;
-	chip->legacy.erase = denali_erase;
 
 	ret = denali_multidev_fixup(denali);
 	if (ret)
-- 
2.7.4


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

* Re: [PATCH] mtd: rawnand: denali: remove ->erase hook
  2019-01-21  4:52 [PATCH] mtd: rawnand: denali: remove ->erase hook Masahiro Yamada
@ 2019-01-21  8:10 ` Boris Brezillon
  2019-01-25 12:36 ` Miquel Raynal
  1 sibling, 0 replies; 3+ messages in thread
From: Boris Brezillon @ 2019-01-21  8:10 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: linux-mtd, Boris Brezillon, Miquel Raynal, Marek Vasut,
	Richard Weinberger, linux-kernel, Brian Norris, David Woodhouse

On Mon, 21 Jan 2019 13:52:06 +0900
Masahiro Yamada <yamada.masahiro@socionext.com> wrote:

> Commit f9ebd1bb4103 ("mtd: rawnand: Deprecate ->erase()") discouraged
> the use of this hook, so I am happy to follow the suggestion.
> 
> Although the Denali IP provides a special MAP10 command for erasing,
> using it would not buy us much. The Denali IP actually works with the
> generic erasing by single_erase() + ->cmdfunc hook (nand_command_lp)
> + ->cmd_ctrl hook (denali_cmd_ctrl).
> 
> This method is also deprecated, but denali_erase() can go away
> irrespective of ->exec_op conversion.
> 
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

Reviewed-by: Boris Brezillon <bbrezillon@kernel.org>

> ---
> 
>  drivers/mtd/nand/raw/denali.c | 21 ---------------------
>  1 file changed, 21 deletions(-)
> 
> diff --git a/drivers/mtd/nand/raw/denali.c b/drivers/mtd/nand/raw/denali.c
> index 6e8edc9..21320b1 100644
> --- a/drivers/mtd/nand/raw/denali.c
> +++ b/drivers/mtd/nand/raw/denali.c
> @@ -37,9 +37,6 @@
>  #define DENALI_MAP11_ADDR	((DENALI_MAP11) | 1)	/* address cycle */
>  #define DENALI_MAP11_DATA	((DENALI_MAP11) | 2)	/* data cycle */
>  
> -/* MAP10 commands */
> -#define DENALI_ERASE		0x01
> -
>  #define DENALI_BANK(denali)	((denali)->active_bank << 24)
>  
>  #define DENALI_INVALID_BANK	-1
> @@ -903,23 +900,6 @@ static int denali_waitfunc(struct nand_chip *chip)
>  	return irq_status & INTR__INT_ACT ? 0 : NAND_STATUS_FAIL;
>  }
>  
> -static int denali_erase(struct nand_chip *chip, int page)
> -{
> -	struct denali_nand_info *denali = mtd_to_denali(nand_to_mtd(chip));
> -	uint32_t irq_status;
> -
> -	denali_reset_irq(denali);
> -
> -	denali->host_write(denali, DENALI_MAP10 | DENALI_BANK(denali) | page,
> -			   DENALI_ERASE);
> -
> -	/* wait for erase to complete or failure to occur */
> -	irq_status = denali_wait_for_irq(denali,
> -					 INTR__ERASE_COMP | INTR__ERASE_FAIL);
> -
> -	return irq_status & INTR__ERASE_COMP ? 0 : -EIO;
> -}
> -
>  static int denali_setup_data_interface(struct nand_chip *chip, int chipnr,
>  				       const struct nand_data_interface *conf)
>  {
> @@ -1244,7 +1224,6 @@ static int denali_attach_chip(struct nand_chip *chip)
>  	chip->ecc.write_page_raw = denali_write_page_raw;
>  	chip->ecc.read_oob = denali_read_oob;
>  	chip->ecc.write_oob = denali_write_oob;
> -	chip->legacy.erase = denali_erase;
>  
>  	ret = denali_multidev_fixup(denali);
>  	if (ret)


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

* Re: [PATCH] mtd: rawnand: denali: remove ->erase hook
  2019-01-21  4:52 [PATCH] mtd: rawnand: denali: remove ->erase hook Masahiro Yamada
  2019-01-21  8:10 ` Boris Brezillon
@ 2019-01-25 12:36 ` Miquel Raynal
  1 sibling, 0 replies; 3+ messages in thread
From: Miquel Raynal @ 2019-01-25 12:36 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: linux-mtd, Boris Brezillon, Brian Norris, linux-kernel,
	Marek Vasut, Richard Weinberger, David Woodhouse, Boris Brezillon

Hi Masahiro,

Masahiro Yamada <yamada.masahiro@socionext.com> wrote on Mon, 21 Jan
2019 13:52:06 +0900:

> Commit f9ebd1bb4103 ("mtd: rawnand: Deprecate ->erase()") discouraged
> the use of this hook, so I am happy to follow the suggestion.
> 
> Although the Denali IP provides a special MAP10 command for erasing,
> using it would not buy us much. The Denali IP actually works with the
> generic erasing by single_erase() + ->cmdfunc hook (nand_command_lp)
> + ->cmd_ctrl hook (denali_cmd_ctrl).
> 
> This method is also deprecated, but denali_erase() can go away
> irrespective of ->exec_op conversion.
> 
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

Applied to nand/next.

Thanks!
Miquèl


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

end of thread, other threads:[~2019-01-25 12:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-21  4:52 [PATCH] mtd: rawnand: denali: remove ->erase hook Masahiro Yamada
2019-01-21  8:10 ` Boris Brezillon
2019-01-25 12:36 ` Miquel Raynal

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