From patchwork Thu Sep 28 18:08:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jani Nikula X-Patchwork-Id: 13403433 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 59605CE7B19 for ; Thu, 28 Sep 2023 18:09:39 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D462910E6A8; Thu, 28 Sep 2023 18:09:38 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTPS id 90E0310E6AB for ; Thu, 28 Sep 2023 18:09:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1695924575; x=1727460575; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=PzrFYR9PX/0lavIBnWhmJJiquwQPQwkuYVczO3BSeF0=; b=d1iG5xv7IyWV2z/lh2OTSwRyMXPE+Mx3DIOBtBSRPH4RxP52laEN06cK 9t8F6v9Ub91L02KQipBkYhWbsngTPriL47DdPGVcCOXHHaee/71H+ZCyO 53XzcTdJbRkmDVK6PhqarapuZ831qcbF95HANRR6n/K7zLZrCiGTXGe6V hcsn+OrEbHCKxcnUUGt3rFutQt31Jv3VeMWdYH5Sq2Wl6zrm1AIPjZuV4 B/yCohe+IK1H4KXD8qpCONQFuX4jfVIGa1K0yDBzIn+sfdPXTipxLAVby 7bDoAoCRZGcHNid/XjqAXmsvNf/Thfvq1K5hrW7kPuLyv1Gu3XksA4S2/ w==; X-IronPort-AV: E=McAfee;i="6600,9927,10847"; a="384949768" X-IronPort-AV: E=Sophos;i="6.03,184,1694761200"; d="scan'208";a="384949768" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Sep 2023 11:09:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10847"; a="873357099" X-IronPort-AV: E=Sophos;i="6.03,184,1694761200"; d="scan'208";a="873357099" Received: from danielba-mobl1.ger.corp.intel.com (HELO localhost) ([10.252.53.20]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Sep 2023 11:09:33 -0700 From: Jani Nikula To: intel-gfx@lists.freedesktop.org Date: Thu, 28 Sep 2023 21:08:52 +0300 Message-Id: <7953952019a6362acbf8b20372d398b86fbf3a0e.1695924021.git.jani.nikula@intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Subject: [Intel-gfx] [PATCH 08/15] drm/i915: convert i915_coredump_get/put() to proper functions X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jani.nikula@intel.com Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Also make i915_gpu_coredump_get() static, as it's not used outside of i915_gpu_error.h. Signed-off-by: Jani Nikula --- drivers/gpu/drm/i915/i915_gpu_error.c | 14 +++++++++++++- drivers/gpu/drm/i915/i915_gpu_error.h | 14 +------------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c index 17699b20694c..9b1bb5aeec11 100644 --- a/drivers/gpu/drm/i915/i915_gpu_error.c +++ b/drivers/gpu/drm/i915/i915_gpu_error.c @@ -1060,7 +1060,7 @@ static void cleanup_gt(struct intel_gt_coredump *gt) kfree(gt); } -void __i915_gpu_coredump_free(struct kref *error_ref) +static void i915_gpu_coredump_free(struct kref *error_ref) { struct i915_gpu_coredump *error = container_of(error_ref, typeof(*error), ref); @@ -1080,6 +1080,18 @@ void __i915_gpu_coredump_free(struct kref *error_ref) kfree(error); } +static struct i915_gpu_coredump *i915_gpu_coredump_get(struct i915_gpu_coredump *gpu) +{ + kref_get(&gpu->ref); + return gpu; +} + +void i915_gpu_coredump_put(struct i915_gpu_coredump *gpu) +{ + if (gpu) + kref_put(&gpu->ref, i915_gpu_coredump_free); +} + static struct i915_vma_coredump * i915_vma_coredump_create(const struct intel_gt *gt, const struct i915_vma_resource *vma_res, diff --git a/drivers/gpu/drm/i915/i915_gpu_error.h b/drivers/gpu/drm/i915/i915_gpu_error.h index 68c964d6720a..f6f8d284a07d 100644 --- a/drivers/gpu/drm/i915/i915_gpu_error.h +++ b/drivers/gpu/drm/i915/i915_gpu_error.h @@ -305,23 +305,11 @@ void i915_vma_capture_finish(struct intel_gt_coredump *gt, void i915_error_state_store(struct i915_gpu_coredump *error); -static inline struct i915_gpu_coredump * -i915_gpu_coredump_get(struct i915_gpu_coredump *gpu) -{ - kref_get(&gpu->ref); - return gpu; -} - ssize_t i915_gpu_coredump_copy_to_buffer(struct i915_gpu_coredump *error, char *buf, loff_t offset, size_t count); -void __i915_gpu_coredump_free(struct kref *kref); -static inline void i915_gpu_coredump_put(struct i915_gpu_coredump *gpu) -{ - if (gpu) - kref_put(&gpu->ref, __i915_gpu_coredump_free); -} +void i915_gpu_coredump_put(struct i915_gpu_coredump *gpu); void i915_reset_error_state(struct drm_i915_private *i915); void i915_disable_error_state(struct drm_i915_private *i915, int err);