diff mbox

[4/4] b2c2: Always turn off receive stream

Message ID 1432326508-6825-5-git-send-email-jdenson@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jemma Denson May 22, 2015, 8:28 p.m. UTC
When letting an external device control the receive stream, it won't
know when there's demand for any feeds, so won't be turning off our
receive stream. This patch bring back control of turning it off in
this sitation.

The demod can still delay turning it on until it has data to send,
and still turn it off temporarily whilst it knows there's no
stream, such as whilst tuning.

Signed-off-by: Jemma Denson <jdenson@gmail.com>
---
 drivers/media/common/b2c2/flexcop-hw-filter.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jemma Denson May 24, 2015, 12:35 p.m. UTC | #1
On 22/05/15 21:28, Jemma Denson wrote:
> When letting an external device control the receive stream, it won't
> know when there's demand for any feeds, so won't be turning off our
> receive stream. This patch bring back control of turning it off in
> this sitation.
>
> The demod can still delay turning it on until it has data to send,
> and still turn it off temporarily whilst it knows there's no
> stream, such as whilst tuning.
>
> Signed-off-by: Jemma Denson <jdenson@gmail.com>
> ---
>   drivers/media/common/b2c2/flexcop-hw-filter.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/media/common/b2c2/flexcop-hw-filter.c b/drivers/media/common/b2c2/flexcop-hw-filter.c
> index eceb9c5..8926c82 100644
> --- a/drivers/media/common/b2c2/flexcop-hw-filter.c
> +++ b/drivers/media/common/b2c2/flexcop-hw-filter.c
> @@ -206,7 +206,7 @@ int flexcop_pid_feed_control(struct flexcop_device *fc,
>   
>   	/* if it was the first or last feed request change the stream-status */
>   	if (fc->feedcount == onoff) {
> -		if (!fc->external_stream_control)
> +		if (!fc->external_stream_control || onoff == 0)
>   			flexcop_rcv_data_ctrl(fc, onoff);
>   
>   		if (fc->stream_control) /* device specific stream control */

Hmm, OK. I've done some further testing and this last patch needs either 
ignoring or a rethink. It interferes with flexcop_pci_irq_check_work() 
in pci/b2c2/flexcop-pci.c. That function will try and reset all the hw 
filters with calls to flexcop_pid_feed_control() by turning them all off 
and then back on again.
Including this patch causes the receive stream to be turned off and it 
then doesn't get enabled again.


Jemma.
--
To unsubscribe from this list: send the line "unsubscribe linux-media" 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/media/common/b2c2/flexcop-hw-filter.c b/drivers/media/common/b2c2/flexcop-hw-filter.c
index eceb9c5..8926c82 100644
--- a/drivers/media/common/b2c2/flexcop-hw-filter.c
+++ b/drivers/media/common/b2c2/flexcop-hw-filter.c
@@ -206,7 +206,7 @@  int flexcop_pid_feed_control(struct flexcop_device *fc,
 
 	/* if it was the first or last feed request change the stream-status */
 	if (fc->feedcount == onoff) {
-		if (!fc->external_stream_control)
+		if (!fc->external_stream_control || onoff == 0)
 			flexcop_rcv_data_ctrl(fc, onoff);
 
 		if (fc->stream_control) /* device specific stream control */