[PATCH] nfs: replace strict_strto* with kstrto*

2012-09-26 Thread Daniel Walter
[nfs] replace strict_str* with kstr* variants * replace string conversions with newer kstr* functions Signed-off-by: Daniel Walter --- apply against current linux-2.6 tree --- fs/nfs/idmap.c |4 ++-- fs/nfs/super.c |4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) --- diff

[PATCH] trace: replace strict_strto* with kstrto*

2012-09-26 Thread Daniel Walter
[trace] replace strict_strto* with kstrto* * remove old string conversions with kstrto* Signed-off-by: Daniel Walter --- kernel/trace/ftrace.c |2 +- kernel/trace/trace.c |2 +- kernel/trace/trace_events_filter.c |4 ++-- kernel/trace/trace_functions.c

PROBLEM: ReiserFS crashing

2005-08-03 Thread Daniel Walter
Acessing the (software-)raid1 results in crash of shell raid worked ok for some days before error message appeared upon first hangup: Linux version 2.6.11.10BERNHADINERMBO.DE ([EMAIL PROTECTED]) (gcc version 3.3.4) #3 Fri Jul 15 11:53:00 CEST 2005 ReiserFS: warning: is_leaf: item location se

Re: ReiserFS crashing

2005-08-03 Thread Daniel Walter
Jan Engelhardt schrieb: Acessing the (software-)raid1 results in crash of shell raid worked ok for some days before error message appeared upon first hangup: Linux version 2.6.11.10BERNHADINERMBO.DE ([EMAIL PROTECTED]) (gcc version 3.3.4) #3 Fri Jul 15 11:53:00 CEST 2005 ReiserFS: warning:

[PATCH v2 01/46] mtdpart: Propagate _get/put_device()

2016-09-21 Thread Daniel Walter
From: Richard Weinberger If the master device has callbacks for _get/put_device() and this MTD has slaves a get_mtd_device() call on paritions will never issue the registered callbacks. Fix this by propagating _get/put_device() down. Reviewed-by: Boris Brezillon Signed-off-by: Richard Weinberge

[PATCH v2 00/46] Nandsim facelift (part I of II)

2016-09-21 Thread Daniel Walter
emulation will be used but to allow arbitrary sized MTDs a more simple mode will be added which just allocates a MTD with the expected sizes instead of mocking nand_base.c. Daniel Walter (1): mtd/nandsim: Add ioctl for info Mathias Kresin (1): mtd: nandsim: use the existing output

[PATCH v2 03/46] mtd: Don't unconditionally unregister reboot notifier

2016-09-21 Thread Daniel Walter
From: Richard Weinberger del_mtd_device() is allowed to fail. i.e. when the MTD is busy. Unregister the reboot notifier only when we're really about to delete the MTD. Signed-off-by: Richard Weinberger --- drivers/mtd/mtdcore.c | 15 ++- 1 file changed, 10 insertions(+), 5 deletion

[PATCH v2 02/46] mtd: nand: Provide nand_cleanup() function to free NAND related resources

2016-09-21 Thread Daniel Walter
: Richard Weinberger Signed-off-by: Daniel Walter --- drivers/mtd/nand/nand_base.c | 18 +- include/linux/mtd/nand.h | 1 + 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index 77533f7..e743052 100644

[PATCH v2 04/46] mtd: Don't unconditionally execute remove notifiers

2016-09-21 Thread Daniel Walter
From: Richard Weinberger Only call them when we're really removing the MTD. Reviewed-by: Boris Brezillon Signed-off-by: Richard Weinberger --- drivers/mtd/mtdcore.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c in

[PATCH v2 05/46] mtd: Don't print a scary message when trying to remove a busy MTD

2016-09-21 Thread Daniel Walter
From: Richard Weinberger Just return -EBUSY and everything is fine. Signed-off-by: Richard Weinberger --- drivers/mtd/mtdcore.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c index b8205ec..32f1088 100644 --- a/drivers/mtd/mtdcore.c +++ b/dri

[PATCH v2 07/46] mtd: nandsim: Begin with removal of global state

2016-09-21 Thread Daniel Walter
From: Richard Weinberger A first step to support multiple nandsim instances... Remove global variables and put them into struct nandsim. Signed-off-by: Richard Weinberger --- drivers/mtd/nand/nandsim.c | 115 - 1 file changed, 61 insertions(+), 54 de

[PATCH v2 06/46] mtd: nandsim: Add basic control file support

2016-09-21 Thread Daniel Walter
From: Richard Weinberger /dev/nandsim_ctrl accept ioctl() commands such that userspace can configure nandsim. Signed-off-by: Richard Weinberger --- drivers/mtd/nand/nandsim.c | 66 +++--- 1 file changed, 56 insertions(+), 10 deletions(-) diff --git a/dr

[PATCH v2 10/46] mtd: nandsim: Add helper functions for pointer magic

2016-09-21 Thread Daniel Walter
From: Richard Weinberger Add chip_to_ns() and ns_to_mtd() helper functions Signed-off-by: Richard Weinberger --- drivers/mtd/nand/nandsim.c | 17 ++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/drivers/mtd/nand/nandsim.c b/drivers/mtd/nand/nandsim.c index fda67

