Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp926996imj; Sat, 9 Feb 2019 10:59:43 -0800 (PST) X-Google-Smtp-Source: AHgI3Ia28eaiJyk5brcu3itEymv18kDe6y5GxkflbAt9VVpVYMj0b95zBu/SzNExjI07oqZJXzSt X-Received: by 2002:a63:f91c:: with SMTP id h28mr2117780pgi.14.1549738783477; Sat, 09 Feb 2019 10:59:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549738783; cv=none; d=google.com; s=arc-20160816; b=ByjSKRVLTOutd6Shacw2nIXKogPzoU5y50YbQf+Rq+5SJsDjKPCNOlR4qeEK9kO//O 4p+Kpwcv4wxpUEo9dGG5b/Fpsq3cRRJfj0R0NUo7wVq3bOnAkBjKg3nCjHfOo82Rp75n L68ZXsnt0b+7aIWvTZSJ9lvDUNZu2hOU6xM5c2WWX0efBKvoat7zoBJPWSluoX/WBaj0 OgL3g0Ai36kKMiV746k25zRgrJkhky9abaLMFiLrluN21o0mI7lcv/HOHYLZVBSVukde QnIFbzB5chXRXeN1nj+Da+p2QUPKG4gAbaJyV1rf2b5eLkdEl6TTvEhNm29dvdYZagKC HqOw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=0VhRxDeZsVh6O3Y/aa4UhpZACk28mtfIHlBk2k4pRWQ=; b=T5PHybolgv5BhMl61fRSuQRGQqzw+lY7di5GjvawnVnuNeDFCnh0IgjvlSjqktnCYi TBu1uznv5Kg4wleqPMtYkg5NLTtpoH5deyn5o53bCMpqUyKFqqGq52ihYFM8xvCMVGwI dbxHWZNlIUJ8YNt/VX7PovtqVz1yGH+6QlBU8vcH91wYwEWt10FOb2zePWcnkZLGAN2g yS79P/P46bz4hOm7WVytytZO1ETZ0KlgN1J9gPCdyFGShFphL4bbNPV9k2dpEYy+P/L+ zOa/9jMk6tJq/plnGGFL25bmueWsVou8eXLFGnlh7skIFFCg/s8Dr32ocogIQQXSxoBE DAkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=USQ3ADWu; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q189si5774272pgq.9.2019.02.09.10.59.27; Sat, 09 Feb 2019 10:59:43 -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=USQ3ADWu; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727231AbfBISrh (ORCPT + 99 others); Sat, 9 Feb 2019 13:47:37 -0500 Received: from mail.kernel.org ([198.145.29.99]:60064 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727013AbfBISrh (ORCPT ); Sat, 9 Feb 2019 13:47:37 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 15C0A20821; Sat, 9 Feb 2019 18:47:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549738056; bh=xlMinsUh28iFhejDQZ5kBMqcF4vRxA4M4wsvOhUNFSg=; h=From:To:Cc:Subject:Date:From; b=USQ3ADWu8U27CPoU7gXlQLWQBdVhiUq2xomSUlWQVsRWjKiHPH+U3rWcvCbeJwWdk MkE+Msuh200A5+fK2wCd34BDmotw1lT8DW8IUnnkW0eMZHoMhp4We6ThAP9d5G0G14 o1NKXXPgoZlwuVnwe+TwR9zsH+NZFevbhrabiRgQ= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Emily Deng , Alex Deucher , Sasha Levin Subject: [PATCH AUTOSEL 4.20 01/42] drm/amdgpu/sriov:Correct pfvf exchange logic Date: Sat, 9 Feb 2019 13:46:53 -0500 Message-Id: <20190209184734.125935-1-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Emily Deng [ Upstream commit b8cf66182eddb22e9c7539821ed6eecdb4f86d1a ] The pfvf exchange need be in exclusive mode. And add pfvf exchange in gpu reset. Signed-off-by: Emily Deng Reviewed-By: Xiangliang Yu Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 8 ++++---- drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index 30bc345d6fdf..8547fdaf8273 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -1684,8 +1684,10 @@ static int amdgpu_device_ip_init(struct amdgpu_device *adev) amdgpu_xgmi_add_device(adev); amdgpu_amdkfd_device_init(adev); - if (amdgpu_sriov_vf(adev)) + if (amdgpu_sriov_vf(adev)) { + amdgpu_virt_init_data_exchange(adev); amdgpu_virt_release_full_gpu(adev, true); + } return 0; } @@ -2597,9 +2599,6 @@ fence_driver_init: goto failed; } - if (amdgpu_sriov_vf(adev)) - amdgpu_virt_init_data_exchange(adev); - amdgpu_fbdev_init(adev); r = amdgpu_pm_sysfs_init(adev); @@ -3271,6 +3270,7 @@ static int amdgpu_device_reset_sriov(struct amdgpu_device *adev, r = amdgpu_ib_ring_tests(adev); error: + amdgpu_virt_init_data_exchange(adev); amdgpu_virt_release_full_gpu(adev, true); if (!r && adev->virt.gim_feature & AMDGIM_FEATURE_GIM_FLR_VRAMLOST) { atomic_inc(&adev->vram_lost_counter); diff --git a/drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c b/drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c index 8cbb4655896a..b11a1c17a7f2 100644 --- a/drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c +++ b/drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c @@ -174,7 +174,7 @@ static int xgpu_ai_send_access_requests(struct amdgpu_device *adev, return r; } /* Retrieve checksum from mailbox2 */ - if (req == IDH_REQ_GPU_INIT_ACCESS) { + if (req == IDH_REQ_GPU_INIT_ACCESS || req == IDH_REQ_GPU_RESET_ACCESS) { adev->virt.fw_reserve.checksum_key = RREG32_NO_KIQ(SOC15_REG_OFFSET(NBIO, 0, mmBIF_BX_PF0_MAILBOX_MSGBUF_RCV_DW2)); -- 2.19.1