Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B5663FD530D for ; Fri, 27 Feb 2026 07:55:11 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2DD2010E0EB; Fri, 27 Feb 2026 07:55:11 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="A+6pYEIX"; dkim-atps=neutral Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6ACE510E0EB for ; Fri, 27 Feb 2026 07:55:09 +0000 (UTC) Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-48378136adcso10056345e9.1 for ; Thu, 26 Feb 2026 23:55:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1772178908; x=1772783708; darn=lists.freedesktop.org; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=0bo1+MeHyz3oo0R9LPXDVH4BNCFrZ2q0p2S2NbLydZI=; b=A+6pYEIXWEW7cWn8OIuPXubR9GI76T5KDQvZKHwYHhqS1GOgaLABxHrz+oYTiRWxSE +H2zBp0xvbRwCc7iWacIxYJ7dnUPSAZQhmVrHFYK3RULG81VocebYyf3GRMr5EgCsRtD E29ZcK+l74HbfSZKTcsp/1qlPelWSm+yCMvGfz3PYwqcxEUqteJw2cjO7K60BbEYoHTz ovYqADgeq6kuvmTJzhxpcTHCyD+PP2LHR9R7x/G7zqwTxY1Q4o9pB04VIAkj9gtvB+jE HaT8JF7Fz1S5jF/lsc6xAMEMZmhUSU7RCD2s5TjsttgEUTRWueGIgxF6R0RjNLyJiqL7 +ZkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772178908; x=1772783708; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=0bo1+MeHyz3oo0R9LPXDVH4BNCFrZ2q0p2S2NbLydZI=; b=HjrZEKJsgAuUUbNerYefvgAxMWPF3dIccIAWJ2QoWF6hMiXWovrVKrN9yZ3rGDigFW K6LZEd6UlYBIAwTYXtJd6p0UTObVNaehdMweWRBwMXhUQkMzFiSoHQXq8bNTROBPnZLl F89E6ABIwZVFS8NofOTwkCTG69EXla85AHdmGKkYP0tUyBTgoS2H5sX59uYlhxpaJQzC 0Qth/UN7OJ+qkXVtP8xA3YuYPip3MnP637DIkCjsmH6J0KhgQdId6RxjUywqX8jdREtO c8xmghcS+69LGVPl3SjKSuDDT189CxlZ7BxW+bCArcKbMpRL7v4Uc2Y4jb4kuEUU1vCC H0XA== X-Forwarded-Encrypted: i=1; AJvYcCUA9RcwaiNRZJXf+jHIRJh6Y8KFsINbV9OMTreAgMmJ7iXrbQ8Ro2nRVS4WR2lhlNUu9LaAxc0qC9A=@lists.freedesktop.org X-Gm-Message-State: AOJu0Yz/pqxt7rDsHMIGCGajl3TFgTaerUjFk9gsqFFurRfhVvTkegCm wSfXYUSeqDwNUCd+nuRLLg9Yv3Pr1hghUrChlOasuA4WbUVHSnMiGzv5lTd/xSiS6sY= X-Gm-Gg: ATEYQzyAVAbXmCOghWghJ0We5Ougz/fOf8F01aR7/D5PYHTHvrmsQzf5jWLDV89f65L h2aBCz9//VjRLZkC0t5ZD86zRrtPnwNUZ1d6cmA+sL7/OI3TJ2DqySWcT0mNI/CM92C1bjLKbGs SeX/2e1Cx1fgU6uWAp4gsUIh+12Bf3J1jylxi6+/FJFS0l/IQHNNfjDGdApplOtHAIgCE7XURZm uxuNEI8DoKSrND6eAB6bf4YIFkcCPUy4/aCFxYRZ6kI0JBJ/J8faw3X2wAEPij0NWLQKh7gBctJ MkU6oDxigWF5B0EUYfNgdht5TOirnSM6vCWe8hvoc6n6cSWoK069TIKtxgqkdYbd7ukx7GIxPl0 O9gjZKZQQSlsXSgPwnq8mDYP5LB5VBb8SQ3F48+7WF1LEjoT29sBBscRTYcTjyr96APicaXF6KO 3FlruxHgRU988zQJh3AFCyrGZljS7+ X-Received: by 2002:a05:600c:828c:b0:482:dbd7:a1c1 with SMTP id 5b1f17b1804b1-483c9c23c72mr23232475e9.34.1772178907803; Thu, 26 Feb 2026 23:55:07 -0800 (PST) Received: from localhost ([196.207.164.177]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-483bd7507adsm219000415e9.9.2026.02.26.23.55.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Feb 2026 23:55:07 -0800 (PST) Date: Fri, 27 Feb 2026 10:55:04 +0300 From: Dan Carpenter To: Pierre-Eric Pelloux-Prayer Cc: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, "SHANMUGAM, SRINIVASAN" Subject: [bug report] drm/amdgpu: add missing lock in amdgpu_benchmark_do_move Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" [ Smatch checking is paused while we raise funding. #SadFace https://lore.kernel.org/all/aTaiGSbWZ9DJaGo7@stanley.mountain/ -dan ] Hello Pierre-Eric Pelloux-Prayer, Commit 30f2daedf4d8 ("drm/amdgpu: add missing lock in amdgpu_benchmark_do_move") from Nov 18, 2025 (linux-next), leads to the following Smatch static checker warning: drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c:57 amdgpu_benchmark_do_move() warn: inconsistent returns '&adev->mman.default_entity.lock'. drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c 31 static int amdgpu_benchmark_do_move(struct amdgpu_device *adev, unsigned size, 32 uint64_t saddr, uint64_t daddr, int n, s64 *time_ms) 33 { 34 ktime_t stime, etime; 35 struct dma_fence *fence; 36 int i, r; 37 38 mutex_lock(&adev->mman.default_entity.lock); 39 stime = ktime_get(); 40 for (i = 0; i < n; i++) { 41 r = amdgpu_copy_buffer(adev, &adev->mman.default_entity, 42 saddr, daddr, size, NULL, &fence, 43 false, 0); 44 if (r) 45 goto exit_do_move; 46 r = dma_fence_wait(fence, false); 47 dma_fence_put(fence); 48 if (r) 49 goto exit_do_move; 50 } 51 mutex_unlock(&adev->mman.default_entity.lock); 52 53 exit_do_move: The unlock should be after the exit_do_move label. 54 etime = ktime_get(); 55 *time_ms = ktime_ms_delta(etime, stime); 56 --> 57 return r; 58 } regards, dan carpenter