[PATCH v2 09/46] mtd: nandsim: Don't directly use module parameters

2016-09-21 Thread Daniel Walter
From: Richard Weinberger Move simulator related module params into struct nandsim such that each instance can later use different parameters. Signed-off-by: Richard Weinberger --- drivers/mtd/nand/nandsim.c | 57 ++ 1 file changed, 37 insertions(+),

[PATCH v2 08/46] mtd: nandsim: Kill global nsmtd

2016-09-21 Thread Daniel Walter
From: Richard Weinberger Do it like UBI and support in future up to 32 instances. For now we still keep a single instance and allow more when all global state has been removed. Signed-off-by: Richard Weinberger --- drivers/mtd/nand/nandsim.c | 14 +++--- 1 file changed, 11 insertions(+

[PATCH v2 13/46] mtd: nandsim: Add final logic for multiple instances

2016-09-21 Thread Daniel Walter
From: Richard Weinberger Add support to create and delete multiple instances of nandsim. Signed-off-by: Richard Weinberger --- drivers/mtd/nand/nandsim.c | 59 ++ 1 file changed, 49 insertions(+), 10 deletions(-) diff --git a/drivers/mtd/nand/nandsi

[PATCH v2 15/46] mtd: nandsim: Introduce backend operations

2016-09-21 Thread Daniel Walter
From: Richard Weinberger ...to untangle the ram based and cachefile based code. It will help us later supporting different backends. Signed-off-by: Richard Weinberger --- drivers/mtd/nand/nandsim.c | 400 ++--- 1 file changed, 228 insertions(+), 172 dele

[PATCH v2 12/46] mtd: nandsim: Make debugfs logic multi instance capable

2016-09-21 Thread Daniel Walter
From: Richard Weinberger Instead of creating our files in /nandsim/, create one directory per instance. Signed-off-by: Richard Weinberger --- drivers/mtd/nand/nandsim.c | 36 ++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/nand/na

[PATCH v2 14/46] mtd: nandsim: Add simulator id to MTD parition name

2016-09-21 Thread Daniel Walter
From: Richard Weinberger ...also don't use spaces in the name. It allows UBI attach via MTD name to function correctly. Signed-off-by: Richard Weinberger --- drivers/mtd/nand/nandsim.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/mtd/nand/nandsim.c b/driv

[PATCH v2 11/46] mtd: nandsim: Factor out nandsim parameters

2016-09-21 Thread Daniel Walter
From: Richard Weinberger ...such that we have a way to pass different parameters to different instances. Signed-off-by: Richard Weinberger --- drivers/mtd/nand/nandsim.c | 129 - 1 file changed, 93 insertions(+), 36 deletions(-) diff --git a/drivers

[PATCH v2 16/46] mtd: nandsim: Print error when backend init failed

2016-09-21 Thread Daniel Walter
From: Richard Weinberger Signed-off-by: Richard Weinberger --- drivers/mtd/nand/nandsim.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/nand/nandsim.c b/drivers/mtd/nand/nandsim.c index 633872a..e333c5c 100644 --- a/drivers/mtd/nand/nandsim.c +++ b/drivers/m

[PATCH v2 19/46] mtd: nandsim: UAPI v1

2016-09-21 Thread Daniel Walter
From: Richard Weinberger Expose nandsim creation and delete functions to user-space Signed-off-by: Richard Weinberger --- include/uapi/mtd/nandsim-user.h | 102 1 file changed, 102 insertions(+) create mode 100644 include/uapi/mtd/nandsim-user.h diff

[PATCH v2 17/46] mtd: nandsim: Allow external backends

2016-09-21 Thread Daniel Walter
From: Richard Weinberger This turns nandsim into a mini framework to allow backends implemented in different drivers. i.e. virtio or usermodelinux. Signed-off-by: Richard Weinberger --- drivers/mtd/nand/nandsim.c | 124 +--- include/linux/mtd/nandsim.h

[PATCH v2 18/46] mtd: nandsim: Add basic support for a file backend

2016-09-21 Thread Daniel Walter
From: Richard Weinberger This is the first step to allow using a file as backing store. Such that it is possible to directly use nanddump images in nandsim. The current file cache mode is not desiged for this since it maintains an in memory list of erased block to skipt 0xff reads/writes. Further

[PATCH v2 20/46] mtd: nandsim: Implement preliminary constructor function

2016-09-21 Thread Daniel Walter
From: Richard Weinberger This function will be used later by the ioctl() interface for creating new nandsim instances. Signed-off-by: Richard Weinberger --- drivers/mtd/nand/nandsim.c | 41 - include/linux/mtd/nandsim.h | 3 ++- 2 files changed, 42 ins

[PATCH v2 22/46] mtd: nandsim: Cleanup destroy handlers

2016-09-21 Thread Daniel Walter
From: Richard Weinberger Make sure that we free stuff only after it has been initialized. Signed-off-by: Richard Weinberger --- drivers/mtd/nand/nandsim.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/drivers/mtd/nand/nandsim.c b/drivers/mtd/nand/nandsim.c index bac3fde..816d

[PATCH v2 23/46] mtd: nandsim: Unify file backend init logic

2016-09-21 Thread Daniel Walter
From: Richard Weinberger file and cache file backend do more or less the same, so share some code. Signed-off-by: Richard Weinberger --- drivers/mtd/nand/nandsim.c | 102 ++--- 1 file changed, 68 insertions(+), 34 deletions(-) diff --git a/drivers/mtd/n

[PATCH v2 21/46] mtd: nandsim: Implement preliminary destructor function

2016-09-21 Thread Daniel Walter
From: Richard Weinberger This function will be used via ioctl() to remove nandsim instances. Signed-off-by: Richard Weinberger --- drivers/mtd/nand/nandsim.c | 81 +++-- include/linux/mtd/nandsim.h | 2 +- 2 files changed, 79 insertions(+), 4 deletions

[PATCH v2 26/46] mtd: nandsim: use the existing output macros

2016-09-21 Thread Daniel Walter
From: Mathias Kresin Without using the output macros, it isn't possible to suppress these messages on the console by specifying an appropriate console log level. Signed-off-by: Mathias Kresin Signed-off-by: Richard Weinberger --- drivers/mtd/nand/nandsim.c | 28 ++-- 1

[PATCH v2 24/46] mtd: nandsim: Wire up NANDSIM_MODE_CACHEFILE ioctl mode

2016-09-21 Thread Daniel Walter
From: Richard Weinberger Allow the userspace control tool also to setup a cache file. In contrast to the cache_file module parameter the ioctl() only accepts a fd. So, userspace should hand in an fd pointing to a temp file. Signed-off-by: Richard Weinberger --- drivers/mtd/nand/nandsim.c | 5 +

[PATCH v2 25/46] mtd: nandsim: Print backend name

2016-09-21 Thread Daniel Walter
From: Richard Weinberger ...useful to figure what backend is currently in use. Signed-off-by: Richard Weinberger --- drivers/mtd/nand/nandsim.c | 4 include/linux/mtd/nandsim.h | 1 + 2 files changed, 5 insertions(+) diff --git a/drivers/mtd/nand/nandsim.c b/drivers/mtd/nand/nandsim.c i

[PATCH v2 27/46] mtd: nandsim: Add no_oob mode

2016-09-21 Thread Daniel Walter
From: Richard Weinberger This allows using a nanddump image directly as file backend. The use case is dumping without OOB from a real device, startup nandsim with the same NAND ID an use the file. That way NAND dumps can loaded into nandsim much faster since no nandwrite is needed and, of course

[PATCH v2 28/46] mtd: nandsim: Refine exports

2016-09-21 Thread Daniel Walter
From: Richard Weinberger Keep the file backend logic directly in nandsim such that other users of only have to implement simple read/write functions. Signed-off-by: Richard Weinberger --- drivers/mtd/nand/nandsim.c | 101 +--- include/linux/mtd/nandsim.

[PATCH v2 29/46] um: Add nandsim backend driver

2016-09-21 Thread Daniel Walter
From: Richard Weinberger Add a small UML driver to act as nandsim backend. This allows us to use the nandsim MTD as root device and boot from it. e.g. ./linux mem=512M unand.backing_file=/home/rw/work/ubifs/mtd4.raw \ unand.id_bytes=0x1c,0xd3,0x90,0xa6 unand.no_oob=y nandsim.defaults=n \ ubi.mt

[PATCH v2 38/46] mtd: nandsim: Expose partition creation logic to user space

2016-09-21 Thread Daniel Walter
From: Richard Weinberger Signed-off-by: Richard Weinberger --- drivers/mtd/nand/nandsim.c | 12 +++- include/linux/mtd/nandsim.h | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/nand/nandsim.c b/drivers/mtd/nand/nandsim.c index 615dde3..6b7570b 10064

[PATCH v2 34/46] mtd: nandsim: Support bitflip and read error emulation in file backend

2016-09-21 Thread Daniel Walter
From: Richard Weinberger Since we don't track the empty state we have to check whether the buffer is full with 0xff bytes or not. Signed-off-by: Richard Weinberger --- drivers/mtd/nand/nandsim.c | 34 -- 1 file changed, 28 insertions(+), 6 deletions(-) diff --g

[PATCH v2 32/46] mtd: nandsim: Remove NS_IS_INITIALIZED

2016-09-21 Thread Daniel Walter
From: Richard Weinberger init_nandsim() has exactly one caller, the construction function. So, checking for this condition makes no sense. Signed-off-by: Richard Weinberger --- drivers/mtd/nand/nandsim.c | 8 1 file changed, 8 deletions(-) diff --git a/drivers/mtd/nand/nandsim.c b/dr

[PATCH v2 31/46] mtd: nandsim: Remove NS_RAW_OFFSET_OOB

2016-09-21 Thread Daniel Walter
From: Richard Weinberger This helper macro has no users, kill it. Signed-off-by: Richard Weinberger --- drivers/mtd/nand/nandsim.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/mtd/nand/nandsim.c b/drivers/mtd/nand/nandsim.c index 048beb0..915e3bb 100644 --- a/drivers/mtd/nand/

[PATCH v2 35/46] mtd: nandsim: Make NANDSIM_MAX_DEVICES part of uapi

2016-09-21 Thread Daniel Walter
From: Richard Weinberger ...such that userspace very easy remove all nandsim instances. Signed-off-by: Richard Weinberger --- drivers/mtd/nand/nandsim.c | 14 ++ 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/mtd/nand/nandsim.c b/drivers/mtd/nand/nandsim.c in

[PATCH v2 30/46] mtd: nandsim: Use pr_ style logging

2016-09-21 Thread Daniel Walter
From: Richard Weinberger These days we have CONFIG_DYNAMIC_DEBUG and stuff, there is no need to open code logging. Signed-off-by: Richard Weinberger --- drivers/mtd/nand/nandsim.c | 323 + 1 file changed, 149 insertions(+), 174 deletions(-) diff --g

[PATCH v2 37/46] mtd: nandsim: Turn parts[] into a integer

2016-09-21 Thread Daniel Walter
From: Richard Weinberger The parts array denotes how many erase blocks each partition has. Therefore a plain integer can also do it. If someone shows me a NAND with more than 2^32 erase blocks we can turn it back into a long. ;) Signed-off-by: Richard Weinberger --- drivers/mtd/nand/nandsim.c

