)]}'
{
  "commit": "cfeeb01dee52afa673896482f5b52ea14f897d00",
  "tree": "0553fcdb8609b6ec69b4e41b613a29b301f43ea0",
  "parents": [
    "4e9b860045712a4703d4ac61dd36761b1f8acfae"
  ],
  "author": {
    "name": "Yu-Ping Wu",
    "email": "yupingso@google.com",
    "time": "Thu Nov 19 14:26:47 2026 +0800"
  },
  "committer": {
    "name": "CrOS LUCI",
    "email": "chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com",
    "time": "Mon Nov 30 16:15:18 2026 -0800"
  },
  "message": "vboot: Record whether the slot switched away from failed\n\nWhen both firmware slots fail and the new slot needs an extra reboot\n(e.g. for EC or CSE sync), vb2_select_fw_slot() copies the new slot\u0027s\nown result into FW_PREV_TRIED/FW_PREV_RESULT on that reboot. fail_impl()\nthen no longer sees that the other slot failed, so it switches back to\nit instead of requesting recovery, and the device boots back and forth\nbetween the two slots forever.\n\nAdd a new nvdata bit, VB2_NV_FW_OTHER_SLOT_FAILED, which\nvb2_select_fw_slot() sets on every slot switch to whether the slot being\nleft had failed. Extra reboots on the same slot leave it alone. In\nfail_impl(), decide whether to try the other slot from this bit instead\nof FW_PREV_*. When RO includes this change, the bit is set whenever the\nold check would be true, and with extra reboots the loop now ends in\nrecovery. Like FW_PREV_* with the formal RO fix discussed on the bug,\nthe record doesn\u0027t expire while the device stays on a slot, so a later\nsingle failure on that slot goes straight to recovery.\n\nFW_PREV_TRIED/FW_PREV_RESULT become vestigial for this decision, but\nvb2_select_fw_slot() still sets them as before, and crossystem still\nreports them (fw_prev_tried/fw_prev_result). Adding a new field instead\nof changing what FW_PREV_* mean also makes it easier to build a\nbackport for existing firmware branches: there, RW firmware can write\nthe new bit without touching fields that frozen RO also writes.\n\nThe bit is MISC 0x80 rather than 0x20, which is unused on ToT, because\n0x20 is still VB2_NV_MISC_DISABLE_ALT_OS on several supported firmware\nbranches (e.g. octopus, grunt, rammus, atlas, nocturne), whose firmware\nreads and writes it. Those branches will get an equivalent backport\nthat writes the same bit from RW firmware, so the bit must be free\nthere too. 0x80 has never been assigned on any firmware branch, and old\nRO, old RW and crossystem preserve it.\n\nWARNING: Do not cherry-pick this change to existing firmware branches.\nOnly RO sets the new bit, and RO is already frozen on devices using\nthose branches. With old RO, RW built with this change never sees the\nbit set, so fail_impl() never requests recovery even when both slots\nfail. Existing firmware branches need the separate backport, which\nwrites the bit from RW firmware (e.g. CL:8842975 for\nfirmware-bluey-16702.B).\n\nBRANCH\u003dnone\nBUG\u003db:184304285\nTEST\u003dmake run2tests USE_FLASHROM\u003d0\nTAG\u003dagy\nCONV\u003d22503f2d-2161-4a37-9f9d-fe851ee04c47\n\nChange-Id: I19641e70fdaf9f3d9441b919767958d16a6a6964\nSigned-off-by: Yu-Ping Wu \u003cyupingso@google.com\u003e\nReviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/8811902\nTested-by: Yu-Ping Wu \u003cyupingso@chromium.org\u003e\nReviewed-by: Julius Werner \u003cjwerner@chromium.org\u003e\nCommit-Queue: Yu-Ping Wu \u003cyupingso@chromium.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "4164531f2cc7bb72df61402a52d75ce2acb16384",
      "old_mode": 33188,
      "old_path": "firmware/2lib/2misc.c",
      "new_id": "2097b9fad6459db83c544a081107135884dfde87",
      "new_mode": 33188,
      "new_path": "firmware/2lib/2misc.c"
    },
    {
      "type": "modify",
      "old_id": "afd3a609af1b2ca5bd41dafdc5eb2709b43f74ec",
      "old_mode": 33188,
      "old_path": "firmware/2lib/2nvstorage.c",
      "new_id": "1df13e31a17254512506e70b557b1b304be943d1",
      "new_mode": 33188,
      "new_path": "firmware/2lib/2nvstorage.c"
    },
    {
      "type": "modify",
      "old_id": "a9620759db504dee928177a8875404101b2c919c",
      "old_mode": 33188,
      "old_path": "firmware/2lib/include/2nvstorage_fields.h",
      "new_id": "06bb4c0adc628a4251e3bd8bb5d745c24927d553",
      "new_mode": 33188,
      "new_path": "firmware/2lib/include/2nvstorage_fields.h"
    },
    {
      "type": "modify",
      "old_id": "53edb195338ccf7a5e36436676ccc55079d26ebf",
      "old_mode": 33188,
      "old_path": "firmware/2lib/include/2nvstorage_params.h",
      "new_id": "cf41f23da9926eebd72a780633db712ed0630726",
      "new_mode": 33188,
      "new_path": "firmware/2lib/include/2nvstorage_params.h"
    },
    {
      "type": "modify",
      "old_id": "0dc731b76edf24662304bd1fb2bd744faf987704",
      "old_mode": 33188,
      "old_path": "tests/vb2_misc_tests.c",
      "new_id": "4ab4931f00246d66f7fa909efbbc12e7ba06fd00",
      "new_mode": 33188,
      "new_path": "tests/vb2_misc_tests.c"
    },
    {
      "type": "modify",
      "old_id": "da677d6a1a3b51718d86e38dcfb2f3a171f6681e",
      "old_mode": 33188,
      "old_path": "tests/vb2_nvstorage_tests.c",
      "new_id": "ae28be011070f64cda696b9509c928b8313f0a75",
      "new_mode": 33188,
      "new_path": "tests/vb2_nvstorage_tests.c"
    }
  ]
}
