* [PATCH] gpu: drm: i915: Change return type to vm_fault_t
@ 2018-04-17 15:11 Souptick Joarder
2018-04-17 15:29 ` Jani Nikula
` (4 more replies)
0 siblings, 5 replies; 17+ messages in thread
From: Souptick Joarder @ 2018-04-17 15:11 UTC (permalink / raw)
To: jani.nikula, joonas.lahtinen, rodrigo.vivi, airlied
Cc: intel-gfx, dri-devel, linux-kernel, willy
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
^ permalink raw reply related [flat|nested] 17+ messages in thread
* Re: [PATCH] gpu: drm: i915: Change return type to vm_fault_t
2018-04-17 15:11 [PATCH] gpu: drm: i915: Change return type to vm_fault_t Souptick Joarder
@ 2018-04-17 15:29 ` Jani Nikula
2018-04-18 15:54 ` ✗ Fi.CI.CHECKPATCH: warning for gpu: drm: i915: Change return type to vm_fault_t (rev2) Patchwork
` (3 subsequent siblings)
4 siblings, 0 replies; 17+ messages in thread
From: Jani Nikula @ 2018-04-17 15:29 UTC (permalink / raw)
To: Souptick Joarder, joonas.lahtinen, rodrigo.vivi, airlied
Cc: intel-gfx, dri-devel, linux-kernel, willy
On Tue, 17 Apr 2018, Souptick Joarder <jrdr.linux@gmail.com> wrote:
> 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;
What's the point of changing the name? An unnecessary change.
BR,
Jani.
>
> /* 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
>
--
Jani Nikula, Intel Open Source Technology Center
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH] gpu: drm: i915: Change return type to vm_fault_t
@ 2018-04-17 15:29 ` Jani Nikula
0 siblings, 0 replies; 17+ messages in thread
From: Jani Nikula @ 2018-04-17 15:29 UTC (permalink / raw)
To: Souptick Joarder, joonas.lahtinen, rodrigo.vivi, airlied
Cc: intel-gfx, willy, linux-kernel, dri-devel
On Tue, 17 Apr 2018, Souptick Joarder <jrdr.linux@gmail.com> wrote:
> 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;
What's the point of changing the name? An unnecessary change.
BR,
Jani.
>
> /* 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
>
--
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH] gpu: drm: i915: Change return type to vm_fault_t
2018-04-17 15:29 ` Jani Nikula
(?)
@ 2018-04-17 15:44 ` Souptick Joarder
2018-04-17 16:15 ` Matthew Wilcox
-1 siblings, 1 reply; 17+ messages in thread
From: Souptick Joarder @ 2018-04-17 15:44 UTC (permalink / raw)
To: Jani Nikula
Cc: joonas.lahtinen, rodrigo.vivi, airlied, intel-gfx, dri-devel,
linux-kernel, Matthew Wilcox
Not exactly. The plan for these patches is to introduce new vm_fault_t type
in vm_operations_struct fault handlers. It's now available in 4.17-rc1. We will
push all the required drivers/filesystem changes through different maintainers
to linus tree. Once everything is converted into vm_fault_t type then Changing
it from a signed to an unsigned int causes GCC to warn about an assignment
from an incompatible type -- int foo(void) is incompatible with
unsigned int foo(void).
Please refer 1c8f422059ae ("mm: change return type to vm_fault_t") in 4.17-rc1.
On Tue, Apr 17, 2018 at 8:59 PM, Jani Nikula
<jani.nikula@linux.intel.com> wrote:
> On Tue, 17 Apr 2018, Souptick Joarder <jrdr.linux@gmail.com> wrote:
>> 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;
>
> What's the point of changing the name? An unnecessary change.
>
> BR,
> Jani.
>
>>
>> /* 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
>>
>
> --
> Jani Nikula, Intel Open Source Technology Center
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH] gpu: drm: i915: Change return type to vm_fault_t
2018-04-17 15:44 ` Souptick Joarder
@ 2018-04-17 16:15 ` Matthew Wilcox
0 siblings, 0 replies; 17+ messages in thread
From: Matthew Wilcox @ 2018-04-17 16:15 UTC (permalink / raw)
To: Souptick Joarder
Cc: Jani Nikula, joonas.lahtinen, rodrigo.vivi, airlied, intel-gfx,
dri-devel, linux-kernel
On Tue, Apr 17, 2018 at 09:14:32PM +0530, Souptick Joarder wrote:
> Not exactly. The plan for these patches is to introduce new vm_fault_t type
> in vm_operations_struct fault handlers. It's now available in 4.17-rc1. We will
> push all the required drivers/filesystem changes through different maintainers
> to linus tree. Once everything is converted into vm_fault_t type then Changing
> it from a signed to an unsigned int causes GCC to warn about an assignment
> from an incompatible type -- int foo(void) is incompatible with
> unsigned int foo(void).
>
> Please refer 1c8f422059ae ("mm: change return type to vm_fault_t") in 4.17-rc1.
I think this patch would be clearer if you did
- int ret;
+ int err;
+ vm_fault_t ret;
Then it would be clearer to the maintainer that you're splitting apart the
VM_FAULT and errno codes.
Sorry for not catching this during initial review.
> On Tue, Apr 17, 2018 at 8:59 PM, Jani Nikula
> <jani.nikula@linux.intel.com> wrote:
> > On Tue, 17 Apr 2018, Souptick Joarder <jrdr.linux@gmail.com> wrote:
> >> 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;
> >
> > What's the point of changing the name? An unnecessary change.
> >
> > BR,
> > Jani.
> >
> >>
> >> /* 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
> >>
> >
> > --
> > Jani Nikula, Intel Open Source Technology Center
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH] gpu: drm: i915: Change return type to vm_fault_t
@ 2018-04-17 16:15 ` Matthew Wilcox
0 siblings, 0 replies; 17+ messages in thread
From: Matthew Wilcox @ 2018-04-17 16:15 UTC (permalink / raw)
To: Souptick Joarder
Cc: airlied, intel-gfx, linux-kernel, dri-devel, rodrigo.vivi
On Tue, Apr 17, 2018 at 09:14:32PM +0530, Souptick Joarder wrote:
> Not exactly. The plan for these patches is to introduce new vm_fault_t type
> in vm_operations_struct fault handlers. It's now available in 4.17-rc1. We will
> push all the required drivers/filesystem changes through different maintainers
> to linus tree. Once everything is converted into vm_fault_t type then Changing
> it from a signed to an unsigned int causes GCC to warn about an assignment
> from an incompatible type -- int foo(void) is incompatible with
> unsigned int foo(void).
>
> Please refer 1c8f422059ae ("mm: change return type to vm_fault_t") in 4.17-rc1.
I think this patch would be clearer if you did
- int ret;
+ int err;
+ vm_fault_t ret;
Then it would be clearer to the maintainer that you're splitting apart the
VM_FAULT and errno codes.
Sorry for not catching this during initial review.
> On Tue, Apr 17, 2018 at 8:59 PM, Jani Nikula
> <jani.nikula@linux.intel.com> wrote:
> > On Tue, 17 Apr 2018, Souptick Joarder <jrdr.linux@gmail.com> wrote:
> >> 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;
> >
> > What's the point of changing the name? An unnecessary change.
> >
> > BR,
> > Jani.
> >
> >>
> >> /* 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
> >>
> >
> > --
> > Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH] gpu: drm: i915: Change return type to vm_fault_t
2018-04-17 15:29 ` Jani Nikula
@ 2018-04-17 16:18 ` Daniel Vetter
-1 siblings, 0 replies; 17+ messages in thread
From: Daniel Vetter @ 2018-04-17 16:18 UTC (permalink / raw)
To: Jani Nikula
Cc: Souptick Joarder, Joonas Lahtinen, Rodrigo Vivi, Dave Airlie,
intel-gfx, Matthew Wilcox, Linux Kernel Mailing List, dri-devel
On Tue, Apr 17, 2018 at 5:29 PM, Jani Nikula
<jani.nikula@linux.intel.com> wrote:
> On Tue, 17 Apr 2018, Souptick Joarder <jrdr.linux@gmail.com> wrote:
>> 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;
>
> What's the point of changing the name? An unnecessary change.
int ret;
already exists and is used. You can't also have a vm_fault_t ret; on
top of that :-)
-Daniel
>
> BR,
> Jani.
>
>>
>> /* 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
>>
>
> --
> Jani Nikula, Intel Open Source Technology Center
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH] gpu: drm: i915: Change return type to vm_fault_t
@ 2018-04-17 16:18 ` Daniel Vetter
0 siblings, 0 replies; 17+ messages in thread
From: Daniel Vetter @ 2018-04-17 16:18 UTC (permalink / raw)
To: Jani Nikula
Cc: dri-devel, Dave Airlie, intel-gfx, Linux Kernel Mailing List,
Matthew Wilcox, Souptick Joarder, Rodrigo Vivi
On Tue, Apr 17, 2018 at 5:29 PM, Jani Nikula
<jani.nikula@linux.intel.com> wrote:
> On Tue, 17 Apr 2018, Souptick Joarder <jrdr.linux@gmail.com> wrote:
>> 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;
>
> What's the point of changing the name? An unnecessary change.
int ret;
already exists and is used. You can't also have a vm_fault_t ret; on
top of that :-)
-Daniel
>
> BR,
> Jani.
>
>>
>> /* 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
>>
>
> --
> Jani Nikula, Intel Open Source Technology Center
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH] gpu: drm: i915: Change return type to vm_fault_t
2018-04-17 16:15 ` Matthew Wilcox
(?)
@ 2018-04-17 16:27 ` Souptick Joarder
2018-04-18 5:46 ` Jani Nikula
-1 siblings, 1 reply; 17+ messages in thread
From: Souptick Joarder @ 2018-04-17 16:27 UTC (permalink / raw)
To: Matthew Wilcox; +Cc: airlied, intel-gfx, linux-kernel, dri-devel, rodrigo.vivi
[-- Attachment #1.1: Type: text/plain, Size: 5561 bytes --]
On 17-Apr-2018 9:45 PM, "Matthew Wilcox" <willy@infradead.org> wrote:
>
> On Tue, Apr 17, 2018 at 09:14:32PM +0530, Souptick Joarder wrote:
> > Not exactly. The plan for these patches is to introduce new vm_fault_t
type
> > in vm_operations_struct fault handlers. It's now available in 4.17-rc1.
We will
> > push all the required drivers/filesystem changes through different
maintainers
> > to linus tree. Once everything is converted into vm_fault_t type then
Changing
> > it from a signed to an unsigned int causes GCC to warn about an
assignment
> > from an incompatible type -- int foo(void) is incompatible with
> > unsigned int foo(void).
> >
> > Please refer 1c8f422059ae ("mm: change return type to vm_fault_t") in
4.17-rc1.
>
> I think this patch would be clearer if you did
>
> - int ret;
> + int err;
> + vm_fault_t ret;
>
> Then it would be clearer to the maintainer that you're splitting apart the
> VM_FAULT and errno codes.
>
> Sorry for not catching this during initial review.
Ok, I will make required changes and send v2. Sorry, even I missed this :)
>
> > On Tue, Apr 17, 2018 at 8:59 PM, Jani Nikula
> > <jani.nikula@linux.intel.com> wrote:
> > > On Tue, 17 Apr 2018, Souptick Joarder <jrdr.linux@gmail.com> wrote:
> > >> 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;
> > >
> > > What's the point of changing the name? An unnecessary change.
> > >
> > > BR,
> > > Jani.
> > >
> > >>
> > >> /* 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
> > >>
> > >
> > > --
> > > Jani Nikula, Intel Open Source Technology Center
[-- Attachment #1.2: Type: text/html, Size: 8261 bytes --]
[-- Attachment #2: Type: text/plain, Size: 160 bytes --]
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH] gpu: drm: i915: Change return type to vm_fault_t
2018-04-17 16:27 ` Souptick Joarder
@ 2018-04-18 5:46 ` Jani Nikula
2018-04-20 22:13 ` Rodrigo Vivi
0 siblings, 1 reply; 17+ messages in thread
From: Jani Nikula @ 2018-04-18 5:46 UTC (permalink / raw)
To: Souptick Joarder, Matthew Wilcox
Cc: rodrigo.vivi, linux-kernel, joonas.lahtinen, intel-gfx, airlied,
dri-devel
On Tue, 17 Apr 2018, Souptick Joarder <jrdr.linux@gmail.com> wrote:
> On 17-Apr-2018 9:45 PM, "Matthew Wilcox" <willy@infradead.org> wrote:
>>
>> On Tue, Apr 17, 2018 at 09:14:32PM +0530, Souptick Joarder wrote:
>> > Not exactly. The plan for these patches is to introduce new vm_fault_t
> type
>> > in vm_operations_struct fault handlers. It's now available in 4.17-rc1.
> We will
>> > push all the required drivers/filesystem changes through different
> maintainers
>> > to linus tree. Once everything is converted into vm_fault_t type then
> Changing
>> > it from a signed to an unsigned int causes GCC to warn about an
> assignment
>> > from an incompatible type -- int foo(void) is incompatible with
>> > unsigned int foo(void).
>> >
>> > Please refer 1c8f422059ae ("mm: change return type to vm_fault_t") in
> 4.17-rc1.
>>
>> I think this patch would be clearer if you did
>>
>> - int ret;
>> + int err;
>> + vm_fault_t ret;
>>
>> Then it would be clearer to the maintainer that you're splitting apart the
>> VM_FAULT and errno codes.
>>
>> Sorry for not catching this during initial review.
>
> Ok, I will make required changes and send v2. Sorry, even I missed this :)
I'm afraid Daniel is closer to the truth. My bad, sorry for the noise.
BR,
Jani.
>>
>> > On Tue, Apr 17, 2018 at 8:59 PM, Jani Nikula
>> > <jani.nikula@linux.intel.com> wrote:
>> > > On Tue, 17 Apr 2018, Souptick Joarder <jrdr.linux@gmail.com> wrote:
>> > >> 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;
>> > >
>> > > What's the point of changing the name? An unnecessary change.
>> > >
>> > > BR,
>> > > Jani.
>> > >
>> > >>
>> > >> /* 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
>> > >>
>> > >
>> > > --
>> > > Jani Nikula, Intel Open Source Technology Center
--
Jani Nikula, Intel Open Source Technology Center
^ permalink raw reply [flat|nested] 17+ messages in thread
* ✗ Fi.CI.CHECKPATCH: warning for gpu: drm: i915: Change return type to vm_fault_t (rev2)
2018-04-17 15:11 [PATCH] gpu: drm: i915: Change return type to vm_fault_t Souptick Joarder
2018-04-17 15:29 ` Jani Nikula
@ 2018-04-18 15:54 ` Patchwork
2018-04-18 18:22 ` Souptick Joarder
2018-04-18 15:54 ` ✗ Fi.CI.SPARSE: " Patchwork
` (2 subsequent siblings)
4 siblings, 1 reply; 17+ messages in thread
From: Patchwork @ 2018-04-18 15:54 UTC (permalink / raw)
To: Souptick Joarder; +Cc: intel-gfx
== Series Details ==
Series: gpu: drm: i915: Change return type to vm_fault_t (rev2)
URL : https://patchwork.freedesktop.org/series/41893/
State : warning
== Summary ==
$ dim checkpatch origin/drm-tip
045e647f1204 gpu: drm: i915: Change return type to vm_fault_t
-:11: ERROR:GIT_COMMIT_ID: Please use git commit description style 'commit <12+ chars of sha1> ("<title line>")' - ie: 'commit 1c8f422059ae ("mm: change return type to vm_fault_t")'
#11:
Reference id -> 1c8f422059ae ("mm: change return type to
total: 1 errors, 0 warnings, 0 checks, 64 lines checked
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 17+ messages in thread
* ✗ Fi.CI.SPARSE: warning for gpu: drm: i915: Change return type to vm_fault_t (rev2)
2018-04-17 15:11 [PATCH] gpu: drm: i915: Change return type to vm_fault_t Souptick Joarder
2018-04-17 15:29 ` Jani Nikula
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 15:54 ` Patchwork
2018-04-18 16:08 ` ✓ Fi.CI.BAT: success " Patchwork
2018-04-18 21:06 ` ✓ Fi.CI.IGT: " Patchwork
4 siblings, 0 replies; 17+ messages in thread
From: Patchwork @ 2018-04-18 15:54 UTC (permalink / raw)
To: Souptick Joarder; +Cc: intel-gfx
== Series Details ==
Series: gpu: drm: i915: Change return type to vm_fault_t (rev2)
URL : https://patchwork.freedesktop.org/series/41893/
State : warning
== Summary ==
$ dim sparse origin/drm-tip
Commit: gpu: drm: i915: Change return type to vm_fault_t
-drivers/gpu/drm/i915/selftests/../i915_drv.h:2207:33: warning: constant 0xffffea0000000000 is so big it is unsigned long
-drivers/gpu/drm/i915/selftests/../i915_drv.h:3655:16: warning: expression using sizeof(void)
+drivers/gpu/drm/i915/selftests/../i915_drv.h:2208:33: warning: constant 0xffffea0000000000 is so big it is unsigned long
+drivers/gpu/drm/i915/selftests/../i915_drv.h:3656:16: warning: expression using sizeof(void)
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 17+ messages in thread
* ✓ Fi.CI.BAT: success for gpu: drm: i915: Change return type to vm_fault_t (rev2)
2018-04-17 15:11 [PATCH] gpu: drm: i915: Change return type to vm_fault_t Souptick Joarder
` (2 preceding siblings ...)
2018-04-18 15:54 ` ✗ Fi.CI.SPARSE: " Patchwork
@ 2018-04-18 16:08 ` Patchwork
2018-04-18 21:06 ` ✓ Fi.CI.IGT: " Patchwork
4 siblings, 0 replies; 17+ messages in thread
From: Patchwork @ 2018-04-18 16:08 UTC (permalink / raw)
To: Souptick Joarder; +Cc: intel-gfx
== Series Details ==
Series: gpu: drm: i915: Change return type to vm_fault_t (rev2)
URL : https://patchwork.freedesktop.org/series/41893/
State : success
== Summary ==
= CI Bug Log - changes from CI_DRM_4066 -> Patchwork_8736 =
== Summary - SUCCESS ==
No regressions found.
External URL: https://patchwork.freedesktop.org/api/1.0/series/41893/revisions/2/mbox/
== Known issues ==
Here are the changes found in Patchwork_8736 that come from known issues:
=== IGT changes ===
==== Issues hit ====
igt@kms_frontbuffer_tracking@basic:
fi-cnl-y3: PASS -> FAIL (fdo#103167)
igt@kms_pipe_crc_basic@suspend-read-crc-pipe-b:
fi-bxt-dsi: NOTRUN -> INCOMPLETE (fdo#103927)
fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
fdo#103927 https://bugs.freedesktop.org/show_bug.cgi?id=103927
== Participating hosts (33 -> 32) ==
Additional (2): fi-glk-j4005 fi-bxt-dsi
Missing (3): fi-ctg-p8600 fi-ilk-m540 fi-skl-6700hq
== Build changes ==
* Linux: CI_DRM_4066 -> Patchwork_8736
CI_DRM_4066: e1fbca4821d0700551df233285a5c28db09fd0f6 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4441: 83ba5b7d3bde48b383df41792fc9c955a5a23bdb @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_8736: 045e647f1204c28a28882560da315568d838e3ea @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4441: e60d247eb359f044caf0c09904da14e39d7adca1 @ git://anongit.freedesktop.org/piglit
== Linux commits ==
045e647f1204 gpu: drm: i915: Change return type to vm_fault_t
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_8736/issues.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: ✗ Fi.CI.CHECKPATCH: warning for gpu: drm: i915: Change return type to vm_fault_t (rev2)
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
0 siblings, 0 replies; 17+ messages in thread
From: Souptick Joarder @ 2018-04-18 18:22 UTC (permalink / raw)
To: intel-gfx
On Wed, Apr 18, 2018 at 9:24 PM, Patchwork
<patchwork@emeril.freedesktop.org> wrote:
> == Series Details ==
>
> Series: gpu: drm: i915: Change return type to vm_fault_t (rev2)
> URL : https://patchwork.freedesktop.org/series/41893/
> State : warning
>
> == Summary ==
>
> $ dim checkpatch origin/drm-tip
> 045e647f1204 gpu: drm: i915: Change return type to vm_fault_t
> -:11: ERROR:GIT_COMMIT_ID: Please use git commit description style 'commit <12+ chars of sha1> ("<title line>")' - ie: 'commit 1c8f422059ae ("mm: change return type to vm_fault_t")'
Does it mean I need to send v3 with correction ?
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 17+ messages in thread
* ✓ Fi.CI.IGT: success for gpu: drm: i915: Change return type to vm_fault_t (rev2)
2018-04-17 15:11 [PATCH] gpu: drm: i915: Change return type to vm_fault_t Souptick Joarder
` (3 preceding siblings ...)
2018-04-18 16:08 ` ✓ Fi.CI.BAT: success " Patchwork
@ 2018-04-18 21:06 ` Patchwork
4 siblings, 0 replies; 17+ messages in thread
From: Patchwork @ 2018-04-18 21:06 UTC (permalink / raw)
To: Souptick Joarder; +Cc: intel-gfx
== Series Details ==
Series: gpu: drm: i915: Change return type to vm_fault_t (rev2)
URL : https://patchwork.freedesktop.org/series/41893/
State : success
== Summary ==
= CI Bug Log - changes from CI_DRM_4066_full -> Patchwork_8736_full =
== Summary - WARNING ==
Minor unknown changes coming with Patchwork_8736_full need to be verified
manually.
If you think the reported changes have nothing to do with the changes
introduced in Patchwork_8736_full, please notify your bug team to allow them
to document this new failure mode, which will reduce false positives in CI.
External URL: https://patchwork.freedesktop.org/api/1.0/series/41893/revisions/2/mbox/
== Possible new issues ==
Here are the unknown changes that may have been introduced in Patchwork_8736_full:
=== IGT changes ===
==== Warnings ====
igt@gem_exec_schedule@deep-bsd1:
shard-kbl: PASS -> SKIP +1
igt@gem_mocs_settings@mocs-rc6-bsd2:
shard-kbl: SKIP -> PASS
igt@kms_vblank@pipe-a-query-forked-busy:
shard-snb: PASS -> SKIP
== Known issues ==
Here are the changes found in Patchwork_8736_full that come from known issues:
=== IGT changes ===
==== Issues hit ====
igt@kms_flip@plain-flip-ts-check:
shard-hsw: PASS -> FAIL (fdo#100368)
igt@kms_setmode@basic:
shard-hsw: PASS -> FAIL (fdo#99912)
==== Possible fixes ====
igt@kms_cursor_legacy@2x-long-cursor-vs-flip-legacy:
shard-hsw: FAIL (fdo#105767) -> PASS
igt@kms_flip@2x-dpms-vs-vblank-race:
shard-hsw: FAIL (fdo#103060) -> PASS
igt@kms_flip@2x-flip-vs-expired-vblank:
shard-hsw: FAIL (fdo#102887) -> PASS
igt@kms_flip@flip-vs-blocking-wf-vblank:
shard-hsw: FAIL (fdo#100368) -> PASS
igt@kms_frontbuffer_tracking@fbc-farfromfence:
shard-kbl: DMESG-WARN (fdo#103558, fdo#105602) -> PASS +2
igt@kms_setmode@basic:
shard-kbl: FAIL (fdo#99912) -> PASS
igt@kms_sysfs_edid_timing:
shard-apl: WARN (fdo#100047) -> PASS
fdo#100047 https://bugs.freedesktop.org/show_bug.cgi?id=100047
fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#102887 https://bugs.freedesktop.org/show_bug.cgi?id=102887
fdo#103060 https://bugs.freedesktop.org/show_bug.cgi?id=103060
fdo#103558 https://bugs.freedesktop.org/show_bug.cgi?id=103558
fdo#105602 https://bugs.freedesktop.org/show_bug.cgi?id=105602
fdo#105767 https://bugs.freedesktop.org/show_bug.cgi?id=105767
fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912
== Participating hosts (9 -> 4) ==
Missing (5): shard-glk8 shard-glk6 shard-glk7 shard-glk shard-glkb
== Build changes ==
* Linux: CI_DRM_4066 -> Patchwork_8736
CI_DRM_4066: e1fbca4821d0700551df233285a5c28db09fd0f6 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4441: 83ba5b7d3bde48b383df41792fc9c955a5a23bdb @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_8736: 045e647f1204c28a28882560da315568d838e3ea @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4441: e60d247eb359f044caf0c09904da14e39d7adca1 @ git://anongit.freedesktop.org/piglit
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_8736/shards.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [Intel-gfx] [PATCH] gpu: drm: i915: Change return type to vm_fault_t
2018-04-18 5:46 ` Jani Nikula
@ 2018-04-20 22:13 ` Rodrigo Vivi
0 siblings, 0 replies; 17+ messages in thread
From: Rodrigo Vivi @ 2018-04-20 22:13 UTC (permalink / raw)
To: Jani Nikula
Cc: Souptick Joarder, Matthew Wilcox, airlied, intel-gfx,
linux-kernel, dri-devel
On Wed, Apr 18, 2018 at 08:46:44AM +0300, Jani Nikula wrote:
> On Tue, 17 Apr 2018, Souptick Joarder <jrdr.linux@gmail.com> wrote:
> > On 17-Apr-2018 9:45 PM, "Matthew Wilcox" <willy@infradead.org> wrote:
> >>
> >> On Tue, Apr 17, 2018 at 09:14:32PM +0530, Souptick Joarder wrote:
> >> > Not exactly. The plan for these patches is to introduce new vm_fault_t
> > type
> >> > in vm_operations_struct fault handlers. It's now available in 4.17-rc1.
> > We will
> >> > push all the required drivers/filesystem changes through different
> > maintainers
> >> > to linus tree. Once everything is converted into vm_fault_t type then
> > Changing
> >> > it from a signed to an unsigned int causes GCC to warn about an
> > assignment
> >> > from an incompatible type -- int foo(void) is incompatible with
> >> > unsigned int foo(void).
> >> >
> >> > Please refer 1c8f422059ae ("mm: change return type to vm_fault_t") in
> > 4.17-rc1.
> >>
> >> I think this patch would be clearer if you did
> >>
> >> - int ret;
> >> + int err;
> >> + vm_fault_t ret;
> >>
> >> Then it would be clearer to the maintainer that you're splitting apart the
> >> VM_FAULT and errno codes.
> >>
> >> Sorry for not catching this during initial review.
> >
> > Ok, I will make required changes and send v2. Sorry, even I missed this :)
>
> I'm afraid Daniel is closer to the truth.
+1.
> My bad, sorry for the noise.
I opened this thread to add exactly question/noise ;).
So my recommendation for some next time is to make the intention clear
on the commit message itself from the begin.
>
> BR,
> Jani.
>
>
>
> >>
> >> > On Tue, Apr 17, 2018 at 8:59 PM, Jani Nikula
> >> > <jani.nikula@linux.intel.com> wrote:
> >> > > On Tue, 17 Apr 2018, Souptick Joarder <jrdr.linux@gmail.com> wrote:
> >> > >> 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;
> >> > >
> >> > > What's the point of changing the name? An unnecessary change.
> >> > >
> >> > > BR,
> >> > > Jani.
> >> > >
> >> > >>
> >> > >> /* 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
> >> > >>
> >> > >
> >> > > --
> >> > > Jani Nikula, Intel Open Source Technology Center
>
> --
> Jani Nikula, Intel Open Source Technology Center
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [Intel-gfx] [PATCH] gpu: drm: i915: Change return type to vm_fault_t
@ 2018-04-20 22:13 ` Rodrigo Vivi
0 siblings, 0 replies; 17+ messages in thread
From: Rodrigo Vivi @ 2018-04-20 22:13 UTC (permalink / raw)
To: Jani Nikula
Cc: Matthew Wilcox, airlied, intel-gfx, linux-kernel, dri-devel,
Souptick Joarder
On Wed, Apr 18, 2018 at 08:46:44AM +0300, Jani Nikula wrote:
> On Tue, 17 Apr 2018, Souptick Joarder <jrdr.linux@gmail.com> wrote:
> > On 17-Apr-2018 9:45 PM, "Matthew Wilcox" <willy@infradead.org> wrote:
> >>
> >> On Tue, Apr 17, 2018 at 09:14:32PM +0530, Souptick Joarder wrote:
> >> > Not exactly. The plan for these patches is to introduce new vm_fault_t
> > type
> >> > in vm_operations_struct fault handlers. It's now available in 4.17-rc1.
> > We will
> >> > push all the required drivers/filesystem changes through different
> > maintainers
> >> > to linus tree. Once everything is converted into vm_fault_t type then
> > Changing
> >> > it from a signed to an unsigned int causes GCC to warn about an
> > assignment
> >> > from an incompatible type -- int foo(void) is incompatible with
> >> > unsigned int foo(void).
> >> >
> >> > Please refer 1c8f422059ae ("mm: change return type to vm_fault_t") in
> > 4.17-rc1.
> >>
> >> I think this patch would be clearer if you did
> >>
> >> - int ret;
> >> + int err;
> >> + vm_fault_t ret;
> >>
> >> Then it would be clearer to the maintainer that you're splitting apart the
> >> VM_FAULT and errno codes.
> >>
> >> Sorry for not catching this during initial review.
> >
> > Ok, I will make required changes and send v2. Sorry, even I missed this :)
>
> I'm afraid Daniel is closer to the truth.
+1.
> My bad, sorry for the noise.
I opened this thread to add exactly question/noise ;).
So my recommendation for some next time is to make the intention clear
on the commit message itself from the begin.
>
> BR,
> Jani.
>
>
>
> >>
> >> > On Tue, Apr 17, 2018 at 8:59 PM, Jani Nikula
> >> > <jani.nikula@linux.intel.com> wrote:
> >> > > On Tue, 17 Apr 2018, Souptick Joarder <jrdr.linux@gmail.com> wrote:
> >> > >> 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;
> >> > >
> >> > > What's the point of changing the name? An unnecessary change.
> >> > >
> >> > > BR,
> >> > > Jani.
> >> > >
> >> > >>
> >> > >> /* 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
> >> > >>
> >> > >
> >> > > --
> >> > > Jani Nikula, Intel Open Source Technology Center
>
> --
> Jani Nikula, Intel Open Source Technology Center
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2018-04-20 22:13 UTC | newest]
Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-17 15:11 [PATCH] gpu: drm: i915: Change return type to vm_fault_t Souptick Joarder
2018-04-17 15:29 ` 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
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.