Skip to content

Commit

Permalink
mtd: OneNAND: Fix 2KiB pagesize handling at Samsung SoCs
Browse files Browse the repository at this point in the history
Wrong assumption bufferram can be switched between BufferRAM0 and BufferRAM1

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
Kyungmin Park authored and David Woodhouse committed Sep 13, 2010
1 parent 8b865d5 commit 9aba97a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/mtd/onenand/samsung.c
Original file line number Diff line number Diff line change
Expand Up @@ -571,13 +571,12 @@ static int s5pc110_read_bufferram(struct mtd_info *mtd, int area,
unsigned char *buffer, int offset, size_t count)
{
struct onenand_chip *this = mtd->priv;
void __iomem *bufferram;
void __iomem *p;
void *buf = (void *) buffer;
dma_addr_t dma_src, dma_dst;
int err;

p = bufferram = this->base + area;
p = this->base + area;
if (ONENAND_CURRENT_BUFFERRAM(this)) {
if (area == ONENAND_DATARAM)
p += this->writesize;
Expand Down Expand Up @@ -621,7 +620,7 @@ static int s5pc110_read_bufferram(struct mtd_info *mtd, int area,
normal:
if (count != mtd->writesize) {
/* Copy the bufferram to memory to prevent unaligned access */
memcpy(this->page_buf, bufferram, mtd->writesize);
memcpy(this->page_buf, p, mtd->writesize);
p = this->page_buf + offset;
}

Expand Down

0 comments on commit 9aba97a

Please sign in to comment.