[PATCH v2 36/46] mtd: nandsim: Cleanup constants

2016-09-21 Thread Daniel Walter
From: Richard Weinberger Rename CONFIG_NANDSIM_* to NANDSIM_* since these constants are not exposed to kconfig. Signed-off-by: Richard Weinberger --- drivers/mtd/nand/nandsim.c | 74 -- 1 file changed, 25 insertions(+), 49 deletions(-) diff --git a/

[PATCH v2 43/46] mtd: nandsim: Wire up NANDSIM_IOC_NEW_INSTANCE

2016-09-21 Thread Daniel Walter
From: Richard Weinberger Since we have now all what we need we can arm NANDSIM_IOC_NEW_INSTANCE. Signed-off-by: Richard Weinberger --- drivers/mtd/nand/nandsim.c | 31 --- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/drivers/mtd/nand/nandsim.c b/dr

[PATCH v2 44/46] mtd: nandsim: Wire up NANDSIM_IOC_DESTROY_INSTANCE

2016-09-21 Thread Daniel Walter
From: Richard Weinberger The logic for destroying nandsim instances now also ready. Signed-off-by: Richard Weinberger --- drivers/mtd/nand/nandsim.c | 13 + 1 file changed, 13 insertions(+) diff --git a/drivers/mtd/nand/nandsim.c b/drivers/mtd/nand/nandsim.c index bb30763..5d82a0a

