)]}'
{
  "commit": "636139603b99d2e3a18a46cf3f8d39313ce8042e",
  "tree": "c8c9f10598d5f47a29bbe697faa22d67e70e4b10",
  "parents": [
    "5f28bb1c2cd9dcdb76a20d61b3ea069b85893c59"
  ],
  "author": {
    "name": "Mike Lothian",
    "email": "mike@fireburn.co.uk",
    "time": "Sat Sep 12 00:29:08 2026 +0100"
  },
  "committer": {
    "name": "Alex Deucher",
    "email": "alexander.deucher@amd.com",
    "time": "Thu Sep 17 11:54:05 2026 -0400"
  },
  "message": "drm/amdgpu: hold a runtime PM reference for P2P dma-buf attachments\n\namdgpu_dma_buf_map() adds VRAM to the allowed domains for a peer2peer\nattachment.  GTT is only a fallback placement when VRAM is preferred, so\nttm_bo_validate() migrates the buffer from GTT into VRAM.  While the\nexporting device is runtime suspended its SDMA rings are down and the\nmove fails:\n\n  amdgpu: Move buffer fallback to memcpy unavailable\n\nAn importer on a second GPU reaches this holding no runtime PM\nreference on the exporter, e.g. a compositor on the APU submitting a\nframe that references a buffer exported by an idle dGPU:\n\n  amdgpu_cs_ioctl -\u003e amdgpu_cs_parser_bos -\u003e amdgpu_cs_bo_validate\n    -\u003e ttm_bo_validate -\u003e amdgpu_bo_move -\u003e dma_buf_map_attachment\n      -\u003e amdgpu_dma_buf_map -\u003e ttm_bo_validate -\u003e amdgpu_bo_move\n\nPinning a dma-buf into VRAM has the same requirement, which\ncommit 030631e97b20 (\"drm/amdgpu: revert \"take runtime pm reference\nwhen we attach a buffer\" v2\") called out as the one case that would\nneed the reference back.\n\nTake it in attach and drop it in detach.  pm_runtime_get_if_active()\nnever resumes the device, so it cannot deadlock against the reservation\ntaken during resume, which is why the old pm_runtime_get_sync() had to\ngo.  If the device is not active, clear peer2peer instead: the buffer\nthen stays in GTT, which remains accessible while the GPU is powered\ndown.  If runtime PM is disabled, take a plain reference so the put in\ndetach stays balanced.\n\nFixes: 030631e97b20 (\"drm/amdgpu: revert \"take runtime pm reference when we attach a buffer\" v2\")\nSuggested-by: Christian König \u003cchristian.koenig@amd.com\u003e\nReviewed-by: Christian König \u003cchristian.koenig@amd.com\u003e\nSigned-off-by: Mike Lothian \u003cmike@fireburn.co.uk\u003e\nAssisted-by: Claude:Opus-5 [Claude Code]\nSigned-off-by: Alex Deucher \u003calexander.deucher@amd.com\u003e\n(cherry picked from commit 062ff15e30a48d14fb7d7558eba84f8dc97197f0)\nCc: stable@vger.kernel.org\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "b33c300e26e2eb0b22aad04baeb607a0502be1ec",
      "old_mode": 33188,
      "old_path": "drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c",
      "new_id": "9adf3eed8822c7b02efcc7767b47ded05cd66153",
      "new_mode": 33188,
      "new_path": "drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c"
    }
  ]
}
