Commit 35c222fd authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull MTD updates from Miquel Raynal:
 "MTD core
   - block2mtd: page index should use pgoff_t
   - maps: physmap: minimal Runtime PM support
   - maps: pcmciamtd: avoid possible sleep-in-atomic-context bugs
   - concat: Fix a comment referring to an unknown symbol

  Raw NAND:
   - Macronix: Use match_string() helper
   - Atmel: switch to using devm_fwnode_gpiod_get()
   - Denali: rework the SKIP_BYTES feature and add reset controlling
   - Brcmnand: set appropriate DMA mask
   - Cadence: add unspecified HAS_IOMEM dependency
   - Various cleanup.

  Onenand:
   - Rename Samsung and Omap2 drivers to avoid possible build warnings
   - Enable compile testing
   - Various build issues
   - Kconfig cleanup

  SPI-NAND:
   - Support for Toshiba TC58CVG2S0HRAIJ

  SPI-NOR:
   - Add support for TB selection using SR bit 6,
   - Add support for few flashes"

* tag 'mtd/for-5.6' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux: (41 commits)
  mtd: concat: Fix a comment referring to an unknown symbol
  mtd: rawnand: add unspecified HAS_IOMEM dependency
  mtd: block2mtd: page index should use pgoff_t
  mtd: maps: physmap: Add minimal Runtime PM support
  mtd: maps: pcmciamtd: fix possible sleep-in-atomic-context bugs in pcmciamtd_set_vpp()
  mtd: onenand: Rename omap2 driver to avoid a build warning
  mtd: onenand: Use a better name for samsung driver
  mtd: rawnand: atmel: switch to using devm_fwnode_gpiod_get()
  mtd: spinand: add support for Toshiba TC58CVG2S0HRAIJ
  mtd: rawnand: macronix: Use match_string() helper to simplify the code
  mtd: sharpslpart: Fix unsigned comparison to zero
  mtd: onenand: Enable compile testing of OMAP and Samsung drivers
  mtd: onenand: samsung: Fix printing format for size_t on 64-bit
  mtd: onenand: samsung: Fix pointer cast -Wpointer-to-int-cast warnings on 64 bit
  mtd: rawnand: denali: remove hard-coded DENALI_DEFAULT_OOB_SKIP_BYTES
  mtd: rawnand: denali_dt: add reset controlling
  dt-bindings: mtd: denali_dt: document reset property
  mtd: rawnand: denali_dt: Add support for configuring SPARE_AREA_SKIP_BYTES
  mtd: rawnand: denali_dt: error out if platform has no associated data
  mtd: rawnand: brcmnand: Set appropriate DMA mask
  ...
parents e84bcd61 4575243c
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -14,6 +14,11 @@ Required properties:
    interface clock, and the ECC circuit clock.
  - clock-names: should contain "nand", "nand_x", "ecc"

Optional properties:
  - resets: may contain phandles to the controller core reset, the register
    reset
  - reset-names: may contain "nand", "reg"

Sub-nodes:
  Sub-nodes represent available NAND chips.