[PATCH v2 46/46] mtd/nandsim: Add ioctl for info

2016-09-21 Thread Daniel Walter
Add a ioctl() call for nandsim information. This information includes, nand id, backend type and path to the file if the file backend is used Signed-off-by: Daniel Walter --- drivers/mtd/nand/nandsim.c | 65 + include/uapi/mtd/nandsim-user.h | 11

[PATCH v2 42/46] mtd: nandsim: Don't printk on ENOMEM

2016-09-21 Thread Daniel Walter
From: Richard Weinberger Memory allocation failures are tabu, we don't talk about them. Signed-off-by: Richard Weinberger --- drivers/mtd/nand/nandsim.c | 37 + 1 file changed, 9 insertions(+), 28 deletions(-) diff --git a/drivers/mtd/nand/nandsim.c b/drive

[PATCH v2 33/46] mtd: nandsim: Relax page size restrictions

2016-09-21 Thread Daniel Walter
From: Richard Weinberger Allow any page size as long it is a power of two and less than KMALLOC_MAX_SIZE. Signed-off-by: Richard Weinberger --- drivers/mtd/nand/nandsim.c | 26 +- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/mtd/nand/nandsim.c

[PATCH v2 39/46] mtd: nandsim: Rework init error paths

2016-09-21 Thread Daniel Walter
From: Richard Weinberger Signed-off-by: Richard Weinberger --- drivers/mtd/nand/nandsim.c | 97 +++--- 1 file changed, 57 insertions(+), 40 deletions(-) diff --git a/drivers/mtd/nand/nandsim.c b/drivers/mtd/nand/nandsim.c index 6b7570b..92f5efc 100644 --

[PATCH v2 41/46] mtd: nandsim: Expose support for weakpages/blocks to userspace

2016-09-21 Thread Daniel Walter
From: Richard Weinberger Allow users to define weakpages/blocks while creating a new nandsim instance. Signed-off-by: Richard Weinberger --- drivers/mtd/nand/nandsim.c | 338 include/linux/mtd/nandsim.h | 7 +- 2 files changed, 285 insertions(+),

[PATCH v2 40/46] mtd: nandsim: Expose BBT, delays, etc.. to userspace

2016-09-21 Thread Daniel Walter
From: Richard Weinberger Allow userspace to define nandsim parameters like delays, bitflips, ... Signed-off-by: Richard Weinberger --- drivers/mtd/nand/nandsim.c | 43 --- include/linux/mtd/nandsim.h | 2 +- 2 files changed, 37 insertions(+), 8 deletio

[PATCH v2 45/46] mtd: nandsim: Always answer all 8 bytes from NAND_CMD_READID

