linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] gpu: drm: armada: Adding new typedef vm_fault_t
@ 2018-05-10 15:04 Souptick Joarder
  2018-05-11  9:22 ` Russell King - ARM Linux
  0 siblings, 1 reply; 8+ messages in thread
From: Souptick Joarder @ 2018-05-10 15:04 UTC (permalink / raw)
  To: linux, airlied; +Cc: dri-devel, linux-kernel, willy

Use new return type vm_fault_t for fault handler in
struct vm_operations_struct. 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.

commit 1c8f422059ae ("mm: change return type to vm_fault_t")

Previously vm_insert_pfn() returns err which driver
mapped into VM_FAULT_* type. The new function
vmf_insert_pfn() will replace this inefficiency by
returning VM_FAULT_* type.

Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>
Reviewed-by: Matthew Wilcox <mawilcox@microsoft.com>
---
v2: Updated the change log

 drivers/gpu/drm/armada/armada_gem.c | 15 ++-------------
 1 file changed, 2 insertions(+), 13 deletions(-)

diff --git a/drivers/gpu/drm/armada/armada_gem.c b/drivers/gpu/drm/armada/armada_gem.c
index a97f509..81a55b7 100644
--- a/drivers/gpu/drm/armada/armada_gem.c
+++ b/drivers/gpu/drm/armada/armada_gem.c
@@ -13,25 +13,14 @@
 #include <drm/armada_drm.h>
 #include "armada_ioctlP.h"

-static int armada_gem_vm_fault(struct vm_fault *vmf)
+static vm_fault_t armada_gem_vm_fault(struct vm_fault *vmf)
 {
 	struct drm_gem_object *gobj = vmf->vma->vm_private_data;
 	struct armada_gem_object *obj = drm_to_armada_gem(gobj);
 	unsigned long pfn = obj->phys_addr >> PAGE_SHIFT;
-	int ret;

 	pfn += (vmf->address - vmf->vma->vm_start) >> PAGE_SHIFT;
-	ret = vm_insert_pfn(vmf->vma, vmf->address, pfn);
-
-	switch (ret) {
-	case 0:
-	case -EBUSY:
-		return VM_FAULT_NOPAGE;
-	case -ENOMEM:
-		return VM_FAULT_OOM;
-	default:
-		return VM_FAULT_SIGBUS;
-	}
+	return vmf_insert_pfn(vmf->vma, vmf->address, pfn);
 }

 const struct vm_operations_struct armada_gem_vm_ops = {
--
1.9.1

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] gpu: drm: armada: Adding new typedef vm_fault_t
  2018-05-10 15:04 [PATCH v2] gpu: drm: armada: Adding new typedef vm_fault_t Souptick Joarder
@ 2018-05-11  9:22 ` Russell King - ARM Linux
  2018-05-16  4:35   ` Souptick Joarder
  0 siblings, 1 reply; 8+ messages in thread
From: Russell King - ARM Linux @ 2018-05-11  9:22 UTC (permalink / raw)
  To: Souptick Joarder; +Cc: airlied, dri-devel, linux-kernel, willy

On Thu, May 10, 2018 at 08:34:48PM +0530, Souptick Joarder wrote:
> Use new return type vm_fault_t for fault handler in
> struct vm_operations_struct. 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.
> 
> commit 1c8f422059ae ("mm: change return type to vm_fault_t")
> 
> Previously vm_insert_pfn() returns err which driver
> mapped into VM_FAULT_* type. The new function
> vmf_insert_pfn() will replace this inefficiency by
> returning VM_FAULT_* type.
> 
> Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>
> Reviewed-by: Matthew Wilcox <mawilcox@microsoft.com>

Acked-by: Russell King <rmk+kernel@armlinux.org.uk>

Thanks.

> ---
> v2: Updated the change log
> 
>  drivers/gpu/drm/armada/armada_gem.c | 15 ++-------------
>  1 file changed, 2 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/gpu/drm/armada/armada_gem.c b/drivers/gpu/drm/armada/armada_gem.c
> index a97f509..81a55b7 100644
> --- a/drivers/gpu/drm/armada/armada_gem.c
> +++ b/drivers/gpu/drm/armada/armada_gem.c
> @@ -13,25 +13,14 @@
>  #include <drm/armada_drm.h>
>  #include "armada_ioctlP.h"
> 
> -static int armada_gem_vm_fault(struct vm_fault *vmf)
> +static vm_fault_t armada_gem_vm_fault(struct vm_fault *vmf)
>  {
>  	struct drm_gem_object *gobj = vmf->vma->vm_private_data;
>  	struct armada_gem_object *obj = drm_to_armada_gem(gobj);
>  	unsigned long pfn = obj->phys_addr >> PAGE_SHIFT;
> -	int ret;
> 
>  	pfn += (vmf->address - vmf->vma->vm_start) >> PAGE_SHIFT;
> -	ret = vm_insert_pfn(vmf->vma, vmf->address, pfn);
> -
> -	switch (ret) {
> -	case 0:
> -	case -EBUSY:
> -		return VM_FAULT_NOPAGE;
> -	case -ENOMEM:
> -		return VM_FAULT_OOM;
> -	default:
> -		return VM_FAULT_SIGBUS;
> -	}
> +	return vmf_insert_pfn(vmf->vma, vmf->address, pfn);
>  }
> 
>  const struct vm_operations_struct armada_gem_vm_ops = {
> --
> 1.9.1
> 

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 8.8Mbps down 630kbps up
According to speedtest.net: 8.21Mbps down 510kbps up

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] gpu: drm: armada: Adding new typedef vm_fault_t
  2018-05-11  9:22 ` Russell King - ARM Linux
