Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2940791rwb; Fri, 9 Dec 2022 08:06:06 -0800 (PST) X-Google-Smtp-Source: AA0mqf7Tmo9y+SvOF+Xpeoj1oxs7saN0Q9ixNwkJVLC8iNeTtNR2QPx+ZAZ10UKTz5hUbwPXAfYg X-Received: by 2002:a17:903:1248:b0:189:129e:92af with SMTP id u8-20020a170903124800b00189129e92afmr7965029plh.14.1670601966634; Fri, 09 Dec 2022 08:06:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670601966; cv=none; d=google.com; s=arc-20160816; b=q8/RvGQelO4cfLS0Mgcy58VZn9kFaOUATBqYV+zMzFqWafmBmhwzZeVu19jh9HPyBW 7ZY0cAjsLAN2Bxo2D51sdpb0yaemXLroFCEr6AoiOCMi1JnKEl6yrcfHmkuQrtMwlDqk p5Rn3biLWcSmvSdrbxRYbEzE+VcX9pLrnpAUk1TlEmdIc3USuuax0Auf3KlzkKcjviXt ZvAPmCtD3lBHZzkQc4YVMf0eUy9/wCsLifKM3uruLF6OSDnPbrlGJtrgUvz/tn1I5AQK cX7m2R718J1qgZ79+w9PNoPHocy5Z0ChlXpYAXj4ECdcil5q5gYv6LM1pEOwD5fm7r0r 0vxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:organization :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=7fUsUnAXepfKuE0su1ADZrvdwwtcafW5Ec0KIa2sKOo=; b=ZvdgpCVR+Z45oc4UKSKU9LtsitOI3ssiWawQ/QOCjaMKHm6ZVvbXS7YgZ3S1gp8AeM aADm8baUF90K/cJ6KA/92cdvI1yct7Y/hWjMEdAkWJ7NQc5mp9HSJRC2Q/nq+sptHP6O qvewBM5EjD06iHT+uf1VkbzLpokCyWwSgw9C5bTH/s9vkvN80HInpy9WynN7P2HLfEo/ 5egjtbV0ugYPKqfJ6SBMU6hTSGCn/Q2dO9gjiyxQFROfdJfEtHm+bA0AuMWIrNLcWmzj JZ2XxzQVqVF6f2ItViNDhsI7sBYOV/81aKjdylBZ8C8mbP+JAucjWV/HaNvK3SiJh3Rl Vs3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=aKfC4IUf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x22-20020a170902821600b0018965245866si1679543pln.308.2022.12.09.08.05.56; Fri, 09 Dec 2022 08:06:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=aKfC4IUf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230523AbiLIPu4 (ORCPT + 75 others); Fri, 9 Dec 2022 10:50:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230487AbiLIPuS (ORCPT ); Fri, 9 Dec 2022 10:50:18 -0500 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A0715592 for ; Fri, 9 Dec 2022 07:49:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1670600967; x=1702136967; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=1d8DO0y4KPCKgk9FowYpGZO4PZW2hY3vRExtJAWw+og=; b=aKfC4IUfiXqYG3Muegn8D/hqmtTVgOqXtRLb+ExPos64pz8Juhqvuby+ k/Uh5NuddsquRjAyMMqRiXsp0puronfPfoSPhuDQ+rs85/T66YpxRoKyB /Fr8rwQYvy675ZeowBH6gCWCRIYXx0YBN/V5RkmGvokASDNvYtq9bvKhN XXdsvXOPblCu06YFzKbBRlJnff28BGPA2sDxmsKH/TxVMzRE9BG6N3TsD k2wSPPsgrCWzo23uJE1liLkwG4Oo2iHkDdz5RB2BLZmIB5WoJZEFsemmC TlBtNCZoH1dUhQxe1VrKp/EVxeCp9xlwqN2AC9ZTdd8/E4uN396Z3iTt1 w==; X-IronPort-AV: E=McAfee;i="6500,9779,10556"; a="315119821" X-IronPort-AV: E=Sophos;i="5.96,230,1665471600"; d="scan'208";a="315119821" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Dec 2022 07:49:27 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10556"; a="647433368" X-IronPort-AV: E=Sophos;i="5.96,230,1665471600"; d="scan'208";a="647433368" Received: from lab-ah.igk.intel.com ([10.91.215.196]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Dec 2022 07:49:23 -0800 From: Andrzej Hajda To: linux-kernel@vger.kernel.org, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Cc: Andrzej Hajda , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , Andi Shyti , Andrew Morton , Andy Shevchenko , Arnd Bergmann Subject: [PATCH 4/5] drm/i915/gvt: kill fetch_and_zero usage Date: Fri, 9 Dec 2022 16:48:42 +0100 Message-Id: <20221209154843.4162814-4-andrzej.hajda@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221209154843.4162814-1-andrzej.hajda@intel.com> References: <20221209154843.4162814-1-andrzej.hajda@intel.com> MIME-Version: 1.0 Organization: Intel Technology Poland sp. z o.o. - ul. Slowackiego 173, 80-298 Gdansk - KRS 101882 - NIP 957-07-52-316 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Better use recently introduced kernel core helper. Signed-off-by: Andrzej Hajda --- drivers/gpu/drm/i915/gvt/kvmgt.c | 2 +- drivers/gpu/drm/i915/gvt/scheduler.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/gvt/kvmgt.c b/drivers/gpu/drm/i915/gvt/kvmgt.c index 077892a9aa8fdc..061302abb0a189 100644 --- a/drivers/gpu/drm/i915/gvt/kvmgt.c +++ b/drivers/gpu/drm/i915/gvt/kvmgt.c @@ -1831,7 +1831,7 @@ static int init_service_thread(struct intel_gvt *gvt) */ static void intel_gvt_clean_device(struct drm_i915_private *i915) { - struct intel_gvt *gvt = fetch_and_zero(&i915->gvt); + struct intel_gvt *gvt = exchange(&i915->gvt, NULL); if (drm_WARN_ON(&i915->drm, !gvt)) return; diff --git a/drivers/gpu/drm/i915/gvt/scheduler.c b/drivers/gpu/drm/i915/gvt/scheduler.c index 9cd8fcbf7cad16..6699135f366f3f 100644 --- a/drivers/gpu/drm/i915/gvt/scheduler.c +++ b/drivers/gpu/drm/i915/gvt/scheduler.c @@ -826,7 +826,7 @@ static int dispatch_workload(struct intel_vgpu_workload *workload) /* We might still need to add request with * clean ctx to retire it properly.. */ - rq = fetch_and_zero(&workload->req); + rq = exchange(&workload->req, NULL); i915_request_put(rq); } @@ -1103,7 +1103,7 @@ static void complete_current_workload(struct intel_gvt *gvt, int ring_id) intel_vgpu_trigger_virtual_event(vgpu, event); } - i915_request_put(fetch_and_zero(&workload->req)); + i915_request_put(exchange(&workload->req, 0)); } gvt_dbg_sched("ring id %d complete workload %p status %d\n", -- 2.34.1