2016-09-21 Thread Daniel Walter
From: Richard Weinberger nand base reads the full 8 byte NAND ID, no matter how many id bytes we have configured. So, instead of getting confused return all bytes even when they are not configured (0xff). Fixes error messages such as: nandsim: unexpected data output cycle, state is STATE_READY

Re: [PATCH v2 03/46] mtd: Don't unconditionally unregister reboot notifier

2016-09-21 Thread Daniel Walter
On 09/21/2016 04:31 PM, Boris Brezillon wrote: > On Wed, 21 Sep 2016 11:45:12 +0200 > Daniel Walter wrote: > >> From: Richard Weinberger >> >> del_mtd_device() is allowed to fail. >> i.e. when the MTD is busy. >> Unregister the reboot notifier only when

Re: [PATCH v2 02/46] mtd: nand: Provide nand_cleanup() function to free NAND related resources

2016-09-21 Thread Daniel Walter
Boris, On 09/21/2016 04:25 PM, Boris Brezillon wrote: > Daniel, Richard, > > On Wed, 21 Sep 2016 11:44:41 +0200 > Daniel Walter wrote: > >> From: Richard Weinberger >> >> Provide a nand_cleanup() function to free all nand related resources >> withou

[PATCH 00/46] Nandsim facelift (part I of II)

2016-08-31 Thread Daniel Walter
dded which just allocates a MTD with the expected sizes instead of mocking nand_base.c. Daniel Walter (1): mtd/nandsim: Add ioctl for info Mathias Kresin (1): mtd: nandsim: use the existing output macros Richard Weinberger (44): mtdpart: Propagate _get/put_device() mtd: nand:

[PATCH 02/46] mtd: nand: TODO Propagate mtd_device_unregister() return value in tear down

2016-08-31 Thread Daniel Walter
From: Richard Weinberger Provide a __nand_release() function for drivers which can deal with a failing nand release operation. Most drivers should be safe since they rely on module refcounting. To catch outliers implement a nand_release() with a WARN_ON(). Signed-off-by: Richard Weinberger ---

[PATCH 44/46] mtd: nandsim: Wire up NANDSIM_IOC_DESTROY_INSTANCE

2016-08-31 Thread Daniel Walter
From: Richard Weinberger The logic for destroying nandsim instances now also ready. Signed-off-by: Richard Weinberger --- drivers/mtd/nand/nandsim.c | 13 + 1 file changed, 13 insertions(+) diff --git a/drivers/mtd/nand/nandsim.c b/drivers/mtd/nand/nandsim.c index 4145ab6..8a63812

[PATCH 35/46] mtd: nandsim: Make NANDSIM_MAX_DEVICES part of uapi

2016-08-31 Thread Daniel Walter
From: Richard Weinberger ...such that userspace very easy remove all nandsim instances. Signed-off-by: Richard Weinberger --- drivers/mtd/nand/nandsim.c | 14 ++ 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/mtd/nand/nandsim.c b/drivers/mtd/nand/nandsim.c in

[PATCH 37/46] mtd: nandsim: Turn parts[] into a integer

2016-08-31 Thread Daniel Walter
From: Richard Weinberger The parts array denotes how many erase blocks each partition has. Therefore a plain integer can also do it. If someone shows me a NAND with more than 2^32 erase blocks we can turn it back into a long. ;) Signed-off-by: Richard Weinberger --- drivers/mtd/nand/nandsim.c

[PATCH 43/46] mtd: nandsim: Wire up NANDSIM_IOC_NEW_INSTANCE

2016-08-31 Thread Daniel Walter
From: Richard Weinberger Since we have now all what we need we can arm NANDSIM_IOC_NEW_INSTANCE. Signed-off-by: Richard Weinberger --- drivers/mtd/nand/nandsim.c | 31 --- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/drivers/mtd/nand/nandsim.c b/dr

[PATCH 39/46] mtd: nandsim: Rework init error paths

2016-08-31 Thread Daniel Walter
From: Richard Weinberger Signed-off-by: Richard Weinberger --- drivers/mtd/nand/nandsim.c | 97 +++--- 1 file changed, 57 insertions(+), 40 deletions(-) diff --git a/drivers/mtd/nand/nandsim.c b/drivers/mtd/nand/nandsim.c index 05a3088..027b15d 100644 --

[PATCH 46/46] mtd/nandsim: Add ioctl for info

2016-08-31 Thread Daniel Walter
Add a ioctl() call for nandsim information. This information includes, nand id, backend type and path to the file if the file backend is used Signed-off-by: Daniel Walter --- drivers/mtd/nand/nandsim.c | 65 + include/uapi/mtd/nandsim-user.h | 11

[PATCH 40/46] mtd: nandsim: Expose BBT, delays, etc.. to userspace

2016-08-31 Thread Daniel Walter
From: Richard Weinberger Signed-off-by: Richard Weinberger --- drivers/mtd/nand/nandsim.c | 43 --- include/linux/mtd/nandsim.h | 2 +- 2 files changed, 37 insertions(+), 8 deletions(-) diff --git a/drivers/mtd/nand/nandsim.c b/drivers/mtd/nand/nandsim

