Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2169913iof; Tue, 7 Jun 2022 22:03:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwU4/UNFtebKg9D2KGzT3yFYC49/4vl7e5MTG1z7xRu9k2Uuq/6SPc1NzJu7gM13DoYMHp8 X-Received: by 2002:a63:d013:0:b0:3fc:e50f:8e2a with SMTP id z19-20020a63d013000000b003fce50f8e2amr26570181pgf.283.1654664629922; Tue, 07 Jun 2022 22:03:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654664629; cv=none; d=google.com; s=arc-20160816; b=IAqoPSmNv+xyJQkjpnxp3da6GtdOUD4ee2Kq0Te7gDJHOjQjLwt9nXv/q3ebMJk5GK iBeJRgO3avBFDmD11589QFejD8rGZbqkkcbigM9zaUR5ztDhqc0UVxnQEMk7+BhdEZu9 LqnYwNGxBTN1TipKmWZNhUVXQaW+VT8h2vwLmATkTbjFpYP01hMURBtGdr0b1N21CXZW lg2GY2hVLq7uGBdA1n24/PD+g3avdb2Vbx6t26ucf9dLsR6agV8LqcbpTcCfhibQjlzj iSuHbL+qKE7+RNOPnsomu//VvVRiYZ1k/ZwaWq+99UW4Fqj3TTuOMiyQu8zYtOkg83Bi O1Qg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=3ZKie3V4eqjptRsgax5fg799MEhmxCWMsjuaEgqy7C0=; b=TOig67yhNCYgyQfXK1kyRxCfFEsvZPAykFZgDoXLosJKlPFTiqQ4E+nmVoupfXD0gB tEJLlgBS6mIYdxSotxJ+Otq1QJXKE9CK4PHQM61/jY+WSiTZ7WDl1dQKeznmS9WZNC9V o36KAIf/adZXlmTwSo/m8AmE75JsiELF+ZoZWM4n6CPBj7vIWWB1AFNUhyeNeauPAepS 4o7ItRdE0P553Q9RH32hEMbqXcA5V52N6vGMeXIdlNt9LRF4zn/Yo4EAnfMN+Ef7P/8d F6v6febkrsSUOxR387UDrSowOs9viW0qdojn9HEGoSssEDl4P2SKxc2jnB8zqgWbsPYs F1yQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Nq5mviCJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id l65-20020a639144000000b003fb0b79d84esi27203007pge.732.2022.06.07.22.03.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 22:03:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Nq5mviCJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 826BA45D339; Tue, 7 Jun 2022 21:31:29 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1381854AbiFGWel (ORCPT + 99 others); Tue, 7 Jun 2022 18:34:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378618AbiFGVWj (ORCPT ); Tue, 7 Jun 2022 17:22:39 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B146A226556; Tue, 7 Jun 2022 12:00:26 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id DC89D617E8; Tue, 7 Jun 2022 18:59:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EBF66C385A2; Tue, 7 Jun 2022 18:59:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654628399; bh=gmKKWmpotjYcp8qIaAw1Rg5fTRetCkoV8RD+koRbpAk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Nq5mviCJyF/d2YiVq4+5SRUtp2dg/Tkqlg5g+M2HW9LSops+wOzgoiCwU4zIFURRi wZ6U9LUsk3NlFtcveDLtOApBz5zYYRRkzxnLs1NAE1LRNJomS+j09Pnt4uhoRc9rsd fQ/CKVj1lj//6nTwXpxgCKaN7HYtJXe1YnmA2Evw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alex Deucher , Gavin Wan , Sasha Levin Subject: [PATCH 5.18 314/879] drm/amd/amdgpu: Remove static from variable in RLCG Reg RW Date: Tue, 7 Jun 2022 18:57:12 +0200 Message-Id: <20220607165011.961968301@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607165002.659942637@linuxfoundation.org> References: <20220607165002.659942637@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Gavin Wan [ Upstream commit d68cf992ded575928cf4ddf7c64faff0d8dcce14 ] [why] These static variables save the RLC Scratch registers address. When we install multiple GPUs (for example: XGMI setting) and multiple GPUs call the function at same time. The RLC Scratch registers address are changed each other. Then it caused reading/writing from/to wrong GPU. [how] Removed the static from the variables. The variables are on the stack. Fixes: 5d447e29670148 ("drm/amdgpu: add helper for rlcg indirect reg access") Reviewed-by: Alex Deucher Signed-off-by: Gavin Wan Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c index 5e3756643da3..1d55b2bae37e 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c @@ -864,11 +864,11 @@ static u32 amdgpu_virt_rlcg_reg_rw(struct amdgpu_device *adev, u32 offset, u32 v uint32_t timeout = 50000; uint32_t i, tmp; uint32_t ret = 0; - static void *scratch_reg0; - static void *scratch_reg1; - static void *scratch_reg2; - static void *scratch_reg3; - static void *spare_int; + void *scratch_reg0; + void *scratch_reg1; + void *scratch_reg2; + void *scratch_reg3; + void *spare_int; if (!adev->gfx.rlc.rlcg_reg_access_supported) { dev_err(adev->dev, -- 2.35.1