Received: by 10.213.65.68 with SMTP id h4csp505982imn; Fri, 16 Mar 2018 09:49:09 -0700 (PDT) X-Google-Smtp-Source: AG47ELtutAe1K/3X9bmkYDkMsgHT9Iqfmhe9rHJSQFt5d/4qb24vlUWk2GL/JNtZVWIH7VuM/T96 X-Received: by 2002:a17:902:aa02:: with SMTP id be2-v6mr2893696plb.86.1521218949402; Fri, 16 Mar 2018 09:49:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521218949; cv=none; d=google.com; s=arc-20160816; b=ZIbRzl4FAUZIm8ZkB3n7gvugL2qA75t20Kq+w73M4+RK+jnW1aJd8BO9MJJ2+43E8o Rx0jpIhGQ1Sz11JtIGMz/2osakAkQQqS4R9M8YB0w9vkpj44i6XYSh0obLepuBHxddSJ N1W0EEXnc9SIONK43eOAnVk9ngaTjRH7lal+/+Rewt7wrWYY659gS4UAmG06yhlUXJT9 4f5O1v9Yud17J0s4H4dP4qIJuR9CbmSb3dNVevlBDAAFA2UX9HFwfk4CHihfa7hP9qgj 4TLSO8AWDk1WXrXS+WQHPAcA4h0RmJ0WV/eVtwcaC7P+dme5ZxIJ+NBb279fA9rLckya 0weA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=r3cMkc5ya1i+CgJwj/bO725ODuOU9S1MPTub//lnAA4=; b=cYgsriXsoBfnKf8YUYEf8VCRi/9sMyiWjfhAQW1dgbHQkZ/Sf65CviHBqFbhToTVef PeXHJLKxyc3jV1xTDhf6yoxM3oB44rmTkBTzUVTReRHtbKHJYnkY9YG2JVvFVHJMelO7 vcXFzOov1OL6JbFAFsooWupsc8iBGPUEhwZ8qdDFGF2VOb8mfRSSWsRe6IB28bNQO4+F jMFfvZ4gsi41kmc/602mhDyXbsGO68+okSl15mUqPu7CVkrZRul656k5349IFf3TjS3Z Yn0x/+GMTMUUVQGMdUlCBUcwAQ7wxeVR78dKiths60Ey7C9ip7KcBYvYx5nfe9BrxNUd 6u8w== ARC-Authentication-Results: i=1; mx.google.com; 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 f13si5054894pgp.666.2018.03.16.09.48.55; Fri, 16 Mar 2018 09:49:09 -0700 (PDT) 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; 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 S934155AbeCPPfb (ORCPT + 99 others); Fri, 16 Mar 2018 11:35:31 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:39794 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934099AbeCPPfT (ORCPT ); Fri, 16 Mar 2018 11:35:19 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 2B6791080; Fri, 16 Mar 2018 15:35:19 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Felix Kuehling , Oded Gabbay , Sasha Levin Subject: [PATCH 4.14 036/109] drm/amdgpu: fix get_max_engine_clock_in_mhz Date: Fri, 16 Mar 2018 16:23:05 +0100 Message-Id: <20180316152331.913173753@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180316152329.844663293@linuxfoundation.org> References: <20180316152329.844663293@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Felix Kuehling [ Upstream commit a9efcc19161e20623c285fac967a32842972cebe ] Use proper powerplay function. This fixes OpenCL initialization problems. Signed-off-by: Felix Kuehling Acked-by: Oded Gabbay Signed-off-by: Oded Gabbay Signed-off-by: Sasha Levin 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 @@ -265,6 +265,9 @@ uint32_t get_max_engine_clock_in_mhz(str { struct amdgpu_device *adev = (struct amdgpu_device *)kgd; - /* The sclk is in quantas of 10kHz */ - return adev->pm.dpm.dyn_state.max_clock_voltage_on_ac.sclk / 100; + /* the sclk is in quantas of 10kHz */ + if (amdgpu_sriov_vf(adev)) + return adev->clock.default_sclk / 100; + + return amdgpu_dpm_get_sclk(adev, false) / 100; }