[PATCH v3 2/2] mtd: mediatek: driver for MTK Smart Device Gen1 NAND

Jorge Ramirez-Ortiz jorge.ramirez-ortiz at linaro.org
Tue Apr 19 14:16:28 PDT 2016


On 04/19/2016 04:24 PM, Boris Brezillon wrote:
> On Mon, 11 Apr 2016 12:56:12 -0400
> Jorge Ramirez-Ortiz<jorge.ramirez-ortiz at linaro.org>  wrote:
>
>
>> >+static int mtk_nfc_read_oob(struct mtd_info *mtd, struct nand_chip *chip,
>> >+				int page)
>> >+{
>> >+	u8 *buf = chip->buffers->databuf;
> You're touching ->databuf here, and the core uses this buffer for its
> internal cache. If want to use this buffer you have to invalidate the
> cache by setting chip->pagebuf to -1 first.
>

ack. we will use our private buffer instead as discussed on IRC.

  static int mtk_nfc_write_oob(struct mtd_info *mtd, struct nand_chip *chip,
                                 int page)
  {
-   u8 *data = chip->buffers->databuf;
+ struct mtk_nfc *nfc = nand_get_controller_data(chip);
         int ret;

-   memset(data, 0xff, mtd->writesize);
+ memset(nfc->buffer, 0xff, mtd->writesize);

         chip->cmdfunc(mtd, NAND_CMD_SEQIN, 0x00, page);

-   ret = mtk_nfc_write_page_hwecc(mtd, chip, data, 1, page);
+ ret = mtk_nfc_write_page_hwecc(mtd, chip, nfc->buffer, 1, page);
         if (ret < 0)
                 return -EIO;



More information about the linux-mtd mailing list