From patchwork Fri Jan 5 12:20:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 185377 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp6182870dyb; Fri, 5 Jan 2024 04:20:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IHcB3WLqEnGp/w8Tfe6eRbbA4w1fYByv1Fpki2dJo37P72jPW2SDOGqZjt+nuwMGcYYj9ue X-Received: by 2002:a05:6214:1d25:b0:680:b44c:1a0b with SMTP id f5-20020a0562141d2500b00680b44c1a0bmr2001651qvd.99.1704457247233; Fri, 05 Jan 2024 04:20:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704457247; cv=none; d=google.com; s=arc-20160816; b=hbwSNfcFj2bdiGUrr57XIxeGYtafX8DH3uOoAapoNKWp8CenTZ5yS8qMGjLiVbv6yq xs41x+1xUp9Y1lTPIytrkF5d8qvjkcpc9KawJQwjPXqlpr50ISoEFyxLvyl8HSRFJR2H K+bRpMT6KKcxxRRVZJA7CaCOYxK99rbeADqI2xsebhpHW+2HO237EJCJzGXYBF0+Vlyb sAapX1Ym9JXG5H7MvSeaVyj6GgA/aWZQjba0Rsa7Rtqs+I+USPV3/vY4fpvheJj/yy/2 jAIyxyeOBjGo70KrfkxUnw9+ddQ9lwOnwvEOA5IE4hzkOtXL6VMKBW5Az9IWRzmBM/Eq pvCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-disposition:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:message-id:subject:cc:to:from:date :dkim-signature; bh=CWCHZKbV0nCInnBBb4G3T1/9XNnm41DOrT+nUORhlYo=; fh=zCD6KAvLwCVU0O8Hgr5r2QDon/c2XME8hYCIBUgvIa4=; b=tlEhFtsD9qbzcJOohOeemkTs+e0/xectT6FopfsvMZFU/Vtc+/TB72NeZWTitYBncB YUyAq8aS7mwyR7XgmsMACtTL6M1WhIVwDQ5irnqmDjKM2ztcr8fUsGZNKU2BTqTrsewW aEbAmSZXR/Vnd1JkmSxpYw2eVUSly4oh8K0XJAoE3DaFlZpDhfk43koaMo3zYepl+uRw oOxKciGcsvWDmCvDF07pZS4hRD+YRopBDhyKN7H3B9DR+IOFRpr1oLa/N6ZYk1AXFrKe vj9BWCpmxOSmG7pE8qZm3E9TBUbKHGNO6eqA1mv0ec0HZTCL+4UiKW0hwuQEFPvdXTDH IG9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dD4ms66B; spf=pass (google.com: domain of linux-kernel+bounces-17826-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17826-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id t2-20020a05622a148200b004297d0db572si158895qtx.16.2024.01.05.04.20.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jan 2024 04:20:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-17826-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dD4ms66B; spf=pass (google.com: domain of linux-kernel+bounces-17826-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17826-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 0A3E61C22EF5 for ; Fri, 5 Jan 2024 12:20:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 431242D615; Fri, 5 Jan 2024 12:20:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="dD4ms66B" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (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 F34272CCD4 for ; Fri, 5 Jan 2024 12:20:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-40d858c56cbso17121105e9.2 for ; Fri, 05 Jan 2024 04:20:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704457226; x=1705062026; darn=vger.kernel.org; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=CWCHZKbV0nCInnBBb4G3T1/9XNnm41DOrT+nUORhlYo=; b=dD4ms66BzWBO2N87ZD/lmXsaQnZuvR59dWj4ApBMsfe/ZCskpGpzj1ovwrRRq+IWzE 3ioO2t/frxYk1zoGanU3AwHs7ye/EoQybtblzPAXdePg5fuZwbTB2GwA743OJGeAYllz BGWIr1LvVvsrrrQ7EUy/oFqedemAopkHZxYWpROis4sIe4FR12oz09lY/5zoM2Nbttx6 FYbwbfzsVyTKEOa1JDVcl5vmMOtCMj2hRuUnCIlswFyJvYSlxgay/lWQiKgO8UXL3WAs Ucf0xZ4mAlVhLGtht3BA5BP94TxEXHOZNmaZBQs6MDuioCLKOF5Ce8OXBxPkbCFK7uLA wn+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704457226; x=1705062026; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=CWCHZKbV0nCInnBBb4G3T1/9XNnm41DOrT+nUORhlYo=; b=R+YEqB3FEvbZCxJ1neahjIjdoq0gWYORZpsMPXqTJ3HedGWZxG2/HcWRYgldtRC5Rc TSrn5P/LED0BzoWlWbZwk5KyKx81B8N0L6Psi1wSiFyJjApOqWJ+aRD0p/05f+TpSwcY HOKdwgYzqHMe4RJMBdz08CCm2WVztRzIf54GPI7p27zEK0hEPgt7La7MqSgUaNRgwjKb Ur6/HkOelkcbTkPqzj93CNxFDGe+SbHT2tbFl4HiNOOsVsDSLZpOUJko0wVulqEq1mAa 13TqrRlhClTDMdGXFIZGS9U0UadP+fQ3XzT1lguRaTgOGP9S7SQo3EytsIhz+q55Zna2 qtrw== X-Gm-Message-State: AOJu0YzCZ+jfN130+3xp25T82F9bM4+WPzwOLubdz0xvhU4sf+O+kLv9 vO2DCGgY7s/5SxKdTK282MIX3t3qlHfn+g== X-Received: by 2002:a05:600c:3595:b0:40d:8d45:aae4 with SMTP id p21-20020a05600c359500b0040d8d45aae4mr1238303wmq.173.1704457226169; Fri, 05 Jan 2024 04:20:26 -0800 (PST) Received: from localhost ([102.140.209.237]) by smtp.gmail.com with ESMTPSA id iv20-20020a05600c549400b0040b3d8907fesm1420756wmb.29.2024.01.05.04.20.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jan 2024 04:20:25 -0800 (PST) Date: Fri, 5 Jan 2024 15:20:22 +0300 From: Dan Carpenter To: Thomas =?iso-8859-1?q?Hellstr=F6m?= Cc: Lucas De Marchi , Oded Gabbay , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Rodrigo Vivi , Matthew Brost , intel-xe@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] drm/xe: unlock on error path in xe_vm_add_compute_exec_queue() Message-ID: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787252962439558260 X-GMAIL-MSGID: 1787252962439558260 Drop the "&vm->lock" before returning. Fixes: 24f947d58fe5 ("drm/xe: Use DRM GPUVM helpers for external- and evicted objects") Signed-off-by: Dan Carpenter Reviewed-by: Matthew Brost --- drivers/gpu/drm/xe/xe_vm.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/xe/xe_vm.c b/drivers/gpu/drm/xe/xe_vm.c index 9180f2d2d71d..4aa7979fe6bf 100644 --- a/drivers/gpu/drm/xe/xe_vm.c +++ b/drivers/gpu/drm/xe/xe_vm.c @@ -332,13 +332,13 @@ int xe_vm_add_compute_exec_queue(struct xe_vm *vm, struct xe_exec_queue *q) down_write(&vm->lock); err = drm_gpuvm_exec_lock(&vm_exec); if (err) - return err; + goto out_up_write; pfence = xe_preempt_fence_create(q, q->compute.context, ++q->compute.seqno); if (!pfence) { err = -ENOMEM; - goto out_unlock; + goto out_fini; } list_add(&q->compute.link, &vm->preempt.exec_queues); @@ -361,8 +361,9 @@ int xe_vm_add_compute_exec_queue(struct xe_vm *vm, struct xe_exec_queue *q) up_read(&vm->userptr.notifier_lock); -out_unlock: +out_fini: drm_exec_fini(exec); +out_up_write: up_write(&vm->lock); return err;