Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp4297469pxb; Mon, 21 Feb 2022 17:16:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJxQw8hDlEUtxqlhtBcjEOO4+3+Ypdg9AK3GPX4UrNoCHUSk28Bmn9HgaMiwS0fuds2uXyyy X-Received: by 2002:a63:a509:0:b0:36c:6a53:7cd with SMTP id n9-20020a63a509000000b0036c6a5307cdmr18021601pgf.403.1645492567368; Mon, 21 Feb 2022 17:16:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645492567; cv=none; d=google.com; s=arc-20160816; b=eahNgXxMSdJ9K3HNBxGmkQ1Xbiun1QXYIn1mHcABnpTYItRKctgVikgQsNxl5qkAjW oFPZiCggxOgV6/X284ooqQRuy83/3MrNJttK/YYa6fWTZSxDpUolMLKzzzg8fuGHmh96 KSV17hGmZyqfdrzGzQ4JNve5E6Oz7FbpUfN2XQLP2t/+HBvR4XHPiEcFoZtgGgksCy2c w4ZfJPZOlqcSluigMOQBkQelxOWFm7yd2joJLzjDtTg6Fd18WJ7m2HhoXQW9KBCiujAW AgUwTAhpvWnWfYubN0rawS05QbT8UQGlDrbIglJwaHJ2lEDMUUfqGdD/iaR3RC4ruhV6 OzFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=CxMgqM9k5IkPxjiAWNTsAgEve6ZWk57V7rseKSldhMM=; b=LSFGwQZRpQKjOVxoOr4yhDibYyd5Nt4ow0LckyYSW0Brlkpk2rLL3vtptlyJLi/Tuh Yl9QOrOu0Rr2Y7GMm+WlGvySeTp8k0t3l3u2W70fXLt6GvhAk3UveN0QoilSpNySFEXu Pfgv7DNxO6aFFhesBtg8/uqFLmmBYjHsIZoFqvzEoP5hAYPfYr8sA/WB4dutcdiksgYO WTRpoDtWX8Gx5NvgW+8aLLtwO8dwRukbgKKQ0F2BnBmX1BZW3iFyL7LPh59QC8ofb4yo w5rV668X/7N5i/L8w536Z7JeNemyw2DMVTQlK73xdSD2+HcEH6lTQ+Pjq2j2/1/7Qvo8 deQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Ly51+vqm; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ch22si759444pjb.183.2022.02.21.17.15.52; Mon, 21 Feb 2022 17:16:07 -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=@linuxfoundation.org header.s=korg header.b=Ly51+vqm; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353742AbiBUJ5q (ORCPT + 99 others); Mon, 21 Feb 2022 04:57:46 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:43536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352593AbiBUJrh (ORCPT ); Mon, 21 Feb 2022 04:47:37 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1595842EF4; Mon, 21 Feb 2022 01:20:11 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A05B260EB3; Mon, 21 Feb 2022 09:20:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AFE5BC340EC; Mon, 21 Feb 2022 09:20:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1645435210; bh=MCHtTJpifQkGD42L/6e6W90C2fxMXP0SRmYINnpTOuc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ly51+vqmFARuLaz0v2jxV8/hwi3ZymoLjez+TDAdhOo95xDJnQgQ5gq5i2QSg2Gw7 nmbut2GZfRhysJ6nPL9PFiFrOaKn0yUu3rBCsQWu3X50jc3OeBrSobK/VNojU3Gwwo swcl1xmtzue89XkRvs+Sn5a8G2l2UDsS4ft5V3Po= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= , Jani Nikula , Tvrtko Ursulin Subject: [PATCH 5.16 084/227] drm/i915: Fix dbuf slice config lookup Date: Mon, 21 Feb 2022 09:48:23 +0100 Message-Id: <20220221084937.660836840@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220221084934.836145070@linuxfoundation.org> References: <20220221084934.836145070@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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_PASS,T_SCC_BODY_TEXT_LINE 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 From: Ville Syrjälä commit 698bef8ff5d2edea5d1c9d6e5adf1bfed1e8a106 upstream. Apparently I totally fumbled the loop condition when I removed the ARRAY_SIZE() stuff from the dbuf slice config lookup. Comparing the loop index with the active_pipes bitmask is utter nonsense, what we want to do is check to see if the mask is zero or not. Note that the code actually ended up working correctly despite the fumble, up until commit eef173954432 ("drm/i915: Allow !join_mbus cases for adlp+ dbuf configuration") when things broke for real. Cc: stable@vger.kernel.org Fixes: 05e8155afe35 ("drm/i915: Use a sentinel to terminate the dbuf slice arrays") Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220207132700.481-1-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula (cherry picked from commit a28fde308c3c1c174249ff9559b57f24e6850086) Signed-off-by: Tvrtko Ursulin Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/i915/intel_pm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/gpu/drm/i915/intel_pm.c +++ b/drivers/gpu/drm/i915/intel_pm.c @@ -4860,7 +4860,7 @@ static u8 compute_dbuf_slices(enum pipe { int i; - for (i = 0; i < dbuf_slices[i].active_pipes; i++) { + for (i = 0; dbuf_slices[i].active_pipes != 0; i++) { if (dbuf_slices[i].active_pipes == active_pipes && dbuf_slices[i].join_mbus == join_mbus) return dbuf_slices[i].dbuf_mask[pipe];