@ 2018-05-16  4:35   ` Souptick Joarder
  2018-05-23  9:39     ` Souptick Joarder
  0 siblings, 1 reply; 8+ messages in thread
From: Souptick Joarder @ 2018-05-16  4:35 UTC (permalink / raw)
  To: Russell King - ARM Linux; +Cc: airlied, dri-devel, linux-kernel, Matthew Wilcox

On Fri, May 11, 2018 at 2:52 PM, Russell King - ARM Linux
<linux@armlinux.org.uk> wrote:
> On Thu, May 10, 2018 at 08:34:48PM +0530, Souptick Joarder wrote:
>> Use new return type vm_fault_t for fault handler in
>> struct vm_operations_struct. 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.
>>
>> commit 1c8f422059ae ("mm: change return type to vm_fault_t")
>>
>> Previously vm_insert_pfn() returns err which driver
>> mapped into VM_FAULT_* type. The new function
>> vmf_insert_pfn() will replace this inefficiency by
>> returning VM_FAULT_* type.
>>
>> Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>
>> Reviewed-by: Matthew Wilcox <mawilcox@microsoft.com>
>
> Acked-by: Russell King <rmk+kernel@armlinux.org.uk>
>
> Thanks.

If no further comment, we would like to get this patch in queue
for 4.18.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] gpu: drm: armada: Adding new typedef vm_fault_t
  2018-05-16  4:35   ` Souptick Joarder
@ 2018-05-23  9:39     ` Souptick Joarder
  2018-06-04  5:16       ` Souptick Joarder
  0 siblings, 1 reply; 8+ messages in thread
From: Souptick Joarder @ 2018-05-23  9:39 UTC (permalink / raw)
  To: Russell King - ARM Linux; +Cc: airlied, dri-devel, linux-kernel, Matthew Wilcox

On Wed, May 16, 2018 at 10:05 AM, Souptick Joarder <jrdr.linux@gmail.com> wrote:
> On Fri, May 11, 2018 at 2:52 PM, Russell King - ARM Linux
> <linux@armlinux.org.uk> wrote:
>> On Thu, May 10, 2018 at 08:34:48PM +0530, Souptick Joarder wrote:
>>> Use new return type vm_fault_t for fault handler in
>>> struct vm_operations_struct. 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.
>>>
>>> commit 1c8f422059ae ("mm: change return type to vm_fault_t")
>>>
>>> Previously vm_insert_pfn() returns err which driver
>>> mapped into VM_FAULT_* type. The new function
>>> vmf_insert_pfn() will replace this inefficiency by
>>> returning VM_FAULT_* type.
>>>
>>> Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>
>>> Reviewed-by: Matthew Wilcox <mawilcox@microsoft.com>
>>
>> Acked-by: Russell King <rmk+kernel@armlinux.org.uk>
>>
>> Thanks.
>
> If no further comment, we would like to get this patch in queue
> for 4.18.

We would like to get this patch in queue
for 4.18.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] gpu: drm: armada: Adding new typedef vm_fault_t
  2018-05-23  9:39     ` Souptick Joarder
@ 2018-06-04  5:16       ` Souptick Joarder
  2018-06-19  5:12         ` Souptick Joarder
  0 siblings, 1 reply; 8+ messages in thread
From: Souptick Joarder @ 2018-06-04  5:16 UTC (permalink / raw)
  To: Russell King - ARM Linux, airlied; +Cc: dri-devel, linux-kernel, Matthew Wilcox

