diff mbox

soc: qcom: smp2p: Use memset_io to zero out new entries

Message ID 1456417057-17591-1-git-send-email-bjorn.andersson@linaro.org (mailing list archive)
State Accepted, archived
Delegated to: Andy Gross
Headers show

Commit Message

Bjorn Andersson Feb. 25, 2016, 4:17 p.m. UTC
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
---
 drivers/soc/qcom/smp2p.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Andy Gross Feb. 25, 2016, 10:02 p.m. UTC | #1
On Thu, Feb 25, 2016 at 08:17:37AM -0800, Bjorn Andersson wrote:
> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> ---
>  drivers/soc/qcom/smp2p.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/soc/qcom/smp2p.c b/drivers/soc/qcom/smp2p.c
> index f1eed7f9dd67..61df598444e6 100644
> --- a/drivers/soc/qcom/smp2p.c
> +++ b/drivers/soc/qcom/smp2p.c
> @@ -379,7 +379,7 @@ static int qcom_smp2p_alloc_outbound_item(struct qcom_smp2p *smp2p)
>  		return PTR_ERR(out);
>  	}
>  
> -	memset(out, 0, sizeof(*out));
> +	memset_io(out, 0, sizeof(*out));
>  	out->magic = SMP2P_MAGIC;
>  	out->local_pid = smp2p->local_pid;
>  	out->remote_pid = smp2p->remote_pid;

Good catch.  I'll add this fix for the pull.

--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Paul Walmsley March 1, 2016, 5:10 p.m. UTC | #2
On Thu, 25 Feb 2016, Andy Gross wrote:

> On Thu, Feb 25, 2016 at 08:17:37AM -0800, Bjorn Andersson wrote:
> > Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> > ---
> >  drivers/soc/qcom/smp2p.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/soc/qcom/smp2p.c b/drivers/soc/qcom/smp2p.c
> > index f1eed7f9dd67..61df598444e6 100644
> > --- a/drivers/soc/qcom/smp2p.c
> > +++ b/drivers/soc/qcom/smp2p.c
> > @@ -379,7 +379,7 @@ static int qcom_smp2p_alloc_outbound_item(struct qcom_smp2p *smp2p)
> >  		return PTR_ERR(out);
> >  	}
> >  
> > -	memset(out, 0, sizeof(*out));
> > +	memset_io(out, 0, sizeof(*out));
> >  	out->magic = SMP2P_MAGIC;
> >  	out->local_pid = smp2p->local_pid;
> >  	out->remote_pid = smp2p->remote_pid;
> 
> Good catch.  I'll add this fix for the pull.

Folks, is qmem_smem_get() intended to return pointers to device-mapped 
memory, as implied by this change?

If so, shouldn't the return type of qmem_smem_get() et al. be void 
__iomem * rather than void *?


- Paul
--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Bjorn Andersson March 1, 2016, 5:27 p.m. UTC | #3
On Tue 01 Mar 09:10 PST 2016, Paul Walmsley wrote:

> On Thu, 25 Feb 2016, Andy Gross wrote:
> 
> > On Thu, Feb 25, 2016 at 08:17:37AM -0800, Bjorn Andersson wrote:
> > > Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> > > ---
> > >  drivers/soc/qcom/smp2p.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > 
> > > diff --git a/drivers/soc/qcom/smp2p.c b/drivers/soc/qcom/smp2p.c
> > > index f1eed7f9dd67..61df598444e6 100644
> > > --- a/drivers/soc/qcom/smp2p.c
> > > +++ b/drivers/soc/qcom/smp2p.c
> > > @@ -379,7 +379,7 @@ static int qcom_smp2p_alloc_outbound_item(struct qcom_smp2p *smp2p)
> > >  		return PTR_ERR(out);
> > >  	}
> > >  
> > > -	memset(out, 0, sizeof(*out));
> > > +	memset_io(out, 0, sizeof(*out));
> > >  	out->magic = SMP2P_MAGIC;
> > >  	out->local_pid = smp2p->local_pid;
> > >  	out->remote_pid = smp2p->remote_pid;
> > 
> > Good catch.  I'll add this fix for the pull.
> 
> Folks, is qmem_smem_get() intended to return pointers to device-mapped 
> memory, as implied by this change?
> 
> If so, shouldn't the return type of qmem_smem_get() et al. be void 
> __iomem * rather than void *?
> 

The shared memory is remapped system ram, so it should not be device
mapped. I've discussed this with Andy in the past and we'll try to get
the discussions settled during next week's Linaro Connect.

Regards,
Bjorn
--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/soc/qcom/smp2p.c b/drivers/soc/qcom/smp2p.c
index f1eed7f9dd67..61df598444e6 100644
--- a/drivers/soc/qcom/smp2p.c
+++ b/drivers/soc/qcom/smp2p.c
@@ -379,7 +379,7 @@  static int qcom_smp2p_alloc_outbound_item(struct qcom_smp2p *smp2p)
 		return PTR_ERR(out);
 	}
 
-	memset(out, 0, sizeof(*out));
+	memset_io(out, 0, sizeof(*out));
 	out->magic = SMP2P_MAGIC;
 	out->local_pid = smp2p->local_pid;
 	out->remote_pid = smp2p->remote_pid;