Linux-remoteproc Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH v2 1/2] remoteproc: qcom_q6v5_mss: map/unmap mpss segments before/after use
@ 2020-04-15  7:16 Sibi Sankar
  2020-04-15  7:16 ` Sibi Sankar
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Sibi Sankar @ 2020-04-15  7:16 UTC (permalink / raw)
  To: bjorn.andersson
  Cc: agross, linux-arm-msm, linux-kernel, linux-remoteproc, ohad,
	evgreen, Sibi Sankar

The application processor accessing the mpss region when the Q6 modem is
running will lead to an XPU violation. Fix this by un-mapping the mpss
segments post copy during mpss authentication and coredumps.

Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
---

V2:
 * use ioremap_wc/iounmap instead of the devm_ variants
 * with mpss_region no longer relevant leave rproc_da_to_va unused

 drivers/remoteproc/qcom_q6v5_mss.c | 31 +++++++++++++++++++-----------
 1 file changed, 20 insertions(+), 11 deletions(-)

diff --git a/drivers/remoteproc/qcom_q6v5_mss.c b/drivers/remoteproc/qcom_q6v5_mss.c
index ce49c3236ff7c..b781fc8de3597 100644
--- a/drivers/remoteproc/qcom_q6v5_mss.c
+++ b/drivers/remoteproc/qcom_q6v5_mss.c
@@ -1156,7 +1156,13 @@ static int q6v5_mpss_load(struct q6v5 *qproc)
 			goto release_firmware;
 		}
 
-		ptr = qproc->mpss_region + offset;
+		ptr = ioremap_wc(qproc->mpss_phys + offset, phdr->p_memsz);
+		if (!ptr) {
+			dev_err(qproc->dev,
+				"unable to map memory region: %pa+%zx-%x\n",
+				&qproc->mpss_phys, offset, phdr->p_memsz);
+			goto release_firmware;
+		}
 
 		if (phdr->p_filesz && phdr->p_offset < fw->size) {
 			/* Firmware is large enough to be non-split */
@@ -1165,6 +1171,7 @@ static int q6v5_mpss_load(struct q6v5 *qproc)
 					"failed to load segment %d from truncated file %s\n",
 					i, fw_name);
 				ret = -EINVAL;
+				iounmap(ptr);
 				goto release_firmware;
 			}
 
@@ -1175,6 +1182,7 @@ static int q6v5_mpss_load(struct q6v5 *qproc)
 			ret = request_firmware(&seg_fw, fw_name, qproc->dev);
 			if (ret) {
 				dev_err(qproc->dev, "failed to load %s\n", fw_name);
+				iounmap(ptr);
 				goto release_firmware;
 			}
 
@@ -1187,6 +1195,7 @@ static int q6v5_mpss_load(struct q6v5 *qproc)
 			memset(ptr + phdr->p_filesz, 0,
 			       phdr->p_memsz - phdr->p_filesz);
 		}
+		iounmap(ptr);
 		size += phdr->p_memsz;
 
 		code_length = readl(qproc->rmb_base + RMB_PMI_CODE_LENGTH_REG);
@@ -1236,7 +1245,8 @@ static void qcom_q6v5_dump_segment(struct rproc *rproc,
 	int ret = 0;
 	struct q6v5 *qproc = rproc->priv;
 	unsigned long mask = BIT((unsigned long)segment->priv);
-	void *ptr = rproc_da_to_va(rproc, segment->da, segment->size);
+	int offset = segment->da - qproc->mpss_reloc;
+	void *ptr = NULL;
 
 	/* Unlock mba before copying segments */
 	if (!qproc->dump_mba_loaded) {
@@ -1250,10 +1260,15 @@ static void qcom_q6v5_dump_segment(struct rproc *rproc,
 		}
 	}
 
-	if (!ptr || ret)
-		memset(dest, 0xff, segment->size);
-	else
+	if (!ret)
+		ptr = ioremap_wc(qproc->mpss_phys + offset, segment->size);
+
+	if (ptr) {
 		memcpy(dest, ptr, segment->size);
+		iounmap(ptr);
+	} else {
+		memset(dest, 0xff, segment->size);
+	}
 
 	qproc->dump_segment_mask |= mask;
 
@@ -1595,12 +1610,6 @@ static int q6v5_alloc_memory_region(struct q6v5 *qproc)
 
 	qproc->mpss_phys = qproc->mpss_reloc = r.start;
 	qproc->mpss_size = resource_size(&r);
-	qproc->mpss_region = devm_ioremap_wc(qproc->dev, qproc->mpss_phys, qproc->mpss_size);
-	if (!qproc->mpss_region) {
-		dev_err(qproc->dev, "unable to map memory region: %pa+%zx\n",
-			&r.start, qproc->mpss_size);
-		return -EBUSY;
-	}
 
 	return 0;
 }
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

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

* [PATCH v2 1/2] remoteproc: qcom_q6v5_mss: map/unmap mpss segments before/after use
  2020-04-15  7:16 [PATCH v2 1/2] remoteproc: qcom_q6v5_mss: map/unmap mpss segments before/after use Sibi Sankar
@ 2020-04-15  7:16 ` Sibi Sankar
  2020-04-15  7:16 ` [PATCH v2 2/2] remoteproc: qcom_q6v5_mss: Remove unused q6v5_da_to_va function Sibi Sankar
  2020-05-13  6:20 ` [PATCH v2 1/2] remoteproc: qcom_q6v5_mss: map/unmap mpss segments before/after use patchwork-bot+linux-remoteproc
  2 siblings, 0 replies; 10+ messages in thread
