Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3546382pxj; Mon, 24 May 2021 09:05:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxkqVcabSDLvoGWDfC0vqWcDAky+pf2RWceKi/cGA5CJjtP9z1f+NmTNqaEQdRYrCloaINP X-Received: by 2002:a05:6402:b91:: with SMTP id cf17mr27180528edb.19.1621872348708; Mon, 24 May 2021 09:05:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621872348; cv=none; d=google.com; s=arc-20160816; b=LXxJMCWPX4bJwn9nBS/AE+5WwS61u6QmI7+RXJbFogLa59qL42OdeW2NkDstmq286z AAQvjZM6LwxRhOSxMh5eBJi3hDtL6oPFjhPboatw09VnOyVGMeRjzZV7M5eE4kFEc34F AwVeaUKLqaFobMxheX1ZMLR6pX20uEoPXO/a84wSI2wLKtOk43oAPbG2PQQsKxFFRq/q bGUgY4ayK9gx81ya7mCPS59RjTqI4UgrND7NU0OBeBqAQH/xttSnja9vmC75gmOM56gK 6WYgwZSXTPFzB3U7yacyJ3nYXd8cxphKOI6EuiwcpIdju3Dsjz1FOs2Ir7CIb0UblL9U iMjg== 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=d9WLF4ZQYRQcvjU34IG5IHfq0Ff1NNUMV2vvWALn0YQ=; b=QhDNOa8FCqjAhXO3WPpKbB5EpVcyDXOH51iPlh2V13qq61qvmU3ERJnkmT3XvumeV+ kUiBtcMMJxOBYUMAgQFcpvCSqyemu1+Mr9uYfp7QzZtDXrLZaWPLpi0JAEKdVHm9aI/s KuFTVNMjKpBu/OnuHUWYnP4T0xWC7Sjq2MZ0o4V95mfWZ9ftuhKvpwf9jI59vq66Zpe+ WAnpawtAqQx9hwzqL4Sk+3XOUuR/x6AHt0NLPpRubHpIa6+oeP24mGDPoosuL0Y75BVu OqQfuz0rLPKvwfWuYDrKf9RCzWTGR1Tm9Nv9W4gjWdGEg9xmH+OUgM6Lnw+7L0S9acWS fUcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=mGIiuxXV; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p17si1603342ejr.362.2021.05.24.09.05.25; Mon, 24 May 2021 09:05:48 -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=@linuxfoundation.org header.s=korg header.b=mGIiuxXV; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233827AbhEXQFq (ORCPT + 99 others); Mon, 24 May 2021 12:05:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:45006 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235840AbhEXP7P (ORCPT ); Mon, 24 May 2021 11:59:15 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id ECF7F61452; Mon, 24 May 2021 15:45:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621871107; bh=X1nSI36gVj+lwwu87lKIKivvc1Xlem4MisVkfCpIYWI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mGIiuxXVmyRp8DMxzvpMcqwjNrjGi9JJkg2F/L5u66NepZKoX4V8XtABbSJ3Rm3eV /w1cOcka7Jl9RTQDfHtZ+I+T+uAmTgi6CDmIikwVef2kdwsEWCPDjLEC2X8mA2SMsV NgU0XBxEoOwOSj95mrXKQcmEdNBpVvHHsc7p9fjg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Christian=20K=C3=B6nig?= , Yi Li , Huacai Chen , Alex Deucher Subject: [PATCH 5.12 077/127] drm/amdgpu: Fix GPU TLB update error when PAGE_SIZE > AMDGPU_PAGE_SIZE Date: Mon, 24 May 2021 17:26:34 +0200 Message-Id: <20210524152337.456766387@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210524152334.857620285@linuxfoundation.org> References: <20210524152334.857620285@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yi Li commit d53751568359e5b3ffb859b13cbd79dc77a571f1 upstream. When PAGE_SIZE is larger than AMDGPU_PAGE_SIZE, the number of GPU TLB entries which need to update in amdgpu_map_buffer() should be multiplied by AMDGPU_GPU_PAGES_IN_CPU_PAGE (PAGE_SIZE / AMDGPU_PAGE_SIZE). Reviewed-by: Christian König Signed-off-by: Yi Li Signed-off-by: Huacai Chen Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c @@ -267,7 +267,7 @@ static int amdgpu_ttm_map_buffer(struct *addr += offset & ~PAGE_MASK; num_dw = ALIGN(adev->mman.buffer_funcs->copy_num_dw, 8); - num_bytes = num_pages * 8; + num_bytes = num_pages * 8 * AMDGPU_GPU_PAGES_IN_CPU_PAGE; r = amdgpu_job_alloc_with_ib(adev, num_dw * 4 + num_bytes, AMDGPU_IB_POOL_DELAYED, &job);