From patchwork Wed Jun 1 21:17:30 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 9148153 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 960C060751 for ; Wed, 1 Jun 2016 21:17:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 87A6520410 for ; Wed, 1 Jun 2016 21:17:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7C56B26B39; Wed, 1 Jun 2016 21:17:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_WEB, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E5D8920410 for ; Wed, 1 Jun 2016 21:17:52 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3BC1C6EA4C; Wed, 1 Jun 2016 21:17:44 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-io0-x242.google.com (mail-io0-x242.google.com [IPv6:2607:f8b0:4001:c06::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0B0766EA4C for ; Wed, 1 Jun 2016 21:17:42 +0000 (UTC) Received: by mail-io0-x242.google.com with SMTP id m17so4142507ioi.3 for ; Wed, 01 Jun 2016 14:17:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cZQMAYqI78eufTrsnYypjVdwq9D+2myVH4MsjnFjcf4=; b=ffXmCK0EFWkxtcMGZq+hTa+kx4B54P2EyWm/2Oguxg3+hSq7iypXOVY8r8ZxrKxUWz 0WPUbVxNFABL6xjZ/FOUG3+it6NrZ1Gc/JrT6MgXRRFCx5KVz7LXTch+/ilk+VXX47JZ xPmMWH4edyFrUTh1TJJUuNJpX5lG+oZzYJ4NlqvNWW9CUERBGJlnwcWwJTQxlumUYYNA IPm62uiEJzKZX7H0trVB+KJ2cCGSmXqjMcQ9efuBIb6aQwzZHe8T+bJdA/krEPLXZlB6 ISKNvKZjKbW8t0ici2FrgDPIxnmfdG00JLOEU0NsmZR3SJuonOuJ11j7eCVzjqDYULPK mcZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=cZQMAYqI78eufTrsnYypjVdwq9D+2myVH4MsjnFjcf4=; b=bECn6GpGBQos3q4QOdyo1PPmiVroEzSwDnVca9tPUwUhwC/nKiA/e5j4zAhjkcU2yM wXYc8vGNF+OryFAiI/yp9VSWr38j/ngQB7xnO5XKPEAqhxYmvCgqcHLoCrfusiQGD7oG 2WMlqZcoM7W8/fJbBV4fra3fJDmJaSBlgTp4oHuScfuodujMsln48gL5IVxGl9Py2paI o0iRDQxrQPxnjXcYVqGlPXfW6cQGq7tgiNKXJ6gBKhQtJpddnYySxpbdKtNfQs1IJYxb SxcInt01Wg/XHckwyfFpUlruWGjuhzLM12jpBaVXJl6u65VymtfL5/vQ+IYcWTtTi0/w pU4w== X-Gm-Message-State: ALyK8tIvVE5tLywI+Cb2nfAA/vVYe6COjieeqBhI9RteH09EpJJZYE//l17KG5BrADIB/A== X-Received: by 10.107.62.196 with SMTP id l187mr6794030ioa.185.1464815861042; Wed, 01 Jun 2016 14:17:41 -0700 (PDT) Received: from cm.amd.com ([165.204.55.251]) by smtp.gmail.com with ESMTPSA id m123sm10696475iom.5.2016.06.01.14.17.40 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 01 Jun 2016 14:17:40 -0700 (PDT) From: Alex Deucher X-Google-Original-From: Alex Deucher To: dri-devel@lists.freedesktop.org Subject: [PATCH 2/3] drm/amdgpu: impl late_fini for amdgpu_pp_ip Date: Wed, 1 Jun 2016 17:17:30 -0400 Message-Id: <1464815851-29658-3-git-send-email-alexander.deucher@amd.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1464815851-29658-1-git-send-email-alexander.deucher@amd.com> References: <1464815851-29658-1-git-send-email-alexander.deucher@amd.com> MIME-Version: 1.0 Cc: Alex Deucher , Monk Liu X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Monk Liu This adds a late_fini callback for the powerplay ip module. Signed-off-by: Monk Liu Reviewed-by: Alex Deucher Reviewed-by: Christian König Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c index cfbb360..f2e08b35 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c @@ -224,6 +224,22 @@ static int amdgpu_pp_hw_fini(void *handle) return ret; } +static void amdgpu_pp_late_fini(void *handle) +{ + struct amdgpu_device *adev = (struct amdgpu_device *)handle; + +#ifdef CONFIG_DRM_AMD_POWERPLAY + if (adev->pp_enabled) { + amdgpu_pm_sysfs_fini(adev); + amd_powerplay_fini(adev->powerplay.pp_handle); + } + + if (adev->powerplay.ip_funcs->late_fini) + adev->powerplay.ip_funcs->late_fini( + adev->powerplay.pp_handle); +#endif +} + static int amdgpu_pp_suspend(void *handle) { int ret = 0; @@ -312,6 +328,7 @@ const struct amd_ip_funcs amdgpu_pp_ip_funcs = { .sw_fini = amdgpu_pp_sw_fini, .hw_init = amdgpu_pp_hw_init, .hw_fini = amdgpu_pp_hw_fini, + .late_fini = amdgpu_pp_late_fini, .suspend = amdgpu_pp_suspend, .resume = amdgpu_pp_resume, .is_idle = amdgpu_pp_is_idle,