mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
Merge branch 'master' into for-next
Conflicts: MAINTAINERS arch/arm/mach-omap2/pm24xx.c drivers/scsi/bfa/bfa_fcpim.c Needed to update to apply fixes for which the old branch was too outdated.
This commit is contained in:
commit
4b7bd36470
2029 changed files with 37852 additions and 20361 deletions
|
|
@ -51,7 +51,7 @@ struct pxa2xx_flash_info {
|
|||
static const char *probes[] = { "RedBoot", "cmdlinepart", NULL };
|
||||
|
||||
|
||||
static int __init pxa2xx_flash_probe(struct platform_device *pdev)
|
||||
static int __devinit pxa2xx_flash_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct flash_platform_data *flash = pdev->dev.platform_data;
|
||||
struct pxa2xx_flash_info *info;
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@
|
|||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
#define CONFIG_MTD_NAND_OMAP_HWECC
|
||||
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/dma-mapping.h>
|
||||
|
|
|
|||
|
|
@ -482,10 +482,17 @@ static int nor_erase_prepare(struct ubi_device *ubi, int pnum)
|
|||
uint32_t data = 0;
|
||||
struct ubi_vid_hdr vid_hdr;
|
||||
|
||||
addr = (loff_t)pnum * ubi->peb_size + ubi->vid_hdr_aloffset;
|
||||
/*
|
||||
* It is important to first invalidate the EC header, and then the VID
|
||||
* header. Otherwise a power cut may lead to valid EC header and
|
||||
* invalid VID header, in which case UBI will treat this PEB as
|
||||
* corrupted and will try to preserve it, and print scary warnings (see
|
||||
* the header comment in scan.c for more information).
|
||||
*/
|
||||
addr = (loff_t)pnum * ubi->peb_size;
|
||||
err = ubi->mtd->write(ubi->mtd, addr, 4, &written, (void *)&data);
|
||||
if (!err) {
|
||||
addr -= ubi->vid_hdr_aloffset;
|
||||
addr += ubi->vid_hdr_aloffset;
|
||||
err = ubi->mtd->write(ubi->mtd, addr, 4, &written,
|
||||
(void *)&data);
|
||||
if (!err)
|
||||
|
|
@ -494,18 +501,24 @@ static int nor_erase_prepare(struct ubi_device *ubi, int pnum)
|
|||
|
||||
/*
|
||||
* We failed to write to the media. This was observed with Spansion
|
||||
* S29GL512N NOR flash. Most probably the eraseblock erasure was
|
||||
* interrupted at a very inappropriate moment, so it became unwritable.
|
||||
* In this case we probably anyway have garbage in this PEB.
|
||||
* S29GL512N NOR flash. Most probably the previously eraseblock erasure
|
||||
* was interrupted at a very inappropriate moment, so it became
|
||||
* unwritable. In this case we probably anyway have garbage in this
|
||||
* PEB.
|
||||
*/
|
||||
err1 = ubi_io_read_vid_hdr(ubi, pnum, &vid_hdr, 0);
|
||||
if (err1 == UBI_IO_BAD_HDR_EBADMSG || err1 == UBI_IO_BAD_HDR)
|
||||
/*
|
||||
* The VID header is corrupted, so we can safely erase this
|
||||
* PEB and not afraid that it will be treated as a valid PEB in
|
||||
* case of an unclean reboot.
|
||||
*/
|
||||
return 0;
|
||||
if (err1 == UBI_IO_BAD_HDR_EBADMSG || err1 == UBI_IO_BAD_HDR) {
|
||||
struct ubi_ec_hdr ec_hdr;
|
||||
|
||||
err1 = ubi_io_read_ec_hdr(ubi, pnum, &ec_hdr, 0);
|
||||
if (err1 == UBI_IO_BAD_HDR_EBADMSG || err1 == UBI_IO_BAD_HDR)
|
||||
/*
|
||||
* Both VID and EC headers are corrupted, so we can
|
||||
* safely erase this PEB and not afraid that it will be
|
||||
* treated as a valid PEB in case of an unclean reboot.
|
||||
*/
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* The PEB contains a valid VID header, but we cannot invalidate it.
|
||||
|
|
|
|||
|
|
@ -787,16 +787,15 @@ static int check_corruption(struct ubi_device *ubi, struct ubi_vid_hdr *vid_hdr,
|
|||
* erased, so it became unstable and corrupted, and should be
|
||||
* erased.
|
||||
*/
|
||||
return 0;
|
||||
err = 0;
|
||||
goto out_unlock;
|
||||
}
|
||||
|
||||
if (err)
|
||||
return err;
|
||||
goto out_unlock;
|
||||
|
||||
if (ubi_check_pattern(ubi->peb_buf1, 0xFF, ubi->leb_size)) {
|
||||
mutex_unlock(&ubi->buf_mutex);
|
||||
return 0;
|
||||
}
|
||||
if (ubi_check_pattern(ubi->peb_buf1, 0xFF, ubi->leb_size))
|
||||
goto out_unlock;
|
||||
|
||||
ubi_err("PEB %d contains corrupted VID header, and the data does not "
|
||||
"contain all 0xFF, this may be a non-UBI PEB or a severe VID "
|
||||
|
|
@ -806,8 +805,11 @@ static int check_corruption(struct ubi_device *ubi, struct ubi_vid_hdr *vid_hdr,
|
|||
pnum, ubi->leb_start, ubi->leb_size);
|
||||
ubi_dbg_print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_OFFSET, 32, 1,
|
||||
ubi->peb_buf1, ubi->leb_size, 1);
|
||||
err = 1;
|
||||
|
||||
out_unlock:
|
||||
mutex_unlock(&ubi->buf_mutex);
|
||||
return 1;
|
||||
return err;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -951,6 +953,10 @@ static int process_eb(struct ubi_device *ubi, struct ubi_scan_info *si,
|
|||
* impossible to distinguish it from a PEB which just
|
||||
* contains garbage because of a power cut during erase
|
||||
* operation. So we just schedule this PEB for erasure.
|
||||
*
|
||||
* Besides, in case of NOR flash, we deliberatly
|
||||
* corrupt both headers because NOR flash erasure is
|
||||
* slow and can start from the end.
|
||||
*/
|
||||
err = 0;
|
||||
else
|
||||
|
|
|
|||
Loading…
Reference in a new issue