All of lore.kernel.org
 help / color / mirror / Atom feed
From: Souptick Joarder <jrdr.linux@gmail.com>
To: jani.nikula@linux.intel.com, joonas.lahtinen@linux.intel.com,
	rodrigo.vivi@intel.com, airlied@linux.ie
Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org, willy@infradead.org
Subject: [PATCH] gpu: drm: i915: Change return type to vm_fault_t
Date: Tue, 17 Apr 2018 20:41:27 +0530	[thread overview]
Message-ID: <20180417151127.GA31655@jordon-HP-15-Notebook-PC> (raw)

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 <jrdr.linux@gmail.com>
---
 drivers/gpu/drm/i915/i915_drv.h |  3 ++-
 drivers/gpu/drm/i915/i915_gem.c | 15 ++++++++-------
 2 files changed, 10 insertions(+), 8 deletions(-)

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 <drm/drm_gem.h>
 #include <drm/drm_auth.h>
 #include <drm/drm_cache.h>
+#include <linux/mm_types.h>

 #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)
--
1.9.1

             reply	other threads:[~2018-04-17 15:09 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-17 15:11 Souptick Joarder [this message]
2018-04-17 15:29 ` [PATCH] gpu: drm: i915: Change return type to vm_fault_t Jani Nikula
2018-04-17 15:29   ` Jani Nikula
2018-04-17 15:44   ` Souptick Joarder
2018-04-17 16:15     ` Matthew Wilcox
2018-04-17 16:15       ` Matthew Wilcox
2018-04-17 16:27       ` Souptick Joarder
2018-04-18  5:46         ` Jani Nikula
2018-04-20 22:13           ` [Intel-gfx] " Rodrigo Vivi
2018-04-20 22:13             ` Rodrigo Vivi
2018-04-17 16:18   ` Daniel Vetter
2018-04-17 16:18     ` Daniel Vetter
2018-04-18 15:54 ` ✗ Fi.CI.CHECKPATCH: warning for gpu: drm: i915: Change return type to vm_fault_t (rev2) Patchwork
2018-04-18 18:22   ` Souptick Joarder
2018-04-18 15:54 ` ✗ Fi.CI.SPARSE: " Patchwork
2018-04-18 16:08 ` ✓ Fi.CI.BAT: success " Patchwork
2018-04-18 21:06 ` ✓ Fi.CI.IGT: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180417151127.GA31655@jordon-HP-15-Notebook-PC \
    --to=jrdr.linux@gmail.com \
    --cc=airlied@linux.ie \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=joonas.lahtinen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rodrigo.vivi@intel.com \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.