From patchwork Tue Dec 1 08:52:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 336780 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E165CC64E7A for ; Tue, 1 Dec 2020 09:20:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 772062065C for ; Tue, 1 Dec 2020 09:20:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="YvnID7FT" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389413AbgLAJU2 (ORCPT ); Tue, 1 Dec 2020 04:20:28 -0500 Received: from mail.kernel.org ([198.145.29.99]:46912 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389439AbgLAJJZ (ORCPT ); Tue, 1 Dec 2020 04:09:25 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 4FDE62224A; Tue, 1 Dec 2020 09:08:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1606813724; bh=pU4+iLvfEPqb4ShgmgqBEAl5Mh4SYEhmO3+yTyncc/Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YvnID7FTi8uUCZOvvqwTGttqvtfyiW4wCFmgaA3m75IpO0Woao57J2hQhdkRqyi2S FGQdX/AUzhPH3y+/IqZcHvnfsi6AGDMNXR523VEAD9WwpH+UGIuXDL3lmJ4pEEcmW/ 5gFi0umLhXX5MV2K5ndtOaAjJNLEnOR7QPbmrBQ8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kenneth Feng , Alex Deucher Subject: [PATCH 5.9 037/152] drm/amd/amdgpu: fix null pointer in runtime pm Date: Tue, 1 Dec 2020 09:52:32 +0100 Message-Id: <20201201084716.744009594@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201201084711.707195422@linuxfoundation.org> References: <20201201084711.707195422@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Kenneth Feng commit 7acc79eb5f78d3d1aa5dd21fc0a0329f1b7f2be5 upstream. fix the null pointer issue when runtime pm is triggered. Signed-off-by: Kenneth Feng Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -4593,7 +4593,7 @@ int amdgpu_device_baco_enter(struct drm_ if (!amdgpu_device_supports_baco(adev->ddev)) return -ENOTSUPP; - if (ras && ras->supported) + if (ras && ras->supported && adev->nbio.funcs->enable_doorbell_interrupt) adev->nbio.funcs->enable_doorbell_interrupt(adev, false); return amdgpu_dpm_baco_enter(adev); @@ -4612,7 +4612,7 @@ int amdgpu_device_baco_exit(struct drm_d if (ret) return ret; - if (ras && ras->supported) + if (ras && ras->supported && adev->nbio.funcs->enable_doorbell_interrupt) adev->nbio.funcs->enable_doorbell_interrupt(adev, true); return 0;