Commit 206825f5 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull mtd updates from Miquel Raynal:
 "Core:
   - Remove obsolete macros only used by the old nand_ecclayout struct
   - Don't remove debugfs directory if device is in use
   - MAINTAINERS:
      - Add entry for Qualcomm NAND controller driver
      - Update the devicetree documentation path of hyperbus

  MTD devices:
   - block2mtd:
      - Add support for an optional custom MTD label
      - Minor refactor to avoid hard coded constant
   - mtdswap: Remove redundant assignment of pointer eb

  CFI:
   - Fixup CFI on ixp4xx

  Raw NAND controller drivers:
   - Arasan:
      - Prevent an unsupported configuration
   - Xway, Socrates: plat_nand, Pasemi, Orion, mpc5121, GPIO, Au1550nd,
     AMS-Delta:
      - Keep the driver compatible with on-die ECC engines
   - cs553x, lpc32xx_slc, ndfc, sharpsl, tmio, txx9ndfmc:
      - Revert the commits: "Fix external use of SW Hamming ECC helper"
      - And let callers use the bare Hamming helpers
   - Fsmc: Fix use of SM ORDER
   - Intel:
      - Fix potential buffer overflow in probe
   - xway, vf610, txx9ndfm, tegra, stm32, plat_nand, oxnas, omap, mtk,
     hisi504, gpmi, gpio, denali, bcm6368, atmel:
      - Make use of the helper function devm_platform_ioremap_resource{,byname}()

  Onenand drivers:
   - Samsung: Drop Exynos4 and describe driver in KConfig

  Raw NAND chip drivers:
   - Hynix: Add support for H27UCG8T2ETR-BC MLC NAND

  SPI NOR core:
   - Add spi-nor device tree binding under SPI NOR maintainers

  SPI NOR manufacturer drivers:
   - Enable locking for n25q128a13

  SPI NOR controller drivers:
   - Use devm_platform_ioremap_resource_byname()"

* tag 'mtd/for-5.16' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux: (50 commits)
  mtd: core: don't remove debugfs directory if device is in use
  MAINTAINERS: Update the devicetree documentation path of hyperbus
  mtd: block2mtd: add support for an optional custom MTD label
  mtd: block2mtd: minor refactor to avoid hard coded constant
  mtd: fixup CFI on ixp4xx
  mtd: rawnand: arasan: Prevent an unsupported configuration
  MAINTAINERS: Add entry for Qualcomm NAND controller driver
  mtd: rawnand: hynix: Add support for H27UCG8T2ETR-BC MLC NAND
  mtd: rawnand: xway: Keep the driver compatible with on-die ECC engines
  mtd: rawnand: socrates: Keep the driver compatible with on-die ECC engines
  mtd: rawnand: plat_nand: Keep the driver compatible with on-die ECC engines
  mtd: rawnand: pasemi: Keep the driver compatible with on-die ECC engines
  mtd: rawnand: orion: Keep the driver compatible with on-die ECC engines
  mtd: rawnand: mpc5121: Keep the driver compatible with on-die ECC engines
  mtd: rawnand: gpio: Keep the driver compatible with on-die ECC engines
  mtd: rawnand: au1550nd: Keep the driver compatible with on-die ECC engines
  mtd: rawnand: ams-delta: Keep the driver compatible with on-die ECC engines
  Revert "mtd: rawnand: cs553x: Fix external use of SW Hamming ECC helper"
  Revert "mtd: rawnand: lpc32xx_slc: Fix external use of SW Hamming ECC helper"
  Revert "mtd: rawnand: ndfc: Fix external use of SW Hamming ECC helper"
  ...
parents 05b8cd3d e269d7ca
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -8824,8 +8824,7 @@ S: Supported
Q:	http://patchwork.ozlabs.org/project/linux-mtd/list/
C:	irc://irc.oftc.net/mtd
T:	git git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git cfi/next
F:	Documentation/devicetree/bindings/mtd/cypress,hyperflash.txt
F:	Documentation/devicetree/bindings/mtd/ti,am654-hbmc.txt
F:	Documentation/devicetree/bindings/mtd/ti,am654-hbmc.yaml
F:	drivers/mtd/hyperbus/
F:	include/linux/mtd/hyperbus.h
@@ -15804,6 +15803,14 @@ S: Maintained
F:	Documentation/devicetree/bindings/regulator/vqmmc-ipq4019-regulator.yaml
F:	drivers/regulator/vqmmc-ipq4019-regulator.c
QUALCOMM NAND CONTROLLER DRIVER
M:	Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
L:	linux-mtd@lists.infradead.org
L:	linux-arm-msm@vger.kernel.org
S:	Maintained
F:	Documentation/devicetree/bindings/mtd/qcom,nandc.yaml
F:	drivers/mtd/nand/raw/qcom_nandc.c
QUALCOMM RMNET DRIVER
M:	Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
M:	Sean Tranchetti <stranche@codeaurora.org>
@@ -17903,6 +17910,7 @@ W: http://www.linux-mtd.infradead.org/
Q:	http://patchwork.ozlabs.org/project/linux-mtd/list/
C:	irc://irc.oftc.net/mtd
T:	git git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git spi-nor/next
F:	Documentation/devicetree/bindings/mtd/jedec,spi-nor.yaml
F:	drivers/mtd/spi-nor/
F:	include/linux/mtd/spi-nor.h
+2 −0
Original line number Diff line number Diff line
@@ -55,12 +55,14 @@ choice
	  LITTLE_ENDIAN_BYTE, if the bytes are reversed.

