All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wu Hao <hao.wu@intel.com>
To: Dominic Chen <d.c.ddcc@gmail.com>
Cc: mdf@kernel.org, linux-fpga@vger.kernel.org
Subject: Re: [PATCH v3] fpga: dfl: afu: support debug access to memory-mapped afu regions
Date: Mon, 9 Mar 2020 15:28:10 +0800	[thread overview]
Message-ID: <20200309072810.GA852@hao-dev> (raw)
In-Reply-To: <20200305033310.117030-1-d.c.ddcc@gmail.com>

On Wed, Mar 04, 2020 at 10:33:10PM -0500, Dominic Chen wrote:
> Allow debug access to memory-mapped regions using e.g. gdb.
> 
> Signed-off-by: Dominic Chen <d.c.ddcc@gmail.com>
> ---
>  drivers/fpga/dfl-afu-main.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/drivers/fpga/dfl-afu-main.c b/drivers/fpga/dfl-afu-main.c
> index 02baa6a227c0..8fa1666b5b20 100644
> --- a/drivers/fpga/dfl-afu-main.c
> +++ b/drivers/fpga/dfl-afu-main.c
> @@ -459,6 +459,12 @@ static long afu_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
>  	return -EINVAL;
>  }
>  
> +static const struct vm_operations_struct afu_vma_ops = {
> +#ifdef CONFIG_HAVE_IOREMAP_PROT
> +	.access = generic_access_phys,
> +#endif /* CONFIG_HAVE_IOREMAP_PROT */

To me, it's very clear for #ifdef - #end. So looks like this
/* CONFIG_HAVE_IOREMAP_PROT */ comments is not needed.

Could you please remove it? 

Then

Acked-by: Wu Hao <hao.wu@intel.com>

Thanks
Hao

> +};
> +
>  static int afu_mmap(struct file *filp, struct vm_area_struct *vma)
>  {
>  	struct platform_device *pdev = filp->private_data;
> @@ -488,6 +494,9 @@ static int afu_mmap(struct file *filp, struct vm_area_struct *vma)
>  	    !(region.flags & DFL_PORT_REGION_WRITE))
>  		return -EPERM;
>  
> +	/* Support debug access to the mapping */
> +	vma->vm_ops = &afu_vma_ops;
> +
>  	vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
>  
>  	return remap_pfn_range(vma, vma->vm_start,
> -- 
> 2.17.1

  reply	other threads:[~2020-03-09  7:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-05  3:33 [PATCH v3] fpga: dfl: afu: support debug access to memory-mapped afu regions Dominic Chen
2020-03-09  7:28 ` Wu Hao [this message]
2020-03-09 18:53   ` Dominic Chen
2020-03-21 20:15 ` Moritz Fischer

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=20200309072810.GA852@hao-dev \
    --to=hao.wu@intel.com \
    --cc=d.c.ddcc@gmail.com \
    --cc=linux-fpga@vger.kernel.org \
    --cc=mdf@kernel.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 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.