Received: by 10.223.176.5 with SMTP id f5csp1034741wra; Fri, 2 Feb 2018 10:03:31 -0800 (PST) X-Google-Smtp-Source: AH8x224ezp/v9zd3gr+gqI24uSDdCiw65/U/kmUJLwWSbbzIevJcRjWpbi370+siqKdaFaFtaA+z X-Received: by 10.99.148.17 with SMTP id m17mr31442509pge.367.1517594611099; Fri, 02 Feb 2018 10:03:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517594611; cv=none; d=google.com; s=arc-20160816; b=GS+fmJPvGTYx0MGhm/vLDzWZ8fkt8tiWiJ8s9QMB1QooLBEhuPQCSYIgKJ021SC+ka LMXfvQniskmuGvCQmZXgGAhccpgU5xF4A56tjISuDtM3awrZc1xm3vZf/o6fP/ZWVSIY VRREa4aP7RDYB9dvZz0JrMej4cRHBNzrQS49U/zU3Q9+uWZlKkeb9rwpPOxBEHZF5XFN hSzX/kJHOTl1L7liG+W2twBIei1YHlrk0WBmyHluntx4ksLDD/rcqbROZMz4pS1A3RG7 vxMpBgFBSd/8mVMKXpA5LoNr0ZUu0lR6L9t3ON29Ek+869JaLg96arnBrfFE6JacT2eu 7cAQ== 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=DQ+WOz20vyfgn2TSDdE9lByTJzXNn94qW0H1OOXMfuU=; b=DJdFY8TOi9BkRf4JO1NQCAi1/ltfWhAr2fiaDUQ/+4OuXzm/YK/dCDjWmgw7je7pZQ KMB3N3uGm6UdWnlgKTEy0iQzJdnOiLqtllbXnbI99idQvwwJC/qHW5MXvnZOcDAd+0dH wr4gOXF0H1OHBTIC0EuaD2gQx7QIaRanrP4Bszl1+LLBAekz+riJBadDegqTQZQEyuVs VVGayNUNfsFfYndyQUc6zqsGcmzZsbL+H05ZSadT3huHXP3kQWy9Ys6mmxlMZ+X0/zHS VSJ9cgy3qGrP3N/T/szSZ9mkq9syLIzy5NBLU4Z/D0UVahUnurUooEDxGoblMr8YZDRw tsVw== 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 w2si1695775pgp.680.2018.02.02.10.03.16; Fri, 02 Feb 2018 10:03:31 -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 S1753558AbeBBSAZ (ORCPT + 99 others); Fri, 2 Feb 2018 13:00:25 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:38086 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752415AbeBBRJz (ORCPT ); Fri, 2 Feb 2018 12:09:55 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 276EEEFA; Fri, 2 Feb 2018 17:09:53 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, shaoyun liu , Felix Kuehling , Oded Gabbay , Sasha Levin Subject: [PATCH 4.14 063/156] drm/amdkfd: Fix SDMA ring buffer size calculation Date: Fri, 2 Feb 2018 17:57:24 +0100 Message-Id: <20180202140843.143873811@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180202140840.242829545@linuxfoundation.org> References: <20180202140840.242829545@linuxfoundation.org> User-Agent: quilt/0.65 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: shaoyunl [ Upstream commit d12fb13f23199faa7e536acec1db49068e5a067d ] ffs function return the position of the first bit set on 1 based. (bit zero returns 1). Signed-off-by: shaoyun liu Signed-off-by: Felix Kuehling Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_cik.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_cik.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_cik.c @@ -205,8 +205,8 @@ static int update_mqd_sdma(struct mqd_ma struct cik_sdma_rlc_registers *m; m = get_sdma_mqd(mqd); - m->sdma_rlc_rb_cntl = ffs(q->queue_size / sizeof(unsigned int)) << - SDMA0_RLC0_RB_CNTL__RB_SIZE__SHIFT | + m->sdma_rlc_rb_cntl = (ffs(q->queue_size / sizeof(unsigned int)) - 1) + << SDMA0_RLC0_RB_CNTL__RB_SIZE__SHIFT | q->vmid << SDMA0_RLC0_RB_CNTL__RB_VMID__SHIFT | 1 << SDMA0_RLC0_RB_CNTL__RPTR_WRITEBACK_ENABLE__SHIFT | 6 << SDMA0_RLC0_RB_CNTL__RPTR_WRITEBACK_TIMER__SHIFT;