diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2012-06-26 11:26:16 -0400 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2012-07-06 10:06:23 -0400 |
commit | 6023813a2d5949ba368e7df464f2ccb649719777 (patch) | |
tree | bbc874c7e097539bcc03a841a2ae45d79811413a /drivers/mtd/nand/gpmi-nand | |
parent | 096bcc231fd263bc8df215f0d616b08e3696c6db (diff) |
mtd: gpmi-nand: fix read page when reading to vmalloced area
The gpmi-nand driver uses virt_addr_valid() to check whether a buffer
is suitable for dma. If it's not, a driver allocated buffer is used
instead. Then after a page read the driver allocated buffer must be
copied to the user supplied buffer. This does not happen since commit
7725cc85932bd02dd12c23108e0ef748c551ccba.
This patch fixes the issue. The bug is encountered with UBI which uses a
vmalloced buffer for the volume table.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Tested-by: snijsure@grid-net.com
Acked-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd/nand/gpmi-nand')
-rw-r--r-- | drivers/mtd/nand/gpmi-nand/gpmi-nand.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c index a05b7b444d4f..a6cad5caba78 100644 --- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c +++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c | |||
@@ -920,12 +920,12 @@ static int gpmi_ecc_read_page(struct mtd_info *mtd, struct nand_chip *chip, | |||
920 | */ | 920 | */ |
921 | memset(chip->oob_poi, ~0, mtd->oobsize); | 921 | memset(chip->oob_poi, ~0, mtd->oobsize); |
922 | chip->oob_poi[0] = ((uint8_t *) auxiliary_virt)[0]; | 922 | chip->oob_poi[0] = ((uint8_t *) auxiliary_virt)[0]; |
923 | |||
924 | read_page_swap_end(this, buf, mtd->writesize, | ||
925 | this->payload_virt, this->payload_phys, | ||
926 | nfc_geo->payload_size, | ||
927 | payload_virt, payload_phys); | ||
928 | } | 923 | } |
924 | |||
925 | read_page_swap_end(this, buf, mtd->writesize, | ||
926 | this->payload_virt, this->payload_phys, | ||
927 | nfc_geo->payload_size, | ||
928 | payload_virt, payload_phys); | ||
929 | exit_nfc: | 929 | exit_nfc: |
930 | return ret; | 930 | return ret; |
931 | } | 931 | } |