@ -60,7 +60,7 @@ Date: Thu Nov 30 18:01:29 2017 +0100
break;
touch_softlockup_watchdog();
} while (time_before(jiffies, timeo));
@@ -10 16,7 +1028 ,15 @@ static void panic_nand_wait(struct mtd_i
@@ -10 21,7 +1033 ,15 @@ static void panic_nand_wait(struct mtd_i
if (chip->dev_ready(mtd))
break;
} else {
@ -77,7 +77,7 @@ Date: Thu Nov 30 18:01:29 2017 +0100
break;
}
mdelay(1);
@@ -103 3,8 +1053 ,9 @@ static void panic_nand_wait(struct mtd_i
@@ -103 8,8 +1058 ,9 @@ static void panic_nand_wait(struct mtd_i
static int nand_wait(struct mtd_info *mtd, struct nand_chip *chip)
{
@ -88,7 +88,7 @@ Date: Thu Nov 30 18:01:29 2017 +0100
/*
* Apply this short delay always to ensure that we do wait tWB in any
@@ -104 2,7 +1063 ,9 @@ static int nand_wait(struct mtd_info *mt
@@ -104 7,7 +1068 ,9 @@ static int nand_wait(struct mtd_info *mt
*/
ndelay(100);
@ -99,7 +99,7 @@ Date: Thu Nov 30 18:01:29 2017 +0100
if (in_interrupt() || oops_in_progress)
panic_nand_wait(mtd, chip, timeo);
@@ -105 3,14 +1076 ,22 @@ static int nand_wait(struct mtd_info *mt
@@ -105 8,14 +1081 ,22 @@ static int nand_wait(struct mtd_info *mt
if (chip->dev_ready(mtd))
break;
} else {
@ -124,7 +124,7 @@ Date: Thu Nov 30 18:01:29 2017 +0100
/* This can happen if in case of timeout or buggy dev_ready */
WARN_ON(!(status & NAND_STATUS_READY));
return status;
@@ -12 15,6 +1246 ,516 @@ static void nand_release_data_interface(
@@ -12 20,6 +1251 ,516 @@ static void nand_release_data_interface(
}
/**
@ -641,7 +641,7 @@ Date: Thu Nov 30 18:01:29 2017 +0100
* nand_reset - Reset and initialize a NAND device
* @chip: The NAND chip
* @chipnr: Internal die id
@@ -12 35,8 +1776 ,10 @@ int nand_reset(struct nand_chip *chip, i
@@ -12 40,8 +1781 ,10 @@ int nand_reset(struct nand_chip *chip, i
* interface settings, hence this weird ->select_chip() dance.
*/
chip->select_chip(mtd, chipnr);
@ -653,7 +653,7 @@ Date: Thu Nov 30 18:01:29 2017 +0100
chip->select_chip(mtd, chipnr);
ret = nand_setup_data_interface(chip, chipnr);
@@ -139 2,9 +1935 ,19 @@ EXPORT_SYMBOL(nand_check_erased_ecc_chun
@@ -139 7,9 +1940 ,19 @@ EXPORT_SYMBOL(nand_check_erased_ecc_chun
int nand_read_page_raw(struct mtd_info *mtd, struct nand_chip *chip,
uint8_t *buf, int oob_required, int page)
{
@ -676,7 +676,7 @@ Date: Thu Nov 30 18:01:29 2017 +0100
return 0;
}
EXPORT_SYMBOL(nand_read_page_raw);
@@ -14 16,29 +1969 ,46 @@ static int nand_read_page_raw_syndrome(s
@@ -14 21,29 +1974 ,46 @@ static int nand_read_page_raw_syndrome(s
int eccsize = chip->ecc.size;
int eccbytes = chip->ecc.bytes;
uint8_t *oob = chip->oob_poi;
@ -730,7 +730,7 @@ Date: Thu Nov 30 18:01:29 2017 +0100
return 0;
}
@@ -15 27,7 +2097 ,9 @@ static int nand_read_subpage(struct mtd_
@@ -15 32,7 +2102 ,9 @@ static int nand_read_subpage(struct mtd_
chip->cmdfunc(mtd, NAND_CMD_RNDOUT, data_col_addr, -1);
p = bufpoi + data_col_addr;
@ -741,7 +741,7 @@ Date: Thu Nov 30 18:01:29 2017 +0100
/* Calculate ECC */
for (i = 0; i < eccfrag_len ; i += chip->ecc.bytes, p += chip->ecc.size)
@@ -15 45,8 +2117 ,11 @@ static int nand_read_subpage(struct mtd_
@@ -15 50,8 +2122 ,11 @@ static int nand_read_subpage(struct mtd_
gaps = 1;
if (gaps) {
@ -755,7 +755,7 @@ Date: Thu Nov 30 18:01:29 2017 +0100
} else {
/*
* Send the command to read the particular ECC bytes take care
@@ -156 0,9 +2135 ,12 @@ static int nand_read_subpage(struct mtd_
@@ -156 5,9 +2140 ,12 @@ static int nand_read_subpage(struct mtd_
(busw - 1))
aligned_len++;
@ -771,7 +771,7 @@ Date: Thu Nov 30 18:01:29 2017 +0100
}
ret = mtd_ooblayout_get_eccbytes(mtd, chip->buffers->ecccode,
@@ -16 19,10 +2197 ,17 @@ static int nand_read_page_hwecc(struct m
@@ -16 24,10 +2202 ,17 @@ static int nand_read_page_hwecc(struct m
for (i = 0; eccsteps; eccsteps--, i += eccbytes, p += eccsize) {
chip->ecc.hwctl(mtd, NAND_ECC_READ);
@ -791,7 +791,7 @@ Date: Thu Nov 30 18:01:29 2017 +0100
ret = mtd_ooblayout_get_eccbytes(mtd, ecc_code, chip->oob_poi, 0,
chip->ecc.total);
@@ -168 1,9 +2266 ,13 @@ static int nand_read_page_hwecc_oob_firs
@@ -168 6,9 +2271 ,13 @@ static int nand_read_page_hwecc_oob_firs
unsigned int max_bitflips = 0;
/* Read the OOB area first */
@ -808,7 +808,7 @@ Date: Thu Nov 30 18:01:29 2017 +0100
ret = mtd_ooblayout_get_eccbytes(mtd, ecc_code, chip->oob_poi, 0,
chip->ecc.total);
@@ -169 4,7 +2283 ,11 @@ static int nand_read_page_hwecc_oob_firs
@@ -169 9,7 +2288 ,11 @@ static int nand_read_page_hwecc_oob_firs
int stat;
chip->ecc.hwctl(mtd, NAND_ECC_READ);
@ -821,7 +821,7 @@ Date: Thu Nov 30 18:01:29 2017 +0100
chip->ecc.calculate(mtd, p, &ecc_calc[i]);
stat = chip->ecc.correct(mtd, p, &ecc_code[i], NULL);
@@ -173 1,7 +2324 ,7 @@ static int nand_read_page_hwecc_oob_firs
@@ -173 6,7 +2329 ,7 @@ static int nand_read_page_hwecc_oob_firs
static int nand_read_page_syndrome(struct mtd_info *mtd, struct nand_chip *chip,
uint8_t *buf, int oob_required, int page)
{
@ -830,7 +830,7 @@ Date: Thu Nov 30 18:01:29 2017 +0100
int eccbytes = chip->ecc.bytes;
int eccsteps = chip->ecc.steps;
int eccpadbytes = eccbytes + chip->ecc.prepad + chip->ecc.postpad;
@@ -174 3,21 +2336 ,36 @@ static int nand_read_page_syndrome(struc
@@ -174 8,21 +2341 ,36 @@ static int nand_read_page_syndrome(struc
int stat;
chip->ecc.hwctl(mtd, NAND_ECC_READ);
@ -871,7 +871,7 @@ Date: Thu Nov 30 18:01:29 2017 +0100
oob += chip->ecc.postpad;
}
@@ -178 1,8 +2389 ,11 @@ static int nand_read_page_syndrome(struc
@@ -178 6,8 +2394 ,11 @@ static int nand_read_page_syndrome(struc
/* Calculate remaining oob bytes */
i = mtd->oobsize - (oob - chip->oob_poi);
@ -885,7 +885,7 @@ Date: Thu Nov 30 18:01:29 2017 +0100
return max_bitflips;
}
@@ -190 3,8 +2514 ,11 @@ static int nand_do_read_ops(struct mtd_i
@@ -190 8,8 +2519 ,11 @@ static int nand_do_read_ops(struct mtd_i
__func__, buf);
read_retry:
@ -899,7 +899,7 @@ Date: Thu Nov 30 18:01:29 2017 +0100
/*
* Now read the page into the buffer. Absent an error,
@@ -206 3,9 +2677 ,7 @@ static int nand_read(struct mtd_info *mt
@@ -206 8,9 +2682 ,7 @@ static int nand_read(struct mtd_info *mt
*/
int nand_read_oob_std(struct mtd_info *mtd, struct nand_chip *chip, int page)
{
@ -910,7 +910,7 @@ Date: Thu Nov 30 18:01:29 2017 +0100
}
EXPORT_SYMBOL(nand_read_oob_std);
@@ -208 3,25 +2695 ,43 @@ int nand_read_oob_syndrome(struct mtd_in
@@ -208 8,25 +2700 ,43 @@ int nand_read_oob_syndrome(struct mtd_in
int chunk = chip->ecc.bytes + chip->ecc.prepad + chip->ecc.postpad;
int eccsize = chip->ecc.size;
uint8_t *bufpoi = chip->oob_poi;
@ -961,7 +961,7 @@ Date: Thu Nov 30 18:01:29 2017 +0100
return 0;
}
@@ -21 15,18 +2745 ,8 @@ EXPORT_SYMBOL(nand_read_oob_syndrome);
@@ -21 20,18 +2750 ,8 @@ EXPORT_SYMBOL(nand_read_oob_syndrome);
*/
int nand_write_oob_std(struct mtd_info *mtd, struct nand_chip *chip, int page)
{
@ -982,7 +982,7 @@ Date: Thu Nov 30 18:01:29 2017 +0100
}
EXPORT_SYMBOL(nand_write_oob_std);
@@ -214 2,7 +2762 ,7 @@ int nand_write_oob_syndrome(struct mtd_i
@@ -214 7,7 +2767 ,7 @@ int nand_write_oob_syndrome(struct mtd_i
{
int chunk = chip->ecc.bytes + chip->ecc.prepad + chip->ecc.postpad;
int eccsize = chip->ecc.size, length = mtd->oobsize;
@ -991,7 +991,7 @@ Date: Thu Nov 30 18:01:29 2017 +0100
const uint8_t *bufpoi = chip->oob_poi;
/*
@@ -21 56,7 +2776 ,10 @@ int nand_write_oob_syndrome(struct mtd_i
@@ -21 61,7 +2781 ,10 @@ int nand_write_oob_syndrome(struct mtd_i
} else
pos = eccsize;
@ -1003,7 +1003,7 @@ Date: Thu Nov 30 18:01:29 2017 +0100
for (i = 0; i < steps; i++) {
if (sndcmd) {
if (mtd->writesize <= 512) {
@@ -21 65,28 +2788 ,40 @@ int nand_write_oob_syndrome(struct mtd_i
@@ -21 70,28 +2793 ,40 @@ int nand_write_oob_syndrome(struct mtd_i
len = eccsize;
while (len > 0) {
int num = min_t(int, len, 4);
@ -1054,7 +1054,7 @@ Date: Thu Nov 30 18:01:29 2017 +0100
}
EXPORT_SYMBOL(nand_write_oob_syndrome);
@@ -234 1,9 +2976 ,18 @@ static int nand_read_oob(struct mtd_info
@@ -234 6,9 +2981 ,18 @@ static int nand_read_oob(struct mtd_info
int nand_write_page_raw(struct mtd_info *mtd, struct nand_chip *chip,
const uint8_t *buf, int oob_required, int page)
{
@ -1076,7 +1076,7 @@ Date: Thu Nov 30 18:01:29 2017 +0100
return 0;
}
@@ -23 67,29 +3011 ,46 @@ static int nand_write_page_raw_syndrome(
@@ -23 72,29 +3016 ,46 @@ static int nand_write_page_raw_syndrome(
int eccsize = chip->ecc.size;
int eccbytes = chip->ecc.bytes;
uint8_t *oob = chip->oob_poi;
@ -1130,7 +1130,7 @@ Date: Thu Nov 30 18:01:29 2017 +0100
return 0;
}
@@ -244 3,7 +3104 ,11 @@ static int nand_write_page_hwecc(struct
@@ -244 8,7 +3109 ,11 @@ static int nand_write_page_hwecc(struct
for (i = 0; eccsteps; eccsteps--, i += eccbytes, p += eccsize) {
chip->ecc.hwctl(mtd, NAND_ECC_WRITE);
@ -1143,7 +1143,7 @@ Date: Thu Nov 30 18:01:29 2017 +0100
chip->ecc.calculate(mtd, p, &ecc_calc[i]);
}
@@ -245 2,7 +3117 ,9 @@ static int nand_write_page_hwecc(struct
@@ -245 7,7 +3122 ,9 @@ static int nand_write_page_hwecc(struct
if (ret)
return ret;
@ -1154,7 +1154,7 @@ Date: Thu Nov 30 18:01:29 2017 +0100
return 0;
}
@@ -24 88,7 +3155 ,9 @@ static int nand_write_subpage_hwecc(stru
@@ -24 93,7 +3160 ,9 @@ static int nand_write_subpage_hwecc(stru
chip->ecc.hwctl(mtd, NAND_ECC_WRITE);
/* write data (untouched subpages already masked by 0xFF) */
@ -1165,7 +1165,7 @@ Date: Thu Nov 30 18:01:29 2017 +0100
/* mask ECC of un-touched subpages by padding 0xFF */
if ((step < start_step) || (step > end_step))
@@ -25 15,7 +3184 ,9 @@ static int nand_write_subpage_hwecc(stru
@@ -25 20,7 +3189 ,9 @@ static int nand_write_subpage_hwecc(stru
return ret;
/* write OOB buffer to NAND device */
@ -1176,7 +1176,7 @@ Date: Thu Nov 30 18:01:29 2017 +0100
return 0;
}
@@ -254 2,31 +3213 ,49 @@ static int nand_write_page_syndrome(stru
@@ -254 7,31 +3218 ,49 @@ static int nand_write_page_syndrome(stru
int eccsteps = chip->ecc.steps;
const uint8_t *p = buf;
uint8_t *oob = chip->oob_poi;
@ -1233,7 +1233,7 @@ Date: Thu Nov 30 18:01:29 2017 +0100
return 0;
}
@@ -259 4,8 +3283 ,11 @@ static int nand_write_page(struct mtd_in
@@ -259 9,8 +3288 ,11 @@ static int nand_write_page(struct mtd_in
else
subpage = 0;
@ -1247,7 +1247,7 @@ Date: Thu Nov 30 18:01:29 2017 +0100
if (unlikely(raw))
status = chip->ecc.write_page_raw(mtd, chip, buf,
@@ -261 0,13 +3302 ,8 @@ static int nand_write_page(struct mtd_in
@@ -261 5,13 +3307 ,8 @@ static int nand_write_page(struct mtd_in
if (status < 0)
return status;
@ -1263,7 +1263,7 @@ Date: Thu Nov 30 18:01:29 2017 +0100
return 0;
}
@@ -29 89,17 +3676 ,12 @@ out:
@@ -29 94,17 +3681 ,12 @@ out:
static int single_erase(struct mtd_info *mtd, int page)
{
struct nand_chip *chip = mtd_to_nand(mtd);
@ -1284,7 +1284,7 @@ Date: Thu Nov 30 18:01:29 2017 +0100
}
/**
@@ -32 26,22 +3908 ,12 @@ static int nand_max_bad_blocks(struct mt
@@ -32 31,22 +3913 ,12 @@ static int nand_max_bad_blocks(struct mt
static int nand_onfi_set_features(struct mtd_info *mtd, struct nand_chip *chip,
int addr, uint8_t *subfeature_param)
{
@ -1308,7 +1308,7 @@ Date: Thu Nov 30 18:01:29 2017 +0100
}
/**
@@ -325 4,17 +3926 ,12 @@ static int nand_onfi_set_features(struct
@@ -325 9,17 +3931 ,12 @@ static int nand_onfi_set_features(struct
static int nand_onfi_get_features(struct mtd_info *mtd, struct nand_chip *chip,
int addr, uint8_t *subfeature_param)
{
@ -1327,7 +1327,7 @@ Date: Thu Nov 30 18:01:29 2017 +0100
}
/**
@@ -34 07,12 +4074 ,11 @@ static u16 onfi_crc16(u16 crc, u8 const
@@ -34 12,12 +4079 ,11 @@ static u16 onfi_crc16(u16 crc, u8 const
static int nand_flash_detect_ext_param_page(struct nand_chip *chip,
struct nand_onfi_params *p)
{
@ -1341,7 +1341,7 @@ Date: Thu Nov 30 18:01:29 2017 +0100
int len;
int i;
@@ -342 2,14 +4088 ,18 @@ static int nand_flash_detect_ext_param_p
@@ -342 7,14 +4093 ,18 @@ static int nand_flash_detect_ext_param_p
return -ENOMEM;
/* Send our own NAND_CMD_PARAM. */
@ -1365,7 +1365,7 @@ Date: Thu Nov 30 18:01:29 2017 +0100
if ((onfi_crc16(ONFI_CRC_BASE, ((uint8_t *)ep) + 2, len - 2)
!= le16_to_cpu(ep->crc))) {
pr_debug("fail in the CRC.\n");
@@ -348 2,19 +4152 ,23 @@ static int nand_flash_detect_onfi(struct
@@ -348 7,19 +4157 ,23 @@ static int nand_flash_detect_onfi(struct
{
struct mtd_info *mtd = nand_to_mtd(chip);
struct nand_onfi_params *p = &chip->onfi_params;
@ -1397,7 +1397,7 @@ Date: Thu Nov 30 18:01:29 2017 +0100
if (onfi_crc16(ONFI_CRC_BASE, (uint8_t *)p, 254) ==
le16_to_cpu(p->crc)) {
break;
@@ -35 85,20 +4259 ,22 @@ static int nand_flash_detect_jedec(struc
@@ -35 90,20 +4264 ,22 @@ static int nand_flash_detect_jedec(struc
struct mtd_info *mtd = nand_to_mtd(chip);
struct nand_jedec_params *p = &chip->jedec_params;
struct jedec_ecc_info *ecc;
@ -1429,7 +1429,7 @@ Date: Thu Nov 30 18:01:29 2017 +0100
if (onfi_crc16(ONFI_CRC_BASE, (uint8_t *)p, 510) ==
le16_to_cpu(p->crc))
@@ -38 77,8 +4553 ,7 @@ static int nand_detect(struct nand_chip
@@ -38 82,8 +4558 ,7 @@ static int nand_detect(struct nand_chip
{
const struct nand_manufacturer *manufacturer;
struct mtd_info *mtd = nand_to_mtd(chip);
@ -1439,7 +1439,7 @@ Date: Thu Nov 30 18:01:29 2017 +0100
u8 *id_data = chip->id.data;
u8 maf_id, dev_id;
@@ -38 86,17 +4561 ,21 @@ static int nand_detect(struct nand_chip
@@ -38 91,17 +4566 ,21 @@ static int nand_detect(struct nand_chip
* Reset the chip, required by some chips (e.g. Micron MT29FxGxxxxx)
* after power-up.
*/
@ -1465,7 +1465,7 @@ Date: Thu Nov 30 18:01:29 2017 +0100
/*
* Try again to make sure, as some systems the bus-hold or other
@@ -39 05,11 +4584 ,10 @@ static int nand_detect(struct nand_chip
@@ -39 10,11 +4589 ,10 @@ static int nand_detect(struct nand_chip
* not match, ignore the device completely.
*/
@ -1480,7 +1480,7 @@ Date: Thu Nov 30 18:01:29 2017 +0100
if (id_data[0] != maf_id || id_data[1] != dev_id) {
pr_info("second ID read did not match %02x,%02x against %02x,%02x\n",
@@ -423 3,15 +4911 ,16 @@ int nand_scan_ident(struct mtd_info *mtd
@@ -423 8,15 +4916 ,16 @@ int nand_scan_ident(struct mtd_info *mtd
/* Check for a chip array */
for (i = 1; i < maxchips; i++) {