All of lore.kernel.org
 help / color / mirror / Atom feed
* [PULL v2] mtd: nand: changes for 4.12
@ 2017-04-15  7:20 Boris Brezillon
  2017-04-25  1:21 ` Brian Norris
  0 siblings, 1 reply; 3+ messages in thread
From: Boris Brezillon @ 2017-04-15  7:20 UTC (permalink / raw)
  To: Brian Norris
  Cc: Marek Vasut, Cyrille Pitchen, Richard Weinberger,
	David Woodhouse, linux-mtd, Alexandre Belloni

Hi Brian,

No changes from my v1 except the fix in the new Atmel NAND controller
driver (bug reported by Alexandre).

As you can see, the PR is pretty big compared to 4.11, and it's mainly
due to the Denali driver rework/cleanup (which I'd like to thank
Masahiro for), the addition of the per-vendor initialization
infrastructure and the complete rewrite of the Atmel driver.

The rest of the commits are just simple fixes/improvements to existing
drivers or to the core.

Let me know if you see any problem.

Thanks,

Boris

The following changes since commit c1ae3cfa0e89fa1a7ecc4c99031f5e9ae99d9201:

  Linux 4.11-rc1 (2017-03-05 12:59:56 -0800)

are available in the git repository at:

  git@github.com:linux-nand/linux.git tags/nand/for-4.12

for you to fetch changes up to 62f6e49c2bccdfc73382ec65f001558975605486:

  mtd: nand: brcmnand: Check flash #WP pin status before nand erase/program (2017-04-15 09:12:27 +0200)

----------------------------------------------------------------
This pull request contains:

 - some minor fixes/improvements on existing drivers (fsmc, gpio, ifc,
   davinci, brcmnand, omap)
 - a huge cleanup/rework of the denali driver accompanied with core
   fixes/improvements to simplify the driver code
 - a complete rewrite of the atmel driver to support new DT bindings
   make future evolution easier
 - the addition of per-vendor detection/initialization steps to avoid
   extending the nand_ids table with more extended-id entries

----------------------------------------------------------------
Alison Wang (2):
      memory: ifc: Update dependency of IFC for LS1021A
      mtd: nand: Update dependency of IFC for LS1021A

Boris Brezillon (20):
      mtd: nand: Get rid of the mtd parameter in all auto-detection functions
      mtd: nand: Store nand ID in struct nand_chip
      mtd: nand: Get rid of busw parameter
      mtd: nand: Rename nand_get_flash_type() into nand_detect()
      mtd: nand: Rename the nand_manufacturers struct
      mtd: nand: Kill the MTD_NAND_IDS Kconfig option
      mtd: nand: Do not expose the NAND manufacturer table directly
      mtd: nand: Add manufacturer specific initialization/detection steps
      mtd: nand: Move Samsung specific init/detection logic in nand_samsung.c
      mtd: nand: Move Hynix specific init/detection logic in nand_hynix.c
      mtd: nand: Move Toshiba specific init/detection logic in nand_toshiba.c
      mtd: nand: Move Micron specific init logic in nand_micron.c
      mtd: nand: Move AMD/Spansion specific init/detection logic in nand_amd.c
      mtd: nand: Move Macronix specific initialization in nand_macronix.c
      mtd: nand: hynix: Rework NAND ID decoding to extract more information
      mtd: nand: hynix: Add read-retry support for 1x nm MLC NANDs
      mtd: nand: tango: Enforce DMA direction type
      mtd: nand: Cleanup/rework the atmel_nand driver
      mtd: nand: atmel: Document the new DT bindings
      mtd: nand: Remove unused chip->write_page() hook

Christophe Jaillet (1):
      mtd: nand: NULL terminate a of_device_id table

Christophe Leroy (1):
      mtd: nand: gpio: make nCE GPIO optional

Colin Ian King (1):
      mtd: nand: nandsim: fix spelling mistake: "weakpagess" -> "weakpages"

Dan Carpenter (2):
      mtd: nand: hynix: Fix an error code in init
      mtd: nand: Fix a couple error codes

Hans de Goede (1):
      mtd: nand: samsung: Retrieve ECC requirements from extended ID

Kamal Dasu (1):
      mtd: nand: brcmnand: Check flash #WP pin status before nand erase/program

Masahiro Yamada (31):
      mtd: nand: allow to set only one of ECC size and ECC strength from DT
      mtd: nand: use read_oob() instead of cmdfunc() for bad block check
      mtd: nand: denali: remove unused CONFIG option and macros
      mtd: nand: denali: remove redundant define of BANK(x)
      mtd: nand: denali: remove more unused struct members
      mtd: nand: denali: fix comment of denali_nand_info::flash_mem
      mtd: nand: denali: consolidate INTR_STATUS__* and INTR_EN__* macros
      mtd: nand: denali: introduce capability flag
      mtd: nand: denali: use int where no reason to use fixed width variable
      mtd: nand: do not check R/B# for CMD_READID in nand_command(_lp)
      mtd: nand: do not check R/B# for CMD_SET_FEATURES in nand_command(_lp)
      mtd: nand: denali: use nand_chip to hold frequently accessed data
      mtd: nand: denali: call nand_set_flash_node() to set DT node
      mtd: nand: denali: move multi device fixup code to a helper function
      mtd: nand: denali: simplify multi device fixup code
      mtd: nand: denali: set DEVICES_CONNECTED 1 if not set
      mtd: nand: denali: remove meaningless writes to read-only registers
      mtd: nand: denali: remove unnecessary writes to ECC_CORRECTION
      mtd: nand: relax ecc.read_page() return value for uncorrectable ECC
      mtd: nand: denali: allow to override mtd->name from label DT property
      mtd: nand: denali: remove meaningless pipeline read-ahead operation
      mtd: nand: denali: fix bitflips calculation in handle_ecc()
      mtd: nand: denali: fix erased page checking
      mtd: nand: denali: support HW_ECC_FIXUP capability
      mtd: nand: denali_dt: enable HW_ECC_FIXUP for Altera SOCFPGA variant
      mtd: nand: denali: support 64bit capable DMA engine
      mtd: nand: denali_dt: remove dma-mask DT property
      mtd: nand: denali_dt: use pdev instead of ofdev for platform_device
      mtd: nand: denali: allow to override revision number
      mtd: nand: allocate aligned buffers if NAND_OWN_BUFFERS is unset
      mtd: nand: allow drivers to request minimum alignment for passed buffer

Philipp Zabel (1):
      mtd: nand: sunxi: simplify optional reset handling

Roger Quadros (1):
      mtd: nand: omap2: Fix partition creation via cmdline mtdparts

Sekhar Nori (1):
      mtd: nand: davinci: add comment on NAND subpage write status on keystone

Simon Baatz (2):
      mtd: nand: orion: fix clk handling
      mtd: nand: orion: improve handling of optional clock

Thomas Petazzoni (11):
      mtd: nand: fsmc: fix NAND width handling
      mtd: nand: fsmc: move fsmc_nand_data definition
      mtd: nand: fsmc: remove ->select_bank() from fsmc_nand_platform_data
      mtd: nand: fsmc: remove fsmc_select_chip()
      mtd: nand: fmsc: kill {read, write}_dma_priv from fsmc_nand_platform_data
      mtd: nand: fsmc: kill {nr_, }partitions structure fields
      mtd: nand: fsmc: remove duplicate nand_set_flash_node()
      mtd: nand: fsmc: finally remove fsmc_nand_platform_data
      mtd: nand: fsmc: use devm_clk_get()
      mtd: nand: fsmc: remove unused definitions
      mtd: nand: fsmc: remove CONFIG_OF conditional

 Documentation/devicetree/bindings/mtd/atmel-nand.txt  |  107 +++++++-
 Documentation/devicetree/bindings/mtd/denali-nand.txt |    7 +-
 MAINTAINERS                                           |    2 +-
 arch/cris/arch-v32/drivers/Kconfig                    |    1 -
 drivers/memory/Kconfig                                |    2 +-
 drivers/mtd/nand/Kconfig                              |   23 +-
 drivers/mtd/nand/Makefile                             |   11 +-
 drivers/mtd/nand/atmel/Makefile                       |    4 +
 drivers/mtd/nand/atmel/nand-controller.c              | 2198 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 drivers/mtd/nand/atmel/pmecc.c                        | 1020 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 drivers/mtd/nand/atmel/pmecc.h                        |   73 ++++++
 drivers/mtd/nand/atmel_nand.c                         | 2479 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 drivers/mtd/nand/atmel_nand_ecc.h                     |  163 ------------
 drivers/mtd/nand/atmel_nand_nfc.h                     |  103 --------
 drivers/mtd/nand/brcmnand/brcmnand.c                  |   61 ++++-
 drivers/mtd/nand/davinci_nand.c                       |   11 +
 drivers/mtd/nand/denali.c                             |  567 ++++++++++++++++++++++------------------
 drivers/mtd/nand/denali.h                             |  192 +++-----------
 drivers/mtd/nand/denali_dt.c                          |   74 +++---
 drivers/mtd/nand/fsmc_nand.c                          |  236 +++++------------
 drivers/mtd/nand/gpio.c                               |   18 +-
 drivers/mtd/nand/nand_amd.c                           |   51 ++++
 drivers/mtd/nand/nand_base.c                          |  518 ++++++++++++++++---------------------
 drivers/mtd/nand/nand_hynix.c                         |  631 +++++++++++++++++++++++++++++++++++++++++++++
 drivers/mtd/nand/nand_ids.c                           |   39 ++-
 drivers/mtd/nand/nand_macronix.c                      |   30 +++
 drivers/mtd/nand/nand_micron.c                        |   86 +++++++
 drivers/mtd/nand/nand_samsung.c                       |  112 ++++++++
 drivers/mtd/nand/nand_toshiba.c                       |   51 ++++
 drivers/mtd/nand/nandsim.c                            |    2 +-
 drivers/mtd/nand/omap2.c                              |    9 +
 drivers/mtd/nand/orion_nand.c                         |   48 ++--
 drivers/mtd/nand/sunxi_nand.c                         |   20 +-
 drivers/mtd/nand/tango_nand.c                         |    8 +-
 include/linux/mtd/nand.h                              |   96 +++++--
 35 files changed, 5274 insertions(+), 3779 deletions(-)
 create mode 100644 drivers/mtd/nand/atmel/Makefile
 create mode 100644 drivers/mtd/nand/atmel/nand-controller.c
 create mode 100644 drivers/mtd/nand/atmel/pmecc.c
 create mode 100644 drivers/mtd/nand/atmel/pmecc.h
 delete mode 100644 drivers/mtd/nand/atmel_nand.c
 delete mode 100644 drivers/mtd/nand/atmel_nand_ecc.h
 delete mode 100644 drivers/mtd/nand/atmel_nand_nfc.h
 create mode 100644 drivers/mtd/nand/nand_amd.c
 create mode 100644 drivers/mtd/nand/nand_hynix.c
 create mode 100644 drivers/mtd/nand/nand_macronix.c
 create mode 100644 drivers/mtd/nand/nand_micron.c
 create mode 100644 drivers/mtd/nand/nand_samsung.c
 create mode 100644 drivers/mtd/nand/nand_toshiba.c

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

* Re: [PULL v2] mtd: nand: changes for 4.12
  2017-04-15  7:20 [PULL v2] mtd: nand: changes for 4.12 Boris Brezillon
@ 2017-04-25  1:21 ` Brian Norris
  2017-04-25  6:51   ` Boris Brezillon
  0 siblings, 1 reply; 3+ messages in thread
From: Brian Norris @ 2017-04-25  1:21 UTC (permalink / raw)
  To: Boris Brezillon
  Cc: Marek Vasut, Cyrille Pitchen, Richard Weinberger,
	David Woodhouse, linux-mtd, Alexandre Belloni

On Sat, Apr 15, 2017 at 09:20:58AM +0200, Boris Brezillon wrote:
> Hi Brian,
> 
> No changes from my v1 except the fix in the new Atmel NAND controller
> driver (bug reported by Alexandre).
> 
> As you can see, the PR is pretty big compared to 4.11, and it's mainly
> due to the Denali driver rework/cleanup (which I'd like to thank
> Masahiro for), the addition of the per-vendor initialization
> infrastructure and the complete rewrite of the Atmel driver.
> 
> The rest of the commits are just simple fixes/improvements to existing
> drivers or to the core.
> 
> Let me know if you see any problem.

I've gotten partway through your PR, and fortunately Linus blessed me
with another week too :)

Can you run some of your new stuff through sparse, and maybe coccinelle
(I think 'make coccicheck' would suffice). I see a lot of complaints,
some just from migrated/refactored code, but some new. Feel free to fix
any of these on top, of course. I'll continue to review the current PR.

A starter diff is appended, though it has been only compile tested.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
---
 drivers/mtd/nand/atmel/nand-controller.c | 5 ++---
 drivers/mtd/nand/atmel/pmecc.c           | 8 ++++----
 2 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/drivers/mtd/nand/atmel/nand-controller.c b/drivers/mtd/nand/atmel/nand-controller.c
index d5be88f258fc..3b2446896147 100644
--- a/drivers/mtd/nand/atmel/nand-controller.c
+++ b/drivers/mtd/nand/atmel/nand-controller.c
@@ -1744,7 +1744,6 @@ atmel_hsmc_nand_controller_legacy_init(struct atmel_hsmc_nand_controller *nc)
 		.reg_bits = 32,
 		.val_bits = 32,
 		.reg_stride = 4,
-		.val_bits = 32,
 	};
 
 	struct device *dev = nc->base.dev;
@@ -1979,7 +1978,7 @@ static int atmel_hsmc_nand_controller_probe(struct platform_device *pdev,
 	return ret;
 }
 
-const struct atmel_nand_controller_ops atmel_hsmc_nc_ops = {
+static const struct atmel_nand_controller_ops atmel_hsmc_nc_ops = {
 	.probe = atmel_hsmc_nand_controller_probe,
 	.remove = atmel_hsmc_nand_controller_remove,
 	.ecc_init = atmel_hsmc_nand_ecc_init,
@@ -2038,7 +2037,7 @@ atmel_smc_nand_controller_remove(struct atmel_nand_controller *nc)
 	return 0;
 }
 
-const struct atmel_nand_controller_ops atmel_smc_nc_ops = {
+static const struct atmel_nand_controller_ops atmel_smc_nc_ops = {
 	.probe = atmel_smc_nand_controller_probe,
 	.remove = atmel_smc_nand_controller_remove,
 	.ecc_init = atmel_nand_ecc_init,
diff --git a/drivers/mtd/nand/atmel/pmecc.c b/drivers/mtd/nand/atmel/pmecc.c
index 1528aa4713a3..55a8ee5306ea 100644
--- a/drivers/mtd/nand/atmel/pmecc.c
+++ b/drivers/mtd/nand/atmel/pmecc.c
@@ -371,7 +371,7 @@ atmel_pmecc_create_user(struct atmel_pmecc *pmecc,
 
 	user->pmecc = pmecc;
 
-	user->partial_syn = (u16 *)PTR_ALIGN(user + 1, sizeof(u16));
+	user->partial_syn = (s16 *)PTR_ALIGN(user + 1, sizeof(u16));
 	user->si = user->partial_syn + ((2 * req->ecc.strength) + 1);
 	user->lmu = user->si + ((2 * req->ecc.strength) + 1);
 	user->smu = user->lmu + (req->ecc.strength + 1);
@@ -896,20 +896,20 @@ static struct atmel_pmecc *atmel_pmecc_get_by_node(struct device *userdev,
 
 static const int atmel_pmecc_strengths[] = { 2, 4, 8, 12, 24, 32 };
 
-struct atmel_pmecc_caps at91sam9g45_caps = {
+static struct atmel_pmecc_caps at91sam9g45_caps = {
 	.strengths = atmel_pmecc_strengths,
 	.nstrengths = 5,
 	.el_offset = 0x8c,
 };
 
-struct atmel_pmecc_caps sama5d4_caps = {
+static struct atmel_pmecc_caps sama5d4_caps = {
 	.strengths = atmel_pmecc_strengths,
 	.nstrengths = 5,
 	.el_offset = 0x8c,
 	.correct_erased_chunks = true,
 };
 
-struct atmel_pmecc_caps sama5d2_caps = {
+static struct atmel_pmecc_caps sama5d2_caps = {
 	.strengths = atmel_pmecc_strengths,
 	.nstrengths = 6,
 	.el_offset = 0xac,
-- 
2.13.0.rc0.306.g87b477812d-goog

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

* Re: [PULL v2] mtd: nand: changes for 4.12
  2017-04-25  1:21 ` Brian Norris
