Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2535145imu; Thu, 29 Nov 2018 06:32:28 -0800 (PST) X-Google-Smtp-Source: AFSGD/U6fUVQv9XcDvMZvtJiNN9VPvJKJ37DOYXLDeTyTOYvpIAyyiqaamf47a7BNZGdJcWC7eAQ X-Received: by 2002:a17:902:6b46:: with SMTP id g6mr1699263plt.21.1543501948019; Thu, 29 Nov 2018 06:32:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543501947; cv=none; d=google.com; s=arc-20160816; b=HQfL2wMGpYY3OQQbgLsWGSmo5kF0cz4wYLWGdh0syfv1tiEXumAd7/O+VnatTSVZQu zylxgrBnMfiVuEN4x3Q0q2Jry76qYdz393XpcdSLKXx7WjJ8CR4oPYTwB5VjMm6pDiZg TMEAIPi2HXjeYmxbkFR4aaCCMd/Nqit17GjgnuT9qX8tnccNc5DbJj5QyvzYTLdMJAuG oAHtMAC5mzyHsVIvVn0xbSxyVN1hNXO9tWdJpXz1R6xI57ev3QC0MufYLCtU53RKoUNG Hk1zED+i7tjgvI9R9DP5RZrVrw5HJteZIj3HpD4J07hDrrAau0KxZkzXYVyporbn/ZJH qrWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=bqpI4KOIfKq8gCsUYy7CLYVTgLGzrzUjGWqJbZca9PA=; b=oSwiTU2IfLCl7Qa04RXVT/861/gfCcTvTsvSrz3XeUJZjFzU8VXCJyfBfjZM5PLcc7 becyFhU2CPafpzisfF6wcrRsVHbO9FXAiG1AWCWKP1eeNJkgamHxeWxXAs/yy6TXzGAB M/YPUkvtJVcYZoikdrhQWmLsSQUwb0GsefNbp56lXlgJgerjdtuTwEoYChxMaeoBw2wY JnKY92BTCDqCtHC30lbT/tUaggRHmHBYN3IpT2MqgVoAA843YNny5KaZBYVhNavGN6nS f9lah0aH4SjeMQehStL5i2IIszMi5iL531xnP/AxO2Wf2qP5tiMcrZG2jJjKdalwdyzC +F9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=H3DboS14; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g33si2111410pgm.426.2018.11.29.06.32.12; Thu, 29 Nov 2018 06:32:27 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=H3DboS14; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388588AbeK3Bf1 (ORCPT + 99 others); Thu, 29 Nov 2018 20:35:27 -0500 Received: from mail.kernel.org ([198.145.29.99]:37290 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728961AbeK3Bf0 (ORCPT ); Thu, 29 Nov 2018 20:35:26 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 388452145D; Thu, 29 Nov 2018 14:29:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543501793; bh=2wVTB3HEqjxgN62mX+fPjlfCcX9BzTYZncKP8I2w+qo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=H3DboS14YzYiDhCPE7sa2ZTMCF8CYHk7uVIIH45F3STjWzwhdS8rOUmTQiZg9a8FX uXF+ybk+seQ+uqb0ory3M1Fe/mm8HfytPGIMvgcqDlNDXD3XaLwLOuN2vnT00dflm0 HFfldR4CzG+J50LbU+DRrAZQ0pxaFCVE4Sg4Jar4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Joerg Roedel , Felix Kuehling , Alex Deucher Subject: [PATCH 4.19 043/110] drm/amdgpu: Fix oops when pp_funcs->switch_power_profile is unset Date: Thu, 29 Nov 2018 15:12:14 +0100 Message-Id: <20181129135923.011397798@linuxfoundation.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181129135921.231283053@linuxfoundation.org> References: <20181129135921.231283053@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Felix Kuehling commit 919a52fc4ca137c871f295224507fa3401e08472 upstream. On Vega20 and other pre-production GPUs, powerplay is not enabled yet. Check for NULL pointers before calling pp_funcs function pointers. Also affects Kaveri. CC: Joerg Roedel Signed-off-by: Felix Kuehling Reviewed-by: Alex Deucher Tested-by: Joerg Roedel Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c @@ -496,8 +496,11 @@ void amdgpu_amdkfd_set_compute_idle(stru { struct amdgpu_device *adev = (struct amdgpu_device *)kgd; - amdgpu_dpm_switch_power_profile(adev, - PP_SMC_POWER_PROFILE_COMPUTE, !idle); + if (adev->powerplay.pp_funcs && + adev->powerplay.pp_funcs->switch_power_profile) + amdgpu_dpm_switch_power_profile(adev, + PP_SMC_POWER_PROFILE_COMPUTE, + !idle); } bool amdgpu_amdkfd_is_kfd_vmid(struct amdgpu_device *adev, u32 vmid)