Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp1252883pxx; Tue, 27 Oct 2020 11:54:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwy9GMyzVS+Ey9K3wXWI+xrPQFEfr2vBWhZKAVW0UFiCthvACVqi1y5nEDbx9a3WjKuC9kd X-Received: by 2002:a50:a683:: with SMTP id e3mr3783431edc.33.1603824865990; Tue, 27 Oct 2020 11:54:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603824865; cv=none; d=google.com; s=arc-20160816; b=P0yoAJMwrQqLqfEX2WuyzifiZWlbGpvw2jtMLGs3HRKTe11fy+kny5HytB0jHPMo5R vTPnCjnztIXWTv98FrQ0uVLPWdGaWMx04eefY66Fh5dgXuqbsjPn9cusM9EOKuPx7JmO AkUvG04wBBBis2SjAiTPdgSSnESh19yyaekfbCWZUU6lZTHtb/tdeLnSbQ9VQpmmQ5Gh Jgszz34iZVBs25Qak8qZmb94GAPZrL0uDvQsIyI2FUbuubuxmHz37Rn9lXUga/oraGzy BJME+lMJio333XtZBuFz6+FP8FwBOn1Jn8WbOECZZ4KPCW9mhoeW3mHa6iDPSznfCxFS E6MQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=zLq9YmTx5/IqusCVzwP2pRKb7AeamYh06a7zLdJYzqA=; b=G3wg718jquatRCIEI8AhGbstHQa/kgypF+P3mC5muCb7BpPn+ShTC9zQENcNJWGjpt bHKkWG3ZQ1Vfsq87mh4UnKn+mT0mc8fEjVLW58ehMazwLhrh0czdOnh6pl1+aWdUqY3g 9aw6/fVWqdvdnKuSnDQhwFLzdR61vpASM2egPZJyyRe3/s52eLjRKErPpsXZxvK/ffGc U+HlV+Ev82jrrUuHQa9rGbLNwyCTErYUvbxHzlsxX+j+ZAglp7Wt0rgP6l9WTIAZ0CBn 4aecUVh2grjQnqTnchC40zKrJ5zHlF3x2iQ+mKvfHm7iq4xLjAH8pPa8DMFDDo/64afK eO3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZE0+NDzx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id g7si1555165edu.307.2020.10.27.11.54.04; Tue, 27 Oct 2020 11:54:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZE0+NDzx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S2444419AbgJ0Ail (ORCPT + 99 others); Mon, 26 Oct 2020 20:38:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:48130 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2408795AbgJZXtr (ORCPT ); Mon, 26 Oct 2020 19:49:47 -0400 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 3A75320B1F; Mon, 26 Oct 2020 23:49:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603756187; bh=htVQ0lM5PeZptMc1xhUBFGlaX5GmnCOsIXTPr3B8Ttg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZE0+NDzxQqe8F5FknJfZZrGFcORsaasBuNhyTr/aHgi19Vql6v3LSOE+xOwdAoRCx /bvA3FiOoZ8C/+DD46YaKnO/8+/tJJaJcEsmuYqAgVnXJMcmm1J7e6lgWqm10OZ/OJ h/xOQ2ThJD5rAubyWkD737FMaRgRQmxjfUAZvzY0= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Guchun Chen , Hawking Zhang , Alex Deucher , Sasha Levin , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH AUTOSEL 5.9 033/147] drm/amdgpu: restore ras flags when user resets eeprom(v2) Date: Mon, 26 Oct 2020 19:47:11 -0400 Message-Id: <20201026234905.1022767-33-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201026234905.1022767-1-sashal@kernel.org> References: <20201026234905.1022767-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Guchun Chen [ Upstream commit bf0b91b78f002faa1be1902a75eeb0797f9fbcf3 ] RAS flags needs to be cleaned as well when user requires one clean eeprom. v2: RAS flags shall be restored after eeprom reset succeeds. Signed-off-by: Guchun Chen Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c index 1bedb416eebd0..b4fb5a473df5a 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c @@ -367,12 +367,19 @@ static ssize_t amdgpu_ras_debugfs_ctrl_write(struct file *f, const char __user * static ssize_t amdgpu_ras_debugfs_eeprom_write(struct file *f, const char __user *buf, size_t size, loff_t *pos) { - struct amdgpu_device *adev = (struct amdgpu_device *)file_inode(f)->i_private; + struct amdgpu_device *adev = + (struct amdgpu_device *)file_inode(f)->i_private; int ret; - ret = amdgpu_ras_eeprom_reset_table(&adev->psp.ras.ras->eeprom_control); + ret = amdgpu_ras_eeprom_reset_table( + &(amdgpu_ras_get_context(adev)->eeprom_control)); - return ret == 1 ? size : -EIO; + if (ret == 1) { + amdgpu_ras_get_context(adev)->flags = RAS_DEFAULT_FLAGS; + return size; + } else { + return -EIO; + } } static const struct file_operations amdgpu_ras_debugfs_ctrl_ops = { -- 2.25.1