config MTD_CFI_NOSWAP
	depends on !ARCH_IXP4XX || CPU_BIG_ENDIAN
	bool "NO"

config MTD_CFI_BE_BYTE_SWAP
	bool "BIG_ENDIAN_BYTE"

config MTD_CFI_LE_BYTE_SWAP
	depends on !ARCH_IXP4XX
	bool "LITTLE_ENDIAN_BYTE"

endchoice
+21 −8
Original line number Diff line number Diff line
@@ -31,6 +31,9 @@
#include <linux/slab.h>
#include <linux/major.h>

/* Maximum number of comma-separated items in the 'block2mtd=' parameter */
#define BLOCK2MTD_PARAM_MAX_COUNT 3

/* Info for the block device */
struct block2mtd_dev {
	struct list_head list;
@@ -214,7 +217,7 @@ static void block2mtd_free_device(struct block2mtd_dev *dev)


static struct block2mtd_dev *add_device(char *devname, int erase_size,
		int timeout)
		char *label, int timeout)
{
#ifndef MODULE
	int i;
@@ -278,7 +281,10 @@ static struct block2mtd_dev *add_device(char *devname, int erase_size,

	/* Setup the MTD structure */
	/* make the name contain the block device in */
	if (!label)
		name = kasprintf(GFP_KERNEL, "block2mtd: %s", devname);
	else
		name = kstrdup(label, GFP_KERNEL);
	if (!name)
		goto err_destroy_mutex;

@@ -305,7 +311,7 @@ static struct block2mtd_dev *add_device(char *devname, int erase_size,
	list_add(&dev->list, &blkmtd_device_list);
	pr_info("mtd%d: [%s] erase_size = %dKiB [%d]\n",
		dev->mtd.index,
		dev->mtd.name + strlen("block2mtd: "),
		label ? label : dev->mtd.name + strlen("block2mtd: "),
		dev->mtd.erasesize >> 10, dev->mtd.erasesize);
	return dev;

@@ -381,8 +387,9 @@ static int block2mtd_setup2(const char *val)
	/* 80 for device, 12 for erase size, 80 for name, 8 for timeout */
	char buf[80 + 12 + 80 + 8];
	char *str = buf;
	char *token[2];
	char *token[BLOCK2MTD_PARAM_MAX_COUNT];
	char *name;
	char *label = NULL;
	size_t erase_size = PAGE_SIZE;
	unsigned long timeout = MTD_DEFAULT_TIMEOUT;
	int i, ret;
@@ -395,7 +402,7 @@ static int block2mtd_setup2(const char *val)
	strcpy(str, val);
	kill_final_newline(str);

	for (i = 0; i < 2; i++)
	for (i = 0; i < BLOCK2MTD_PARAM_MAX_COUNT; i++)
		token[i] = strsep(&str, ",");

	if (str) {
@@ -414,7 +421,8 @@ static int block2mtd_setup2(const char *val)
		return 0;
	}

	if (token[1]) {
	/* Optional argument when custom label is used */
	if (token[1] && strlen(token[1])) {
		ret = parse_num(&erase_size, token[1]);
		if (ret) {
			pr_err("illegal erase size\n");
@@ -422,7 +430,12 @@ static int block2mtd_setup2(const char *val)
		}
	}

	add_device(name, erase_size, timeout);
	if (token[2]) {
		label = token[2];
		pr_info("Using custom MTD label '%s' for dev %s\n", label, name);
	}

	add_device(name, erase_size, label, timeout);

	return 0;
}
@@ -456,7 +469,7 @@ static int block2mtd_setup(const char *val, const struct kernel_param *kp)


module_param_call(block2mtd, block2mtd_setup, NULL, NULL, 0200);
MODULE_PARM_DESC(block2mtd, "Device to use. \"block2mtd=<dev>[,<erasesize>]\"");
MODULE_PARM_DESC(block2mtd, "Device to use. \"block2mtd=<dev>[,[<erasesize>][,<label>]]\"");

static int __init block2mtd_init(void)
{
+1 −1
Original line number Diff line number Diff line
@@ -302,7 +302,7 @@ config MTD_DC21285

config MTD_IXP4XX
	tristate "CFI Flash device mapped on Intel IXP4xx based systems"
	depends on MTD_CFI && MTD_COMPLEX_MAPPINGS && ARCH_IXP4XX
	depends on MTD_CFI && MTD_COMPLEX_MAPPINGS && ARCH_IXP4XX && MTD_CFI_ADV_OPTIONS
	help
	  This enables MTD access to flash devices on platforms based
	  on Intel's IXP4xx family of network processors such as the
+2 −2
Original line number Diff line number Diff line
@@ -724,8 +724,6 @@ int del_mtd_device(struct mtd_info *mtd)

	mutex_lock(&mtd_table_mutex);

	debugfs_remove_recursive(mtd->dbg.dfs_dir);

	if (idr_find(&mtd_idr, mtd->index) != mtd) {
		ret = -ENODEV;
		goto out_error;
@@ -741,6 +739,8 @@ int del_mtd_device(struct mtd_info *mtd)
		       mtd->index, mtd->name, mtd->usecount);
		ret = -EBUSY;
	} else {
		debugfs_remove_recursive(mtd->dbg.dfs_dir);

		/* Try to remove the NVMEM provider */
		if (mtd->nvmem)
			nvmem_unregister(mtd->nvmem);
Loading