)]}'
{
  "commit": "2307ab799fdfa5e776232abdcd1898e65735bf95",
  "tree": "3ee36b8070b24e042b31b15f261f48f1dc0d8e15",
  "parents": [
    "31de9bcb6bbe184de3b61a0e6f9e101036d73584"
  ],
  "author": {
    "name": "Edward Lee",
    "email": "edwarddl@google.com",
    "time": "Fri Nov 06 00:17:43 2026 +0000"
  },
  "committer": {
    "name": "Edward Lee",
    "email": "edwarddl@google.com",
    "time": "Fri Nov 06 20:03:38 2026 +0000"
  },
  "message": "hothd-usb: Bind service lifetime to its USB device\n\nhothd-usb@.service has no dependency on the USB device it serves. When\nthe USB tree is reset (some platforms reset the USB hubs more than once\nduring boot from their platform init scripts), hothd fails with \"Lost\nconnection with Hoth\" and Restart\u003dalways schedules a restart 5s later.\nIf that restart fires while the device is still gone, hothd_usb.sh\nfinds no HOTH_USB_NAMES entry, exits 10 (\"Missing mapping\"), and\nRestartPreventExitStatus\u003d10 keeps the unit dead for the rest of the\nboot. If the udev add event for the returning device lands while that\nstart job is still running, it is merged into it and nothing starts the\nunit again.\n\nSeen in the field: one Hoth instance never registered on D-Bus after\nboot and stayed missing until the next power cycle.\n\nAdd BindsTo\u003d%i.device and After\u003d%i.device. The instance name is the\nescaped sysfs path that udev passes via SYSTEMD_WANTS, so %i.device is\nthe device unit for that port. systemd now stops the service when the\ndevice disappears (a stop, so Restart\u003d does not fire), refuses to start\nit while the device is absent, and udev starts it again when the device\nreturns, with the device present.\n\nThis needs the device unit to exist. 70-hothd-usb.rules only matched\nACTION\u003d\u003d\"add\", so the \"bind\" uevent that follows every USB add dropped\nthe systemd tag from CURRENT_TAGS and systemd never created (or\nremoved) the .device unit. With BindsTo alone every hothd-usb instance\nwas stopped. Match ACTION!\u003d\"remove|unbind\" so the tag sticks across\nbind and change events, and drops as soon as the driver detaches: on\n\"unbind\" the device unit goes inactive and BindsTo stops hothd, and a\nlater \"bind\" plugs it again and starts hothd once.\n\nTested: on a gBMC with three Hoth USB devices behind a downstream hub,\ncycled the hub (hub driver unbind/bind) 12 times while forcing a unit\nrestart during the gap, rebinding 0.3s-3.0s later, 35s apart.\n  Before (stock rules + unit):\n    Missing mapping / status\u003d10: 12/12 iterations, 24 starts, 12 failed\n  After (this change, as /etc overrides):\n    Missing mapping / status\u003d10: 0/12, 12 starts, 0 failed\n    restart while device absent -\u003e \"Dependency failed\", then\n    \"Starting\"/\"Started\" when the device returns\n  Hub down without a forced restart: device unit and service\n  inactive (dead), not failed; running again 2s after the hub returns.\n  USB driver unbind/bind of one Hoth device (device stays enumerated):\n    on unbind CURRENT_TAGS is empty, device unit and service go\n    inactive (dead), nothing restarts hothd; after bind it is running\n    again in 1s, one start per cycle.\n  All 7 hothd-usb units and 8 Hoth D-Bus objects stayed up otherwise.\n\nGoogle-Bug-Id: 581687485\nChange-Id: Id807e77074e2ae0ece40ee0f8bd5affbfa787b74\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "7b92f4ee6852749bc5684daf45ec067e0e9e2aa4",
      "old_mode": 33188,
      "old_path": "70-hothd-usb.rules",
      "new_id": "fc3cb983971e75810ba49f12314ab2de71e3b205",
      "new_mode": 33188,
      "new_path": "70-hothd-usb.rules"
    },
    {
      "type": "modify",
      "old_id": "3375dc23378c69988a989d759882580481a2ac2c",
      "old_mode": 33188,
      "old_path": "hothd-usb@.service.in",
      "new_id": "599259fa860731c5c98d38bcdf337eb5d5701622",
      "new_mode": 33188,
      "new_path": "hothd-usb@.service.in"
    }
  ]
}