On Wed, May 23, 2018 at 3:09 PM, Souptick Joarder <jrdr.linux@gmail.com> wrote:
> On Wed, May 16, 2018 at 10:05 AM, Souptick Joarder <jrdr.linux@gmail.com> wrote:
>> On Fri, May 11, 2018 at 2:52 PM, Russell King - ARM Linux
>> <linux@armlinux.org.uk> wrote:
>>> On Thu, May 10, 2018 at 08:34:48PM +0530, Souptick Joarder wrote:
>>>> Use new return type vm_fault_t for fault handler in
>>>> struct vm_operations_struct. 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.
>>>>
>>>> commit 1c8f422059ae ("mm: change return type to vm_fault_t")
>>>>
>>>> Previously vm_insert_pfn() returns err which driver
>>>> mapped into VM_FAULT_* type. The new function
>>>> vmf_insert_pfn() will replace this inefficiency by
>>>> returning VM_FAULT_* type.
>>>>
>>>> Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>
>>>> Reviewed-by: Matthew Wilcox <mawilcox@microsoft.com>
>>>
>>> Acked-by: Russell King <rmk+kernel@armlinux.org.uk>
>>>
>>> Thanks.
>>
>> If no further comment, we would like to get this patch in queue
>> for 4.18.
>
> We would like to get this patch in queue
> for 4.18.

We  would like to get this patch in 4.18.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] gpu: drm: armada: Adding new typedef vm_fault_t
  2018-06-04  5:16       ` Souptick Joarder
@ 2018-06-19  5:12         ` Souptick Joarder
  2018-06-26 15:37           ` Russell King - ARM Linux
  0 siblings, 1 reply; 8+ messages in thread
From: Souptick Joarder @ 2018-06-19  5:12 UTC (permalink / raw)
  To: Russell King - ARM Linux, airlied; +Cc: dri-devel, linux-kernel, Matthew Wilcox

On Mon, Jun 4, 2018 at 10:46 AM, Souptick Joarder <jrdr.linux@gmail.com> wrote:
> On Wed, May 23, 2018 at 3:09 PM, Souptick Joarder <jrdr.linux@gmail.com> wrote:
>> On Wed, May 16, 2018 at 10:05 AM, Souptick Joarder <jrdr.linux@gmail.com> wrote:
>>> On Fri, May 11, 2018 at 2:52 PM, Russell King - ARM Linux
>>> <linux@armlinux.org.uk> wrote:
>>>> On Thu, May 10, 2018 at 08:34:48PM +0530, Souptick Joarder wrote:
>>>>> Use new return type vm_fault_t for fault handler in
>>>>> struct vm_operations_struct. 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.
>>>>>
>>>>> commit 1c8f422059ae ("mm: change return type to vm_fault_t")
>>>>>
>>>>> Previously vm_insert_pfn() returns err which driver
>>>>> mapped into VM_FAULT_* type. The new function
>>>>> vmf_insert_pfn() will replace this inefficiency by
>>>>> returning VM_FAULT_* type.
>>>>>
>>>>> Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>
>>>>> Reviewed-by: Matthew Wilcox <mawilcox@microsoft.com>
>>>>
>>>> Acked-by: Russell King <rmk+kernel@armlinux.org.uk>
>>>>
>>>> Thanks.
>>>
>>> If no further comment, we would like to get this patch in queue
>>> for 4.18.
>>
>> We would like to get this patch in queue
>> for 4.18.
>
> We  would like to get this patch in 4.18.

Russell, This patch is not merged in 4.18-rc-1.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] gpu: drm: armada: Adding new typedef vm_fault_t
  2018-06-19  5:12         ` Souptick Joarder
@ 2018-06-26 15:37           ` Russell King - ARM Linux
  2018-06-26 16:07             ` Souptick Joarder
  0 siblings, 1 reply; 8+ messages in thread
From: Russell King - ARM Linux @ 2018-06-26 15:37 UTC (permalink / raw)
  To: Souptick Joarder; +Cc: airlied, dri-devel, linux-kernel, Matthew Wilcox

On Tue, Jun 19, 2018 at 10:42:15AM +0530, Souptick Joarder wrote:
> On Mon, Jun 4, 2018 at 10:46 AM, Souptick Joarder <jrdr.linux@gmail.com> wrote:
> > On Wed, May 23, 2018 at 3:09 PM, Souptick Joarder <jrdr.linux@gmail.com> wrote:
> >> On Wed, May 16, 2018 at 10:05 AM, Souptick Joarder <jrdr.linux@gmail.com> wrote:
> >>> On Fri, May 11, 2018 at 2:52 PM, Russell King - ARM Linux
> >>> <linux@armlinux.org.uk> wrote:
> >>>> On Thu, May 10, 2018 at 08:34:48PM +0530, Souptick Joarder wrote:
> >>>>> Use new return type vm_fault_t for fault handler in
> >>>>> struct vm_operations_struct. 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.
> >>>>>
> >>>>> commit 1c8f422059ae ("mm: change return type to vm_fault_t")
> >>>>>
> >>>>> Previously vm_insert_pfn() returns err which driver
> >>>>> mapped into VM_FAULT_* type. The new function
> >>>>> vmf_insert_pfn() will replace this inefficiency by
> >>>>> returning VM_FAULT_* type.
> >>>>>
> >>>>> Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>
> >>>>> Reviewed-by: Matthew Wilcox <mawilcox@microsoft.com>
> >>>>
> >>>> Acked-by: Russell King <rmk+kernel@armlinux.org.uk>
> >>>>
> >>>> Thanks.
> >>>
> >>> If no further comment, we would like to get this patch in queue
> >>> for 4.18.
> >>
> >> We would like to get this patch in queue
> >> for 4.18.
> >
> > We  would like to get this patch in 4.18.
> 
> Russell, This patch is not merged in 4.18-rc-1.

Correct, I wasn't able to add it to my tree because David Airlie hadn't
pulled the previous merge request, so it missed the 4.18 merge window.

The reason for me acking the patch was so that /someone else/ could
pick it up instead, and that obviously also didn't happen - maybe the
drm-misc tree was closed for new work at the point you sent the patch.

I've picked this patch up now, thanks.

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 8.8Mbps down 630kbps up
According to speedtest.net: 8.21Mbps down 510kbps up

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] gpu: drm: armada: Adding new typedef vm_fault_t
  2018-06-26 15:37           ` Russell King - ARM Linux
@ 2018-06-26 16:07             ` Souptick Joarder
  0 siblings, 0 replies; 8+ messages in thread
From: Souptick Joarder @ 2018-06-26 16:07 UTC (permalink / raw)
  To: Russell King - ARM Linux; +Cc: airlied, dri-devel, linux-kernel, Matthew Wilcox

On Tue, Jun 26, 2018 at 9:07 PM, Russell King - ARM Linux
<linux@armlinux.org.uk> wrote:
> On Tue, Jun 19, 2018 at 10:42:15AM +0530, Souptick Joarder wrote:
>> On Mon, Jun 4, 2018 at 10:46 AM, Souptick Joarder <jrdr.linux@gmail.com> wrote:
>> > On Wed, May 23, 2018 at 3:09 PM, Souptick Joarder <jrdr.linux@gmail.com> wrote:
>> >> On Wed, May 16, 2018 at 10:05 AM, Souptick Joarder <jrdr.linux@gmail.com> wrote:
>> >>> On Fri, May 11, 2018 at 2:52 PM, Russell King - ARM Linux
>> >>> <linux@armlinux.org.uk> wrote:
>> >>>> On Thu, May 10, 2018 at 08:34:48PM +0530, Souptick Joarder wrote:
>> >>>>> Use new return type vm_fault_t for fault handler in
>> >>>>> struct vm_operations_struct. 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.
>> >>>>>
>> >>>>> commit 1c8f422059ae ("mm: change return type to vm_fault_t")
>> >>>>>
>> >>>>> Previously vm_insert_pfn() returns err which driver
>> >>>>> mapped into VM_FAULT_* type. The new function
>> >>>>> vmf_insert_pfn() will replace this inefficiency by
>> >>>>> returning VM_FAULT_* type.
>> >>>>>
>> >>>>> Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>
>> >>>>> Reviewed-by: Matthew Wilcox <mawilcox@microsoft.com>
>> >>>>
>> >>>> Acked-by: Russell King <rmk+kernel@armlinux.org.uk>
>> >>>>
>> >>>> Thanks.
>> >>>
>> >>> If no further comment, we would like to get this patch in queue
>> >>> for 4.18.
>> >>
>> >> We would like to get this patch in queue
>> >> for 4.18.
>> >
>> > We  would like to get this patch in 4.18.
>>
>> Russell, This patch is not merged in 4.18-rc-1.
>
> Correct, I wasn't able to add it to my tree because David Airlie hadn't
> pulled the previous merge request, so it missed the 4.18 merge window.
>
> The reason for me acking the patch was so that /someone else/ could
> pick it up instead, and that obviously also didn't happen - maybe the
> drm-misc tree was closed for new work at the point you sent the patch.
>
> I've picked this patch up now, thanks.
>

Thanks. Queued for 4.19 merge window ?

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2018-06-26 16:07 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-10 15:04 [PATCH v2] gpu: drm: armada: Adding new typedef vm_fault_t Souptick Joarder
2018-05-11  9:22 ` Russell King - ARM Linux
2018-05-16  4:35   ` Souptick Joarder
2018-05-23  9:39     ` Souptick Joarder
2018-06-04  5:16       ` Souptick Joarder
2018-06-19  5:12         ` Souptick Joarder
2018-06-26 15:37           ` Russell King - ARM Linux
2018-06-26 16:07             ` Souptick Joarder

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).