Matthias Auchmann | 29 May 15:38 2016
Picon

mtd locking

Hi all!

I have a question - sorry if it turns out to be a beginner's question. I'm using kernel version 3.17, but as far
as I can tell my question still applies.

My question is how locking is ensured with MTD. I understand that usually there would only be one file system
attached to one mtd partition, but what if I concurrently ran multiple instances of nanddump from
userspace? Is MTD thread-safe?

I'm asking since I had an issue where when I called nanddump on two partitions of the same NAND flash
simultaneously, the ECC errors would count up for both nanddumps although only one partition had ECC
errors. Experimentally adding a mutex to mtdpart.c's part_read() function solved the issue.

I then noticed that quite frequently in the MTD code, ecc_stats are saved, then some reads are performed,
and then ecc_stats are compared. No mutex or spinlock or whatever protection is used. Given that the ECC
errors can result in -EUCLEAN or a positive bitflip count (then resulting in scrubbing for UBI for
example)... I started to feel a little uncomfortable about the whole MTD locking issue.

This is where the question comes from... could anyone shed light on this?

Thanks!

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

Boris Brezillon | 27 May 14:54 2016

[PATCH 00/15] mtd: nand: allow vendor specific detection/initialization

Hello,

This patch series is a step forward in supporting vendor-specific
functionalities.
This series is mainly moving vendor-specific initialization or
detection code out of the core, but also introduces an infrastructure
allowing support for vendor-specific features.

While those features might seem useless to most users, some of them are
actually required on modern MLC/TLC NANDs (this is the case of read-retry
support, which AFAICT has not been standardized by the JEDEC consortium).

Now, let's detail what's inside this patch-set.

Patches 1 to 4 are simple reworks simplifying auto-detection function
prototypes, and clarifying their purpose.

Patch 5 is introducing the vendor-specific initialization
infrastructure.

Patch 6 is removing the MTD_NAND_IDS Kconfig option to avoid creating
a nand_ids.ko module when MTD_NAND is enabled as a module. This prevents
a future cross-dependency between nand.ko where all vendor specific
code will rely and nand_ids.ko which will reference vendor-specific ops
in its manufacturer table, which in turn is referenced by the core code
linked in nand.ko.

Patches 7 to 12 are moving vendor-specific code into their respective
nand_<vendor>.c files.

(Continue reading)

PJ | 27 May 02:40 2016

Looking for an alternative to ubimirror

Hi,

Can anyone please recommend a procedure to copy one UBI volume to another? 

I'd like to execute from the bash command line, if possible.

One upon a time I was able to use ubimirror, however that command appears to
have been removed from mtd-utils. 

- The source volume will be mounted R/O as it is the rootfs. 
- The destination volume will be unrestricted (unmounted).
- Both the source and destination volumes are in the same device.

I checked the FAQ, the archive, and Google but I came up empty, so thanks.

Paul

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

Picon

m25p80 spi32766.0: unrecognized JEDEC id bytes: 00, 0, 0

Hello,
I am running Broadcom 53346 with integratedARM cpu on  Linux 4.0.0 and get the message 
m25p80 spi32766.0: unrecognized JEDEC id bytes: 00,  0,  0
followed by a crash

when mounting the spi nor (m25p80 spi32766.0: n25q256a)

What would be the cause of this read failure?

Cheers,
 Renaud

===================================