[PATCH 36/46] mtd: nandsim: Cleanup constants

2016-08-31 Thread Daniel Walter
From: Richard Weinberger Rename CONFIG_NANDSIM_* to NANDSIM_* since these constants are not exposed to kconfig. Signed-off-by: Richard Weinberger --- drivers/mtd/nand/nandsim.c | 74 -- 1 file changed, 25 insertions(+), 49 deletions(-) diff --git a/

[PATCH 42/46] mtd: nandsim: Don't printk on ENOMEM

2016-08-31 Thread Daniel Walter
From: Richard Weinberger Memory allocation failures are tabu, we don't talk about them. Signed-off-by: Richard Weinberger --- drivers/mtd/nand/nandsim.c | 37 + 1 file changed, 9 insertions(+), 28 deletions(-) diff --git a/drivers/mtd/nand/nandsim.c b/drive

[PATCH 38/46] mtd: nandsim: Expose partition creation logic to user space

2016-08-31 Thread Daniel Walter
From: Richard Weinberger Signed-off-by: Richard Weinberger --- drivers/mtd/nand/nandsim.c | 12 +++- include/linux/mtd/nandsim.h | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/nand/nandsim.c b/drivers/mtd/nand/nandsim.c index 584fc72..05a3088 10064

[PATCH 41/46] mtd: nandsim: Expose support for weakpages/blocks to userspace

2016-08-31 Thread Daniel Walter
From: Richard Weinberger Signed-off-by: Richard Weinberger --- drivers/mtd/nand/nandsim.c | 338 include/linux/mtd/nandsim.h | 7 +- 2 files changed, 285 insertions(+), 60 deletions(-) diff --git a/drivers/mtd/nand/nandsim.c b/drivers/mtd/nand/na

[PATCH 32/46] mtd: nandsim: Remove NS_IS_INITIALIZED

2016-08-31 Thread Daniel Walter
From: Richard Weinberger init_nandsim() has exactly one caller, the construction function. So, checking for this condition makes no sense. Signed-off-by: Richard Weinberger --- drivers/mtd/nand/nandsim.c | 8 1 file changed, 8 deletions(-) diff --git a/drivers/mtd/nand/nandsim.c b/dr

[PATCH 30/46] mtd: nandsim: Use pr_ style logging

2016-08-31 Thread Daniel Walter
From: Richard Weinberger These days we have CONFIG_DYNAMIC_DEBUG and stuff, there is no need to open code logging. Signed-off-by: Richard Weinberger --- drivers/mtd/nand/nandsim.c | 321 + 1 file changed, 148 insertions(+), 173 deletions(-) diff --g

[PATCH 31/46] mtd: nandsim: Remove NS_RAW_OFFSET_OOB

2016-08-31 Thread Daniel Walter
From: Richard Weinberger This helper macro has no users, kill it. Signed-off-by: Richard Weinberger --- drivers/mtd/nand/nandsim.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/mtd/nand/nandsim.c b/drivers/mtd/nand/nandsim.c index 02fa039..fcc7441 100644 --- a/drivers/mtd/nand/

[PATCH 34/46] mtd: nandsim: Support bitflip and read error emulation in file backend

2016-08-31 Thread Daniel Walter
From: Richard Weinberger Since we don't track the empty state we have to check whether the buffer is full with 0xff bytes or not. Signed-off-by: Richard Weinberger --- drivers/mtd/nand/nandsim.c | 34 -- 1 file changed, 28 insertions(+), 6 deletions(-) diff --g

[PATCH 45/46] mtd: nandsim: Always answer all 8 bytes from NAND_CMD_READID

2016-08-31 Thread Daniel Walter
From: Richard Weinberger nand base reads the full 8 byte NAND ID, no matter how many id bytes we have configured. So, instead of getting confused return all bytes even when they are not configured (0xff). Fixes error messages such as: nandsim: unexpected data output cycle, state is STATE_READY

[PATCH 26/46] mtd: nandsim: use the existing output macros

2016-08-31 Thread Daniel Walter
From: Mathias Kresin Without using the output macros, it isn't possible to suppress these messages on the console by specifying an appropriate console log level. Signed-off-by: Mathias Kresin Signed-off-by: Richard Weinberger --- drivers/mtd/nand/nandsim.c | 28 ++-- 1

[PATCH 27/46] mtd: nandsim: Add no_oob mode

2016-08-31 Thread Daniel Walter
From: Richard Weinberger This allows using a nanddump image directly as file backend. The use case is dumping without OOB from a real device, startup nandsim with the same NAND ID an use the file. That way NAND dumps can loaded into nandsim much faster since no nandwrite is needed and, of course

[PATCH 28/46] mtd: nandsim: Refine exports

2016-08-31 Thread Daniel Walter
From: Richard Weinberger Keep the file backend logic directly in nandsim such that other users of only have to implement simple read/write functions. Signed-off-by: Richard Weinberger --- drivers/mtd/nand/nandsim.c | 101 +--- include/linux/mtd/nandsim.

[PATCH 25/46] mtd: nandsim: Print backend name

