FAILED: patch "[PATCH] drm/i915/power: fix size for for_each_set_bit() in abox" failed to apply to 6.12-stable tree
[email protected]
maintainerThe patch below does not apply to the 6.12-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.12.y
git checkout FETCH_HEAD
git cherry-pick -x cfa7b7659757f8d0fc4914429efa90d0d2577dd7
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2025091354-plenty-unlined-c98e@gregkh' --subject-prefix 'PATCH 6.12.y' HEAD^..
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From cfa7b7659757f8d0fc4914429efa90d0d2577dd7 Mon Sep 17 00:00:00 2001
From: Jani Nikula <[email protected]>
Date: Fri, 5 Sep 2025 13:41:49 +0300
Subject: [PATCH] drm/i915/power: fix size for for_each_set_bit() in abox
iteration
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
for_each_set_bit() expects size to be in bits, not bytes. The abox mask iteration uses bytes, but it works by coincidence, because the local variable holding the mask is unsigned long, and the mask only ever has bit 2 as the highest bit. Using a smaller type could lead to subtle and very hard to track bugs.
drivers/gpu/drm/i915/display/intel_display_power.c +3 -3
@@ -1172,7 +1172,7 @@ static void icl_mbus_init(struct intel_display *display)if (DISPLAY_VER (display) ==12 ) abox_regs |=BIT (0 ); -for_each_set_bit (i, &abox_regs,sizeof (abox_regs)) +for_each_set_bit (i, &abox_regs,BITS_PER_TYPE (abox_regs))intel_de_rmw (display,MBUS_ABOX_CTL (i), mask, val); }
@@ -1629,11 +1629,11 @@ static void tgl_bw_buddy_init(struct intel_display *display)if (table[config].page_mask ==0 ) {drm_dbg_kms (display->drm,"Unknown memory configuration; disabling address buddy logic.\n" ); -for_each_set_bit (i, &abox_mask,sizeof (abox_mask)) +for_each_set_bit (i, &abox_mask,BITS_PER_TYPE (abox_mask))intel_de_write (display,BW_BUDDY_CTL (i),BW_BUDDY_DISABLE ); }else { -for_each_set_bit (i, &abox_mask,sizeof (abox_mask)) { +for_each_set_bit (i, &abox_mask,BITS_PER_TYPE (abox_mask)) {intel_de_write (display,BW_BUDDY_PAGE_MASK (i), table[config].page_mask);
Sasha Levin
maintainerPATCH 1/1 drm/i915/power: fix size for for_each_set_bit() in abox iteration
From: Jani Nikula <[email protected]>
[ Upstream commit cfa7b7659757f8d0fc4914429efa90d0d2577dd7 ]
for_each_set_bit() expects size to be in bits, not bytes. The abox mask iteration uses bytes, but it works by coincidence, because the local variable holding the mask is unsigned long, and the mask only ever has bit 2 as the highest bit. Using a smaller type could lead to subtle and very hard to track bugs.
--- drivers/gpu/drm/i915/display/intel_display_power.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/display/intel_display_power.c +3 -3
@@ -1150,7 +1150,7 @@ static void icl_mbus_init(struct drm_i915_private *dev_priv)if (DISPLAY_VER (dev_priv) ==12 ) abox_regs |=BIT (0 ); -for_each_set_bit (i, &abox_regs,sizeof (abox_regs)) +for_each_set_bit (i, &abox_regs,BITS_PER_TYPE (abox_regs))intel_de_rmw (dev_priv,MBUS_ABOX_CTL (i), mask, val); }
@@ -1603,11 +1603,11 @@ static void tgl_bw_buddy_init(struct drm_i915_private *dev_priv)if (table[config].page_mask ==0 ) {drm_dbg (&dev_priv->drm,"Unknown memory configuration; disabling address buddy logic.\n" ); -for_each_set_bit (i, &abox_mask,sizeof (abox_mask)) +for_each_set_bit (i, &abox_mask,BITS_PER_TYPE (abox_mask))intel_de_write (dev_priv,BW_BUDDY_CTL (i),BW_BUDDY_DISABLE ); }else { -for_each_set_bit (i, &abox_mask,sizeof (abox_mask)) { +for_each_set_bit (i, &abox_mask,BITS_PER_TYPE (abox_mask)) {intel_de_write (dev_priv,BW_BUDDY_PAGE_MASK (i), table[config].page_mask);
Signature · 1 line
2.51.0