All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: stable@vger.kernel.org
Cc: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	patches@lists.linux.dev,
	"John Harrison" <John.C.Harrison@Intel.com>,
	"Chris Wilson" <chris@chris-wilson.co.uk>,
	"Joonas Lahtinen" <joonas.lahtinen@linux.intel.com>,
	"Jani Nikula" <jani.nikula@linux.intel.com>,
	"Rodrigo Vivi" <rodrigo.vivi@intel.com>,
	"Tvrtko Ursulin" <tvrtko.ursulin@linux.intel.com>,
	intel-gfx@lists.freedesktop.org,
	"Jouni Högander" <jouni.hogander@intel.com>,
	"Daniele Ceraolo Spurio" <daniele.ceraolospurio@intel.com>,
	"Jani Nikula" <jani.nikula@intel.com>
Subject: [PATCH 4.19 36/39] drm/i915: Dont use BAR mappings for ring buffers with LLC
Date: Wed, 15 Mar 2023 13:12:50 +0100	[thread overview]
Message-ID: <20230315115722.581384565@linuxfoundation.org> (raw)
In-Reply-To: <20230315115721.234756306@linuxfoundation.org>

From: John Harrison <John.C.Harrison@Intel.com>

commit 85636167e3206c3fbd52254fc432991cc4e90194 upstream.

Direction from hardware is that ring buffers should never be mapped
via the BAR on systems with LLC. There are too many caching pitfalls
due to the way BAR accesses are routed. So it is safest to just not
use it.