2016-08-31 Thread Daniel Walter
From: Richard Weinberger ...useful to figure what backend is currently in use. Signed-off-by: Richard Weinberger --- drivers/mtd/nand/nandsim.c | 4 include/linux/mtd/nandsim.h | 1 + 2 files changed, 5 insertions(+) diff --git a/drivers/mtd/nand/nandsim.c b/drivers/mtd/nand/nandsim.c i

[PATCH 16/46] mtd: nandsim: Print error when backend init failed

2016-08-31 Thread Daniel Walter
From: Richard Weinberger Signed-off-by: Richard Weinberger --- drivers/mtd/nand/nandsim.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/nand/nandsim.c b/drivers/mtd/nand/nandsim.c index 633872a..e333c5c 100644 --- a/drivers/mtd/nand/nandsim.c +++ b/drivers/m

[PATCH 33/46] mtd: nandsim: Relax page size restrictions

2016-08-31 Thread Daniel Walter
From: Richard Weinberger Allow any page size as long it is a power of two and less than KMALLOC_MAX_SIZE. Signed-off-by: Richard Weinberger --- drivers/mtd/nand/nandsim.c | 26 +- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/mtd/nand/nandsim.c

[PATCH 29/46] um: Add nandsim backend driver

2016-08-31 Thread Daniel Walter
From: Richard Weinberger Add a small UML driver to act as nandsim backend. This allows us to use the nandsim MTD as root device and boot from it. e.g. ./linux mem=512M unand.backing_file=/home/rw/work/ubifs/mtd4.raw \ unand.id_bytes=0x1c,0xd3,0x90,0xa6 unand.no_oob=y nandsim.defaults=n \ ubi.mt

[PATCH 24/46] mtd: nandsim: Wire up NANDSIM_MODE_CACHEFILE ioctl mode

2016-08-31 Thread Daniel Walter
From: Richard Weinberger Allow the userspace control tool also to setup a cache file. In contrast to the cache_file module parameter the ioctl() only accepts a fd. So, userspace should hand in an fd pointing to a temp file. Signed-off-by: Richard Weinberger --- drivers/mtd/nand/nandsim.c | 5 +

[PATCH 19/46] mtd: nandsim: UAPI v1

2016-08-31 Thread Daniel Walter
From: Richard Weinberger expose UAPI for nandsim Signed-off-by: Richard Weinberger --- include/uapi/mtd/nandsim-user.h | 102 1 file changed, 102 insertions(+) create mode 100644 include/uapi/mtd/nandsim-user.h diff --git a/include/uapi/mtd/nandsim-us

[PATCH 17/46] mtd: nandsim: Allow external backends

2016-08-31 Thread Daniel Walter
From: Richard Weinberger This turns nandsim into a mini framework to allow backends implemented in different drivers. i.e. virtio or usermodelinux. Signed-off-by: Richard Weinberger --- drivers/mtd/nand/nandsim.c | 124 +--- include/linux/mtd/nandsim.h

[PATCH 20/46] mtd: nandsim: Implement preliminary constructor function

2016-08-31 Thread Daniel Walter
From: Richard Weinberger This function will be used later by the ioctl() interface for creating new nandsim instances. Signed-off-by: Richard Weinberger --- drivers/mtd/nand/nandsim.c | 41 - include/linux/mtd/nandsim.h | 3 ++- 2 files changed, 42 ins

[PATCH 23/46] mtd: nandsim: Unify file backend init logic

2016-08-31 Thread Daniel Walter
From: Richard Weinberger file and cache file backend do more or less the same, so share some code. Signed-off-by: Richard Weinberger --- drivers/mtd/nand/nandsim.c | 102 ++--- 1 file changed, 68 insertions(+), 34 deletions(-) diff --git a/drivers/mtd/n

[PATCH 18/46] mtd: nandsim: Add basic support for a file backend

2016-08-31 Thread Daniel Walter
From: Richard Weinberger This is the first step to allow using a file as backing store. Such that it is possible to directly use nanddump images in nandsim. The current file cache mode is not desiged for this since it maintains an in memory list of erased block to skipt 0xff reads/writes. Further

[PATCH 15/46] mtd: nandsim: Introduce backend operations

2016-08-31 Thread Daniel Walter
From: Richard Weinberger ...to untangle the ram based and cachefile based code. It will help us later supporting different backends. Signed-off-by: Richard Weinberger --- drivers/mtd/nand/nandsim.c | 400 ++--- 1 file changed, 228 insertions(+), 172 dele

[PATCH 12/46] mtd: nandsim: Make debugfs logic multi instance capable

2016-08-31 Thread Daniel Walter
From: Richard Weinberger Instead of creating our files in /nandsim/, create one directory per instance. Signed-off-by: Richard Weinberger --- drivers/mtd/nand/nandsim.c | 36 ++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/nand/na

[PATCH 14/46] mtd: nandsim: Add simulator id to MTD parition name

2016-08-31 Thread Daniel Walter
From: Richard Weinberger ...also don't use spaces in the name. It allows UBI attach via MTD name to function correctly. Signed-off-by: Richard Weinberger --- drivers/mtd/nand/nandsim.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/mtd/nand/nandsim.c b/driv

[PATCH 13/46] mtd: nandsim: Add final logic for multiple instances

