Skip to content

Commit b0e7815

Browse files
committed
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
2 parents 714069d + c4d28e3 commit b0e7815

File tree

6 files changed

+23
-18
lines changed

6 files changed

+23
-18
lines changed

MAINTAINERS

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1601,7 +1601,7 @@ F: drivers/media/i2c/ar0521.c
16011601

16021602
ARASAN NAND CONTROLLER DRIVER
16031603
M: Miquel Raynal <[email protected]>
1604-
M: Naga Sureshkumar Relli <nagasure@xilinx.com>
1604+
R: Michal Simek <michal.simek@amd.com>
16051605
16061606
S: Maintained
16071607
F: Documentation/devicetree/bindings/mtd/arasan,nand-controller.yaml
@@ -1764,15 +1764,15 @@ F: include/linux/amba/mmci.h
17641764

17651765
ARM PRIMECELL PL35X NAND CONTROLLER DRIVER
17661766
M: Miquel Raynal <[email protected]>
1767-
M: Naga Sureshkumar Relli <nagasure@xilinx.com>
1767+
R: Michal Simek <michal.simek@amd.com>
17681768
17691769
S: Maintained
17701770
F: Documentation/devicetree/bindings/mtd/arm,pl353-nand-r2p1.yaml
17711771
F: drivers/mtd/nand/raw/pl35x-nand-controller.c
17721772

17731773
ARM PRIMECELL PL35X SMC DRIVER
17741774
M: Miquel Raynal <[email protected]>
1775-
M: Naga Sureshkumar Relli <nagasure@xilinx.com>
1775+
R: Michal Simek <michal.simek@amd.com>
17761776
L: [email protected] (moderated for non-subscribers)
17771777
S: Maintained
17781778
F: Documentation/devicetree/bindings/memory-controllers/arm,pl35x-smc.yaml

drivers/mtd/mtdchar.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -590,8 +590,8 @@ static void adjust_oob_length(struct mtd_info *mtd, uint64_t start,
590590
(end_page - start_page + 1) * oob_per_page);
591591
}
592592