From: Sibi Sankar @ 2020-04-15  7:16 UTC (permalink / raw)
  To: bjorn.andersson
  Cc: agross, linux-arm-msm, linux-kernel, linux-remoteproc, ohad,
	evgreen, Sibi Sankar

The application processor accessing the mpss region when the Q6 modem is
running will lead to an XPU violation. Fix this by un-mapping the mpss
segments post copy during mpss authentication and coredumps.

Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
---

V2:
 * use ioremap_wc/iounmap instead of the devm_ variants
 * with mpss_region no longer relevant leave rproc_da_to_va unused

 drivers/remoteproc/qcom_q6v5_mss.c | 31 +++++++++++++++++++-----------
 1 file changed, 20 insertions(+), 11 deletions(-)

diff --git a/drivers/remoteproc/qcom_q6v5_mss.c b/drivers/remoteproc/qcom_q6v5_mss.c
index ce49c3236ff7c..b781fc8de3597 100644
--- a/drivers/remoteproc/qcom_q6v5_mss.c
+++ b/drivers/remoteproc/qcom_q6v5_mss.c
@@ -1156,7 +1156,13 @@ static int q6v5_mpss_load(struct q6v5 *qproc)
 			goto release_firmware;
 		}
 
-		ptr = qproc->mpss_region + offset;
+		ptr = ioremap_wc(qproc->mpss_phys + offset, phdr->p_memsz);
+		if (!ptr) {
+			dev_err(qproc->dev,
+				"unable to map memory region: %pa+%zx-%x\n",
+				&qproc->mpss_phys, offset, phdr->p_memsz);
+			goto release_firmware;
+		}
 
 		if (phdr->p_filesz && phdr->p_offset < fw->size) {
 			/* Firmware is large enough to be non-split */
@@ -1165,6 +1171,7 @@ static int q6v5_mpss_load(struct q6v5 *qproc)
 					"failed to load segment %d from truncated file %s\n",
 					i, fw_name);
 				ret = -EINVAL;
+				iounmap(ptr);
 				goto release_firmware;
 			}
 
