All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] [media] [PATCH] don't reset the delivery system on DTV_CLEAR
@ 2012-01-11  1:44 Mauro Carvalho Chehab
  2012-01-14 18:47 ` Malcolm Priestley
  0 siblings, 1 reply; 3+ messages in thread
From: Mauro Carvalho Chehab @ 2012-01-11  1:44 UTC (permalink / raw)
  Cc: Mauro Carvalho Chehab, Linux Media Mailing List

As a DVBv3 application may be relying on the delivery system,
don't reset it at DTV_CLEAR. For DVBv5 applications, the
delivery system should be set anyway.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
---
 drivers/media/dvb/dvb-core/dvb_frontend.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.c b/drivers/media/dvb/dvb-core/dvb_frontend.c
index a904793..b15db4f 100644
--- a/drivers/media/dvb/dvb-core/dvb_frontend.c
+++ b/drivers/media/dvb/dvb-core/dvb_frontend.c
@@ -909,7 +909,6 @@ static int dvb_frontend_clear_cache(struct dvb_frontend *fe)
 
 	c->state = DTV_CLEAR;
 
-	c->delivery_system = fe->ops.delsys[0];
 	dprintk("%s() Clearing cache for delivery system %d\n", __func__,
 		c->delivery_system);
 
@@ -2377,6 +2376,8 @@ int dvb_register_frontend(struct dvb_adapter* dvb,
 	 * Initialize the cache to the proper values according with the
 	 * first supported delivery system (ops->delsys[0])
 	 */
+
+        fe->dtv_property_cache.delivery_system = fe->ops.delsys[0];
 	dvb_frontend_clear_cache(fe);
 
 	mutex_unlock(&frontend_mutex);
-- 
1.7.7.5


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

* Re: [PATCH] [media] [PATCH] don't reset the delivery system on DTV_CLEAR
  2012-01-11  1:44 [PATCH] [media] [PATCH] don't reset the delivery system on DTV_CLEAR Mauro Carvalho Chehab
@ 2012-01-14 18:47 ` Malcolm Priestley
  2012-01-14 20:41   ` Malcolm Priestley
  0 siblings, 1 reply; 3+ messages in thread
From: Malcolm Priestley @ 2012-01-14 18:47 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: Linux Media Mailing List

On Tue, 2012-01-10 at 23:44 -0200, Mauro Carvalho Chehab wrote:
> As a DVBv3 application may be relying on the delivery system,
> don't reset it at DTV_CLEAR. For DVBv5 applications, the
> delivery system should be set anyway.
> 
> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
> ---
>  drivers/media/dvb/dvb-core/dvb_frontend.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.c b/drivers/media/dvb/dvb-core/dvb_frontend.c
> index a904793..b15db4f 100644
> --- a/drivers/media/dvb/dvb-core/dvb_frontend.c
> +++ b/drivers/media/dvb/dvb-core/dvb_frontend.c
> @@ -909,7 +909,6 @@ static int dvb_frontend_clear_cache(struct dvb_frontend *fe)
>  
>  	c->state = DTV_CLEAR;
>  
> -	c->delivery_system = fe->ops.delsys[0];
>  	dprintk("%s() Clearing cache for delivery system %d\n", __func__,
>  		c->delivery_system);
>  
> @@ -2377,6 +2376,8 @@ int dvb_register_frontend(struct dvb_adapter* dvb,
>  	 * Initialize the cache to the proper values according with the
>  	 * first supported delivery system (ops->delsys[0])
>  	 */
> +
> +        fe->dtv_property_cache.delivery_system = fe->ops.delsys[0];
>  	dvb_frontend_clear_cache(fe);
>  
>  	mutex_unlock(&frontend_mutex);

This patch breaks applications.

Due to the memset in dvb_frontend_clear_cache which clears
fe->dtv_property_cache.
...
static int dvb_frontend_clear_cache(struct dvb_frontend *fe)
{
	struct dtv_frontend_properties *c = &fe->dtv_property_cache;
	int i;

	memset(c, 0, sizeof(struct dtv_frontend_properties));
...

Also, the delivery system can not be reset when making a call to
DTV_CLEAR.

So the delivery system must be set dvb_frontend_clear_cache.

Regards


Malcolm


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

* Re: [PATCH] [media] [PATCH] don't reset the delivery system on DTV_CLEAR
  2012-01-14 18:47 ` Malcolm Priestley
@ 2012-01-14 20:41   ` Malcolm Priestley
  0 siblings, 0 replies; 3+ messages in thread
From: Malcolm Priestley @ 2012-01-14 20:41 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: Linux Media Mailing List

On Sat, 2012-01-14 at 18:47 +0000, Malcolm Priestley wrote:
> On Tue, 2012-01-10 at 23:44 -0200, Mauro Carvalho Chehab wrote:
> > As a DVBv3 application may be relying on the delivery system,
> > don't reset it at DTV_CLEAR. For DVBv5 applications, the
> > delivery system should be set anyway.
> > 
> > Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
> > ---
> >  drivers/media/dvb/dvb-core/dvb_frontend.c |    3 ++-
> >  1 files changed, 2 insertions(+), 1 deletions(-)
> > 
> > diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.c b/drivers/media/dvb/dvb-core/dvb_frontend.c
> > index a904793..b15db4f 100644
> > --- a/drivers/media/dvb/dvb-core/dvb_frontend.c
> > +++ b/drivers/media/dvb/dvb-core/dvb_frontend.c
> > @@ -909,7 +909,6 @@ static int dvb_frontend_clear_cache(struct dvb_frontend *fe)
> >  
> >  	c->state = DTV_CLEAR;
> >  
> > -	c->delivery_system = fe->ops.delsys[0];
> >  	dprintk("%s() Clearing cache for delivery system %d\n", __func__,
> >  		c->delivery_system);
> >  
> > @@ -2377,6 +2376,8 @@ int dvb_register_frontend(struct dvb_adapter* dvb,
> >  	 * Initialize the cache to the proper values according with the
> >  	 * first supported delivery system (ops->delsys[0])
> >  	 */
> > +
> > +        fe->dtv_property_cache.delivery_system = fe->ops.delsys[0];
> >  	dvb_frontend_clear_cache(fe);
> >  
> >  	mutex_unlock(&frontend_mutex);
> 
> This patch breaks applications.
> 
> Due to the memset in dvb_frontend_clear_cache which clears
> fe->dtv_property_cache.
> ...
> static int dvb_frontend_clear_cache(struct dvb_frontend *fe)
> {
> 	struct dtv_frontend_properties *c = &fe->dtv_property_cache;
> 	int i;
> 
> 	memset(c, 0, sizeof(struct dtv_frontend_properties));
> ...
> 
> Also, the delivery system can not be reset when making a call to
> DTV_CLEAR.

I have just noticed this is fix with patch;

dvb-core: preserve the delivery system at cache clear




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

end of thread, other threads:[~2012-01-14 20:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-11  1:44 [PATCH] [media] [PATCH] don't reset the delivery system on DTV_CLEAR Mauro Carvalho Chehab
2012-01-14 18:47 ` Malcolm Priestley
2012-01-14 20:41   ` Malcolm Priestley

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.