@ 2017-04-25  6:51   ` Boris Brezillon
  0 siblings, 0 replies; 3+ messages in thread
From: Boris Brezillon @ 2017-04-25  6:51 UTC (permalink / raw)
  To: Brian Norris
  Cc: Marek Vasut, Cyrille Pitchen, Richard Weinberger,
	David Woodhouse, linux-mtd, Alexandre Belloni

On Mon, 24 Apr 2017 18:21:16 -0700
Brian Norris <computersforpeace@gmail.com> wrote:

> On Sat, Apr 15, 2017 at 09:20:58AM +0200, Boris Brezillon wrote:
> > Hi Brian,
> > 
> > No changes from my v1 except the fix in the new Atmel NAND controller
> > driver (bug reported by Alexandre).
> > 
> > As you can see, the PR is pretty big compared to 4.11, and it's mainly
> > due to the Denali driver rework/cleanup (which I'd like to thank
> > Masahiro for), the addition of the per-vendor initialization
> > infrastructure and the complete rewrite of the Atmel driver.
> > 
> > The rest of the commits are just simple fixes/improvements to existing
> > drivers or to the core.
> > 
> > Let me know if you see any problem.  
> 
> I've gotten partway through your PR, and fortunately Linus blessed me
> with another week too :)
> 
> Can you run some of your new stuff through sparse, and maybe coccinelle
> (I think 'make coccicheck' would suffice).

When I run

make coccicheck MODE=patch M=drivers/mtd/nand/ V=1

it fails.

I'm using spatch 1.0.4 (the one packaged by debian/ubuntu).

> I see a lot of complaints,
> some just from migrated/refactored code, but some new. Feel free to fix
> any of these on top, of course. I'll continue to review the current PR.
> 
> A starter diff is appended, though it has been only compile tested.

Looks good to me. Thanks for the fixes, I'll squash the changes in the
initial commit.

I'll wait a bit before sending a new PR so that you can finish your
review.

Regards,

Boris

> 
> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
> ---
>  drivers/mtd/nand/atmel/nand-controller.c | 5 ++---
>  drivers/mtd/nand/atmel/pmecc.c           | 8 ++++----
>  2 files changed, 6 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/mtd/nand/atmel/nand-controller.c b/drivers/mtd/nand/atmel/nand-controller.c
> index d5be88f258fc..3b2446896147 100644
> --- a/drivers/mtd/nand/atmel/nand-controller.c
> +++ b/drivers/mtd/nand/atmel/nand-controller.c
> @@ -1744,7 +1744,6 @@ atmel_hsmc_nand_controller_legacy_init(struct atmel_hsmc_nand_controller *nc)
>  		.reg_bits = 32,
>  		.val_bits = 32,
>  		.reg_stride = 4,
> -		.val_bits = 32,
>  	};
>  
>  	struct device *dev = nc->base.dev;
> @@ -1979,7 +1978,7 @@ static int atmel_hsmc_nand_controller_probe(struct platform_device *pdev,
>  	return ret;
>  }
>  
> -const struct atmel_nand_controller_ops atmel_hsmc_nc_ops = {
> +static const struct atmel_nand_controller_ops atmel_hsmc_nc_ops = {
>  	.probe = atmel_hsmc_nand_controller_probe,
>  	.remove = atmel_hsmc_nand_controller_remove,
>  	.ecc_init = atmel_hsmc_nand_ecc_init,
> @@ -2038,7 +2037,7 @@ atmel_smc_nand_controller_remove(struct atmel_nand_controller *nc)
>  	return 0;
>  }
>  
> -const struct atmel_nand_controller_ops atmel_smc_nc_ops = {
> +static const struct atmel_nand_controller_ops atmel_smc_nc_ops = {
>  	.probe = atmel_smc_nand_controller_probe,
>  	.remove = atmel_smc_nand_controller_remove,
>  	.ecc_init = atmel_nand_ecc_init,
> diff --git a/drivers/mtd/nand/atmel/pmecc.c b/drivers/mtd/nand/atmel/pmecc.c
> index 1528aa4713a3..55a8ee5306ea 100644
> --- a/drivers/mtd/nand/atmel/pmecc.c
> +++ b/drivers/mtd/nand/atmel/pmecc.c
> @@ -371,7 +371,7 @@ atmel_pmecc_create_user(struct atmel_pmecc *pmecc,
>  
>  	user->pmecc = pmecc;
>  
> -	user->partial_syn = (u16 *)PTR_ALIGN(user + 1, sizeof(u16));
> +	user->partial_syn = (s16 *)PTR_ALIGN(user + 1, sizeof(u16));
>  	user->si = user->partial_syn + ((2 * req->ecc.strength) + 1);
>  	user->lmu = user->si + ((2 * req->ecc.strength) + 1);
>  	user->smu = user->lmu + (req->ecc.strength + 1);
> @@ -896,20 +896,20 @@ static struct atmel_pmecc *atmel_pmecc_get_by_node(struct device *userdev,
>  
>  static const int atmel_pmecc_strengths[] = { 2, 4, 8, 12, 24, 32 };
>  
> -struct atmel_pmecc_caps at91sam9g45_caps = {
> +static struct atmel_pmecc_caps at91sam9g45_caps = {
>  	.strengths = atmel_pmecc_strengths,
>  	.nstrengths = 5,
>  	.el_offset = 0x8c,
>  };
>  
> -struct atmel_pmecc_caps sama5d4_caps = {
> +static struct atmel_pmecc_caps sama5d4_caps = {
>  	.strengths = atmel_pmecc_strengths,
>  	.nstrengths = 5,
>  	.el_offset = 0x8c,
>  	.correct_erased_chunks = true,
>  };
>  
> -struct atmel_pmecc_caps sama5d2_caps = {
> +static struct atmel_pmecc_caps sama5d2_caps = {
>  	.strengths = atmel_pmecc_strengths,
>  	.nstrengths = 6,
>  	.el_offset = 0xac,

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

end of thread, other threads:[~2017-04-25  6:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-15  7:20 [PULL v2] mtd: nand: changes for 4.12 Boris Brezillon
2017-04-25  1:21 ` Brian Norris
2017-04-25  6:51   ` Boris Brezillon

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.