2016-08-31 Thread Daniel Walter
From: Richard Weinberger Signed-off-by: Richard Weinberger --- drivers/mtd/nand/nandsim.c | 59 ++ 1 file changed, 49 insertions(+), 10 deletions(-) diff --git a/drivers/mtd/nand/nandsim.c b/drivers/mtd/nand/nandsim.c index 057cc7a..bef5afa 100644 --

[PATCH 10/46] mtd: nandsim: Add helper functions for pointer magic

2016-08-31 Thread Daniel Walter
From: Richard Weinberger Signed-off-by: Richard Weinberger --- drivers/mtd/nand/nandsim.c | 17 ++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/drivers/mtd/nand/nandsim.c b/drivers/mtd/nand/nandsim.c index fda670b..f26e983 100644 --- a/drivers/mtd/nand/nandsim.c

[PATCH 22/46] mtd: nandsim: Cleanup destroy handlers

2016-08-31 Thread Daniel Walter
From: Richard Weinberger Make sure that we free stuff only after it has been initialized. Signed-off-by: Richard Weinberger --- drivers/mtd/nand/nandsim.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/drivers/mtd/nand/nandsim.c b/drivers/mtd/nand/nandsim.c index f8b9e76..78c3

[PATCH 21/46] mtd: nandsim: Implement preliminary destructor function

2016-08-31 Thread Daniel Walter
From: Richard Weinberger This function will be used via ioctl() to remove nandsim instances. Signed-off-by: Richard Weinberger --- drivers/mtd/nand/nandsim.c | 80 +++-- include/linux/mtd/nandsim.h | 2 +- 2 files changed, 78 insertions(+), 4 deletions

[PATCH 06/46] mtd: nandsim: Add basic control file support

2016-08-31 Thread Daniel Walter
From: Richard Weinberger /dev/nandsim_ctrl accept ioctl() commands such that userspace can configure nandsim. Signed-off-by: Richard Weinberger --- drivers/mtd/nand/nandsim.c | 66 +++--- 1 file changed, 56 insertions(+), 10 deletions(-) diff --git a/dr

[PATCH 07/46] mtd: nandsim: Begin with removal of global state

2016-08-31 Thread Daniel Walter
From: Richard Weinberger A first step to support multiple nandsim instances... Remove global variables and put them into struct nandsim. Signed-off-by: Richard Weinberger --- drivers/mtd/nand/nandsim.c | 115 - 1 file changed, 61 insertions(+), 54 de

[PATCH 05/46] mtd: Don't print a scary message when trying to remove a busy MTD

2016-08-31 Thread Daniel Walter
From: Richard Weinberger Just return -EBUSY and everything is fine. Signed-off-by: Richard Weinberger --- drivers/mtd/mtdcore.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c index b8205ec..32f1088 100644 --- a/drivers/mtd/mtdcore.c +++ b/dri

[PATCH 11/46] mtd: nandsim: Factor out nandsim parameters

2016-08-31 Thread Daniel Walter
From: Richard Weinberger ...such that we have a way to pass different parameters to different instances. Signed-off-by: Richard Weinberger --- drivers/mtd/nand/nandsim.c | 129 - 1 file changed, 93 insertions(+), 36 deletions(-) diff --git a/drivers

[PATCH 09/46] mtd: nandsim: Don't directly use module parameters

2016-08-31 Thread Daniel Walter
From: Richard Weinberger Move simulator related module params into struct nandsim such that each instance can later use different parameters. Signed-off-by: Richard Weinberger --- drivers/mtd/nand/nandsim.c | 57 ++ 1 file changed, 37 insertions(+),

[PATCH 08/46] mtd: nandsim: Kill global nsmtd

2016-08-31 Thread Daniel Walter
From: Richard Weinberger Do it like UBI and support in future up to 32 instances. For now we still keep a single instance and allow more when all global state has been removed. Signed-off-by: Richard Weinberger --- drivers/mtd/nand/nandsim.c | 14 +++--- 1 file changed, 11 insertions(+

[PATCH 03/46] mtd: Don't unconditionally unregister reboot notifier

2016-08-31 Thread Daniel Walter
From: Richard Weinberger del_mtd_device() is allowed to fail. i.e. when the MTD is busy. Unregister the reboot notifier only when we're really about to delete the MTD. Signed-off-by: Richard Weinberger --- drivers/mtd/mtdcore.c | 15 ++- 1 file changed, 10 insertions(+), 5 deletion

[PATCH 04/46] mtd: Don't unconditionally execute remove notifiers

2016-08-31 Thread Daniel Walter
From: Richard Weinberger Only call them when we're really removing the MTD. Reviewed-by: Boris Brezillon Signed-off-by: Richard Weinberger --- drivers/mtd/mtdcore.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c in

[PATCH 01/46] mtdpart: Propagate _get/put_device()

2016-08-31 Thread Daniel Walter
From: Richard Weinberger If the master device has callbacks for _get/put_device() and this MTD has slaves a get_mtd_device() call on paritions will never issue the registered callbacks. Fix this by propagating _get/put_device() down. Reviewed-by: Boris Brezillon Signed-off-by: Richard Weinberge

  1   2   >