<p dir="ltr"></p>
<p dir="ltr">On 17-Apr-2018 9:45 PM, "Matthew Wilcox" <<a href="mailto:willy@infradead.org">willy@infradead.org</a>> wrote:<br>
><br>
> On Tue, Apr 17, 2018 at 09:14:32PM +0530, Souptick Joarder wrote:<br>
> > Not exactly. The plan for these patches is to introduce new vm_fault_t type<br>
> > in vm_operations_struct fault handlers. It's now available in 4.17-rc1. We will<br>
> > push all the required drivers/filesystem changes through different maintainers<br>
> > to linus tree. Once everything is converted into vm_fault_t type then Changing<br>
> > it from a signed to an unsigned int causes GCC to warn about an assignment<br>
> > from an incompatible type -- int foo(void) is incompatible with<br>
> > unsigned int foo(void).<br>
> > <br>
> > Please refer 1c8f422059ae ("mm: change return type to vm_fault_t") in 4.17-rc1.<br>
><br>
> I think this patch would be clearer if you did<br>
><br>
> - int ret;<br>
> + int err;<br>
> + vm_fault_t ret;<br>
><br>
> Then it would be clearer to the maintainer that you're splitting apart the<br>
> VM_FAULT and errno codes.<br>
><br>
> Sorry for not catching this during initial review. </p>
<p dir="ltr">Ok, I will make required changes and send v2. Sorry, even I missed this :)<br>
><br>
> > On Tue, Apr 17, 2018 at 8:59 PM, Jani Nikula<br>
> > <<a href="mailto:jani.nikula@linux.intel.com">jani.nikula@linux.intel.com</a>> wrote:<br>
> > > On Tue, 17 Apr 2018, Souptick Joarder <<a href="mailto:jrdr.linux@gmail.com">jrdr.linux@gmail.com</a>> wrote:<br>
> > >> Use new return type vm_fault_t for fault handler. For<br>
> > >> now, this is just documenting that the function returns<br>
> > >> a VM_FAULT value rather than an errno. Once all instances<br>
> > >> are converted, vm_fault_t will become a distinct type.<br>
> > >><br>
> > >> Reference id -> 1c8f422059ae ("mm: change return type to<br>
> > >> vm_fault_t")<br>
> > >><br>
> > >> Signed-off-by: Souptick Joarder <<a href="mailto:jrdr.linux@gmail.com">jrdr.linux@gmail.com</a>><br>
> > >> ---<br>
> > >> drivers/gpu/drm/i915/i915_drv.h | 3 ++-<br>
> > >> drivers/gpu/drm/i915/i915_gem.c | 15 ++++++++-------<br>
> > >> 2 files changed, 10 insertions(+), 8 deletions(-)<br>
> > >><br>
> > >> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h<br>
> > >> index a42deeb..95b0d50 100644<br>
> > >> --- a/drivers/gpu/drm/i915/i915_drv.h<br>
> > >> +++ b/drivers/gpu/drm/i915/i915_drv.h<br>
> > >> @@ -51,6 +51,7 @@<br>
> > >> #include <drm/drm_gem.h><br>
> > >> #include <drm/drm_auth.h><br>
> > >> #include <drm/drm_cache.h><br>
> > >> +#include <linux/mm_types.h><br>
> > >><br>
> > >> #include "i915_params.h"<br>
> > >> #include "i915_reg.h"<br>
> > >> @@ -3363,7 +3364,7 @@ int i915_gem_wait_for_idle(struct drm_i915_private *dev_priv,<br>
> > >> unsigned int flags);<br>
> > >> int __must_check i915_gem_suspend(struct drm_i915_private *dev_priv);<br>
> > >> void i915_gem_resume(struct drm_i915_private *dev_priv);<br>
> > >> -int i915_gem_fault(struct vm_fault *vmf);<br>
> > >> +vm_fault_t i915_gem_fault(struct vm_fault *vmf);<br>
> > >> int i915_gem_object_wait(struct drm_i915_gem_object *obj,<br>
> > >> unsigned int flags,<br>
> > >> long timeout,<br>
> > >> diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c<br>
> > >> index dd89abd..bdac690 100644<br>
> > >> --- a/drivers/gpu/drm/i915/i915_gem.c<br>
> > >> +++ b/drivers/gpu/drm/i915/i915_gem.c<br>
> > >> @@ -1882,7 +1882,7 @@ int i915_gem_mmap_gtt_version(void)<br>
> > >> * The current feature set supported by i915_gem_fault() and thus GTT mmaps<br>
> > >> * is exposed via I915_PARAM_MMAP_GTT_VERSION (see i915_gem_mmap_gtt_version).<br>
> > >> */<br>
> > >> -int i915_gem_fault(struct vm_fault *vmf)<br>
> > >> +vm_fault_t i915_gem_fault(struct vm_fault *vmf)<br>
> > >> {<br>
> > >> #define MIN_CHUNK_PAGES ((1 << 20) >> PAGE_SHIFT) /* 1 MiB */<br>
> > >> struct vm_area_struct *area = vmf->vma;<br>
> > >> @@ -1895,6 +1895,7 @@ int i915_gem_fault(struct vm_fault *vmf)<br>
> > >> pgoff_t page_offset;<br>
> > >> unsigned int flags;<br>
> > >> int ret;<br>
> > >> + vm_fault_t retval;<br>
> > ><br>
> > > What's the point of changing the name? An unnecessary change.<br>
> > ><br>
> > > BR,<br>
> > > Jani.<br>
> > ><br>
> > >><br>
> > >> /* We don't use vmf->pgoff since that has the fake offset */<br>
> > >> page_offset = (vmf->address - area->vm_start) >> PAGE_SHIFT;<br>
> > >> @@ -2000,7 +2001,7 @@ int i915_gem_fault(struct vm_fault *vmf)<br>
> > >> * and so needs to be reported.<br>
> > >> */<br>
> > >> if (!i915_terminally_wedged(&dev_priv->gpu_error)) {<br>
> > >> - ret = VM_FAULT_SIGBUS;<br>
> > >> + retval = VM_FAULT_SIGBUS;<br>
> > >> break;<br>
> > >> }<br>
> > >> case -EAGAIN:<br>
> > >> @@ -2017,21 +2018,21 @@ int i915_gem_fault(struct vm_fault *vmf)<br>
> > >> * EBUSY is ok: this just means that another thread<br>
> > >> * already did the job.<br>
> > >> */<br>
> > >> - ret = VM_FAULT_NOPAGE;<br>
> > >> + retval = VM_FAULT_NOPAGE;<br>
> > >> break;<br>
> > >> case -ENOMEM:<br>
> > >> - ret = VM_FAULT_OOM;<br>
> > >> + retval = VM_FAULT_OOM;<br>
> > >> break;<br>
> > >> case -ENOSPC:<br>
> > >> case -EFAULT:<br>
> > >> - ret = VM_FAULT_SIGBUS;<br>
> > >> + retval = VM_FAULT_SIGBUS;<br>
> > >> break;<br>
> > >> default:<br>
> > >> WARN_ONCE(ret, "unhandled error in i915_gem_fault: %i\n", ret);<br>
> > >> - ret = VM_FAULT_SIGBUS;<br>
> > >> + retval = VM_FAULT_SIGBUS;<br>
> > >> break;<br>
> > >> }<br>
> > >> - return ret;<br>
> > >> + return retval;<br>
> > >> }<br>
> > >><br>
> > >> static void __i915_gem_object_release_mmap(struct drm_i915_gem_object *obj)<br>
> > >> --<br>
> > >> 1.9.1<br>
> > >><br>
> > ><br>
> > > --<br>
> > > Jani Nikula, Intel Open Source Technology Center<br></p>