@@ -46,6 +51,8 @@ nand: nand@ff900000 {
	reg-names = "nand_data", "denali_reg";
	clocks = <&nand_clk>, <&nand_x_clk>, <&nand_ecc_clk>;
	clock-names = "nand", "nand_x", "ecc";
	resets = <&nand_rst>, <&nand_reg_rst>;
	reset-names = "nand", "reg";
	interrupts = <0 144 4>;

	nand@0 {
+4 −4
Original line number Diff line number Diff line
@@ -44,7 +44,7 @@ struct block2mtd_dev {
static LIST_HEAD(blkmtd_device_list);


static struct page *page_read(struct address_space *mapping, int index)
static struct page *page_read(struct address_space *mapping, pgoff_t index)
{
	return read_mapping_page(mapping, index, NULL);
}
@@ -54,7 +54,7 @@ static int _block2mtd_erase(struct block2mtd_dev *dev, loff_t to, size_t len)
{
	struct address_space *mapping = dev->blkdev->bd_inode->i_mapping;
	struct page *page;
	int index = to >> PAGE_SHIFT;	// page index
	pgoff_t index = to >> PAGE_SHIFT;	// page index
	int pages = len >> PAGE_SHIFT;
	u_long *p;
	u_long *max;
@@ -103,7 +103,7 @@ static int block2mtd_read(struct mtd_info *mtd, loff_t from, size_t len,
{
	struct block2mtd_dev *dev = mtd->priv;
	struct page *page;
	int index = from >> PAGE_SHIFT;
	pgoff_t index = from >> PAGE_SHIFT;
	int offset = from & (PAGE_SIZE-1);
	int cpylen;

@@ -137,7 +137,7 @@ static int _block2mtd_write(struct block2mtd_dev *dev, const u_char *buf,
{
	struct page *page;
	struct address_space *mapping = dev->blkdev->bd_inode->i_mapping;
	int index = to >> PAGE_SHIFT;	// page index
	pgoff_t index = to >> PAGE_SHIFT;	// page index
	int offset = to & ~PAGE_MASK;	// page offset
	int cpylen;

+3 −4
Original line number Diff line number Diff line
@@ -294,16 +294,15 @@ static void pcmcia_copy_to(struct map_info *map, unsigned long to, const void *f
}


static DEFINE_SPINLOCK(pcmcia_vpp_lock);
static DEFINE_MUTEX(pcmcia_vpp_lock);
static int pcmcia_vpp_refcnt;
static void pcmciamtd_set_vpp(struct map_info *map, int on)
{
	struct pcmciamtd_dev *dev = (struct pcmciamtd_dev *)map->map_priv_1;
	struct pcmcia_device *link = dev->p_dev;
	unsigned long flags;

	pr_debug("dev = %p on = %d vpp = %d\n\n", dev, on, dev->vpp);
	spin_lock_irqsave(&pcmcia_vpp_lock, flags);
	mutex_lock(&pcmcia_vpp_lock);
	if (on) {
		if (++pcmcia_vpp_refcnt == 1)   /* first nested 'on' */
			pcmcia_fixup_vpp(link, dev->vpp);
@@ -311,7 +310,7 @@ static void pcmciamtd_set_vpp(struct map_info *map, int on)
		if (--pcmcia_vpp_refcnt == 0)   /* last nested 'off' */
			pcmcia_fixup_vpp(link, 0);
	}
	spin_unlock_irqrestore(&pcmcia_vpp_lock, flags);
	mutex_unlock(&pcmcia_vpp_lock);
}


+15 −5
Original line number Diff line number Diff line
@@ -38,6 +38,7 @@
#include <linux/mtd/cfi_endian.h>
#include <linux/io.h>
#include <linux/of_device.h>
#include <linux/pm_runtime.h>
#include <linux/gpio/consumer.h>

#include "physmap-gemini.h"
@@ -64,16 +65,16 @@ static int physmap_flash_remove(struct platform_device *dev)
{
	struct physmap_flash_info *info;
	struct physmap_flash_data *physmap_data;
	int i, err;
	int i, err = 0;

	info = platform_get_drvdata(dev);
	if (!info)
		return 0;
		goto out;

	if (info->cmtd) {
		err = mtd_device_unregister(info->cmtd);
		if (err)
			return err;
			goto out;

		if (info->cmtd != info->mtds[0])
			mtd_concat_destroy(info->cmtd);
@@ -88,7 +89,10 @@ static int physmap_flash_remove(struct platform_device *dev)
	if (physmap_data && physmap_data->exit)
		physmap_data->exit(dev);

	return 0;
out:
	pm_runtime_put(&dev->dev);
	pm_runtime_disable(&dev->dev);
	return err;
}

static void physmap_set_vpp(struct map_info *map, int state)
@@ -484,13 +488,19 @@ static int physmap_flash_probe(struct platform_device *dev)
		return -EINVAL;
	}

	pm_runtime_enable(&dev->dev);
	pm_runtime_get_sync(&dev->dev);

	if (dev->dev.of_node)
		err = physmap_flash_of_init(dev);
	else
		err = physmap_flash_pdata_init(dev);

	if (err)
	if (err) {
		pm_runtime_put(&dev->dev);
		pm_runtime_disable(&dev->dev);
		return err;
	}

	for (i = 0; i < info->nmaps; i++) {
		struct resource *res;
+1 −4
Original line number Diff line number Diff line
@@ -841,10 +841,7 @@ struct mtd_info *mtd_concat_create(struct mtd_info *subdev[], /* subdevices to c
	return &concat->mtd;
}

/*
 * This function destroys an MTD object obtained from concat_mtd_devs()
 */

/* Cleans the context obtained from mtd_concat_create() */
void mtd_concat_destroy(struct mtd_info *mtd)
{
	struct mtd_concat *concat = CONCAT(mtd);
Loading