Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3516905pxf; Mon, 15 Mar 2021 11:17:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxZnjFFGsFmB71O+C5cxWGYIaV4fYqcgbe7tGXqW8vJfyBHNi+gNdiesiykwZhAJPHkXwH/ X-Received: by 2002:a17:906:f896:: with SMTP id lg22mr24557689ejb.124.1615832243314; Mon, 15 Mar 2021 11:17:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615832243; cv=none; d=google.com; s=arc-20160816; b=I5nE/El7ZvPFds+fil9RZb1McFENQfJojWK1Ss+QeBQgffNwZnunig6hZ73IHVsEUS R48UeXDIlIZErqjEcFj4yiiXFstrdk5odI7mhPvv2LaepOAv24tluoxah2vwiAPhfB88 HIVUO2lbJ/7DvNdoEfjufK/1GmpIL4vyl5OotO0m7w8GdKNKOj64X6IpFL60xTGFHwJu 4YereiclFUyI9neAiOEVCJ4X2+38uATt8k3kT4SB5iy0ZAXis7y6cdYJ8pVaYfE6ZUB7 IPq4rCQnsykDYcsxxl+Xw05qXaRmy61VBOf1OmxKD7UeRaCRzD7x4dk+JTfRPOx7uNwG VbDA== 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=UZmHtJ4Efr0Sdrlu70ikAEBSx8WkLqBzO9SR0Q+mS/I=; b=r0AaqtfsyLh2I0kHzKFF0Uh6LFpjDoZnhfeoRvmcMn8jU2+DW0vBCgxw2gIU/ToqbO +ClbiI6XFP6Iqkb/ZRIF2xjszc2lwwUTmMkJS+FG8INeS1EsZr5YzEJhonR78yA0bllu dW5rhn1l4FLz7CEIkx783smR7Ns3EKyETbpAM9mIIqxrurhMfAtz8wCqsg8X4PvkPRaa 36cDOEvRjfBf/GQhWikqPUdTfPtAbGMoqFDGwtHahiPlpMDJwz0KzBgQmgLCX2bDhKEd rmu/PeBU9FOBnOYE+M9SEpL1Pbg9SM/YQlVrpOFQLdQ3NGnqPs2PhnQCwB+NpTdabd34 Q8og== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="yy/2G+rx"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hr14si12277618ejc.394.2021.03.15.11.17.00; Mon, 15 Mar 2021 11:17:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="yy/2G+rx"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S236907AbhCOOQ3 (ORCPT + 99 others); Mon, 15 Mar 2021 10:16:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:37836 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232645AbhCON7Y (ORCPT ); Mon, 15 Mar 2021 09:59:24 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7F90A64F34; Mon, 15 Mar 2021 13:59:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816741; bh=nEhMUSXITP2LzNXPsSS6OHxbgy/5HGkC3u513vhGvvg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yy/2G+rxGbvDZ7A7QsN2uJ2zvO+P/tKDDca6hlh13PoSz6ixuqi0v24dvuP4rQTsH XDaZNAzWTOXB55BhLx2UixANw1kLGrYzcpw3/ZnLEpX17oHahwXXYC9QWhwFZxgfHF g6JszdmDwexIONkRORatq5SXsqUVCTSgv6fBOLUw= From: gregkh@linuxfoundation.org To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Holger=20Hoffst=C3=A4tte?= , Alex Deucher Subject: [PATCH 5.10 087/290] drm/amd/display: Fix nested FPU context in dcn21_validate_bandwidth() Date: Mon, 15 Mar 2021 14:53:00 +0100 Message-Id: <20210315135544.863621681@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135541.921894249@linuxfoundation.org> References: <20210315135541.921894249@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Greg Kroah-Hartman From: Holger Hoffstätte commit 15e8b95d5f7509e0b09289be8c422c459c9f0412 upstream. Commit 41401ac67791 added FPU wrappers to dcn21_validate_bandwidth(), which was correct. Unfortunately a nested function alredy contained DC_FP_START()/DC_FP_END() calls, which results in nested FPU context enter/exit and complaints by kernel_fpu_begin_mask(). This can be observed e.g. with 5.10.20, which backported 41401ac67791 and now emits the following warning on boot: WARNING: CPU: 6 PID: 858 at arch/x86/kernel/fpu/core.c:129 kernel_fpu_begin_mask+0xa5/0xc0 Call Trace: dcn21_calculate_wm+0x47/0xa90 [amdgpu] dcn21_validate_bandwidth_fp+0x15d/0x2b0 [amdgpu] dcn21_validate_bandwidth+0x29/0x40 [amdgpu] dc_validate_global_state+0x3c7/0x4c0 [amdgpu] The warning is emitted due to the additional DC_FP_START/END calls in patch_bounding_box(), which is inlined into dcn21_calculate_wm(), its only caller. Removing the calls brings the code in line with dcn20 and makes the warning disappear. Fixes: 41401ac67791 ("drm/amd/display: Add FPU wrappers to dcn21_validate_bandwidth()") Signed-off-by: Holger Hoffstätte Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c | 4 ---- 1 file changed, 4 deletions(-) --- a/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c +++ b/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c @@ -1058,8 +1058,6 @@ static void patch_bounding_box(struct dc { int i; - DC_FP_START(); - if (dc->bb_overrides.sr_exit_time_ns) { for (i = 0; i < WM_SET_COUNT; i++) { dc->clk_mgr->bw_params->wm_table.entries[i].sr_exit_time_us = @@ -1084,8 +1082,6 @@ static void patch_bounding_box(struct dc dc->bb_overrides.dram_clock_change_latency_ns / 1000.0; } } - - DC_FP_END(); } void dcn21_calculate_wm(