593-
static int mtdchar_write_ioctl(struct mtd_info *mtd,
594-
struct mtd_write_req __user *argp)
593+
static noinline_for_stack int
594+
mtdchar_write_ioctl(struct mtd_info *mtd, struct mtd_write_req __user *argp)
595595
{
596596
struct mtd_info *master = mtd_get_master(mtd);
597597
struct mtd_write_req req;
@@ -688,8 +688,8 @@ static int mtdchar_write_ioctl(struct mtd_info *mtd,
688688
return ret;
689689
}
690690

691-
static int mtdchar_read_ioctl(struct mtd_info *mtd,
692-
struct mtd_read_req __user *argp)
691+
static noinline_for_stack int
692+
mtdchar_read_ioctl(struct mtd_info *mtd, struct mtd_read_req __user *argp)
693693
{
694694
struct mtd_info *master = mtd_get_master(mtd);
695695
struct mtd_read_req req;

drivers/mtd/nand/raw/ingenic/ingenic_ecc.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,25 +36,25 @@ int ingenic_ecc_correct(struct ingenic_ecc *ecc,
3636
void ingenic_ecc_release(struct ingenic_ecc *ecc);
3737
struct ingenic_ecc *of_ingenic_ecc_get(struct device_node *np);
3838
#else /* CONFIG_MTD_NAND_INGENIC_ECC */
39-
int ingenic_ecc_calculate(struct ingenic_ecc *ecc,
39+
static inline int ingenic_ecc_calculate(struct ingenic_ecc *ecc,
4040
struct ingenic_ecc_params *params,
4141
const u8 *buf, u8 *ecc_code)
4242
{
4343
return -ENODEV;
4444
}
4545

46-
int ingenic_ecc_correct(struct ingenic_ecc *ecc,
46+
static inline int ingenic_ecc_correct(struct ingenic_ecc *ecc,
4747
struct ingenic_ecc_params *params, u8 *buf,
4848
u8 *ecc_code)
4949
{
5050
return -ENODEV;
5151
}
5252

53-
void ingenic_ecc_release(struct ingenic_ecc *ecc)
53+
static inline void ingenic_ecc_release(struct ingenic_ecc *ecc)
5454
{
5555
}
5656

57-
struct ingenic_ecc *of_ingenic_ecc_get(struct device_node *np)
57+
static inline struct ingenic_ecc *of_ingenic_ecc_get(struct device_node *np)
5858
{
5959
return ERR_PTR(-ENODEV);
6060
}

drivers/mtd/nand/raw/marvell_nand.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2457,6 +2457,12 @@ static int marvell_nfc_setup_interface(struct nand_chip *chip, int chipnr,
24572457
NDTR1_WAIT_MODE;
24582458
}
24592459

2460+
/*
2461+
* Reset nfc->selected_chip so the next command will cause the timing
2462+
* registers to be updated in marvell_nfc_select_target().
2463+
*/
2464+
nfc->selected_chip = NULL;
2465+
24602466
return 0;
24612467
}
24622468

@@ -2894,10 +2900,6 @@ static int marvell_nfc_init(struct marvell_nfc *nfc)
28942900
regmap_update_bits(sysctrl_base, GENCONF_CLK_GATING_CTRL,
28952901
GENCONF_CLK_GATING_CTRL_ND_GATE,
28962902
GENCONF_CLK_GATING_CTRL_ND_GATE);
2897-
2898-
regmap_update_bits(sysctrl_base, GENCONF_ND_CLK_CTRL,
2899-
GENCONF_ND_CLK_CTRL_EN,
2900-
GENCONF_ND_CLK_CTRL_EN);
29012903
}
29022904

29032905
/* Configure the DMA if appropriate */

drivers/mtd/spi-nor/core.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2018,6 +2018,7 @@ static const struct spi_nor_manufacturer *manufacturers[] = {
20182018

20192019
static const struct flash_info spi_nor_generic_flash = {
20202020
.name = "spi-nor-generic",
2021+
.n_banks = 1,
20212022
/*
20222023
* JESD216 rev A doesn't specify the page size, therefore we need a
20232024
* sane default.
@@ -2921,7 +2922,8 @@ static void spi_nor_late_init_params(struct spi_nor *nor)
29212922
if (nor->flags & SNOR_F_HAS_LOCK && !nor->params->locking_ops)
29222923
spi_nor_init_default_locking_ops(nor);
29232924

2924-
nor->params->bank_size = div64_u64(nor->params->size, nor->info->n_banks);
2925+
if (nor->info->n_banks > 1)
2926+
params->bank_size = div64_u64(params->size, nor->info->n_banks);
29252927
}
29262928

29272929
/**
@@ -2987,6 +2989,7 @@ static void spi_nor_init_default_params(struct spi_nor *nor)
29872989
/* Set SPI NOR sizes. */
29882990
params->writesize = 1;
29892991
params->size = (u64)info->sector_size * info->n_sectors;
2992+
params->bank_size = params->size;
29902993
params->page_size = info->page_size;
29912994

29922995
if (!(info->flags & SPI_NOR_NO_FR)) {

drivers/mtd/spi-nor/spansion.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ static int cypress_nor_determine_addr_mode_by_sr1(struct spi_nor *nor,
361361
*/
362362
static int cypress_nor_set_addr_mode_nbytes(struct spi_nor *nor)
363363
{
364-
struct spi_mem_op op;
364+
struct spi_mem_op op = {};
365365
u8 addr_mode;
366366
int ret;
367367

@@ -492,7 +492,7 @@ s25fs256t_post_bfpt_fixup(struct spi_nor *nor,
492492
const struct sfdp_parameter_header *bfpt_header,
493493
const struct sfdp_bfpt *bfpt)
494494
{
495-
struct spi_mem_op op;
495+
struct spi_mem_op op = {};
496496
int ret;
497497

498498
ret = cypress_nor_set_addr_mode_nbytes(nor);

0 commit comments

Comments
 (0)