Linux Media Controller development
 help / color / mirror / Atom feed
From: Hans Verkuil <hansverk@cisco.com>
To: Jose Abreu <Jose.Abreu@synopsys.com>, linux-media@vger.kernel.org
Cc: Hans Verkuil <hans.verkuil@cisco.com>,
	Joao Pinto <Joao.Pinto@synopsys.com>
Subject: Re: [PATCH] [media] cec: GIVE_PHYSICAL_ADDR should respond to unregistered device
Date: Thu, 14 Sep 2017 15:10:09 +0200	[thread overview]
Message-ID: <dfaad7d7-883f-38b4-d685-610ee0ce88b9@cisco.com> (raw)
In-Reply-To: <73019b13e5e8d727c37ec1b99f2e746aad0a7153.1505388690.git.joabreu@synopsys.com>

On 09/14/17 13:33, Jose Abreu wrote:
> Running CEC 1.4 compliance test we get the following error on test
> 11.1.6.2: "ERROR: The DUT did not broadcast a
> <Report Physical Address> message to the unregistered device."
> 
> Fix this by letting GIVE_PHYSICAL_ADDR message respond to unregistered
> device.
> 
> With this fix we pass CEC 1.4 official compliance.
> 
> Signed-off-by: Jose Abreu <joabreu@synopsys.com>
> Cc: Hans Verkuil <hans.verkuil@cisco.com>
> Cc: Joao Pinto <jpinto@synopsys.com>
> ---
>  drivers/media/cec/cec-adap.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/media/cec/cec-adap.c b/drivers/media/cec/cec-adap.c
> index dd769e4..48482aa 100644
> --- a/drivers/media/cec/cec-adap.c
> +++ b/drivers/media/cec/cec-adap.c
> @@ -1797,9 +1797,12 @@ static int cec_receive_notify(struct cec_adapter *adap, struct cec_msg *msg,
>  	case CEC_MSG_GIVE_DEVICE_VENDOR_ID:
>  	case CEC_MSG_ABORT:
>  	case CEC_MSG_GIVE_DEVICE_POWER_STATUS:
> -	case CEC_MSG_GIVE_PHYSICAL_ADDR:
>  	case CEC_MSG_GIVE_OSD_NAME:
>  	case CEC_MSG_GIVE_FEATURES:
> +		if (from_unregistered)

This should be (!adap->passthrough && from_unregistered)

> +			return 0;

Actually, CEC_MSG_GIVE_DEVICE_VENDOR_ID and CEC_MSG_GIVE_FEATURES
fall in the same category as CEC_MSG_GIVE_PHYSICAL_ADDR. I.e. these are
directed messages but the reply is a broadcast message. All three can be
sent by an unregistered device. It's a good idea to mention this here.
I.e. something like:

		/* These messages reply with a directed message, so ignore if
		   the initiator is Unregistered */

> +		/* Fall through */
> +	case CEC_MSG_GIVE_PHYSICAL_ADDR:
>  		/*
>  		 * Skip processing these messages if the passthrough mode
>  		 * is on.
> @@ -1807,7 +1810,7 @@ static int cec_receive_notify(struct cec_adapter *adap, struct cec_msg *msg,
>  		if (adap->passthrough)
>  			goto skip_processing;
>  		/* Ignore if addressing is wrong */
> -		if (is_broadcast || from_unregistered)
> +		if (is_broadcast)
>  			return 0;
>  		break;
>  
> 

Good catch, if you can make a v2 then I'll get this in for 4.14.

Not bad, just one obscure compliance error!

Regards,

	Hans

  reply	other threads:[~2017-09-14 13:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-14 11:33 [PATCH] [media] cec: GIVE_PHYSICAL_ADDR should respond to unregistered device Jose Abreu
2017-09-14 13:10 ` Hans Verkuil [this message]
2017-09-14 13:28   ` Jose Abreu
2017-09-14 15:09     ` Hans Verkuil
2017-09-14 15:30       ` Jose Abreu
2017-09-14 15:46         ` Hans Verkuil
2017-09-15 10:34           ` Jose Abreu

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=dfaad7d7-883f-38b4-d685-610ee0ce88b9@cisco.com \
    --to=hansverk@cisco.com \
    --cc=Joao.Pinto@synopsys.com \
    --cc=Jose.Abreu@synopsys.com \
    --cc=hans.verkuil@cisco.com \
    --cc=linux-media@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox