Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1477123 > unrolled thread

[PATCH v2 2/3] remoteproc: core: transform struct fw_rsc_vdev_vring reserved field in pa

Started byLoic Pallardy <loic.pallardy@st.com>
First post2016-09-06 09:50 +0200
Last post2016-09-06 20:20 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v2 2/3] remoteproc: core: transform struct fw_rsc_vdev_vring reserved field in pa Loic Pallardy <loic.pallardy@st.com> - 2016-09-06 09:50 +0200
    Re: [PATCH v2 2/3] remoteproc: core: transform struct  fw_rsc_vdev_vring reserved field in pa Bjorn Andersson <bjorn.andersson@linaro.org> - 2016-09-06 20:20 +0200

#1477123 — [PATCH v2 2/3] remoteproc: core: transform struct fw_rsc_vdev_vring reserved field in pa

FromLoic Pallardy <loic.pallardy@st.com>
Date2016-09-06 09:50 +0200
Subject[PATCH v2 2/3] remoteproc: core: transform struct fw_rsc_vdev_vring reserved field in pa
Message-ID<sejiN-7mF-7@gated-at.bofh.it>
In current implementation, struct fw_rsc_vdev_vring which describes
vring resource in firmware resource table owns only device address,
because it assumes that host is responsible of vring allocation and
only device address is needed by coprocessor.
But if vrings need to be fixe in system memory map for any reasons
(security, SoC charactieristics...), physical address is needed exatly
identified the memory chunck by host.

For that let's transform reserved field of struct fw_rsc_vdev_vring
to pa (physical address).

Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
---
 drivers/remoteproc/remoteproc_core.c | 6 ------
 include/linux/remoteproc.h           | 4 ++--
 2 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
index 18f4286..0d3c191 100644
--- a/drivers/remoteproc/remoteproc_core.c
+++ b/drivers/remoteproc/remoteproc_core.c
@@ -266,12 +266,6 @@ rproc_parse_vring(struct rproc_vdev *rvdev, struct fw_rsc_vdev *rsc, int i)
 	dev_dbg(dev, "vdev rsc: vring%d: da 0x%x, qsz %d, align %d\n",
 		i, vring->da, vring->num, vring->align);
 
-	/* make sure reserved bytes are zeroes */
-	if (vring->reserved) {
-		dev_err(dev, "vring rsc has non zero reserved bytes\n");
-		return -EINVAL;
-	}
-
 	/* verify queue size and vring alignment are sane */
 	if (!vring->num || !vring->align) {
 		dev_err(dev, "invalid qsz (%d) or alignment (%d)\n",
diff --git a/include/linux/remoteproc.h b/include/linux/remoteproc.h
index 80e1cba..c321eab 100644
--- a/include/linux/remoteproc.h
+++ b/include/linux/remoteproc.h
@@ -241,7 +241,7 @@ struct fw_rsc_trace {
  * @notifyid is a unique rproc-wide notify index for this vring. This notify
  * index is used when kicking a remote processor, to let it know that this
  * vring is triggered.
- * @reserved: reserved (must be zero)
+ * @pa: physical address
  *
  * This descriptor is not a resource entry by itself; it is part of the
  * vdev resource type (see below).
@@ -255,7 +255,7 @@ struct fw_rsc_vdev_vring {
 	u32 align;
 	u32 num;
 	u32 notifyid;
-	u32 reserved;
+	u32 pa;
 } __packed;
 
 /**
-- 
1.9.1

[toc] | [next] | [standalone]


#1477732 — Re: [PATCH v2 2/3] remoteproc: core: transform struct fw_rsc_vdev_vring reserved field in pa

FromBjorn Andersson <bjorn.andersson@linaro.org>
Date2016-09-06 20:20 +0200
SubjectRe: [PATCH v2 2/3] remoteproc: core: transform struct fw_rsc_vdev_vring reserved field in pa
Message-ID<set8u-5vV-17@gated-at.bofh.it>
In reply to#1477123
On Tue 06 Sep 00:39 PDT 2016, Loic Pallardy wrote:

> In current implementation, struct fw_rsc_vdev_vring which describes
> vring resource in firmware resource table owns only device address,
> because it assumes that host is responsible of vring allocation and
> only device address is needed by coprocessor.
> But if vrings need to be fixe in system memory map for any reasons
> (security, SoC charactieristics...), physical address is needed exatly
> identified the memory chunck by host.
> 
> For that let's transform reserved field of struct fw_rsc_vdev_vring
> to pa (physical address).
> 
> Signed-off-by: Loic Pallardy <loic.pallardy@st.com>

Applied, thanks

> ---
>  drivers/remoteproc/remoteproc_core.c | 6 ------
>  include/linux/remoteproc.h           | 4 ++--
>  2 files changed, 2 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
> index 18f4286..0d3c191 100644
> --- a/drivers/remoteproc/remoteproc_core.c
> +++ b/drivers/remoteproc/remoteproc_core.c
> @@ -266,12 +266,6 @@ rproc_parse_vring(struct rproc_vdev *rvdev, struct fw_rsc_vdev *rsc, int i)
>  	dev_dbg(dev, "vdev rsc: vring%d: da 0x%x, qsz %d, align %d\n",
>  		i, vring->da, vring->num, vring->align);
>  
> -	/* make sure reserved bytes are zeroes */
> -	if (vring->reserved) {
> -		dev_err(dev, "vring rsc has non zero reserved bytes\n");
> -		return -EINVAL;
> -	}
> -
>  	/* verify queue size and vring alignment are sane */
>  	if (!vring->num || !vring->align) {
>  		dev_err(dev, "invalid qsz (%d) or alignment (%d)\n",
> diff --git a/include/linux/remoteproc.h b/include/linux/remoteproc.h
> index 80e1cba..c321eab 100644
> --- a/include/linux/remoteproc.h
> +++ b/include/linux/remoteproc.h
> @@ -241,7 +241,7 @@ struct fw_rsc_trace {
>   * @notifyid is a unique rproc-wide notify index for this vring. This notify
>   * index is used when kicking a remote processor, to let it know that this
>   * vring is triggered.
> - * @reserved: reserved (must be zero)
> + * @pa: physical address
>   *
>   * This descriptor is not a resource entry by itself; it is part of the
>   * vdev resource type (see below).
> @@ -255,7 +255,7 @@ struct fw_rsc_vdev_vring {
>  	u32 align;
>  	u32 num;
>  	u32 notifyid;
> -	u32 reserved;
> +	u32 pa;
>  } __packed;
>  
>  /**
> -- 
> 1.9.1
> 

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web