Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3686074ybi; Mon, 29 Jul 2019 10:46:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqwd4ZLswArvTiRTN2UEgm95iCG/BnonGRFNwbIalV0GrbOPRefEAsQ10yRJdkX73dWjFDpM X-Received: by 2002:a17:90a:246f:: with SMTP id h102mr111730969pje.126.1564422371032; Mon, 29 Jul 2019 10:46:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564422371; cv=none; d=google.com; s=arc-20160816; b=SMHg1MyAVyQgsSPyrG59rLXqGQhZwUzBIbyVNf2kwLG3QiR1anYUIt/RpOQo3IU2ft HFKqfJmbdAU2yEvEyPgJLL3g+w6Yrxxbm+YRD+joemkNrYojIsoIxRA/0xibkvQGuaQx q1VZ5Gvx7qOpohBWyJrQOzhH6l87YDV72aB7AGFVkF9EN5qtJwIXS5yfo44EqAWDEXtG 4SB09lVHDUzYgClfw9pZq/vGewqxh8XVHztijGfOF8cDTeB+W47mPUM7o2AYoX1c6oaZ kBqlSsL/Yxuw27g+pdcxPqdntPqc5h32Gyjbn0FmHDCe+QHUcx4GC4EzXhV3JV/BggkF QYSA== 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=rLwKSOlafAJb8n3hQj6kWA/VptqS/47DN+jL5NpRAcY=; b=aFiQScsANBu2Mn/YTP+Lyb0Xm27q8YB/p1u6+7reyHgAD++1+yXsAK5PXT0H01Ehiw TCetF8uL+jm5BV+y9SPiLp2HlNSoJxyIKKjCRTHguIH2tZxdxmok+r/jz39SCxFZuR5r zjFu4LKLssGuJlGUlWCRhmZycc1V0k2//uLpxgZdkCoqqGLT4jaydD857q/lvYrE0Pog 3b6dExoR/UlQ2Fs4tC6nDMI4o2Z0IUtR2ma0LcIPp+YMWz3s1pRUEGUxf/sWS/i8hXQl oVFGTg+7asRwYw3+6+yEvYXH8m3Ia5aGvSqBY0QyRxChl+HWnVarWwFJYMBlEuXTpIOI ZS0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=A+IRZ8M1; 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 x12si25556413plo.64.2019.07.29.10.45.56; Mon, 29 Jul 2019 10:46:11 -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=A+IRZ8M1; 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 S1728321AbfG2O3H (ORCPT + 99 others); Mon, 29 Jul 2019 10:29:07 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:46868 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726190AbfG2O3G (ORCPT ); Mon, 29 Jul 2019 10:29:06 -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=rLwKSOlafAJb8n3hQj6kWA/VptqS/47DN+jL5NpRAcY=; b=A+IRZ8M1YJH2N/gpPN/5CPiigV i/LsLL/cCmEExGvDC7zuiAS3QzG/GI0Ed8MghHETAe8DC5dwOCftZsYXuDgDha21U89uP4jRALlx6 wYIarlhg/pz70o5kgZxi0oDVRBFxgi2caIj3mgBuRcZbFBF84n+3Ps25EnKxvguNY8dZm/GG6xlCO 2lPhHQ1IEuUTTjUmEPOo7Qx6Ji0Inu5VxdUlf2aSxirRwZtpZ4Rn+/aQ8E3fFDscxF8hLpUOco1PP s5Nej8OFdg0xkTb7AewQR47WxbZ4yp+Hr/wJShONMpmmeawP3eh4LVmkE0GVIWJAp4keNUAaACguQ uGoMGT8A==; Received: from [195.167.85.94] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.92 #3 (Red Hat Linux)) id 1hs6e4-0006JM-9F; Mon, 29 Jul 2019 14:29:00 +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 2/9] nouveau: reset dma_nr in nouveau_dmem_migrate_alloc_and_copy Date: Mon, 29 Jul 2019 17:28:36 +0300 Message-Id: <20190729142843.22320-3-hch@lst.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190729142843.22320-1-hch@lst.de> References: <20190729142843.22320-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 --- 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