Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3132350imu; Sun, 27 Jan 2019 22:32:25 -0800 (PST) X-Google-Smtp-Source: ALg8bN5peg0s9fdKfrtYNprcmkvTa6OttElEZDvCxwZNjrMO8eayAPXubvD9fAHcTd/J3clDxfTY X-Received: by 2002:a17:902:5a4d:: with SMTP id f13mr21260810plm.49.1548657145128; Sun, 27 Jan 2019 22:32:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548657145; cv=none; d=google.com; s=arc-20160816; b=AkZ8NAFzn5V1y8O+VQ2rZ0I2qEqM6OUMXyhoUpDLwfEVZPmrIWBmTFazkpj2nCzxs5 j80UvbEa2leKFhg3Cm4hOaKjAe9YzCoc7oiu3HseQv9N9rmtvuAu0AquCBf/hqTd4Fdu 1RTR8hsw9fG3JhaOGRsCeK7yMqjlXrEAHLGrEf3BlGEwr2Tpos3nFc3cTXEOjyjgD7jY 1itB7yV2JTtkRnm2hBqKYvM+24tqJh7kFDSLPwFSvDCQf2w9sz6D6mmdD4dbe1+Rezkj Hy91DIHPI09FkyVrmOACDwC8cvaHq+EGts8zrtcdEPAwTEjfWRtv/5qNioug0COHsHXu NV8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=o//iVq3hBTHa9XD8DZInYP3EOrEMWQQBv8sSLizNJeg=; b=TVEnQCKIUgK+MYJ8j4eccgeJO6FAXsN/W6kRuOt9ExxGY88QEqda8t7g70iH27keI1 AGl2Rvc+vQGjMTcq9N6DLRBqtVY8Wp7dIygAIxZRiQD2Owl0e+CSo/H1Fl+8+DgIhpZi zd7npqNKp01B31vffdhq1vr6mHeY3garBykaY6gJDD/RDzR8s3LjFTC+q4yPlQzHvjX0 +LaIhAmFt80/HzfkhHS7TNwji5YC+WHHcppC36m5rId1Wum8aLdUcZqsPYsLg4ERjAkA 4qAOTWg6Lw+HC/DarvZg1AzoncFSdTz69x1NDRanSDMlp8GKASR6vzwEMzoOovVn2NTL HWaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ATzekJRR; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o89si31622217pfk.223.2019.01.27.22.32.09; Sun, 27 Jan 2019 22:32:25 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ATzekJRR; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726744AbfA1Gb0 (ORCPT + 99 others); Mon, 28 Jan 2019 01:31:26 -0500 Received: from mail-lj1-f195.google.com ([209.85.208.195]:37740 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726150AbfA1Gb0 (ORCPT ); Mon, 28 Jan 2019 01:31:26 -0500 Received: by mail-lj1-f195.google.com with SMTP id t18-v6so13193768ljd.4 for ; Sun, 27 Jan 2019 22:31:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=o//iVq3hBTHa9XD8DZInYP3EOrEMWQQBv8sSLizNJeg=; b=ATzekJRRvtQGucujNrDFXsV130pA0J7dxJD3Z4UK26nneQ0dIukUNKx6fW2rYIh1S9 OI7tn4VuC/2xTJjr74eh9f8zZ3WKdMrF0NkG7xH/VwsTPaFKAjVK4Iy6eymY9yz+tTqp wPJKJcMtN+1Ih7jQsPN1/4jcZwL+CaCvZGfq97ezVCBPFi6vkjj+HVyy67HvPHfl4+pz 1cEexzurgJie7Dvbj2YEg4VCl/HGnCyxuE4gHnsSTdLaV+sLCY16cvZgQVhnzAgdr6gI TLiTTKA89ErBtmCJeLFhXPkDppx2Zh4Hu4sP57CvbL6xZUsSGbqyDpl4CYRwc0Kupb+x csSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=o//iVq3hBTHa9XD8DZInYP3EOrEMWQQBv8sSLizNJeg=; b=i1DDUQPNM3+lb9mn2qJa5TeJug6ADwSwjrCjtHGboQgUGwbtGB8hqvBhMSKlmzbYGr Rp1bGbijtaOdcdTwSRABDt0RNsjbGSW5wz8o+twM2taXM8UbW/PTWXbXpIg2jxph5iku x8u03fJ/0MIu/zntAEsebSTwjjL3ivuc3FrT1tSSQPiR+4PIYaUir0QQbo8grH9OoacS 9BqCwj8v2RTFy3Esad3STRGDTuh8rAJ98EfMUBAxWp8HqBXp8Qxb0jUYThFh9zX295N1 tAPRsIQWEtugDGtzf+zo7rr94yIYGruYhGoOm3zZyFUCaGbrgOLApZy/O+7021noav/F yEpg== X-Gm-Message-State: AJcUukezssiQDhEJwvG+3XzQlHsAthGCXG02TA7QvdkZuML5g+bD9FkM D5nzlX65hFUOJ2Qf+d3pB5YZYMeW+vBwMO5VKdQ= X-Received: by 2002:a2e:5703:: with SMTP id l3-v6mr4691341ljb.106.1548657084389; Sun, 27 Jan 2019 22:31:24 -0800 (PST) MIME-Version: 1.0 References: <20190111150933.GA2760@jordon-HP-15-Notebook-PC> In-Reply-To: <20190111150933.GA2760@jordon-HP-15-Notebook-PC> From: Souptick Joarder Date: Mon, 28 Jan 2019 12:01:12 +0530 Message-ID: Subject: Re: [PATCH 4/9] drm/rockchip/rockchip_drm_gem.c: Convert to use vm_insert_range To: Andrew Morton , Matthew Wilcox , Michal Hocko , hjc@rock-chips.com, Heiko Stuebner , airlied@linux.ie, Russell King - ARM Linux , robin.murphy@arm.com Cc: linux-kernel@vger.kernel.org, Linux-MM , linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org, linux-rockchip@lists.infradead.org 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 On Fri, Jan 11, 2019 at 8:35 PM Souptick Joarder wrote: > > Convert to use vm_insert_range() to map range of kernel > memory to user vma. > > Signed-off-by: Souptick Joarder Any comment on this patch ? > --- > drivers/gpu/drm/rockchip/rockchip_drm_gem.c | 17 ++--------------- > 1 file changed, 2 insertions(+), 15 deletions(-) > > diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c > index a8db758..c9e207f 100644 > --- a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c > +++ b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c > @@ -221,26 +221,13 @@ static int rockchip_drm_gem_object_mmap_iommu(struct drm_gem_object *obj, > struct vm_area_struct *vma) > { > struct rockchip_gem_object *rk_obj = to_rockchip_obj(obj); > - unsigned int i, count = obj->size >> PAGE_SHIFT; > + unsigned int count = obj->size >> PAGE_SHIFT; > unsigned long user_count = vma_pages(vma); > - unsigned long uaddr = vma->vm_start; > - unsigned long offset = vma->vm_pgoff; > - unsigned long end = user_count + offset; > - int ret; > > if (user_count == 0) > return -ENXIO; > - if (end > count) > - return -ENXIO; > > - for (i = offset; i < end; i++) { > - ret = vm_insert_page(vma, uaddr, rk_obj->pages[i]); > - if (ret) > - return ret; > - uaddr += PAGE_SIZE; > - } > - > - return 0; > + return vm_insert_range(vma, rk_obj->pages, count); > } > > static int rockchip_drm_gem_object_mmap_dma(struct drm_gem_object *obj, > -- > 1.9.1 >