@@ -1175,6 +1182,7 @@ static int q6v5_mpss_load(struct q6v5 *qproc)
 			ret = request_firmware(&seg_fw, fw_name, qproc->dev);
 			if (ret) {
 				dev_err(qproc->dev, "failed to load %s\n", fw_name);
+				iounmap(ptr);
 				goto release_firmware;
 			}
 
@@ -1187,6 +1195,7 @@ static int q6v5_mpss_load(struct q6v5 *qproc)
 			memset(ptr + phdr->p_filesz, 0,
 			       phdr->p_memsz - phdr->p_filesz);
 		}
+		iounmap(ptr);
 		size += phdr->p_memsz;
 
 		code_length = readl(qproc->rmb_base + RMB_PMI_CODE_LENGTH_REG);
@@ -1236,7 +1245,8 @@ static void qcom_q6v5_dump_segment(struct rproc *rproc,
 	int ret = 0;
 	struct q6v5 *qproc = rproc->priv;
 	unsigned long mask = BIT((unsigned long)segment->priv);
-	void *ptr = rproc_da_to_va(rproc, segment->da, segment->size);
+	int offset = segment->da - qproc->mpss_reloc;
+	void *ptr = NULL;
 
 	/* Unlock mba before copying segments */
 	if (!qproc->dump_mba_loaded) {
@@ -1250,10 +1260,15 @@ static void qcom_q6v5_dump_segment(struct rproc *rproc,
 		}
 	}
 
-	if (!ptr || ret)
-		memset(dest, 0xff, segment->size);
-	else
+	if (!ret)
+		ptr = ioremap_wc(qproc->mpss_phys + offset, segment->size);
+
+	if (ptr) {
 		memcpy(dest, ptr, segment->size);
+		iounmap(ptr);
+	} else {
+		memset(dest, 0xff, segment->size);
+	}
 
 	qproc->dump_segment_mask |= mask;
 
@@ -1595,12 +1610,6 @@ static int q6v5_alloc_memory_region(struct q6v5 *qproc)
 
 	qproc->mpss_phys = qproc->mpss_reloc = r.start;
 	qproc->mpss_size = resource_size(&r);
-	qproc->mpss_region = devm_ioremap_wc(qproc->dev, qproc->mpss_phys, qproc->mpss_size);
-	if (!qproc->mpss_region) {
-		dev_err(qproc->dev, "unable to map memory region: %pa+%zx\n",
-			&r.start, qproc->mpss_size);
-		return -EBUSY;
-	}
 
 	return 0;
 }
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

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

