)]}'
{
  "commit": "595c5d017402fb20bef14e4d2c399251470c95fe",
  "tree": "49b5163834504c40ffdb373be4360426ba99204e",
  "parents": [
    "5feb8cdb6ff497e45cda73839dacafc240bf83bb"
  ],
  "author": {
    "name": "Douglas Anderson",
    "email": "dianders@chromium.org",
    "time": "Fri Jan 29 16:35:24 2021 -0800"
  },
  "committer": {
    "name": "Felix Singer",
    "email": "felixsinger@posteo.net",
    "time": "Thu Sep 29 17:05:43 2022 +0000"
  },
  "message": "linux_mtd: Disable buffering on the mtd device\n\nWe open the device node for the MTD device with this:\n  dev_fp \u003d fopen(dev_path, \"r+\")\n\nIn C fopen() is allowed to provide _buffered_ access to the file.\nThat means that the standard library is allowed to read ahead and/or\nreturn cached data.  That\u0027s really not what we want for something like\nthis.  Let\u0027s turn it off.\n\nThis fixes a problem where flashrom would sometimes fail to \"verify\"\nthat it erased the flash.  The error message would look something like\nthis:\n\nErasing and writing flash chip... FAILED at 0x0000e220! Expected\u003d0xff, Found\u003d0xe9, failed byte count from 0x0000e200-0x0000e2ff: 0xdc\n failed byte count from 0x0000e000-0x0000efff: 0xffffffff\n ERASE_FAILED\nFAILED!\nUh oh. Erase/write failed. Checking if anything changed.\n\nAfter the failure I could read the flash device with a new invocation\nof flashrom and I would see that, indeed, the erase had worked.\n\nTracing in the kernel showed that when the failure happened we saw a\npattern that looked like this:\n* Read 0x0b00 bytes starting at 0x0000d000\n* Read 0x1000 bytes starting at 0x0000db00\n* Erase 0x1000 bytes starting at 0x0000e000\n\n...and then there was _not_ a read after the erase.  It can be assumed\nthat, since userspace had already read 0xdb00 - 0xeaff that it was\nlooking at old buffered data after the erase.\n\nSigned-off-by: Douglas Anderson \u003cdianders@chromium.org\u003e\nChange-Id: I989afd83a33013b2756a0090d6b08245613215c6\nReviewed-on: https://review.coreboot.org/c/flashrom/+/50155\nReviewed-by: Hung-Te Lin \u003chungte@chromium.org\u003e\nReviewed-by: Patrick Rudolph \u003csiro@das-labor.org\u003e\nReviewed-by: Angel Pons \u003cth3fanbus@gmail.com\u003e\nTested-by: build bot (Jenkins) \u003cno-reply@coreboot.org\u003e\nReviewed-on: https://review.coreboot.org/c/flashrom/+/67871\nReviewed-by: Nikolai Artemiev \u003cnartemiev@google.com\u003e\nReviewed-by: Felix Singer \u003cfelixsinger@posteo.net\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "d2df95ef229c0e7a2e8039774daad37572d0d66d",
      "old_mode": 33188,
      "old_path": "linux_mtd.c",
      "new_id": "22702e904c16f16a61299d80fe41b7a61955edb0",
      "new_mode": 33188,
      "new_path": "linux_mtd.c"
    }
  ]
}
