Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp4152331ybi; Mon, 29 Jul 2019 20:24:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqyNtVsz7WsMvjDmn1HfpkIvZ5+WjeIfFDabPo4XpYjalcZbyblp9FiXMpxeRkdY+SRb3VED X-Received: by 2002:a62:e71a:: with SMTP id s26mr38486899pfh.89.1564457061314; Mon, 29 Jul 2019 20:24:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564457061; cv=none; d=google.com; s=arc-20160816; b=GGAtOtfxL3V9e2tc6QZnq49t4BGNxCrR8E8OTPswRNEt9l3BD+a+UEzLDU8xSgdiSf kGeHJiElxUOF5UPoPtU7IjarP4DRGlED7YoC4x9zZltrsnGE1QpAcGdzEoyBOIiuL+SK zP5blavtMDRClsaRONTCf/HOgsBRukE6sEkXdVDDxYn77XnwDcHAGjLdzBYfgtQiwQjl zlDZv7VqDBkgiuhbhhvQUn9BrowIRFoQcJGzEu3Cisqyc0Bf8i+KLcBYWb7VeacHg0F+ KEz+KlVc17hSspHvFJBBGM+Qk5UgtqawgDeNGb+jYgU5anrLDV5uCYnqJmgy4Tk+I48l qHxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=wffttBld7HfMmTsUtcVoraIE8ihlJ8+LyvWPe1N6NlM=; b=L39DKnEqrO6Xdoe2u5ngps2OOhO8e0wpZop17WrKkfN/muOlr5IOGSw7gWuZZfvalO tjwp3Hl+x9ZwVc2rxvDEqa0g+/C+lJxD87TJGSmaUn5NoWjdcI+wQfvtLA3j8j28RTBP RZlrZ450IZv5ar3OAoPXeMz59fmVgO2qCIUUlF8jL+hSnsbKuMJamqoZ/W+2O6tGAdsY lW9wANGeI04vCqbyI6g8ckP2SrQN01LyxTdsRb0jJ3vXIBvOiWm6ofeSugz7IuEoUSTm 1FRSm3Jyk4CArAMn2K5LYPZSapCVryFLjAzwcwQJqMELfRzYXudGoYaQ1qCoTBmv5+BI nc3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=qJYB6wAP; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g6si27886818pll.82.2019.07.29.20.24.07; Mon, 29 Jul 2019 20:24:21 -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=pass header.i=@nvidia.com header.s=n1 header.b=qJYB6wAP; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729448AbfG2XSS (ORCPT + 99 others); Mon, 29 Jul 2019 19:18:18 -0400 Received: from hqemgate14.nvidia.com ([216.228.121.143]:16914 "EHLO hqemgate14.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727808AbfG2XSR (ORCPT ); Mon, 29 Jul 2019 19:18:17 -0400 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqemgate14.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Mon, 29 Jul 2019 16:18:18 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Mon, 29 Jul 2019 16:18:17 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Mon, 29 Jul 2019 16:18:17 -0700 Received: from rcampbell-dev.nvidia.com (10.124.1.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 29 Jul 2019 23:18:13 +0000 Subject: Re: [PATCH 2/9] nouveau: reset dma_nr in nouveau_dmem_migrate_alloc_and_copy To: Christoph Hellwig , =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , Jason Gunthorpe , Ben Skeggs CC: Bharata B Rao , Andrew Morton , , , , References: <20190729142843.22320-1-hch@lst.de> <20190729142843.22320-3-hch@lst.de> X-Nvconfidentiality: public From: Ralph Campbell Message-ID: <26260dd4-f28d-f962-9e38-8bde45335099@nvidia.com> Date: Mon, 29 Jul 2019 16:18:12 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <20190729142843.22320-3-hch@lst.de> X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL107.nvidia.com (172.20.187.13) Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1564442298; bh=wffttBld7HfMmTsUtcVoraIE8ihlJ8+LyvWPe1N6NlM=; h=X-PGP-Universal:Subject:To:CC:References:X-Nvconfidentiality:From: Message-ID:Date:User-Agent:MIME-Version:In-Reply-To: X-Originating-IP:X-ClientProxiedBy:Content-Type:Content-Language: Content-Transfer-Encoding; b=qJYB6wAPLve6SzMmp5MpWUWQdHoVK+fKim4roGerZZ+H77Co/BQ9+sH3W3tA6tGo6 Qw/ilm9/0g7HpgRfqMM+KqB6PldKNV2/X0EkW+vFmEjKH+/0MNIWB6wXrj1YRUXzwL RCt1HZmcafUvz8j6lns2XXyvcNxg18HpUEpVLEIFOxdtlbLEFvJd6EcuvIHmAssuwk Cu4w6L02s0iaeg0/0OBAUj/7DCbe0uWiSDRevgQpB8N02P0daSKT5OUL6ZfFrUxc/w HIneiuZFGw8uM87zuhdk7izVmIFJFBcoLp4P1KO4Qcu2x+7vZZLRIMwj2jxvykh/K3 cvQCTOyBkvhYA== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/29/19 7:28 AM, Christoph Hellwig wrote: > 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; >