* [PATCH v2 2/2] remoteproc: qcom_q6v5_mss: Remove unused q6v5_da_to_va function
  2020-04-15  7:16 [PATCH v2 1/2] remoteproc: qcom_q6v5_mss: map/unmap mpss segments before/after use Sibi Sankar
  2020-04-15  7:16 ` Sibi Sankar
@ 2020-04-15  7:16 ` Sibi Sankar
  2020-04-15  7:16   ` Sibi Sankar
                     ` (2 more replies)
  2020-05-13  6:20 ` [PATCH v2 1/2] remoteproc: qcom_q6v5_mss: map/unmap mpss segments before/after use patchwork-bot+linux-remoteproc
  2 siblings, 3 replies; 10+ messages in thread
From: Sibi Sankar @ 2020-04-15  7:16 UTC (permalink / raw)
  To: bjorn.andersson
  Cc: agross, linux-arm-msm, linux-kernel, linux-remoteproc, ohad,
	evgreen, Sibi Sankar

Remove unsed q6v5_da_to_va function as the mss driver uses a per segment
dump function.

Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
---
 drivers/remoteproc/qcom_q6v5_mss.c | 14 --------------
 1 file changed, 14 deletions(-)

diff --git a/drivers/remoteproc/qcom_q6v5_mss.c b/drivers/remoteproc/qcom_q6v5_mss.c
index b781fc8de3597..6a19e0e77236e 100644
--- a/drivers/remoteproc/qcom_q6v5_mss.c
+++ b/drivers/remoteproc/qcom_q6v5_mss.c
@@ -196,7 +196,6 @@ struct q6v5 {
 
 	phys_addr_t mpss_phys;
 	phys_addr_t mpss_reloc;
-	void *mpss_region;
 	size_t mpss_size;
 
 	struct qcom_rproc_glink glink_subdev;
@@ -1342,18 +1341,6 @@ static int q6v5_stop(struct rproc *rproc)
 	return 0;
 }
 
-static void *q6v5_da_to_va(struct rproc *rproc, u64 da, size_t len)
-{
-	struct q6v5 *qproc = rproc->priv;
-	int offset;
-
-	offset = da - qproc->mpss_reloc;
-	if (offset < 0 || offset + len > qproc->mpss_size)
-		return NULL;
-
-	return qproc->mpss_region + offset;
-}
-
 static int qcom_q6v5_register_dump_segments(struct rproc *rproc,
 					    const struct firmware *mba_fw)
 {
@@ -1399,7 +1386,6 @@ static int qcom_q6v5_register_dump_segments(struct rproc *rproc,
 static const struct rproc_ops q6v5_ops = {
 	.start = q6v5_start,
 	.stop = q6v5_stop,
-	.da_to_va = q6v5_da_to_va,
 	.parse_fw = qcom_q6v5_register_dump_segments,
 	.load = q6v5_load,
 };
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

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

* [PATCH v2 2/2] remoteproc: qcom_q6v5_mss: Remove unused q6v5_da_to_va function
  2020-04-15  7:16 ` [PATCH v2 2/2] remoteproc: qcom_q6v5_mss: Remove unused q6v5_da_to_va function Sibi Sankar
