diff options
author | Brian Norris <computersforpeace@gmail.com> | 2013-03-13 12:51:31 -0400 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2013-03-14 08:48:54 -0400 |
commit | 5bc7c33ca93a285dcfe7b7fd64970f6314440ad1 (patch) | |
tree | 0ce80c4e6559c939c2eaf86c76950b177c4c157a /drivers/mtd/nand/nand_base.c | |
parent | 91d542f4dcc231749c36114ed8e26bb27d4521e4 (diff) |
mtd: nand: reintroduce NAND_NO_READRDY as NAND_NEED_READRDY
This partially reverts commit 1696e6bc2ae83734e64e206ac99766ea19e9a14e
("mtd: nand: kill NAND_NO_READRDY").
In that patch I overlooked a few things.
The original documentation for NAND_NO_READRDY included "True for all
large page devices, as they do not support autoincrement." I was
conflating "not support autoincrement" with the NAND_NO_AUTOINCR option,
which was in fact doing nothing. So, when I dropped NAND_NO_AUTOINCR, I
concluded that I then could harmlessly drop NAND_NO_READRDY. But of
course the fact the NAND_NO_AUTOINCR was doing nothing didn't mean
NAND_NO_READRDY was doing nothing...
So, NAND_NO_READRDY is re-introduced as NAND_NEED_READRDY and applied
only to those few remaining small-page NAND which needed it in the first
place.
Cc: stable@kernel.org [3.5+]
Reported-by: Alexander Shiyan <shc_work@mail.ru>
Tested-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd/nand/nand_base.c')
-rw-r--r-- | drivers/mtd/nand/nand_base.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index 43214151b882..42c63927609d 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c | |||
@@ -1523,6 +1523,14 @@ static int nand_do_read_ops(struct mtd_info *mtd, loff_t from, | |||
1523 | oobreadlen -= toread; | 1523 | oobreadlen -= toread; |
1524 | } | 1524 | } |
1525 | } | 1525 | } |
1526 | |||
1527 | if (chip->options & NAND_NEED_READRDY) { | ||
1528 | /* Apply delay or wait for ready/busy pin */ | ||
1529 | if (!chip->dev_ready) | ||
1530 | udelay(chip->chip_delay); | ||
1531 | else | ||
1532 | nand_wait_ready(mtd); | ||
1533 | } | ||
1526 | } else { | 1534 | } else { |
1527 | memcpy(buf, chip->buffers->databuf + col, bytes); | 1535 | memcpy(buf, chip->buffers->databuf + col, bytes); |
1528 | buf += bytes; | 1536 | buf += bytes; |
@@ -1787,6 +1795,14 @@ static int nand_do_read_oob(struct mtd_info *mtd, loff_t from, | |||
1787 | len = min(len, readlen); | 1795 | len = min(len, readlen); |
1788 | buf = nand_transfer_oob(chip, buf, ops, len); | 1796 | buf = nand_transfer_oob(chip, buf, ops, len); |
1789 | 1797 | ||
1798 | if (chip->options & NAND_NEED_READRDY) { | ||
1799 | /* Apply delay or wait for ready/busy pin */ | ||
1800 | if (!chip->dev_ready) | ||
1801 | udelay(chip->chip_delay); | ||
1802 | else | ||
1803 | nand_wait_ready(mtd); | ||
1804 | } | ||
1805 | |||
1790 | readlen -= len; | 1806 | readlen -= len; |
1791 | if (!readlen) | 1807 | if (!readlen) |
1792 | break; | 1808 | break; |