mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Russell King - ARM Linux <linux@armlinux.org.uk>
To: Souptick Joarder <jrdr.linux@gmail.com>
Cc: airlied@linux.ie, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org, willy@infradead.org
Subject: Re: [PATCH v2] gpu: drm: armada: Adding new typedef vm_fault_t
Date: Fri, 11 May 2018 10:22:06 +0100	[thread overview]
Message-ID: <20180511092205.GB16141@n2100.armlinux.org.uk> (raw)
In-Reply-To: <20180510150448.GA26306@jordon-HP-15-Notebook-PC>

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

  reply	other threads:[~2018-05-11  9:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-10 15:04 Souptick Joarder
2018-05-11  9:22 ` Russell King - ARM Linux [this message]
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

Reply instructions:

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

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

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

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

  git send-email \
    --in-reply-to=20180511092205.GB16141@n2100.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=airlied@linux.ie \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jrdr.linux@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

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

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

all inboxes | Powered by JetHome®