Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp488670ybl; Wed, 14 Aug 2019 01:01:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqwB2013mRawbcGnllfrykH3v5F7oB8Gmo5bcIE9cnkNBNnt8fgRfvrPSBtuU0LGSOv2CfH4 X-Received: by 2002:a63:dd0b:: with SMTP id t11mr38219654pgg.410.1565769683440; Wed, 14 Aug 2019 01:01:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565769683; cv=none; d=google.com; s=arc-20160816; b=hdbJ+bOZ1hSdYy4InWmRCDscP1XS9Y54h4SjfIlz+xyOiqvfgIYjw4Zcd5Z9H7rVM1 pRJ3/isnVOp3Fk2686gR3/UTB+mVWrcV/KT9BrAICp91yr5Oge0VbofOoyuoL6A9M1CO hpWG22fSDzimWLFI//XfwR3cLX3Eo4ylSRuY/BKiIkegk0PdhHiu8ogt+5YzeezvQ8UH JDbTk0xVJvKWRFORNvI+vV18LIE+2rQvIl4Sp09XYoggWkqTu6ZuepkokMPHgH4TIr+4 hz1yn0nwnW6Hk1OmKfbZoCCVeseqDInJKs6VGr2qaeD8+53IJb+uPgyaMLir4osPLOUu Vqqw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=r4axfViZZyZ+fuvT3jC+Yx773mt75vv7oepOJvLdF2Q=; b=jhwWcUQtFG4fUtud+LlUvNmuKd0zsEU2wDs3x9Fek18pCkALZT6FjHFVhDaWsLAOEa PxRFMefGy+VhUYrLg2jcUf9fJu1hdEw0QM1YrrRIKxnUUJaJ0ozuKXBrQiM8uE/N2+IM hoXzu4Kj8Yf9mZhq0HKRNUSRgBD/Fpq5Ys/ZXJVHPppKQag9E/Dy5FtRhyWX8n2oslFs RzKTAc/+9WLv6nqmee9rgXl8PXm3m9JYJYemZtEaOJjNRtyDZqnRoj8HwZZ02n/Hp940 RjqOscRwCte3i9PWL+2jeFHUPC0lhtWq3s7mM5RhZ2U+WEW9WTRKgjOepOg8PG7/PdOl TbOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="nEF+bkJ/"; 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 l40si25403891plb.205.2019.08.14.01.01.07; Wed, 14 Aug 2019 01:01:23 -0700 (PDT) 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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="nEF+bkJ/"; 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 S1727223AbfHNH7r (ORCPT + 99 others); Wed, 14 Aug 2019 03:59:47 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:39036 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726991AbfHNH7m (ORCPT ); Wed, 14 Aug 2019 03:59:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From :Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=r4axfViZZyZ+fuvT3jC+Yx773mt75vv7oepOJvLdF2Q=; b=nEF+bkJ/uOpwV81bxUK8L50P0Z Q9Ui9x3uYU+lWOSSyKlo/kpfVGPZD4ATVWu/7NfypeSvK47HYQUE91aiDe65KDhsZtzj04hSIVCC0 JN/Fn/v8ufPUzw9PUFrM5yXHhLzV5/HXXalBESjH2Fx76jVX/d2fjU7Gpu5EO97F9HLUUk+24Pyyc epT+N0O9fWv4t+o3NDEVXqamyWgVyF1owIQOgytq40EuG55oaCJFfnxRakoQhhalTgtj7QN1lCwmw Tz6ym6tXty1XMU/Z4YR1mNVUHEbcBex28dMnceRdP9AkSL13RiBJXvq8xyn++ZfLbudL4jpwya7x9 8sKa9vEA==; Received: from [2001:4bb8:180:1ec3:c70:4a89:bc61:2] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.92 #3 (Red Hat Linux)) id 1hxoC1-0007yA-Cx; Wed, 14 Aug 2019 07:59:38 +0000 From: Christoph Hellwig To: =?UTF-8?q?J=C3=A9r=C3=B4me=20Glisse?= , Jason Gunthorpe , Ben Skeggs Cc: Ralph Campbell , Bharata B Rao , Andrew Morton , linux-mm@kvack.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 02/10] nouveau: reset dma_nr in nouveau_dmem_migrate_alloc_and_copy Date: Wed, 14 Aug 2019 09:59:20 +0200 Message-Id: <20190814075928.23766-3-hch@lst.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190814075928.23766-1-hch@lst.de> References: <20190814075928.23766-1-hch@lst.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When we start a new batch of dma_map operations we need to reset dma_nr, as we start filling a newly allocated array. Signed-off-by: Christoph Hellwig Reviewed-by: Ralph Campbell --- drivers/gpu/drm/nouveau/nouveau_dmem.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/nouveau/nouveau_dmem.c b/drivers/gpu/drm/nouveau/nouveau_dmem.c index 38416798abd4..e696157f771e 100644 --- a/drivers/gpu/drm/nouveau/nouveau_dmem.c +++ b/drivers/gpu/drm/nouveau/nouveau_dmem.c @@ -682,6 +682,7 @@ nouveau_dmem_migrate_alloc_and_copy(struct vm_area_struct *vma, migrate->dma = kmalloc(sizeof(*migrate->dma) * npages, GFP_KERNEL); if (!migrate->dma) goto error; + migrate->dma_nr = 0; /* Copy things over */ copy = drm->dmem->migrate.copy_func; -- 2.20.1