Commit b0e78154 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'mtd/fixes-for-6.4-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux

Pull mtd fixes from Miquel Raynal:
 "MTD core:
   - MAINTAINERS: Add Michal as reviewer instead of Naga
   - mtdchar: Mark bits of ioctl handler noinline

  NAND controller drivers:
   - marvell:
       - Don't set the NAND frequency select
       - Ensure timing values are written
   - ingenic: Fix empty stub helper definitions

  SPI-NOR core:
   - Fix divide by zero for spi-nor-generic flashes

  SPI-NOR manufacturer driver:
   - spansion: make sure local struct does not contain garbage"

* tag 'mtd/fixes-for-6.4-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux:
  mtd: rawnand: marvell: don't set the NAND frequency select
  mtd: rawnand: marvell: ensure timing values are written
  mtdchar: mark bits of ioctl handler noinline
  MAINTAINERS: Add myself as reviewer instead of Naga
  mtd: spi-nor: Fix divide by zero for spi-nor-generic flashes
  mtd: rawnand: ingenic: fix empty stub helper definitions
  mtd: spi-nor: spansion: make sure local struct does not contain garbage
parents 714069da c4d28e30
...@@ -1601,7 +1601,7 @@ F: drivers/media/i2c/ar0521.c ...@@ -1601,7 +1601,7 @@ F: drivers/media/i2c/ar0521.c
ARASAN NAND CONTROLLER DRIVER ARASAN NAND CONTROLLER DRIVER
M: Miquel Raynal <miquel.raynal@bootlin.com> M: Miquel Raynal <miquel.raynal@bootlin.com>
M: Naga Sureshkumar Relli <nagasure@xilinx.com> R: Michal Simek <michal.simek@amd.com>
L: linux-mtd@lists.infradead.org L: linux-mtd@lists.infradead.org
S: Maintained S: Maintained
F: Documentation/devicetree/bindings/mtd/arasan,nand-controller.yaml F: Documentation/devicetree/bindings/mtd/arasan,nand-controller.yaml
...@@ -1764,7 +1764,7 @@ F: include/linux/amba/mmci.h ...@@ -1764,7 +1764,7 @@ F: include/linux/amba/mmci.h
ARM PRIMECELL PL35X NAND CONTROLLER DRIVER ARM PRIMECELL PL35X NAND CONTROLLER DRIVER
M: Miquel Raynal <miquel.raynal@bootlin.com> M: Miquel Raynal <miquel.raynal@bootlin.com>
M: Naga Sureshkumar Relli <nagasure@xilinx.com> R: Michal Simek <michal.simek@amd.com>
L: linux-mtd@lists.infradead.org L: linux-mtd@lists.infradead.org
S: Maintained S: Maintained
F: Documentation/devicetree/bindings/mtd/arm,pl353-nand-r2p1.yaml F: Documentation/devicetree/bindings/mtd/arm,pl353-nand-r2p1.yaml
...@@ -1772,7 +1772,7 @@ F: drivers/mtd/nand/raw/pl35x-nand-controller.c ...@@ -1772,7 +1772,7 @@ F: drivers/mtd/nand/raw/pl35x-nand-controller.c
ARM PRIMECELL PL35X SMC DRIVER ARM PRIMECELL PL35X SMC DRIVER
M: Miquel Raynal <miquel.raynal@bootlin.com> M: Miquel Raynal <miquel.raynal@bootlin.com>
M: Naga Sureshkumar Relli <nagasure@xilinx.com> R: Michal Simek <michal.simek@amd.com>
L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
S: Maintained S: Maintained
F: Documentation/devicetree/bindings/memory-controllers/arm,pl35x-smc.yaml F: Documentation/devicetree/bindings/memory-controllers/arm,pl35x-smc.yaml
......
...@@ -590,8 +590,8 @@ static void adjust_oob_length(struct mtd_info *mtd, uint64_t start, ...@@ -590,8 +590,8 @@ static void adjust_oob_length(struct mtd_info *mtd, uint64_t start,
(end_page - start_page + 1) * oob_per_page); (end_page - start_page + 1) * oob_per_page);
} }
static int mtdchar_write_ioctl(struct mtd_info *mtd, static noinline_for_stack int
struct mtd_write_req __user *argp) mtdchar_write_ioctl(struct mtd_info *mtd, struct mtd_write_req __user *argp)
{ {
struct mtd_info *master = mtd_get_master(mtd); struct mtd_info *master = mtd_get_master(mtd);
struct mtd_write_req req; struct mtd_write_req req;
...@@ -688,8 +688,8 @@ static int mtdchar_write_ioctl(struct mtd_info *mtd, ...@@ -688,8 +688,8 @@ static int mtdchar_write_ioctl(struct mtd_info *mtd,
return ret; return ret;
} }
static int mtdchar_read_ioctl(struct mtd_info *mtd, static noinline_for_stack int
struct mtd_read_req __user *argp) mtdchar_read_ioctl(struct mtd_info *mtd, struct mtd_read_req __user *argp)
{ {
struct mtd_info *master = mtd_get_master(mtd); struct mtd_info *master = mtd_get_master(mtd);
struct mtd_read_req req; struct mtd_read_req req;
......
...@@ -36,25 +36,25 @@ int ingenic_ecc_correct(struct ingenic_ecc *ecc, ...@@ -36,25 +36,25 @@ int ingenic_ecc_correct(struct ingenic_ecc *ecc,
void ingenic_ecc_release(struct ingenic_ecc *ecc); void ingenic_ecc_release(struct ingenic_ecc *ecc);
struct ingenic_ecc *of_ingenic_ecc_get(struct device_node *np); struct ingenic_ecc *of_ingenic_ecc_get(struct device_node *np);
#else /* CONFIG_MTD_NAND_INGENIC_ECC */ #else /* CONFIG_MTD_NAND_INGENIC_ECC */
int ingenic_ecc_calculate(struct ingenic_ecc *ecc, static inline int ingenic_ecc_calculate(struct ingenic_ecc *ecc,
struct ingenic_ecc_params *params, struct ingenic_ecc_params *params,
const u8 *buf, u8 *ecc_code) const u8 *buf, u8 *ecc_code)
{ {
return -ENODEV; return -ENODEV;
} }
int ingenic_ecc_correct(struct ingenic_ecc *ecc, static inline int ingenic_ecc_correct(struct ingenic_ecc *ecc,
struct ingenic_ecc_params *params, u8 *buf, struct ingenic_ecc_params *params, u8 *buf,
u8 *ecc_code) u8 *ecc_code)
{ {
return -ENODEV; return -ENODEV;
} }
void ingenic_ecc_release(struct ingenic_ecc *ecc) static inline void ingenic_ecc_release(struct ingenic_ecc *ecc)
{ {
} }
struct ingenic_ecc *of_ingenic_ecc_get(struct device_node *np) static inline struct ingenic_ecc *of_ingenic_ecc_get(struct device_node *np)
{ {
return ERR_PTR(-ENODEV); return ERR_PTR(-ENODEV);
} }
......
...@@ -2457,6 +2457,12 @@ static int marvell_nfc_setup_interface(struct nand_chip *chip, int chipnr, ...@@ -2457,6 +2457,12 @@ static int marvell_nfc_setup_interface(struct nand_chip *chip, int chipnr,
NDTR1_WAIT_MODE; NDTR1_WAIT_MODE;
} }
/*
* Reset nfc->selected_chip so the next command will cause the timing
* registers to be updated in marvell_nfc_select_target().
*/
nfc->selected_chip = NULL;
return 0; return 0;
} }
...@@ -2894,10 +2900,6 @@ static int marvell_nfc_init(struct marvell_nfc *nfc) ...@@ -2894,10 +2900,6 @@ static int marvell_nfc_init(struct marvell_nfc *nfc)
regmap_update_bits(sysctrl_base, GENCONF_CLK_GATING_CTRL, regmap_update_bits(sysctrl_base, GENCONF_CLK_GATING_CTRL,
GENCONF_CLK_GATING_CTRL_ND_GATE, GENCONF_CLK_GATING_CTRL_ND_GATE,
GENCONF_CLK_GATING_CTRL_ND_GATE); GENCONF_CLK_GATING_CTRL_ND_GATE);
regmap_update_bits(sysctrl_base, GENCONF_ND_CLK_CTRL,
GENCONF_ND_CLK_CTRL_EN,
GENCONF_ND_CLK_CTRL_EN);
} }
/* Configure the DMA if appropriate */ /* Configure the DMA if appropriate */
......
...@@ -2018,6 +2018,7 @@ static const struct spi_nor_manufacturer *manufacturers[] = { ...@@ -2018,6 +2018,7 @@ static const struct spi_nor_manufacturer *manufacturers[] = {
static const struct flash_info spi_nor_generic_flash = { static const struct flash_info spi_nor_generic_flash = {
.name = "spi-nor-generic", .name = "spi-nor-generic",
.n_banks = 1,
/* /*
* JESD216 rev A doesn't specify the page size, therefore we need a * JESD216 rev A doesn't specify the page size, therefore we need a
* sane default. * sane default.
...@@ -2921,7 +2922,8 @@ static void spi_nor_late_init_params(struct spi_nor *nor) ...@@ -2921,7 +2922,8 @@ static void spi_nor_late_init_params(struct spi_nor *nor)
if (nor->flags & SNOR_F_HAS_LOCK && !nor->params->locking_ops) if (nor->flags & SNOR_F_HAS_LOCK && !nor->params->locking_ops)
spi_nor_init_default_locking_ops(nor); spi_nor_init_default_locking_ops(nor);
nor->params->bank_size = div64_u64(nor->params->size, nor->info->n_banks); if (nor->info->n_banks > 1)
params->bank_size = div64_u64(params->size, nor->info->n_banks);
} }
/** /**
...@@ -2987,6 +2989,7 @@ static void spi_nor_init_default_params(struct spi_nor *nor) ...@@ -2987,6 +2989,7 @@ static void spi_nor_init_default_params(struct spi_nor *nor)
/* Set SPI NOR sizes. */ /* Set SPI NOR sizes. */
params->writesize = 1; params->writesize = 1;
params->size = (u64)info->sector_size * info->n_sectors; params->size = (u64)info->sector_size * info->n_sectors;
params->bank_size = params->size;
params->page_size = info->page_size; params->page_size = info->page_size;
if (!(info->flags & SPI_NOR_NO_FR)) { if (!(info->flags & SPI_NOR_NO_FR)) {
......
...@@ -361,7 +361,7 @@ static int cypress_nor_determine_addr_mode_by_sr1(struct spi_nor *nor, ...@@ -361,7 +361,7 @@ static int cypress_nor_determine_addr_mode_by_sr1(struct spi_nor *nor,
*/ */
static int cypress_nor_set_addr_mode_nbytes(struct spi_nor *nor) static int cypress_nor_set_addr_mode_nbytes(struct spi_nor *nor)
{ {
struct spi_mem_op op; struct spi_mem_op op = {};
u8 addr_mode; u8 addr_mode;
int ret; int ret;
...@@ -492,7 +492,7 @@ s25fs256t_post_bfpt_fixup(struct spi_nor *nor, ...@@ -492,7 +492,7 @@ s25fs256t_post_bfpt_fixup(struct spi_nor *nor,
const struct sfdp_parameter_header *bfpt_header, const struct sfdp_parameter_header *bfpt_header,
const struct sfdp_bfpt *bfpt) const struct sfdp_bfpt *bfpt)
{ {
struct spi_mem_op op; struct spi_mem_op op = {};
int ret; int ret;
ret = cypress_nor_set_addr_mode_nbytes(nor); ret = cypress_nor_set_addr_mode_nbytes(nor);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment