Skip to contentSkip to conversation

gpu: drm: armada: Adding new typedef vm_fault_t

PATCH Applied Souptick Joarder 2 participants 8 messages May 10, 2018 – Jun 26, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 gpu: drm: armada: Adding new typedef vm_fault_t

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.

---
v2: Updated the change log

 drivers/gpu/drm/armada/armada_gem.c | 15 ++-------------
 1 file changed, 2 insertions(+), 13 deletions(-)
drivers/gpu/drm/armada/armada_gem.c +2 -13
index a97f509..81a55b7 100644
@@ -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

maintainer Acked-by Russell King on v2 1/1
#1 lore raw
Quoted 8 lines · Souptick Joarder

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")

Quoted 7 lines

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.

Thanks.

Quoted 41 lines

---
v2: Updated the change log

 drivers/gpu/drm/armada/armada_gem.c | 15 ++-------------
 1 file changed, 2 insertions(+), 13 deletions(-)
drivers/gpu/drm/armada/armada_gem.c +2 -14
index a97f509..81a55b7 100644
@@ -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

Signature · 3 lines
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
#2 lore raw
Quoted 14 lines · Russell King - ARM Linux
Quoted 13 lines · Souptick Joarder

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.

Quoted 6 lines
Quoted 2 lines

Thanks.

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

#3 lore raw
Quoted 19 lines · Souptick Joarder
Quoted 17 lines · Russell King - ARM Linux
Quoted 15 lines · Souptick Joarder

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.

Quoted 6 lines
Quoted 3 lines

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.

#4 lore raw
Quoted 22 lines · Souptick Joarder
Quoted 21 lines · Souptick Joarder
Quoted 19 lines · Russell King - ARM Linux
Quoted 8 lines · Souptick Joarder

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")

Quoted 7 lines

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.

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

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.

#5 lore raw
Quoted 25 lines · Souptick Joarder
Quoted 24 lines · Souptick Joarder
Quoted 23 lines · Souptick Joarder
Quoted 20 lines · Russell King - ARM Linux
Quoted 8 lines · Souptick Joarder

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")

Quoted 7 lines

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.

Thanks.

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

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.

maintainer Applied
#6 lore raw
Quoted 29 lines · Souptick Joarder
Quoted 28 lines · Souptick Joarder
Quoted 27 lines · Souptick Joarder
Quoted 25 lines · Souptick Joarder
Quoted 14 lines · Russell King - ARM Linux
Quoted 13 lines · Souptick Joarder

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.

Quoted 6 lines
Quoted 2 lines

Thanks.

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

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

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.

Signature · 3 lines
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
#7 lore raw
Quoted 37 lines · Russell King - ARM Linux
Quoted 29 lines · Souptick Joarder
Quoted 28 lines · Souptick Joarder
Quoted 27 lines · Souptick Joarder
Quoted 25 lines · Souptick Joarder
Quoted 14 lines · Russell King - ARM Linux
Quoted 13 lines · Souptick Joarder

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.

Quoted 6 lines
Quoted 2 lines

Thanks.

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

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

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.

Quoted 9 lines

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 ?