From patchwork Tue Apr 17 15:11:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Souptick Joarder X-Patchwork-Id: 10348057 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 35FB260365 for ; Wed, 18 Apr 2018 12:17:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 257B6285E8 for ; Wed, 18 Apr 2018 12:17:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 19B24285ED; Wed, 18 Apr 2018 12:17:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C95A7285E8 for ; Wed, 18 Apr 2018 12:17:10 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 820326E56B; Wed, 18 Apr 2018 12:17:08 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-pl0-x243.google.com (mail-pl0-x243.google.com [IPv6:2607:f8b0:400e:c01::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4699C6E107; Tue, 17 Apr 2018 15:09:35 +0000 (UTC) Received: by mail-pl0-x243.google.com with SMTP id t20-v6so12149851ply.9; Tue, 17 Apr 2018 08:09:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=qEqymeLFQhobON55M3xHB50NKElZpx1R5iXH7HUodtY=; b=Xw1VAiKNpKQh7mrd3HhGYGNimge/sXO3Tkao5gOEQjgvQLu0By6CoikJBNST24sX/u JvfQt7UUnudpFbUkIMEMRU94gbwxpL501xrzy4wl7It700+RVHOreoBs8N8/+Tss62wQ Kj8kHSbKDA5u1MvJIPsDRpYBRSKGGWRRD6S71U7tiN2VBBy7qgLACyRgd0FEvhkDlN2U EB+hn+aG5Yd2uICplwfiX1zPMVfVVjpZp6AIE+tDTg+xKg+0/jNtoI1Tok0YTwCGpdM8 GXBHi7W1aA+jcIXbqy6yVR6FSbT1QWx/cxrmtVXQ6J42qwF05Wr0OcVM196zQDMR31vO 3rqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=qEqymeLFQhobON55M3xHB50NKElZpx1R5iXH7HUodtY=; b=oXUrfRuQyPXIx1WuDyqgJo6tsfZRqOzHA8+k2WHpnpEoCfUs6s/wIyp3wtNW2b4vyJ UB2P6yOMdnXdW9mmfM0MRqfxaSX1o+ssiWGZoTmmTS85qybz5CUDvAuyBF96fGZNXZ1r U7z7eZMZ4H+hADGqity0Ly0n0GMdepR0B0XRMUFmXO3Yej5Iskg2hfFn5SOZgbEQYvsg gNDK5fXGl78OigY89kgyVUFIqI/e4VjMy7jnNZL5ayX2RD5Jni/Y4r5J7YiDjWgLMT1m OpXlwKvppQGE9vld2TDOPy5nXOzKHb7RmNPB007c9vrNqmNaAAPeuwzZTpLswAT5mWSe +D2Q== X-Gm-Message-State: ALQs6tCXIPmNCDK4HlO6UnCXod31KGhcBLtsBsioPzaDMpEPms1wEMkI sTeqbVaeBYX/poLy/SvkJNY= X-Google-Smtp-Source: AIpwx49xGvc7t/fmIb2dY4aza3BfvUF0AWuD6BgZZej0/rSrECMEqFKxqXEmoZ9ImTYhAgkgSKLa1w== X-Received: by 2002:a17:902:5a5:: with SMTP id f34-v6mr2376241plf.288.1523977774363; Tue, 17 Apr 2018 08:09:34 -0700 (PDT) Received: from jordon-HP-15-Notebook-PC ([183.82.18.42]) by smtp.gmail.com with ESMTPSA id b3sm25898987pfi.54.2018.04.17.08.09.31 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Apr 2018 08:09:32 -0700 (PDT) Date: Tue, 17 Apr 2018 20:41:27 +0530 From: Souptick Joarder To: jani.nikula@linux.intel.com, joonas.lahtinen@linux.intel.com, rodrigo.vivi@intel.com, airlied@linux.ie Message-ID: <20180417151127.GA31655@jordon-HP-15-Notebook-PC> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Mailman-Approved-At: Wed, 18 Apr 2018 12:17:02 +0000 Subject: [Intel-gfx] [PATCH] gpu: drm: i915: Change return type to vm_fault_t X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: intel-gfx@lists.freedesktop.org, willy@infradead.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP Use new return type vm_fault_t for fault handler. For now, this is just documenting that the function returns a VM_FAULT value rather than an errno. Once all instances are converted, vm_fault_t will become a distinct type. Reference id -> 1c8f422059ae ("mm: change return type to vm_fault_t") Signed-off-by: Souptick Joarder --- drivers/gpu/drm/i915/i915_drv.h | 3 ++- drivers/gpu/drm/i915/i915_gem.c | 15 ++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) -- 1.9.1 diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index a42deeb..95b0d50 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -51,6 +51,7 @@ #include #include #include +#include #include "i915_params.h" #include "i915_reg.h" @@ -3363,7 +3364,7 @@ int i915_gem_wait_for_idle(struct drm_i915_private *dev_priv, unsigned int flags); int __must_check i915_gem_suspend(struct drm_i915_private *dev_priv); void i915_gem_resume(struct drm_i915_private *dev_priv); -int i915_gem_fault(struct vm_fault *vmf); +vm_fault_t i915_gem_fault(struct vm_fault *vmf); int i915_gem_object_wait(struct drm_i915_gem_object *obj, unsigned int flags, long timeout, diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index dd89abd..bdac690 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -1882,7 +1882,7 @@ int i915_gem_mmap_gtt_version(void) * The current feature set supported by i915_gem_fault() and thus GTT mmaps * is exposed via I915_PARAM_MMAP_GTT_VERSION (see i915_gem_mmap_gtt_version). */ -int i915_gem_fault(struct vm_fault *vmf) +vm_fault_t i915_gem_fault(struct vm_fault *vmf) { #define MIN_CHUNK_PAGES ((1 << 20) >> PAGE_SHIFT) /* 1 MiB */ struct vm_area_struct *area = vmf->vma; @@ -1895,6 +1895,7 @@ int i915_gem_fault(struct vm_fault *vmf) pgoff_t page_offset; unsigned int flags; int ret; + vm_fault_t retval; /* We don't use vmf->pgoff since that has the fake offset */ page_offset = (vmf->address - area->vm_start) >> PAGE_SHIFT; @@ -2000,7 +2001,7 @@ int i915_gem_fault(struct vm_fault *vmf) * and so needs to be reported. */ if (!i915_terminally_wedged(&dev_priv->gpu_error)) { - ret = VM_FAULT_SIGBUS; + retval = VM_FAULT_SIGBUS; break; } case -EAGAIN: @@ -2017,21 +2018,21 @@ int i915_gem_fault(struct vm_fault *vmf) * EBUSY is ok: this just means that another thread * already did the job. */ - ret = VM_FAULT_NOPAGE; + retval = VM_FAULT_NOPAGE; break; case -ENOMEM: - ret = VM_FAULT_OOM; + retval = VM_FAULT_OOM; break; case -ENOSPC: case -EFAULT: - ret = VM_FAULT_SIGBUS; + retval = VM_FAULT_SIGBUS; break; default: WARN_ONCE(ret, "unhandled error in i915_gem_fault: %i\n", ret); - ret = VM_FAULT_SIGBUS; + retval = VM_FAULT_SIGBUS; break; } - return ret; + return retval; } static void __i915_gem_object_release_mmap(struct drm_i915_gem_object *obj)