Received: from mail-pf1-f172.google.com (mail-pf1-f172.google.com [209.85.210.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C082F369D71 for ; Thu, 30 Jul 2026 06:27:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785392861; cv=none; b=olB1z6iQkWljZqWbS3N+Sjvkbg0Vjgi0esKo2lHdPFHEj/O7TG5dGJo1BDJV621dKPvMQZJ0zKAk71g6xAJO8xK0VCdj5Rr05DAwKGTHNUeiic3OB9N9KIWhytqbfNFhG6wC1z0nh/8NtPDyKpcgdgiavmxJDwDG7oesdof4X4Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785392861; c=relaxed/simple; bh=kYA5RbCeLTsX+J20uD1xRq8xVWSem8VdkEpw2oXKluk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=ZYJMwgShskPDqT7tbs9pLyqvWNLDf+0nIDdbrgubV+6bf3hA93/FxFJfmN2RRo2dEiE+pmT4EFlgfsyN4j4Y4bBGKUNHBXGrsxueT7VG+/JsHZYIl6Jz0+BumvpQlVmZaLZt6qZx1xvTKbcPotUFzJkNgJgAXeGoeNe6qEcOB7c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=reNNwZYe; arc=none smtp.client-ip=209.85.210.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="reNNwZYe" Received: by mail-pf1-f172.google.com with SMTP id d2e1a72fcca58-84a4d8fd6ecso1979152b3a.1 for ; Wed, 29 Jul 2026 23:27:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785392857; x=1785997657; darn=vger.kernel.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=8LdAoJKwXyAPy2Oxe1p5of7f27uz/x1w5QiaYqvn624=; b=reNNwZYesjpvC76UCfU2zuL8yfRblMERL6AuVqksGFpoxqKKu+KMedwE7eyEJ8UGVn Ipr3fA4Tm8vcmkl0kvgHjErufyZoxYs/kkM2D043fEjcrAa9wnpJ0xPqUCB49bS8SnFT Q7s+xr5VLLoZgy8pQhEXrGgf2/TPqTGpKJqMwGxR+mEN1xtysfvuca0WBDfKjSeL8xnM M6epSfnif3J/mtLKBR6SOPjMpqvHFkQMUKQhJui3QeJykR7smz4tMJ0A/cjDH7k0QCPV FnB2itZui4LNaOHoO6D/6B5dWjc0odCUauPfYrmzPcqKM6p28VfNUJMoAGPe7l5C2qqI D0Qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785392857; x=1785997657; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=8LdAoJKwXyAPy2Oxe1p5of7f27uz/x1w5QiaYqvn624=; b=EV1aZAWU3h1fqp4Ov5Cgtl9q7XM/o9PaXSE0P4dvnJrTcjAnQ7niVGkAEiDIFvO/71 9vWs8Vqs4FBDkvQYlZLBh2c3DsBUmv1skkYhw0p3RvfLBZVlQC+l3Lk2KwkHQN09fP9Q B55xjx4LMWMLKKbW1lJrk4TykEN/aW8Jn0RZfnjebTiwlyaJg1NbeooErOe+j/nK0s0e P0Hoxrp1lN0dmt++5t0t8/vqAnVJBsiWlNGPH+euTl21e+O4AmSPGhdWWrU6+ESUU9tI caiyMvnXOlECU00+LRIAYIG/tz4i+EDAQID4Y2+Ge4GReAS+1kcxtpbbPA2WDJkZAZR4 LDKA== X-Forwarded-Encrypted: i=1; AHgh+Rqwx4+ESXfugXV/52BdMzgqBT1Ok1VxngzWMhJQUHc3KYzxD4F7fMIgCe91jskb8Jret1rF/C4WhTuVB6Ik@vger.kernel.org X-Gm-Message-State: AOJu0Yw/9JIUn2Hcoe+OqfKGCzfukFdf1E98YIk8ZrB6hfDBKpNJAsIh Ywa9aITxe7/AqxAKvfdCiccbeKMTMxi77PmTqKPsqGvBNMauvHJUVyTo X-Gm-Gg: AR+sD11+PqiB/i/3vaocm0BcKTetKh9uOq0yJ3CKyZ+v4phb4CeE646rqMuf2XO3Zlk YjzbtZBAPTRJORDk1XMbk5uM6S52h7gH7Jn3RyqThAKwkucyIDqARsnq9Cu7cxfZvW4fC74sNpJ Q6PVutpR9L0bT4MA0NEOACoIqMXNj/9fj0mDcseZ73LFdB6GpQBeXWluoR5cCOhfQ3uF/uJdauW PriMpsbRQpUACxy5v4yqmx2aMWbLI5LAB/HcXAKMPDKr04qm7l6UbTY9WW6JaKYsn8Uh5k0B86U cVM1rf97sVrSTksa4y86lcU17qBgnCnbPLAkyG4M9536jnaEkbXMt7Oame5hC2E25XOb6BN4b09 j2Vq4cyy7fRto43dfpaIyLjzHA+JNkfWIg8EJ/bioxKYEFSyCGapAs4q3ZzgyHUp2E0OSkkMygN VSIk5P7mIwm9g+QVS3pl6Ww7PD6qhW4eu6EjGfCXE+S1B8fDJCrQyS/g9Oa27XrXn/3aDIohjpu q8= X-Received: by 2002:a05:6a00:2e87:b0:842:5da3:9b89 with SMTP id d2e1a72fcca58-84ebc3e1d64mr1491102b3a.38.1785392856941; Wed, 29 Jul 2026 23:27:36 -0700 (PDT) Received: from baineng-pc.. ([117.133.183.252]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-84ea00507b0sm2503229b3a.14.2026.07.29.23.27.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Jul 2026 23:27:36 -0700 (PDT) From: Baineng Shou To: Sumit Semwal , =?UTF-8?q?Christian=20K=C3=B6nig?= , "T . J . Mercier" , Benjamin Gaignard , Brian Starkey , John Stultz , Sandeep Patil , "Andrew F . Davis" , Srinivas Kandagatla , David Airlie , Simona Vetter Cc: stable@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org, linaro-mm-sig@lists.linaro.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Baineng Shou Subject: [PATCH v5 3/4] drm/prime: use dma_buf_fd_install() to preserve export tracing Date: Thu, 30 Jul 2026 14:26:44 +0800 Message-Id: <20260730062645.233148-4-shoubaineng@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260730062645.233148-1-shoubaineng@gmail.com> References: <20260730062645.233148-1-shoubaineng@gmail.com> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit drm_gem_prime_handle_to_fd() open-codes fd reservation and install using get_unused_fd_flags() + fd_install() directly. This bypasses the DMA_BUF_TRACE() call that dma_buf_fd() emits, so observability tools relying on the trace_dma_buf_fd tracepoint silently miss all DRM PRIME exports. Replace the bare fd_install() with dma_buf_fd_install(), which wraps fd_install() together with DMA_BUF_TRACE(), restoring full tracepoint coverage. No functional change; the fd lifecycle (get_unused_fd_flags → work → install) is already correct. Note: this patch depends on dma_buf_fd_install() introduced in "dma-buf: dma-heap: don't publish fd before copy_to_user() succeeds" [1]. [1] https://lore.kernel.org/dri-devel/20260714114654.3885457-2-shoubaineng@gmail.com/ Suggested-by: Christian König Signed-off-by: Baineng Shou --- drivers/gpu/drm/drm_prime.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c index 9b44c78cd77f..fe3436d1235d 100644 --- a/drivers/gpu/drm/drm_prime.c +++ b/drivers/gpu/drm/drm_prime.c @@ -524,7 +524,7 @@ int drm_gem_prime_handle_to_fd(struct drm_device *dev, return PTR_ERR(dmabuf); } - fd_install(fd, dmabuf->file); + dma_buf_fd_install(dmabuf, fd); *prime_fd = fd; return 0; } -- 2.34.1