From patchwork Tue Dec 6 09:20:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Previn X-Patchwork-Id: 13065594 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 51685C352A1 for ; Tue, 6 Dec 2022 09:18:16 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B53D610E302; Tue, 6 Dec 2022 09:18:14 +0000 (UTC) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8CEE010E02A for ; Tue, 6 Dec 2022 09:18:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1670318290; x=1701854290; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=EUxDxqn6V9eRmwLZfcerq5N8r6p0LaJC710CmMrA/5E=; b=T7iuOzgL+jRsV1qTNFGkH0oreLj+f02sImF23DPGS3VlclIksIu7cBOK jIm5fWd7FENhXf/NJhW6sAje+faTQ5x11M9ti30F204MS2XNXfZMbF7Ah EX+/XPYTvS41AfLlerQgIoMQ8L7iIKyp++qEUhQfGDETZoMinU6IOqw7t DLmptYlI5qkmOIOxnT5VPJ3kwqXt1rst0B3Jr2TfAhMHgvNzuIbA+DklD FXKEYn/9a+U23CMWmgBRnLkOQDcA9zcsTN02ISVY/ouZ+Klr0pSNWNCxx /b5InykMNjddminTeIiDp074IegK5IPVUZW54hUB1ganYZ4i5+QiyEpM1 Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10552"; a="318438111" X-IronPort-AV: E=Sophos;i="5.96,220,1665471600"; d="scan'208";a="318438111" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Dec 2022 01:18:10 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10552"; a="623833212" X-IronPort-AV: E=Sophos;i="5.96,220,1665471600"; d="scan'208";a="623833212" Received: from aalteres-desk.fm.intel.com ([10.80.57.53]) by orsmga006.jf.intel.com with ESMTP; 06 Dec 2022 01:18:09 -0800 From: Alan Previn To: intel-gfx@lists.freedesktop.org Date: Tue, 6 Dec 2022 01:20:56 -0800 Message-Id: <20221206092100.274195-2-alan.previn.teres.alexis@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221206092100.274195-1-alan.previn.teres.alexis@intel.com> References: <20221206092100.274195-1-alan.previn.teres.alexis@intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH v2 1/5] drm/i915/guc: Fix GuC relay log debugfs failing open 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: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" When GuC-Error-Capture was introduced, we created buf_in_use as a way to identify if relay logging had started. It is meant to replace the previous method where a mmap of the GuC log buffer was the indicator but not since GuC Error Capture shares that mapping throughout operation. However, that method of checking was not updated when the debugfs guc_log_relay_ctl_open was called. Fix that check. Fixes: daff407a083d ("drm/i915/guc: Add capture region into intel_guc_log") Signed-off-by: Alan Previn Reviewed-by: Ashutosh Dixit Link: https://patchwork.freedesktop.org/patch/479021/?series=101603&rev=1 --- drivers/gpu/drm/i915/gt/uc/intel_guc_log.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c index 68331c538b0a..c5a7aecd08ac 100644 --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c @@ -701,7 +701,7 @@ int intel_guc_log_set_level(struct intel_guc_log *log, u32 level) bool intel_guc_log_relay_created(const struct intel_guc_log *log) { - return log->buf_addr; + return log->relay.buf_in_use; } int intel_guc_log_relay_open(struct intel_guc_log *log) From patchwork Tue Dec 6 09:20:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Previn X-Patchwork-Id: 13065596 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 EAB18C352A1 for ; Tue, 6 Dec 2022 09:18:27 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 18E3F10E02A; Tue, 6 Dec 2022 09:18:18 +0000 (UTC) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id E0C0810E304 for ; Tue, 6 Dec 2022 09:18:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1670318290; x=1701854290; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=yfPAqrDWZZCgB1eizROIWW/nWhXr/GEaimFx/LJsQ+I=; b=MdvKuhKUcAf31eSXrEMPwMXE+dIUyBSyUb11TmROyiSvXTJ8izWLywge 6fg7jbwM0tl7qRZiqmi924XUz+Bl2UBVmv10JpWtVcRxcvcme0GnwfrL5 W4QMjGCJswEWJuA5ZT+knWpG9qQEy2aV6f6e5+L2bg6xoL/8S32sjwO1G l7+r1hWmDKbCZMFWlgR4VgXMZBCWjiw+iqKgEtPLhoZQH8LJ1uzlv7RXS 2LPyOrnGthcI7hsKxR8zBy0IXjQqN59l9/LJuANeEhf2ctFwaLo6tb5Qu 7yg6lcOl73L3U7H89Fj6CNrOmNyOnYJ/gHwWeSgyZp36PoiVvd6JDGvA+ A==; X-IronPort-AV: E=McAfee;i="6500,9779,10552"; a="318438112" X-IronPort-AV: E=Sophos;i="5.96,220,1665471600"; d="scan'208";a="318438112" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Dec 2022 01:18:10 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10552"; a="623833214" X-IronPort-AV: E=Sophos;i="5.96,220,1665471600"; d="scan'208";a="623833214" Received: from aalteres-desk.fm.intel.com ([10.80.57.53]) by orsmga006.jf.intel.com with ESMTP; 06 Dec 2022 01:18:10 -0800 From: Alan Previn To: intel-gfx@lists.freedesktop.org Date: Tue, 6 Dec 2022 01:20:57 -0800 Message-Id: <20221206092100.274195-3-alan.previn.teres.alexis@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221206092100.274195-1-alan.previn.teres.alexis@intel.com> References: <20221206092100.274195-1-alan.previn.teres.alexis@intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH v2 2/5] drm/i915/guc: Add unaligned wc memcpy for copying GuC Log 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: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Add usage of unaligned wc mempy in read_update_log_buffer as newer formats of GuC debug-log-events are no longer guaranteed to be exactly 4-dwords long per event. Signed-off-by: Alan Previn Reviewed-by: Ashutosh Dixit --- drivers/gpu/drm/i915/gt/uc/intel_guc_log.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c index c5a7aecd08ac..2fa952916120 100644 --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c @@ -459,13 +459,16 @@ static void _guc_log_copy_debuglogs_for_relay(struct intel_guc_log *log) /* Just copy the newly written data */ if (read_offset > write_offset) { - i915_memcpy_from_wc(dst_data, src_data, write_offset); + if (!i915_memcpy_from_wc(dst_data, src_data, write_offset)) + i915_unaligned_memcpy_from_wc(dst_data, src_data, write_offset); bytes_to_copy = buffer_size - read_offset; } else { bytes_to_copy = write_offset - read_offset; } - i915_memcpy_from_wc(dst_data + read_offset, - src_data + read_offset, bytes_to_copy); + if (!i915_memcpy_from_wc(dst_data + read_offset, + src_data + read_offset, bytes_to_copy)) + i915_unaligned_memcpy_from_wc(dst_data + read_offset, + src_data + read_offset, bytes_to_copy); src_data += buffer_size; dst_data += buffer_size; From patchwork Tue Dec 6 09:20:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Previn X-Patchwork-Id: 13065599 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 D29E1C3A5A7 for ; Tue, 6 Dec 2022 09:18:37 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BB55110E313; Tue, 6 Dec 2022 09:18:25 +0000 (UTC) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1465B10E02A for ; Tue, 6 Dec 2022 09:18:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1670318291; x=1701854291; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=+cE/0K9YE9ytR89UPQRLx4CVp5EB+K6PfzPyz3dqFRA=; b=Dw1XIKhyI2l47tKE3cHBb7WNEl4t2fmxh3ll6vbO8JqAHEOVEeXLGM8g mL2nXIUBtR0MTrDTY3F7jHRhUvVbj+g+GWV87g8egEauXT9c+YfniYcMj qtlD258ARr49eLtfana3g+UgVtdZGu83XIUg5aD6CSrNme8yed+94KgU6 nmTKcT6JzJLJ9pfv83QeoPWL0afZMg725TgGSKslfzEIrREeGTmG0b7cw uCGwtQ34y3TbeNDSQKzbEhTesnJGVtQA4/+SzkRPnrXWhEwT5gMavAVaU y4IWBDL4lYFDIBcnt+pEahomC6zg6NlAp2dj8zNTPQYYFJ3NjepDAYi7N Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10552"; a="318438113" X-IronPort-AV: E=Sophos;i="5.96,220,1665471600"; d="scan'208";a="318438113" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Dec 2022 01:18:10 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10552"; a="623833215" X-IronPort-AV: E=Sophos;i="5.96,220,1665471600"; d="scan'208";a="623833215" Received: from aalteres-desk.fm.intel.com ([10.80.57.53]) by orsmga006.jf.intel.com with ESMTP; 06 Dec 2022 01:18:10 -0800 From: Alan Previn To: intel-gfx@lists.freedesktop.org Date: Tue, 6 Dec 2022 01:20:58 -0800 Message-Id: <20221206092100.274195-4-alan.previn.teres.alexis@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221206092100.274195-1-alan.previn.teres.alexis@intel.com> References: <20221206092100.274195-1-alan.previn.teres.alexis@intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH v2 3/5] drm/i915/guc: Provide debugfs for log relay sub-buf info 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: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" In order to provide alignment between IGT intel_guc_logger tool and i915 kernel's guc log relay channels without requiring updating both repositories everytime a sizing change is made, provide that info via debugfs files. Signed-off-by: Alan Previn --- drivers/gpu/drm/i915/gt/uc/intel_guc_log.c | 10 ++++-- drivers/gpu/drm/i915/gt/uc/intel_guc_log.h | 2 ++ .../drm/i915/gt/uc/intel_guc_log_debugfs.c | 34 +++++++++++++++++++ 3 files changed, 44 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c index 2fa952916120..6e880d9f42d4 100644 --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c @@ -141,7 +141,7 @@ u32 intel_guc_log_section_size_capture(struct intel_guc_log *log) return log->sizes[GUC_LOG_SECTIONS_CAPTURE].bytes; } -static u32 intel_guc_log_size(struct intel_guc_log *log) +u32 intel_guc_log_size(struct intel_guc_log *log) { /* * GuC Log buffer Layout: @@ -170,6 +170,12 @@ static u32 intel_guc_log_size(struct intel_guc_log *log) intel_guc_log_section_size_capture(log); } +#define GUC_LOG_RELAY_SUBBUF_COUNT 8 +u32 intel_guc_log_relay_subbuf_count(struct intel_guc_log *log) +{ + return GUC_LOG_RELAY_SUBBUF_COUNT; +} + /** * DOC: GuC firmware log * @@ -543,7 +549,7 @@ static int guc_log_relay_create(struct intel_guc_log *log) * latency, for consuming the logs from relay. Also doesn't take * up too much memory. */ - n_subbufs = 8; + n_subbufs = intel_guc_log_relay_subbuf_count(log); guc_log_relay_chan = relay_open("guc_log", dev_priv->drm.primary->debugfs_root, diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_log.h b/drivers/gpu/drm/i915/gt/uc/intel_guc_log.h index 02127703be80..c981eb8f4990 100644 --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_log.h +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_log.h @@ -81,6 +81,8 @@ unsigned int intel_guc_get_log_buffer_size(struct intel_guc_log *log, size_t intel_guc_get_log_buffer_offset(struct intel_guc_log *log, enum guc_log_buffer_type type); int intel_guc_log_create(struct intel_guc_log *log); void intel_guc_log_destroy(struct intel_guc_log *log); +u32 intel_guc_log_size(struct intel_guc_log *log); +u32 intel_guc_log_relay_subbuf_count(struct intel_guc_log *log); int intel_guc_log_set_level(struct intel_guc_log *log, u32 level); bool intel_guc_log_relay_created(const struct intel_guc_log *log); diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_log_debugfs.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_log_debugfs.c index ddfbe334689f..27756640338e 100644 --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_log_debugfs.c +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_log_debugfs.c @@ -105,6 +105,38 @@ DEFINE_SIMPLE_ATTRIBUTE(guc_log_level_fops, guc_log_level_get, guc_log_level_set, "%lld\n"); +static int guc_log_relay_subbuf_size_get(void *data, u64 *val) +{ + struct intel_guc_log *log = data; + + if (!log->vma) + return -ENODEV; + + *val = (u64)intel_guc_log_size(log); + + return 0; +} + +DEFINE_SIMPLE_ATTRIBUTE(guc_log_relay_subbuf_size_fops, + guc_log_relay_subbuf_size_get, NULL, + "%lld\n"); + +static int guc_log_relay_subbuf_count_get(void *data, u64 *val) +{ + struct intel_guc_log *log = data; + + if (!log->vma) + return -ENODEV; + + *val = intel_guc_log_relay_subbuf_count(log); + + return 0; +} + +DEFINE_SIMPLE_ATTRIBUTE(guc_log_relay_subbuf_count_fops, + guc_log_relay_subbuf_count_get, NULL, + "%lld\n"); + static int guc_log_relay_open(struct inode *inode, struct file *file) { struct intel_guc_log *log = inode->i_private; @@ -166,6 +198,8 @@ void intel_guc_log_debugfs_register(struct intel_guc_log *log, { "guc_load_err_log_dump", &guc_load_err_log_dump_fops, NULL }, { "guc_log_level", &guc_log_level_fops, NULL }, { "guc_log_relay", &guc_log_relay_fops, NULL }, + { "guc_log_relay_subbuf_size", &guc_log_relay_subbuf_size_fops, NULL }, + { "guc_log_relay_subbuf_count", &guc_log_relay_subbuf_count_fops, NULL }, }; if (!intel_guc_is_supported(log_to_guc(log))) From patchwork Tue Dec 6 09:20:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Previn X-Patchwork-Id: 13065597 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 84460C352A1 for ; Tue, 6 Dec 2022 09:18:31 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7A5B210E311; Tue, 6 Dec 2022 09:18:23 +0000 (UTC) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3BAEB10E311 for ; Tue, 6 Dec 2022 09:18:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1670318291; x=1701854291; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=YNCRvnV2yEl2A7iws1B7dNk1JsXFPGnMWmtyHjeTdLA=; b=D+FjIo9l5JHIh1qLtjS6pOGMd27MJjPvX0FKNUr3/sQXyt3H+61GTEc9 CsL2ahtgPcRZZK8mdjfmTIr+tt+eVER1AVa82ODRSmSBri5KtS/FPNgZC U3PNKZSSUSiTXoVSUzClt2bFReFAH4ASDZQnx+06UAfDBUUTwkvnbLEqR wMQoh8RqF6BrWuu1hOEIB3pCvAY7OBKyl0UNuQwXDwiV1KfPpEzn/djQ3 BEpSEn2iUcERYEuEE+1FGZ7sVKoO3IQAxqPQUlx0obxcx0A0bnzarY5Nn WwD5SGCiKmwIrrKvZAX5vo7UMyPaxv6yRvLD1jYjv263C11hvar9HCKX2 w==; X-IronPort-AV: E=McAfee;i="6500,9779,10552"; a="318438115" X-IronPort-AV: E=Sophos;i="5.96,220,1665471600"; d="scan'208";a="318438115" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Dec 2022 01:18:10 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10552"; a="623833216" X-IronPort-AV: E=Sophos;i="5.96,220,1665471600"; d="scan'208";a="623833216" Received: from aalteres-desk.fm.intel.com ([10.80.57.53]) by orsmga006.jf.intel.com with ESMTP; 06 Dec 2022 01:18:10 -0800 From: Alan Previn To: intel-gfx@lists.freedesktop.org Date: Tue, 6 Dec 2022 01:20:59 -0800 Message-Id: <20221206092100.274195-5-alan.previn.teres.alexis@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221206092100.274195-1-alan.previn.teres.alexis@intel.com> References: <20221206092100.274195-1-alan.previn.teres.alexis@intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH v2 4/5] drm/i915/guc: Rename GuC log relay debugfs descriptively 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: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" GuC log relay debugfs name for the control handle vs the actual relay channel are vague. Fix them so it's obvious from the name. Signed-off-by: Alan Previn --- drivers/gpu/drm/i915/gt/uc/intel_guc_log.c | 2 +- .../drm/i915/gt/uc/intel_guc_log_debugfs.c | 22 +++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c index 6e880d9f42d4..d019c60d34e8 100644 --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c @@ -551,7 +551,7 @@ static int guc_log_relay_create(struct intel_guc_log *log) */ n_subbufs = intel_guc_log_relay_subbuf_count(log); - guc_log_relay_chan = relay_open("guc_log", + guc_log_relay_chan = relay_open("guc_log_relay_chan", dev_priv->drm.primary->debugfs_root, subbuf_size, n_subbufs, &relay_callbacks, dev_priv); diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_log_debugfs.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_log_debugfs.c index 27756640338e..feff1e606b38 100644 --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_log_debugfs.c +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_log_debugfs.c @@ -137,7 +137,7 @@ DEFINE_SIMPLE_ATTRIBUTE(guc_log_relay_subbuf_count_fops, guc_log_relay_subbuf_count_get, NULL, "%lld\n"); -static int guc_log_relay_open(struct inode *inode, struct file *file) +static int guc_log_relay_ctl_open(struct inode *inode, struct file *file) { struct intel_guc_log *log = inode->i_private; @@ -150,10 +150,10 @@ static int guc_log_relay_open(struct inode *inode, struct file *file) } static ssize_t -guc_log_relay_write(struct file *filp, - const char __user *ubuf, - size_t cnt, - loff_t *ppos) +guc_log_relay_ctl_write(struct file *filp, + const char __user *ubuf, + size_t cnt, + loff_t *ppos) { struct intel_guc_log *log = filp->private_data; int val; @@ -175,7 +175,7 @@ guc_log_relay_write(struct file *filp, return ret ?: cnt; } -static int guc_log_relay_release(struct inode *inode, struct file *file) +static int guc_log_relay_ctl_release(struct inode *inode, struct file *file) { struct intel_guc_log *log = inode->i_private; @@ -183,11 +183,11 @@ static int guc_log_relay_release(struct inode *inode, struct file *file) return 0; } -static const struct file_operations guc_log_relay_fops = { +static const struct file_operations guc_log_relay_ctl_fops = { .owner = THIS_MODULE, - .open = guc_log_relay_open, - .write = guc_log_relay_write, - .release = guc_log_relay_release, + .open = guc_log_relay_ctl_open, + .write = guc_log_relay_ctl_write, + .release = guc_log_relay_ctl_release, }; void intel_guc_log_debugfs_register(struct intel_guc_log *log, @@ -197,7 +197,7 @@ void intel_guc_log_debugfs_register(struct intel_guc_log *log, { "guc_log_dump", &guc_log_dump_fops, NULL }, { "guc_load_err_log_dump", &guc_load_err_log_dump_fops, NULL }, { "guc_log_level", &guc_log_level_fops, NULL }, - { "guc_log_relay", &guc_log_relay_fops, NULL }, + { "guc_log_relay_ctl", &guc_log_relay_ctl_fops, NULL }, { "guc_log_relay_subbuf_size", &guc_log_relay_subbuf_size_fops, NULL }, { "guc_log_relay_subbuf_count", &guc_log_relay_subbuf_count_fops, NULL }, }; From patchwork Tue Dec 6 09:21:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Previn X-Patchwork-Id: 13065598 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 CC341C352A1 for ; Tue, 6 Dec 2022 09:18:34 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C8EFF10E312; Tue, 6 Dec 2022 09:18:23 +0000 (UTC) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id 635A210E302 for ; Tue, 6 Dec 2022 09:18:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1670318291; x=1701854291; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=BZBnyq85gvK88mk4cO70dCaLgEmckouYL4n6A0Pm6L0=; b=CEtYZjr8yjFGGmwHbRAxFuqdDCoXeHpwIJxCrt8RYCNinMDllpGqsgjy 5dp4+j7qV/pGCnhhL+jzbq4CAkCPyg65WsMgrYo44ROvMIzDN2NCk8pjX GnofyQDdsG/H3b0tA0iVqzRnN7b4Mukgj+zNbMhU7t2Mclj+3gJGiYzgB EZPLuSHJnWankCHbfwopMJx5ONDmf4ouSUmMCao522a4CxABjeG7D7ZLd //qyH1eazibGm5YWwrDNL3f3sE4VwGtoir6z5bZlHxa1ILsXzL5oHOHGE +nUQf5CKRIbMYG6G4Yt1rzLwgkw62/qumPxPqMkrVllsYvimjyhsoGP6S A==; X-IronPort-AV: E=McAfee;i="6500,9779,10552"; a="318438117" X-IronPort-AV: E=Sophos;i="5.96,220,1665471600"; d="scan'208";a="318438117" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Dec 2022 01:18:10 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10552"; a="623833217" X-IronPort-AV: E=Sophos;i="5.96,220,1665471600"; d="scan'208";a="623833217" Received: from aalteres-desk.fm.intel.com ([10.80.57.53]) by orsmga006.jf.intel.com with ESMTP; 06 Dec 2022 01:18:10 -0800 From: Alan Previn To: intel-gfx@lists.freedesktop.org Date: Tue, 6 Dec 2022 01:21:00 -0800 Message-Id: <20221206092100.274195-6-alan.previn.teres.alexis@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221206092100.274195-1-alan.previn.teres.alexis@intel.com> References: <20221206092100.274195-1-alan.previn.teres.alexis@intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH v2 5/5] drm/i915/guc: Move guc_log_relay_chan debugfs path to uc 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: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" All other GuC Relay Logging debugfs handles including recent additions are under the 'i915/gt/uc/path' so let's also move 'guc_log_relay_chan' to its proper home. Signed-off-by: Alan Previn Reviewed-by: Ashutosh Dixit --- drivers/gpu/drm/i915/gt/uc/intel_guc.h | 2 ++ drivers/gpu/drm/i915/gt/uc/intel_guc_log.c | 2 +- drivers/gpu/drm/i915/gt/uc/intel_uc_debugfs.c | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc.h b/drivers/gpu/drm/i915/gt/uc/intel_guc.h index bb4dfe707a7d..f5394d12c3dd 100644 --- a/drivers/gpu/drm/i915/gt/uc/intel_guc.h +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc.h @@ -41,6 +41,8 @@ struct intel_guc { struct intel_guc_slpc slpc; /** @capture: the error-state-capture module's data and objects */ struct intel_guc_state_capture *capture; + /** @dbgfs_node: the debugfs path for guc file handles */ + struct dentry *dbgfs_node; /** @sched_engine: Global engine used to submit requests to GuC */ struct i915_sched_engine *sched_engine; diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c index d019c60d34e8..2f1825f367bf 100644 --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_log.c @@ -552,7 +552,7 @@ static int guc_log_relay_create(struct intel_guc_log *log) n_subbufs = intel_guc_log_relay_subbuf_count(log); guc_log_relay_chan = relay_open("guc_log_relay_chan", - dev_priv->drm.primary->debugfs_root, + guc->dbgfs_node, subbuf_size, n_subbufs, &relay_callbacks, dev_priv); if (!guc_log_relay_chan) { diff --git a/drivers/gpu/drm/i915/gt/uc/intel_uc_debugfs.c b/drivers/gpu/drm/i915/gt/uc/intel_uc_debugfs.c index 284d6fbc2d08..2f93cc4e408a 100644 --- a/drivers/gpu/drm/i915/gt/uc/intel_uc_debugfs.c +++ b/drivers/gpu/drm/i915/gt/uc/intel_uc_debugfs.c @@ -54,6 +54,8 @@ void intel_uc_debugfs_register(struct intel_uc *uc, struct dentry *gt_root) if (IS_ERR(root)) return; + uc->guc.dbgfs_node = root; + intel_gt_debugfs_register_files(root, files, ARRAY_SIZE(files), uc); intel_guc_debugfs_register(&uc->guc, root);