Received: by 10.223.185.116 with SMTP id b49csp4168291wrg; Mon, 26 Feb 2018 12:26:41 -0800 (PST) X-Google-Smtp-Source: AG47ELtyZrw8gS9sYGTVEeL/HYu5NF3gHExhQtWU7tMVyaxUmjhd75dS5jQNACZJewi9agl+9va0 X-Received: by 10.101.69.4 with SMTP id n4mr4355747pgq.184.1519676801687; Mon, 26 Feb 2018 12:26:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519676801; cv=none; d=google.com; s=arc-20160816; b=hNjEexHl41IDa/jruF5YznDb8xpWe/1MOYToS8kuVBwfyK7wGsjHGUAtA8lHrO+umN L/f+UTdLzI/1QNG6+kblJmTtGM+E1XJM9E2LdZ1kV0l2rFSdKbILcmypnhQ2aoNG0j7k gJKW6SLjFcMYi/KkQVRv8Y67svkNMbO5iBVRVT3Zru+ZnnKyS5Fww/dLmuqSEFAx4fLp oY3XXcCLzcUYvaN2tWYWuKx65GQFuTD0Qk58yCXjykQFcVasr0spAaHJ1Pob9SJr7BMJ j7U39Aeiio6sYJuufCVhA1LyoTbpePyZfBD6wP3zmNd3bTykNZ7degEefD4BQPQaEWBw ACYw== 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=EEnbC4oE0tIyLdRvzulqiZFRCnZnroj9Ao679+PZaMM=; b=lJdksJfz8FtyXTwFO1vxQ77q9N+JpOPYabpcl3hvcI0SgbYNYnOBfMfPlOXrvI3nEv vxPLmRonEODbvkpi49dG01ytZsAgL7CTnOdzUs16ZlXRmn6cEl2oDtlAufQkOQJo5R9n OzpPjDn65jpHKqrz5WAIeWqyh7s4n12CRrSKl7ZiczdlFrRKfVLdNWJuKBWGIj2IiVka JPBp2Ov0RqCQw+QUYtWLc8E085FGgWtt8emqrJzLN3WYP1M6s3RuJ0cVB9Nfh9Y4gErS K/kPGcdjhwFOpSHD/m3KicezQ+NKscXfOjcfpS8LaVKmL16n29HjQzNmBxGB1pmPDbyq w1wg== 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 f10si5962008pge.494.2018.02.26.12.26.25; Mon, 26 Feb 2018 12:26:41 -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; 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 S1753152AbeBZUZV (ORCPT + 99 others); Mon, 26 Feb 2018 15:25:21 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:35402 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752060AbeBZUZT (ORCPT ); Mon, 26 Feb 2018 15:25:19 -0500 Received: from localhost (clnet-b04-243.ikbnet.co.at [83.175.124.243]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id B60F4F4A; Mon, 26 Feb 2018 20:25:18 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Xiangliang Yu , Alex Deucher Subject: [PATCH 4.14 50/54] drm/amdgpu: only check mmBIF_IOV_FUNC_IDENTIFIER on tonga/fiji Date: Mon, 26 Feb 2018 21:22:27 +0100 Message-Id: <20180226202147.172418849@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180226202144.375869933@linuxfoundation.org> References: <20180226202144.375869933@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: Alex Deucher commit 57ad33a307bf85cafda3a77c03a555c9f9ee4139 upstream. We only support SR-IOV on tonga/fiji. Don't check this register on other VI parts. Fixes: 048765ad5af7c89 (amdgpu: fix asic initialization for virtualized environments (v2)) Reviewed-by: Xiangliang Yu Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/amd/amdgpu/vi.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) --- a/drivers/gpu/drm/amd/amdgpu/vi.c +++ b/drivers/gpu/drm/amd/amdgpu/vi.c @@ -448,14 +448,19 @@ static bool vi_read_bios_from_rom(struct static void vi_detect_hw_virtualization(struct amdgpu_device *adev) { - uint32_t reg = RREG32(mmBIF_IOV_FUNC_IDENTIFIER); - /* bit0: 0 means pf and 1 means vf */ - /* bit31: 0 means disable IOV and 1 means enable */ - if (reg & 1) - adev->virt.caps |= AMDGPU_SRIOV_CAPS_IS_VF; + uint32_t reg = 0; - if (reg & 0x80000000) - adev->virt.caps |= AMDGPU_SRIOV_CAPS_ENABLE_IOV; + if (adev->asic_type == CHIP_TONGA || + adev->asic_type == CHIP_FIJI) { + reg = RREG32(mmBIF_IOV_FUNC_IDENTIFIER); + /* bit0: 0 means pf and 1 means vf */ + /* bit31: 0 means disable IOV and 1 means enable */ + if (reg & 1) + adev->virt.caps |= AMDGPU_SRIOV_CAPS_IS_VF; + + if (reg & 0x80000000) + adev->virt.caps |= AMDGPU_SRIOV_CAPS_ENABLE_IOV; + } if (reg == 0) { if (is_virtual_machine()) /* passthrough mode exclus sr-iov mode */