Signed-off-by: John Harrison <John.C.Harrison@Intel.com>
Fixes: 9d80841ea4c9 ("drm/i915: Allow ringbuffers to be bound anywhere")
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Cc: <stable@vger.kernel.org> # v4.9+
Tested-by: Jouni Högander <jouni.hogander@intel.com>
Reviewed-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230216011101.1909009-3-John.C.Harrison@Intel.com
(cherry picked from commit 65c08339db1ada87afd6cfe7db8e60bb4851d919)
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: John Harrison <John.C.Harrison@Intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/gpu/drm/i915/intel_ringbuffer.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/gpu/drm/i915/intel_ringbuffer.c
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
@@ -1083,7 +1083,7 @@ int intel_ring_pin(struct intel_ring *ri
 	if (unlikely(ret))
 		return ret;
 
-	if (i915_vma_is_map_and_fenceable(vma))
+	if (i915_vma_is_map_and_fenceable(vma) && !HAS_LLC(vma->vm->i915))
 		addr = (void __force *)i915_vma_pin_iomap(vma);
 	else
 		addr = i915_gem_object_pin_map(vma->obj, map);
@@ -1118,7 +1118,7 @@ void intel_ring_unpin(struct intel_ring
 	/* Discard any unused bytes beyond that submitted to hw. */
 	intel_ring_reset(ring, ring->tail);
 
-	if (i915_vma_is_map_and_fenceable(ring->vma))
+	if (i915_vma_is_map_and_fenceable(ring->vma) && !HAS_LLC(ring->vma->vm->i915))
 		i915_vma_unpin_iomap(ring->vma);
 	else
 		i915_gem_object_unpin_map(ring->vma->obj);



WARNING: multiple messages have this Message-ID (diff)
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: stable@vger.kernel.org
Cc: Jani Nikula <jani.nikula@intel.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	intel-gfx@lists.freedesktop.org, patches@lists.linux.dev,
	Chris Wilson <chris@chris-wilson.co.uk>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>
Subject: [Intel-gfx] [PATCH 4.19 36/39] drm/i915: Dont use BAR mappings for ring buffers with LLC
Date: Wed, 15 Mar 2023 13:12:50 +0100	[thread overview]
Message-ID: <20230315115722.581384565@linuxfoundation.org> (raw)
In-Reply-To: <20230315115721.234756306@linuxfoundation.org>

From: John Harrison <John.C.Harrison@Intel.com>

commit 85636167e3206c3fbd52254fc432991cc4e90194 upstream.

Direction from hardware is that ring buffers should never be mapped
via the BAR on systems with LLC. There are too many caching pitfalls
due to the way BAR accesses are routed. So it is safest to just not
use it.

Signed-off-by: John Harrison <John.C.Harrison@Intel.com>
Fixes: 9d80841ea4c9 ("drm/i915: Allow ringbuffers to be bound anywhere")
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Cc: <stable@vger.kernel.org> # v4.9+
Tested-by: Jouni Högander <jouni.hogander@intel.com>
Reviewed-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230216011101.1909009-3-John.C.Harrison@Intel.com
(cherry picked from commit 65c08339db1ada87afd6cfe7db8e60bb4851d919)
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: John Harrison <John.C.Harrison@Intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/gpu/drm/i915/intel_ringbuffer.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/gpu/drm/i915/intel_ringbuffer.c
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
@@ -1083,7 +1083,7 @@ int intel_ring_pin(struct intel_ring *ri
 	if (unlikely(ret))
 		return ret;
 
-	if (i915_vma_is_map_and_fenceable(vma))
+	if (i915_vma_is_map_and_fenceable(vma) && !HAS_LLC(vma->vm->i915))
 		addr = (void __force *)i915_vma_pin_iomap(vma);
 	else
 		addr = i915_gem_object_pin_map(vma->obj, map);
@@ -1118,7 +1118,7 @@ void intel_ring_unpin(struct intel_ring
 	/* Discard any unused bytes beyond that submitted to hw. */
 	intel_ring_reset(ring, ring->tail);
 
-	if (i915_vma_is_map_and_fenceable(ring->vma))
+	if (i915_vma_is_map_and_fenceable(ring->vma) && !HAS_LLC(ring->vma->vm->i915))
 		i915_vma_unpin_iomap(ring->vma);
 	else
 		i915_gem_object_unpin_map(ring->vma->obj);



  parent reply	other threads:[~2023-03-15 12:16 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-15 12:12 [PATCH 4.19 00/39] 4.19.278-rc1 review Greg Kroah-Hartman
2023-03-15 12:12 ` [PATCH 4.19 01/39] fs: prevent out-of-bounds array speculation when closing a file descriptor Greg Kroah-Hartman
2023-03-15 12:12 ` [PATCH 4.19 02/39] x86/CPU/AMD: Disable XSAVES on AMD family 0x17 Greg Kroah-Hartman
2023-03-15 12:12 ` [PATCH 4.19 03/39] ext4: fix RENAME_WHITEOUT handling for inline directories Greg Kroah-Hartman
2023-03-15 12:12 ` [PATCH 4.19 04/39] ext4: fix another off-by-one fsmap error on 1k block filesystems Greg Kroah-Hartman
2023-03-15 12:12 ` [PATCH 4.19 05/39] ext4: move where set the MAY_INLINE_DATA flag is set Greg Kroah-Hartman
2023-03-15 12:12 ` [PATCH 4.19 06/39] ext4: fix WARNING in ext4_update_inline_data Greg Kroah-Hartman
2023-03-15 12:12 ` [PATCH 4.19 07/39] ext4: zero i_disksize when initializing the bootloader inode Greg Kroah-Hartman
2023-03-15 12:12 ` [PATCH 4.19 08/39] nfc: change order inside nfc_se_io error path Greg Kroah-Hartman
2023-03-15 12:12 ` [PATCH 4.19 09/39] udf: Explain handling of load_nls() failure Greg Kroah-Hartman
2023-03-15 12:12 ` [PATCH 4.19 10/39] udf: reduce leakage of blocks related to named streams Greg Kroah-Hartman
2023-03-15 12:12 ` [PATCH 4.19 11/39] udf: Remove pointless union in udf_inode_info Greg Kroah-Hartman
2023-03-15 12:12 ` [PATCH 4.19 12/39] udf: Preserve link count of system files Greg Kroah-Hartman
2023-03-15 12:12 ` [PATCH 4.19 13/39] udf: Detect system inodes linked into directory hierarchy Greg Kroah-Hartman
2023-03-15 12:12 ` [PATCH 4.19 14/39] ARM: dts: exynos: Fix language typo and indentation Greg Kroah-Hartman
2023-03-15 12:12 ` [PATCH 4.19 15/39] ARM: dts: exynos: Override thermal by label in Exynos4210 Greg Kroah-Hartman
2023-03-15 12:12 ` [PATCH 4.19 16/39] ARM: dts: exynos: correct TMU phandle " Greg Kroah-Hartman
2023-03-15 12:12 ` [PATCH 4.19 17/39] ARM: dts: exynos: Add all CPUs in cooling maps Greg Kroah-Hartman
2023-03-15 12:12 ` [PATCH 4.19 18/39] ARM: dts: exynos: Move pmu and timer nodes out of soc Greg Kroah-Hartman
2023-03-15 12:12 ` [PATCH 4.19 19/39] ARM: dts: exynos: Override thermal by label in Exynos5250 Greg Kroah-Hartman
2023-03-15 12:12 ` [PATCH 4.19 20/39] ARM: dts: exynos: correct TMU phandle " Greg Kroah-Hartman
2023-03-15 12:12 ` [PATCH 4.19 21/39] kbuild: fix false-positive need-builtin calculation Greg Kroah-Hartman
2023-03-15 12:12 ` [PATCH 4.19 22/39] kbuild: generate modules.order only in directories visited by obj-y/m Greg Kroah-Hartman
2023-03-15 12:12 ` [PATCH 4.19 23/39] ARM: dts: exynos: Add GPU thermal zone cooling maps for Odroid XU3/XU4/HC1 Greg Kroah-Hartman
2023-03-15 12:12 ` [PATCH 4.19 24/39] ARM: dts: exynos: correct TMU phandle in Odroid HC1 Greg Kroah-Hartman
2023-03-15 12:12 ` [PATCH 4.19 25/39] ARM: dts: exynos: correct TMU phandle in Odroid XU3 family Greg Kroah-Hartman
2023-03-15 12:12 ` [PATCH 4.19 26/39] scsi: core: Remove the /proc/scsi/${proc_name} directory earlier Greg Kroah-Hartman
2023-03-15 12:12 ` [PATCH 4.19 27/39] Revert "spi: mt7621: Fix an error message in mt7621_spi_probe()" Greg Kroah-Hartman
2023-03-15 12:12 ` [PATCH 4.19 28/39] clk: qcom: mmcc-apq8084: remove spdm clocks Greg Kroah-Hartman
2023-03-15 12:12 ` [PATCH 4.19 29/39] MIPS: Fix a compilation issue Greg Kroah-Hartman
2023-03-15 12:12 ` [PATCH 4.19 30/39] alpha: fix R_ALPHA_LITERAL reloc for large modules Greg Kroah-Hartman
2023-03-15 12:12 ` [PATCH 4.19 31/39] macintosh: windfarm: Use unsigned type for 1-bit bitfields Greg Kroah-Hartman
2023-03-15 12:12 ` [PATCH 4.19 32/39] PCI: Add SolidRun vendor ID Greg Kroah-Hartman
2023-03-15 12:12 ` [PATCH 4.19 33/39] PCI: Avoid FLR for SolidRun SNET DPU rev 1 Greg Kroah-Hartman
2023-03-15 12:12 ` [PATCH 4.19 34/39] media: ov5640: Fix analogue gain control Greg Kroah-Hartman
2023-03-15 12:12 ` [PATCH 4.19 35/39] tipc: improve function tipc_wait_for_cond() Greg Kroah-Hartman
2023-03-15 12:12 ` Greg Kroah-Hartman [this message]
2023-03-15 12:12   ` [Intel-gfx] [PATCH 4.19 36/39] drm/i915: Dont use BAR mappings for ring buffers with LLC Greg Kroah-Hartman
2023-03-15 12:12 ` [PATCH 4.19 37/39] cgroup/cpuset: Change cpuset_rwsem and hotplug lock order Greg Kroah-Hartman
2023-03-15 12:12 ` [PATCH 4.19 38/39] cgroup: Fix threadgroup_rwsem <-> cpus_read_lock() deadlock Greg Kroah-Hartman
2023-03-15 12:12 ` [PATCH 4.19 39/39] cgroup: Add missing cpus_read_lock() to cgroup_attach_task_all() Greg Kroah-Hartman
2023-03-15 14:12 ` [PATCH 4.19 00/39] 4.19.278-rc1 review Chris Paterson
2023-03-15 14:24   ` Chris Paterson
2023-03-16  7:48   ` Greg Kroah-Hartman
2023-03-15 14:32 ` Guenter Roeck
2023-03-15 15:44 ` Daniel Díaz
2023-03-15 15:59   ` Guenter Roeck
2023-03-15 16:35     ` Greg Kroah-Hartman
2023-03-15 16:28   ` Daniel Díaz
2023-03-16  7:48     ` Greg Kroah-Hartman
2023-03-16  7:47   ` Greg Kroah-Hartman
2023-03-16  0:04 ` Shuah Khan
2023-03-16  8:51 ` Missing patches in 4.19? was " Pavel Machek
2023-03-16  9:34   ` Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230315115722.581384565@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=John.C.Harrison@Intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=daniele.ceraolospurio@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@intel.com \
    --cc=jani.nikula@linux.intel.com \
    --cc=joonas.lahtinen@linux.intel.com \
    --cc=jouni.hogander@intel.com \
    --cc=patches@lists.linux.dev \
    --cc=rodrigo.vivi@intel.com \
    --cc=stable@vger.kernel.org \
    --cc=tvrtko.ursulin@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.