Re: [PATCH 2/3] rpmsg: Only invoke announce_create for rpdev with endpoints

2018-04-10 Thread Bjorn Andersson
On Tue 03 Apr 02:12 PDT 2018, Loic PALLARDY wrote:
> > -Original Message-
> > From: linux-remoteproc-ow...@vger.kernel.org [mailto:linux-remoteproc-
> > ow...@vger.kernel.org] On Behalf Of Bjorn Andersson
[..]
> > diff --git a/drivers/rpmsg/rpmsg_core.c b/drivers/rpmsg/rpmsg_core.c
> > index dffa3aab7178..e85d2691d2cf 100644
> > --- a/drivers/rpmsg/rpmsg_core.c
> > +++ b/drivers/rpmsg/rpmsg_core.c
> > @@ -442,7 +442,7 @@ static int rpmsg_dev_probe(struct device *dev)
> > goto out;
> > }
> > 
> > -   if (rpdev->ops->announce_create)
> > +   if (ept && rpdev->ops->announce_create)
> 
> This check is already part of virtio_rpmsg.c (see line 341)
>   /* need to tell remote processor's name service about this channel ? */
>   if (rpdev->announce && rpdev->ept &&
>   virtio_has_feature(vrp->vdev, VIRTIO_RPMSG_F_NS)) {

The introduction of rpdev->ept in this check was done by Henri, as he
was implementing rpmsg_char support for virtio_rpmsg:

b2599ebffb2d ("rpmsg: virtio_rpmsg_bus: fix announce for devices without 
endpoint")

It's there because the rpmsg_device will not have a primary endpoint and
as such there's no communication channel to announce. We could add this
check in each implementation of announce, but I think it's a common
issue.

> 
> should it be part of qcom_smd driver too? (but each implementation will 
> duplicate checks)
> Or may have a generic check in the core including rpdev->announce as well 
> (and doing virtio_rpmsg.c clean-up)
> 

I think we want to remove the ept check in virtio_rpmsg, to reduce that
part of the duplication at least.

> Change will become:
>   if (rpdev->announce && ept && rpdev->ops->announce_create)
> 

That might make sense, let's see what Wendy comes up with related to
rpmsg_char and supporting Linux-side services, as I suspect that this
handling might be affected.

Regards,
Bjorn


Re: [PATCH 2/3] rpmsg: Only invoke announce_create for rpdev with endpoints

2018-04-10 Thread Bjorn Andersson
On Tue 03 Apr 02:12 PDT 2018, Loic PALLARDY wrote:
> > -Original Message-
> > From: linux-remoteproc-ow...@vger.kernel.org [mailto:linux-remoteproc-
> > ow...@vger.kernel.org] On Behalf Of Bjorn Andersson
[..]
> > diff --git a/drivers/rpmsg/rpmsg_core.c b/drivers/rpmsg/rpmsg_core.c
> > index dffa3aab7178..e85d2691d2cf 100644
> > --- a/drivers/rpmsg/rpmsg_core.c
> > +++ b/drivers/rpmsg/rpmsg_core.c
> > @@ -442,7 +442,7 @@ static int rpmsg_dev_probe(struct device *dev)
> > goto out;
> > }
> > 
> > -   if (rpdev->ops->announce_create)
> > +   if (ept && rpdev->ops->announce_create)
> 
> This check is already part of virtio_rpmsg.c (see line 341)
>   /* need to tell remote processor's name service about this channel ? */
>   if (rpdev->announce && rpdev->ept &&
>   virtio_has_feature(vrp->vdev, VIRTIO_RPMSG_F_NS)) {

The introduction of rpdev->ept in this check was done by Henri, as he
was implementing rpmsg_char support for virtio_rpmsg:

b2599ebffb2d ("rpmsg: virtio_rpmsg_bus: fix announce for devices without 
endpoint")

It's there because the rpmsg_device will not have a primary endpoint and
as such there's no communication channel to announce. We could add this
check in each implementation of announce, but I think it's a common
issue.

> 
> should it be part of qcom_smd driver too? (but each implementation will 
> duplicate checks)
> Or may have a generic check in the core including rpdev->announce as well 
> (and doing virtio_rpmsg.c clean-up)
> 

I think we want to remove the ept check in virtio_rpmsg, to reduce that
part of the duplication at least.

> Change will become:
>   if (rpdev->announce && ept && rpdev->ops->announce_create)
> 

That might make sense, let's see what Wendy comes up with related to
rpmsg_char and supporting Linux-side services, as I suspect that this
handling might be affected.

Regards,
Bjorn


RE: [PATCH 2/3] rpmsg: Only invoke announce_create for rpdev with endpoints

2018-04-10 Thread Loic PALLARDY
Hi Bjorn,

> -Original Message-
> From: Loic PALLARDY
> Sent: Tuesday, April 03, 2018 11:13 AM
> To: 'Bjorn Andersson' <bjorn.anders...@linaro.org>; Ohad Ben-Cohen
> <o...@wizery.com>
> Cc: linux-remotep...@vger.kernel.org; linux-kernel@vger.kernel.org; linux-
> arm-...@vger.kernel.org
> Subject: RE: [PATCH 2/3] rpmsg: Only invoke announce_create for rpdev with
> endpoints
> 
> Hi Bjorn,
> 
> > -Original Message-
> > From: linux-remoteproc-ow...@vger.kernel.org [mailto:linux-
> remoteproc-
> > ow...@vger.kernel.org] On Behalf Of Bjorn Andersson
> > Sent: Tuesday, March 27, 2018 11:07 PM
> > To: Ohad Ben-Cohen <o...@wizery.com>; Bjorn Andersson
> > <bjorn.anders...@linaro.org>
> > Cc: linux-remotep...@vger.kernel.org; linux-kernel@vger.kernel.org;
> linux-
> > arm-...@vger.kernel.org
> > Subject: [PATCH 2/3] rpmsg: Only invoke announce_create for rpdev with
> > endpoints
> >
> > For special rpmsg devices without a primary endpoint there is nothing to
> > announce so don't call the backend announce create function if we didn't
> > create an endpoint.
> >
> > Signed-off-by: Bjorn Andersson <bjorn.anders...@linaro.org>
> > ---
> >  drivers/rpmsg/rpmsg_core.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/rpmsg/rpmsg_core.c b/drivers/rpmsg/rpmsg_core.c
> > index dffa3aab7178..e85d2691d2cf 100644
> > --- a/drivers/rpmsg/rpmsg_core.c
> > +++ b/drivers/rpmsg/rpmsg_core.c
> > @@ -442,7 +442,7 @@ static int rpmsg_dev_probe(struct device *dev)
> > goto out;
> > }
> >
> > -   if (rpdev->ops->announce_create)
> > +   if (ept && rpdev->ops->announce_create)
> 
> This check is already part of virtio_rpmsg.c (see line 341)
>   /* need to tell remote processor's name service about this channel ?
> */
>   if (rpdev->announce && rpdev->ept &&
>   virtio_has_feature(vrp->vdev, VIRTIO_RPMSG_F_NS)) {
> 
> should it be part of qcom_smd driver too? (but each implementation will
> duplicate checks)
> Or may have a generic check in the core including rpdev->announce as well
> (and doing virtio_rpmsg.c clean-up)
> 
> Change will become:
>   if (rpdev->announce && ept && rpdev->ops->announce_create)
> 
> Regards,
> Loic

I'll appreciate if you reply to the review comments before merging patch and 
sending pull request.

Regards,
Loic

> > err = rpdev->ops->announce_create(rpdev);
> >  out:
> > return err;
> > --
> > 2.16.2
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-remoteproc"
> in
> > the body of a message to majord...@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH 2/3] rpmsg: Only invoke announce_create for rpdev with endpoints

2018-04-10 Thread Loic PALLARDY
Hi Bjorn,

> -Original Message-
> From: Loic PALLARDY
> Sent: Tuesday, April 03, 2018 11:13 AM
> To: 'Bjorn Andersson' ; Ohad Ben-Cohen
> 
> Cc: linux-remotep...@vger.kernel.org; linux-kernel@vger.kernel.org; linux-
> arm-...@vger.kernel.org
> Subject: RE: [PATCH 2/3] rpmsg: Only invoke announce_create for rpdev with
> endpoints
> 
> Hi Bjorn,
> 
> > -Original Message-
> > From: linux-remoteproc-ow...@vger.kernel.org [mailto:linux-
> remoteproc-
> > ow...@vger.kernel.org] On Behalf Of Bjorn Andersson
> > Sent: Tuesday, March 27, 2018 11:07 PM
> > To: Ohad Ben-Cohen ; Bjorn Andersson
> > 
> > Cc: linux-remotep...@vger.kernel.org; linux-kernel@vger.kernel.org;
> linux-
> > arm-...@vger.kernel.org
> > Subject: [PATCH 2/3] rpmsg: Only invoke announce_create for rpdev with
> > endpoints
> >
> > For special rpmsg devices without a primary endpoint there is nothing to
> > announce so don't call the backend announce create function if we didn't
> > create an endpoint.
> >
> > Signed-off-by: Bjorn Andersson 
> > ---
> >  drivers/rpmsg/rpmsg_core.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/rpmsg/rpmsg_core.c b/drivers/rpmsg/rpmsg_core.c
> > index dffa3aab7178..e85d2691d2cf 100644
> > --- a/drivers/rpmsg/rpmsg_core.c
> > +++ b/drivers/rpmsg/rpmsg_core.c
> > @@ -442,7 +442,7 @@ static int rpmsg_dev_probe(struct device *dev)
> > goto out;
> > }
> >
> > -   if (rpdev->ops->announce_create)
> > +   if (ept && rpdev->ops->announce_create)
> 
> This check is already part of virtio_rpmsg.c (see line 341)
>   /* need to tell remote processor's name service about this channel ?
> */
>   if (rpdev->announce && rpdev->ept &&
>   virtio_has_feature(vrp->vdev, VIRTIO_RPMSG_F_NS)) {
> 
> should it be part of qcom_smd driver too? (but each implementation will
> duplicate checks)
> Or may have a generic check in the core including rpdev->announce as well
> (and doing virtio_rpmsg.c clean-up)
> 
> Change will become:
>   if (rpdev->announce && ept && rpdev->ops->announce_create)
> 
> Regards,
> Loic

I'll appreciate if you reply to the review comments before merging patch and 
sending pull request.

Regards,
Loic

> > err = rpdev->ops->announce_create(rpdev);
> >  out:
> > return err;
> > --
> > 2.16.2
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-remoteproc"
> in
> > the body of a message to majord...@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH 2/3] rpmsg: Only invoke announce_create for rpdev with endpoints

2018-04-03 Thread Loic PALLARDY
Hi Bjorn,

> -Original Message-
> From: linux-remoteproc-ow...@vger.kernel.org [mailto:linux-remoteproc-
> ow...@vger.kernel.org] On Behalf Of Bjorn Andersson
> Sent: Tuesday, March 27, 2018 11:07 PM
> To: Ohad Ben-Cohen ; Bjorn Andersson
> 
> Cc: linux-remotep...@vger.kernel.org; linux-kernel@vger.kernel.org; linux-
> arm-...@vger.kernel.org
> Subject: [PATCH 2/3] rpmsg: Only invoke announce_create for rpdev with
> endpoints
> 
> For special rpmsg devices without a primary endpoint there is nothing to
> announce so don't call the backend announce create function if we didn't
> create an endpoint.
> 
> Signed-off-by: Bjorn Andersson 
> ---
>  drivers/rpmsg/rpmsg_core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/rpmsg/rpmsg_core.c b/drivers/rpmsg/rpmsg_core.c
> index dffa3aab7178..e85d2691d2cf 100644
> --- a/drivers/rpmsg/rpmsg_core.c
> +++ b/drivers/rpmsg/rpmsg_core.c
> @@ -442,7 +442,7 @@ static int rpmsg_dev_probe(struct device *dev)
>   goto out;
>   }
> 
> - if (rpdev->ops->announce_create)
> + if (ept && rpdev->ops->announce_create)