@ 2020-04-15  7:16   ` Sibi Sankar
  2020-04-20 18:53   ` Evan Green
  2020-04-29 17:27   ` Evan Green
  2 siblings, 0 replies; 10+ messages in thread
From: Sibi Sankar @ 2020-04-15  7:16 UTC (permalink / raw)
  To: bjorn.andersson
  Cc: agross, linux-arm-msm, linux-kernel, linux-remoteproc, ohad,
	evgreen, Sibi Sankar

Remove unsed q6v5_da_to_va function as the mss driver uses a per segment
dump function.

Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
---
 drivers/remoteproc/qcom_q6v5_mss.c | 14 --------------
 1 file changed, 14 deletions(-)

diff --git a/drivers/remoteproc/qcom_q6v5_mss.c b/drivers/remoteproc/qcom_q6v5_mss.c
index b781fc8de3597..6a19e0e77236e 100644
--- a/drivers/remoteproc/qcom_q6v5_mss.c
+++ b/drivers/remoteproc/qcom_q6v5_mss.c
@@ -196,7 +196,6 @@ struct q6v5 {
 
 	phys_addr_t mpss_phys;
 	phys_addr_t mpss_reloc;
-	void *mpss_region;
 	size_t mpss_size;
 
 	struct qcom_rproc_glink glink_subdev;
@@ -1342,18 +1341,6 @@ static int q6v5_stop(struct rproc *rproc)
 	return 0;
 }
 
-static void *q6v5_da_to_va(struct rproc *rproc, u64 da, size_t len)
-{
-	struct q6v5 *qproc = rproc->priv;
-	int offset;
-
-	offset = da - qproc->mpss_reloc;
-	if (offset < 0 || offset + len > qproc->mpss_size)
-		return NULL;
-
-	return qproc->mpss_region + offset;
-}
-
 static int qcom_q6v5_register_dump_segments(struct rproc *rproc,
 					    const struct firmware *mba_fw)
 {
@@ -1399,7 +1386,6 @@ static int qcom_q6v5_register_dump_segments(struct rproc *rproc,
 static const struct rproc_ops q6v5_ops = {
 	.start = q6v5_start,
 	.stop = q6v5_stop,
-	.da_to_va = q6v5_da_to_va,
 	.parse_fw = qcom_q6v5_register_dump_segments,
 	.load = q6v5_load,
 };
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

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

* Re: [PATCH v2 2/2] remoteproc: qcom_q6v5_mss: Remove unused q6v5_da_to_va function
  2020-04-15  7:16 ` [PATCH v2 2/2] remoteproc: qcom_q6v5_mss: Remove unused q6v5_da_to_va function Sibi Sankar
  2020-04-15  7:16   ` Sibi Sankar
@ 2020-04-20 18:53   ` Evan Green
  2020-04-20 18:53     ` Evan Green
  2020-04-20 18:57     ` Evan Green
  2020-04-29 17:27   ` Evan Green
  2 siblings, 2 replies; 10+ messages in thread
From: Evan Green @ 2020-04-20 18:53 UTC (permalink / raw)
  To: Sibi Sankar
  Cc: Bjorn Andersson, Andy Gross, linux-arm-msm, LKML,
	linux-remoteproc, Ohad Ben Cohen

On Wed, Apr 15, 2020 at 12:16 AM Sibi Sankar <sibis@codeaurora.org> wrote:
>
> Remove unsed q6v5_da_to_va function as the mss driver uses a per segment
> dump function.
>
> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
> ---
>  drivers/remoteproc/qcom_q6v5_mss.c | 14 --------------
>  1 file changed, 14 deletions(-)
>
> diff --git a/drivers/remoteproc/qcom_q6v5_mss.c b/drivers/remoteproc/qcom_q6v5_mss.c
> index b781fc8de3597..6a19e0e77236e 100644
> --- a/drivers/remoteproc/qcom_q6v5_mss.c
> +++ b/drivers/remoteproc/qcom_q6v5_mss.c
> @@ -196,7 +196,6 @@ struct q6v5 {
>
>         phys_addr_t mpss_phys;
>         phys_addr_t mpss_reloc;
> -       void *mpss_region;

Hm, this doesn't build for me on our Chrome tree:

  CC [M]  drivers/remoteproc/qcom_q6v5_mss.o
/mnt/host/source/src/third_party/kernel/v5.4/drivers/remoteproc/qcom_q6v5_mss.c:1118:16:
error: no member named 'mpss_region' in 'struct q6v5'
                ptr = qproc->mpss_region + offset;
                      ~~~~~  ^
/mnt/host/source/src/third_party/kernel/v5.4/drivers/remoteproc/qcom_q6v5_mss.c:1520:9:
error: no member named 'mpss_region' in 'struct q6v5'
        qproc->mpss_region = devm_ioremap_wc(qproc->dev,
qproc->mpss_phys, qproc->mpss_size);
        ~~~~~  ^
/mnt/host/source/src/third_party/kernel/v5.4/drivers/remoteproc/qcom_q6v5_mss.c:1521:14:
error: no member named 'mpss_region' in 'struct q6v5'
        if (!qproc->mpss_region) {
             ~~~~~  ^

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

* Re: [PATCH v2 2/2] remoteproc: qcom_q6v5_mss: Remove unused q6v5_da_to_va function
  2020-04-20 18:53   ` Evan Green
@ 2020-04-20 18:53     ` Evan Green
  2020-04-20 18:57     ` Evan Green
  1 sibling, 0 replies; 10+ messages in thread
From: Evan Green @ 2020-04-20 18:53 UTC (permalink / raw)
  To: Sibi Sankar
  Cc: Bjorn Andersson, Andy Gross, linux-arm-msm, LKML,
	linux-remoteproc, Ohad Ben Cohen