The crash output if needed:
[root <at> openware]# mount -t ubifs ubi0:boot /mnt
UBIFS: background thread "ubifs_bgt0_0" started, PID 673
m25p80 spi32766.0: unrecognized JEDEC id bytes: 00,  0,  0
Unable to handle kernel NULL pointer dereference at virtual address 0000000d
pgd = c0004000
[0000000d] *pgd=00000000
Internal error: Oops: 17 [#1] SMP ARM
Modules linked in:
CPU: 0 PID: 669 Comm: ubi_bgt0d Not tainted 4.0.0-owc+ #22
Hardware name: RM927RC
task: cbca4c00 ti: cbccc000 task.ti: cbccc000
PC is at spi_nor_read+0x2c/0x274
LR is at 0x0
pc : [<c0266c58>]    lr : [<00000000>]    psr: 600f0013
sp : cbccdc60  ip : 00000000  fp : cbccdc94
(Continue reading)

Mychaela Falconia | 26 May 07:45 2016

Supporting high-level NAND controllers like FTNANDC024

I am working with a very high-level NAND flash controller, too high-
level to fit comfortably into the abstraction model provided by the
current "generic" NAND code layer in Linux.  This generic NAND layer
assumes that the controller provides a more or less raw access to the
NAND chip, such that the generic NAND code can send arbitrary command
opcodes, do individual read_byte's and request buffer reads and writes.

But the controller I'm working with (Faraday FTNANDC024) provides a
much higher level of abstraction.  The level of abstraction provided
by this controller is more like the MTD interface in Linux than the
current "nand" interface.  This controller does not allow the user to
issue arbitrary opcodes to the NAND or to read/write bytes directly on
the NAND interface under CPU sequencing - instead it has high-level
read and write commands that are essentially like MTD's read and write
methods.  One can command the controller to read or write between 1
and 65535 "sectors" (their term for ECC unit) of 512 or 1024 bytes,
i.e., one can transfer almost 64 MiB of data in one operation.  One
"operation" means that you program the NAND and DMA controllers, give
it the command, and then wait for an interrupt - the controller will
automatically issue as many Read Page or Write Page commands to the
physical NAND as needed, transfer all data by DMA and do all ECC work.

I am currently working in the vendor's tree based on linux-3.3, but I
don't see any substantial changes in the current linux-mtd or l2-mtd
trees in this department.  Faraday made a heroic attempt at hammering
a square peg into a round hole by implementing a driver for their
controller that attaches to the generic NAND layer, but the code is
horrible.  So horrible that I am reimplementing my own FTNANDC024
driver from scratch.  Because the level of abstraction provided by
this controller is so at odds with the assumptions of the current
(Continue reading)

Richard Williams | 25 May 11:51 2016
Picon

Your Audience


Hello
I want to tell you something about Davies Ryan. Being the executor of the
Will, it is possible that we may be tempted to make fortune out of our
client situation. This proposal is with full financial benefit for both of
us,If we can be of one accord, I shall give you a comprehensive detail as
soon as you respond thank you.

Regards
Richard Williams

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

Richard Williams | 25 May 12:05 2016
Picon

Your Audience


Hello
I want to tell you something about Davies Ryan. Being the executor of the
Will, it is possible that we may be tempted to make fortune out of our
client situation. This proposal is with full financial benefit for both of
us,If we can be of one accord, I shall give you a comprehensive detail as
soon as you respond thank you.

Regards
Richard Williams

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

margo5454 | 20 May 21:44 2016
Picon

Доставка посылок в Украину

Предлагаем организацию доставки грузов из России в Украину.
Доставка возможна на частные лица без ограничений в
стоимости товара.
Вы получите:
- все таможенное оформление
- доставку до дверей или пункт выдачи в любом городе Украины
- забор груза по вашему адресу
- автоматическое страхование груза, на сумму 400 руб./кг

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
Matthias Schiffer | 18 May 15:32 2016
Picon
Gravatar

[PATCH 1/2] mtd: spi-nor: disable software protection for Macronix flash at startup

This patch has been tested in OpenWrt for a few months and seems to work
correctly.

Signed-off-by: Felix Fietkau <nbd <at> nbd.name>
Signed-off-by: Matthias Schiffer <mschiffer <at> universe-factory.net>
---
 drivers/mtd/spi-nor/spi-nor.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c
index 157841d..d681003 100644
--- a/drivers/mtd/spi-nor/spi-nor.c
+++ b/drivers/mtd/spi-nor/spi-nor.c
 <at>  <at>  -1304,6 +1304,7  <at>  <at>  int spi_nor_scan(struct spi_nor *nor, const char *name, enum read_mode mode)

 	if (JEDEC_MFR(info) == SNOR_MFR_ATMEL ||
 	    JEDEC_MFR(info) == SNOR_MFR_INTEL ||
+	    JEDEC_MFR(info) == SNOR_MFR_MACRONIX ||
 	    JEDEC_MFR(info) == SNOR_MFR_SST ||
 	    info->flags & SPI_NOR_HAS_LOCK) {
 		write_enable(nor);
--

-- 
2.8.2

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

Martin Townsend | 17 May 17:19 2016
Picon

UBIFS assert when rebooting a read only ubifs when it's been remounted r/w

Hi,

I've just seen the following UBIFS assert which relates to
ubifs_remount_fs in fs/ubifs/super.c
We have a read only root filesystem and it looks like this problem
occurs after rebooting the board when the root filesystem has been
remounted as as r/w, I use the following command to do this in case
I'm doing this incorrectly.
mount -o remount,rw /
The only way to stop it is to login and run
mount -o remount,rw /
mount -o remount,ro /
and then reboots do not assert.

I've tried a few times now and can happily reproduce it.

Any ideas on how to fix this?

Many Thanks,
Martin.

May 17 14:54:44 am43-controller-aquila-1bf6b1 kernel: UBIFS assert
failed in ubifs_remount_fs at 1869 (pid 108)
May 17 14:54:44 am43-controller-aquila-1bf6b1 kernel: CPU: 0 PID: 108
Comm: mount Not tainted 4.1.18-g6b41ca0b94 #1
May 17 14:54:44 am43-controller-aquila-1bf6b1 kernel: Hardware name:
Generic AM43 (Flattened Device Tree)
May 17 14:54:44 am43-controller-aquila-1bf6b1 kernel: Backtrace:
May 17 14:54:44 am43-controller-aquila-1bf6b1 kernel:
May 17 14:54:44 am43-controller-aquila-1bf6b1 kernel: [<c0013398>]
(Continue reading)

Johan Borkhuis | 13 May 10:47 2016

UBIFS automatic recovery

Hello,

On our current system we had some issues with corrupted file systems after
power failures. The system is a TI AM3517 with kernel 2.6.37 and the
backport of UBIFS. The system had one partition, so when the file system
is corrupted the system cannot boot any more.

To improve I change the layout:
- UBI0: 2 partitions, ubi0_0 (rootfs) and ubi0_1 (application), both
read-only
- UBI1: 2 partitions, ubi1_0 (settings) and ubi1_1 (logging)

To test how good this is working I wrote a test application to have a lot
of disk-I/O on the logging partition. Now I cut the power every minute.
I see the erase-counters increase quite fast on UBI1, but UBI0 stays at
the same value (which is what I was looking for)

Once in a while this test results in an error on one of the UBI1
partitions (both settings and logging). The partition cannot be mounted
any more. I can fix this using ubiupdatevol, but I loose the data on this
partition. This was expected and works quite well, the system is always
accessible.

However, when I continue to pull the power on a system with a broken
partition (without running the test-application, this is only started when
all partitions are mounted correctly) after some time (this can be a few
reboots, or a couple of 100 reboots) the system fixes the partition
itself, and I can access the data again, without any indications in the
log.

(Continue reading)


Gmane