This check is already part of virtio_rpmsg.c (see line 341)
/* need to tell remote processor's name service about this channel ? */
if (rpdev->announce && rpdev->ept &&
virtio_has_feature(vrp->vdev, VIRTIO_RPMSG_F_NS)) {

should it be part of qcom_smd driver too? (but each implementation will 
duplicate checks)
Or may have a generic check in the core including rpdev->announce as well (and 
doing virtio_rpmsg.c clean-up)

Change will become:
if (rpdev->announce && ept && rpdev->ops->announce_create)

Regards,
Loic
>   err = rpdev->ops->announce_create(rpdev);
>  out:
>   return err;
> --
> 2.16.2
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-remoteproc" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH 2/3] rpmsg: Only invoke announce_create for rpdev with endpoints

2018-04-03 Thread Loic PALLARDY
Hi Bjorn,

> -Original Message-
> From: linux-remoteproc-ow...@vger.kernel.org [mailto:linux-remoteproc-
> ow...@vger.kernel.org] On Behalf Of Bjorn Andersson
> Sent: Tuesday, March 27, 2018 11:07 PM
> To: Ohad Ben-Cohen ; Bjorn Andersson
> 
> Cc: linux-remotep...@vger.kernel.org; linux-kernel@vger.kernel.org; linux-
> arm-...@vger.kernel.org
> Subject: [PATCH 2/3] rpmsg: Only invoke announce_create for rpdev with
> endpoints
> 
> For special rpmsg devices without a primary endpoint there is nothing to
> announce so don't call the backend announce create function if we didn't
> create an endpoint.
> 
> Signed-off-by: Bjorn Andersson 
> ---
>  drivers/rpmsg/rpmsg_core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/rpmsg/rpmsg_core.c b/drivers/rpmsg/rpmsg_core.c
> index dffa3aab7178..e85d2691d2cf 100644
> --- a/drivers/rpmsg/rpmsg_core.c
> +++ b/drivers/rpmsg/rpmsg_core.c
> @@ -442,7 +442,7 @@ static int rpmsg_dev_probe(struct device *dev)
>   goto out;
>   }
> 
> - if (rpdev->ops->announce_create)
> + if (ept && rpdev->ops->announce_create)

This check is already part of virtio_rpmsg.c (see line 341)
/* need to tell remote processor's name service about this channel ? */
if (rpdev->announce && rpdev->ept &&
virtio_has_feature(vrp->vdev, VIRTIO_RPMSG_F_NS)) {

should it be part of qcom_smd driver too? (but each implementation will 
duplicate checks)
Or may have a generic check in the core including rpdev->announce as well (and 
doing virtio_rpmsg.c clean-up)

Change will become:
if (rpdev->announce && ept && rpdev->ops->announce_create)

Regards,
Loic
>   err = rpdev->ops->announce_create(rpdev);
>  out:
>   return err;
> --
> 2.16.2
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-remoteproc" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html