On Wed, Apr 15, 2020 at 12:16 AM Sibi Sankar <sibis@codeaurora.org> wrote:
>
> Remove unsed q6v5_da_to_va function as the mss driver uses a per segment
> dump function.
>
> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
> ---
>  drivers/remoteproc/qcom_q6v5_mss.c | 14 --------------
>  1 file changed, 14 deletions(-)
>
> diff --git a/drivers/remoteproc/qcom_q6v5_mss.c b/drivers/remoteproc/qcom_q6v5_mss.c
> index b781fc8de3597..6a19e0e77236e 100644
> --- a/drivers/remoteproc/qcom_q6v5_mss.c
> +++ b/drivers/remoteproc/qcom_q6v5_mss.c
> @@ -196,7 +196,6 @@ struct q6v5 {
>
>         phys_addr_t mpss_phys;
>         phys_addr_t mpss_reloc;
> -       void *mpss_region;

Hm, this doesn't build for me on our Chrome tree:

  CC [M]  drivers/remoteproc/qcom_q6v5_mss.o
/mnt/host/source/src/third_party/kernel/v5.4/drivers/remoteproc/qcom_q6v5_mss.c:1118:16:
error: no member named 'mpss_region' in 'struct q6v5'
                ptr = qproc->mpss_region + offset;
                      ~~~~~  ^
/mnt/host/source/src/third_party/kernel/v5.4/drivers/remoteproc/qcom_q6v5_mss.c:1520:9:
error: no member named 'mpss_region' in 'struct q6v5'
        qproc->mpss_region = devm_ioremap_wc(qproc->dev,
qproc->mpss_phys, qproc->mpss_size);
        ~~~~~  ^
/mnt/host/source/src/third_party/kernel/v5.4/drivers/remoteproc/qcom_q6v5_mss.c:1521:14:
error: no member named 'mpss_region' in 'struct q6v5'
        if (!qproc->mpss_region) {
             ~~~~~  ^

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

* Re: [PATCH v2 2/2] remoteproc: qcom_q6v5_mss: Remove unused q6v5_da_to_va function
  2020-04-20 18:53   ` Evan Green
  2020-04-20 18:53     ` Evan Green
@ 2020-04-20 18:57     ` Evan Green
  2020-04-20 18:57       ` Evan Green
  1 sibling, 1 reply; 10+ messages in thread
From: Evan Green @ 2020-04-20 18:57 UTC (permalink / raw)
  To: Sibi Sankar
  Cc: Bjorn Andersson, Andy Gross, linux-arm-msm, LKML,
	linux-remoteproc, Ohad Ben Cohen

On Mon, Apr 20, 2020 at 11:53 AM Evan Green <evgreen@chromium.org> wrote:
>
> On Wed, Apr 15, 2020 at 12:16 AM Sibi Sankar <sibis@codeaurora.org> wrote:
> >
> > Remove unsed q6v5_da_to_va function as the mss driver uses a per segment
> > dump function.
> >
> > Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
> > ---
> >  drivers/remoteproc/qcom_q6v5_mss.c | 14 --------------
> >  1 file changed, 14 deletions(-)
> >
> > diff --git a/drivers/remoteproc/qcom_q6v5_mss.c b/drivers/remoteproc/qcom_q6v5_mss.c
> > index b781fc8de3597..6a19e0e77236e 100644
> > --- a/drivers/remoteproc/qcom_q6v5_mss.c
> > +++ b/drivers/remoteproc/qcom_q6v5_mss.c
> > @@ -196,7 +196,6 @@ struct q6v5 {
> >
> >         phys_addr_t mpss_phys;
> >         phys_addr_t mpss_reloc;
> > -       void *mpss_region;
>
> Hm, this doesn't build for me on our Chrome tree:
>
>   CC [M]  drivers/remoteproc/qcom_q6v5_mss.o
> /mnt/host/source/src/third_party/kernel/v5.4/drivers/remoteproc/qcom_q6v5_mss.c:1118:16:
> error: no member named 'mpss_region' in 'struct q6v5'
>                 ptr = qproc->mpss_region + offset;
>                       ~~~~~  ^
> /mnt/host/source/src/third_party/kernel/v5.4/drivers/remoteproc/qcom_q6v5_mss.c:1520:9:
> error: no member named 'mpss_region' in 'struct q6v5'
>         qproc->mpss_region = devm_ioremap_wc(qproc->dev,
> qproc->mpss_phys, qproc->mpss_size);
>         ~~~~~  ^
> /mnt/host/source/src/third_party/kernel/v5.4/drivers/remoteproc/qcom_q6v5_mss.c:1521:14:
> error: no member named 'mpss_region' in 'struct q6v5'
>         if (!qproc->mpss_region) {
>              ~~~~~  ^

Whoops, ignore me, I missed the other patch in this series.
-Evan

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

* Re: [PATCH v2 2/2] remoteproc: qcom_q6v5_mss: Remove unused q6v5_da_to_va function
  2020-04-20 18:57     ` Evan Green
@ 2020-04-20 18:57       ` Evan Green
  0 siblings, 0 replies; 10+ messages in thread
From: Evan Green @ 2020-04-20 18:57 UTC (permalink / raw)
  To: Sibi Sankar
  Cc: Bjorn Andersson, Andy Gross, linux-arm-msm, LKML,
	linux-remoteproc, Ohad Ben Cohen

On Mon, Apr 20, 2020 at 11:53 AM Evan Green <evgreen@chromium.org> wrote:
>
> On Wed, Apr 15, 2020 at 12:16 AM Sibi Sankar <sibis@codeaurora.org> wrote:
> >
> > Remove unsed q6v5_da_to_va function as the mss driver uses a per segment
> > dump function.
> >
> > Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
> > ---
> >  drivers/remoteproc/qcom_q6v5_mss.c | 14 --------------
> >  1 file changed, 14 deletions(-)
> >
> > diff --git a/drivers/remoteproc/qcom_q6v5_mss.c b/drivers/remoteproc/qcom_q6v5_mss.c
> > index b781fc8de3597..6a19e0e77236e 100644
> > --- a/drivers/remoteproc/qcom_q6v5_mss.c
> > +++ b/drivers/remoteproc/qcom_q6v5_mss.c
> > @@ -196,7 +196,6 @@ struct q6v5 {
> >
> >         phys_addr_t mpss_phys;
> >         phys_addr_t mpss_reloc;
> > -       void *mpss_region;
>
> Hm, this doesn't build for me on our Chrome tree:
>
>   CC [M]  drivers/remoteproc/qcom_q6v5_mss.o
> /mnt/host/source/src/third_party/kernel/v5.4/drivers/remoteproc/qcom_q6v5_mss.c:1118:16:
> error: no member named 'mpss_region' in 'struct q6v5'
>                 ptr = qproc->mpss_region + offset;
>                       ~~~~~  ^
> /mnt/host/source/src/third_party/kernel/v5.4/drivers/remoteproc/qcom_q6v5_mss.c:1520:9:
> error: no member named 'mpss_region' in 'struct q6v5'
>         qproc->mpss_region = devm_ioremap_wc(qproc->dev,
> qproc->mpss_phys, qproc->mpss_size);
>         ~~~~~  ^
> /mnt/host/source/src/third_party/kernel/v5.4/drivers/remoteproc/qcom_q6v5_mss.c:1521:14:
> error: no member named 'mpss_region' in 'struct q6v5'
>         if (!qproc->mpss_region) {
>              ~~~~~  ^

Whoops, ignore me, I missed the other patch in this series.
-Evan

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

* Re: [PATCH v2 2/2] remoteproc: qcom_q6v5_mss: Remove unused q6v5_da_to_va function
  2020-04-15  7:16 ` [PATCH v2 2/2] remoteproc: qcom_q6v5_mss: Remove unused q6v5_da_to_va function Sibi Sankar
  2020-04-15  7:16   ` Sibi Sankar
  2020-04-20 18:53   ` Evan Green
@ 2020-04-29 17:27   ` Evan Green
  2 siblings, 0 replies; 10+ messages in thread
From: Evan Green @ 2020-04-29 17:27 UTC (permalink / raw)
  To: Sibi Sankar
  Cc: Bjorn Andersson, Andy Gross, linux-arm-msm, LKML,
	linux-remoteproc, Ohad Ben Cohen

On Wed, Apr 15, 2020 at 12:16 AM Sibi Sankar <sibis@codeaurora.org> wrote:
>
> Remove unsed q6v5_da_to_va function as the mss driver uses a per segment
> dump function.
>
> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>

I tested both patches (successfully), but for some reason this is the
only one related to this series in my inbox.

Tested-by: Evan Green <evgreen@chromium.org>

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

* Re: [PATCH v2 1/2] remoteproc: qcom_q6v5_mss: map/unmap mpss segments before/after use
  2020-04-15  7:16 [PATCH v2 1/2] remoteproc: qcom_q6v5_mss: map/unmap mpss segments before/after use Sibi Sankar
  2020-04-15  7:16 ` Sibi Sankar
  2020-04-15  7:16 ` [PATCH v2 2/2] remoteproc: qcom_q6v5_mss: Remove unused q6v5_da_to_va function Sibi Sankar
@ 2020-05-13  6:20 ` patchwork-bot+linux-remoteproc
  2 siblings, 0 replies; 10+ messages in thread
From: patchwork-bot+linux-remoteproc @ 2020-05-13  6:20 UTC (permalink / raw)
  To: Sibi Sankar; +Cc: linux-remoteproc

Hello:

This series was applied to andersson/remoteproc.git (refs/heads/for-next).

On Wed, 15 Apr 2020 12:46:18 +0530 you wrote:
> The application processor accessing the mpss region when the Q6 modem is
> running will lead to an XPU violation. Fix this by un-mapping the mpss
> segments post copy during mpss authentication and coredumps.
> 
> Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
> ---
> 
> [...]


Here is a summary with links:
  - [v2,1/2] remoteproc: qcom_q6v5_mss: map/unmap mpss segments before/after use
    https://git.kernel.org/andersson/remoteproc/c/be050a3429f46ecf13eb2b80f299479f8bb823fb
  - [v2,2/2] remoteproc: qcom_q6v5_mss: Remove unused q6v5_da_to_va function
    https://git.kernel.org/andersson/remoteproc/c/9666174a4e1a7b1e32c214312678f8452275da6a

You are awesome, thank you!

-- 
Deet-doot-dot, I am a bot.
https://korg.wiki.kernel.org/userdoc/pwbot

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

end of thread, back to index

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-15  7:16 [PATCH v2 1/2] remoteproc: qcom_q6v5_mss: map/unmap mpss segments before/after use Sibi Sankar
2020-04-15  7:16 ` Sibi Sankar
2020-04-15  7:16 ` [PATCH v2 2/2] remoteproc: qcom_q6v5_mss: Remove unused q6v5_da_to_va function Sibi Sankar
2020-04-15  7:16   ` Sibi Sankar
2020-04-20 18:53   ` Evan Green
2020-04-20 18:53     ` Evan Green
2020-04-20 18:57     ` Evan Green
2020-04-20 18:57       ` Evan Green
2020-04-29 17:27   ` Evan Green
2020-05-13  6:20 ` [PATCH v2 1/2] remoteproc: qcom_q6v5_mss: map/unmap mpss segments before/after use patchwork-bot+linux-remoteproc

Linux-remoteproc Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-remoteproc/0 linux-remoteproc/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-remoteproc linux-remoteproc/ https://lore.kernel.org/linux-remoteproc \
		linux-remoteproc@vger.kernel.org
	public-inbox-index linux-remoteproc

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-remoteproc


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git