From b395e3b40e026a437b7179b78f1beddf2d02a7bc Mon Sep 17 00:00:00 2001 From: Ludovic Pouzenc Date: Fri, 14 Sep 2018 23:42:26 +0200 Subject: target/linux/ramips: add all patches --- .../ramips/patches/111-nand-controller-busy.patch | 55 ++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100755 target/linux/ramips/patches/111-nand-controller-busy.patch (limited to 'target/linux/ramips/patches/111-nand-controller-busy.patch') diff --git a/target/linux/ramips/patches/111-nand-controller-busy.patch b/target/linux/ramips/patches/111-nand-controller-busy.patch new file mode 100755 index 0000000..c87bbb5 --- /dev/null +++ b/target/linux/ramips/patches/111-nand-controller-busy.patch @@ -0,0 +1,55 @@ +Index: linux-3.10.14/drivers/mtd/ralink/ralink_nand.c +=================================================================== +--- linux-3.10.14.orig/drivers/mtd/ralink/ralink_nand.c ++++ linux-3.10.14/drivers/mtd/ralink/ralink_nand.c +@@ -377,7 +377,10 @@ static int nfc_check_wp(void) + int ret; + + ret = _nfc_read_status(&result); +- //FIXME, if ret < 0 ++ if (ret) { ++ printk(KERN_WARNING "unable to tell WP. default FALSE.\n"); ++ return 0; ++ } + + return !(result & NAND_STATUS_WP); + #endif +@@ -1332,10 +1335,9 @@ nand_get_device(struct ra_nand_chip *ra, + int ret = 0; + + #if !defined (__UBOOT__) +- ret = mutex_lock(ra->controller); ++ mutex_lock(ra->controller); + #endif /// +- if (!ret) +- ra->state = new_state; ++ ra->state = new_state; + + return ret; + +@@ -1596,6 +1598,7 @@ int nand_erase_nand(struct ra_nand_chip + + #ifdef SKIP_BAD_BLOCK + do { ++ int newpage = page_remap(ra, page); + #if defined (CONFIG_SUPPORT_OPENWRT) + if (((page << ra->page_shift) >= (int)rootfs_offset) && ((page << ra->page_shift) < (int)rootfs_data_offset)) + { +@@ -1606,8 +1609,6 @@ int nand_erase_nand(struct ra_nand_chip + } + } + #endif +- int newpage = page_remap(ra, page); +- + if (newpage < 0) + { + // printk("page_remap failed, page = 0x%x\n", page); +@@ -2881,7 +2882,7 @@ static int ramtd_nand_writeoob(struct mt + + ra_dbg("%s: \n", __func__); + +- nand_get_device(ra, FL_READING); ++ nand_get_device(ra, FL_WRITING); + + ret = nand_do_write_ops(ra, to, ops); + -- cgit v1.1