xc2028: disable device power-down because power state handling is broken

Message ID 1388410678-12641-1-git-send-email-fschaefer.oss@googlemail.com (mailing list archive)
State Rejected, archived
Delegated to: Michael Krufky
Headers

Commit Message

Frank Schaefer Dec. 30, 2013, 1:37 p.m. UTC
  xc2028 power state handling is broken.
I2C read/write operations fail when the device is powered down at that moment,
which causes the get_rf_strength and get_rf_strength callbacks (and probably
others, too) to fail.
I don't know how to fix this properly, so disable the device power-down until
anyone comes up with a better solution.

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
---
 drivers/media/tuners/tuner-xc2028.c |    4 +++-
 1 Datei geändert, 3 Zeilen hinzugefügt(+), 1 Zeile entfernt(-)
  

Comments

Mauro Carvalho Chehab Jan. 6, 2014, 1 p.m. UTC | #1
Em Mon, 30 Dec 2013 14:37:58 +0100
Frank Schäfer <fschaefer.oss@googlemail.com> escreveu:

> xc2028 power state handling is broken.
> I2C read/write operations fail when the device is powered down at that moment,
> which causes the get_rf_strength and get_rf_strength callbacks (and probably
> others, too) to fail.
> I don't know how to fix this properly, so disable the device power-down until
> anyone comes up with a better solution.
> 
> Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
> ---
>  drivers/media/tuners/tuner-xc2028.c |    4 +++-
>  1 Datei geändert, 3 Zeilen hinzugefügt(+), 1 Zeile entfernt(-)
> 
> diff --git a/drivers/media/tuners/tuner-xc2028.c b/drivers/media/tuners/tuner-xc2028.c
> index 4be5cf8..cb3dc5e 100644
> --- a/drivers/media/tuners/tuner-xc2028.c
> +++ b/drivers/media/tuners/tuner-xc2028.c
> @@ -1291,16 +1291,18 @@ static int xc2028_sleep(struct dvb_frontend *fe)
>  		dump_stack();
>  	}
>  
> +	/* FIXME: device power-up/-down handling is broken */
> +/*
>  	mutex_lock(&priv->lock);
>  
>  	if (priv->firm_version < 0x0202)
>  		rc = send_seq(priv, {0x00, XREG_POWER_DOWN, 0x00, 0x00});
>  	else
>  		rc = send_seq(priv, {0x80, XREG_POWER_DOWN, 0x00, 0x00});
> -
>  	priv->state = XC2028_SLEEP;
>  
>  	mutex_unlock(&priv->lock);
> +*/

This patch is completely broken.

First of all, there are both modprobe and config parameters that disables
the poweroff mode.

Second, it doesn't fix the bug, just hides it.

Third, it keeps the xc3028 energized, with spends power and heats the
device, with reduces its lifetime.

I'm working on a proper fix for it.

Cheers,
Mauro
--
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
  
Frank Schaefer Jan. 7, 2014, 5:34 p.m. UTC | #2
Am 06.01.2014 14:00, schrieb Mauro Carvalho Chehab:
> ...
>
> I'm working on a proper fix for it.

That was the actual goal of this patch. ;)

Thank you for looking at this issue.
I'll get back to the remaing stuff later.

Cheers,
Frank

--
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
  

Patch

diff --git a/drivers/media/tuners/tuner-xc2028.c b/drivers/media/tuners/tuner-xc2028.c
index 4be5cf8..cb3dc5e 100644
--- a/drivers/media/tuners/tuner-xc2028.c
+++ b/drivers/media/tuners/tuner-xc2028.c
@@ -1291,16 +1291,18 @@  static int xc2028_sleep(struct dvb_frontend *fe)
 		dump_stack();
 	}
 
+	/* FIXME: device power-up/-down handling is broken */
+/*
 	mutex_lock(&priv->lock);
 
 	if (priv->firm_version < 0x0202)
 		rc = send_seq(priv, {0x00, XREG_POWER_DOWN, 0x00, 0x00});
 	else
 		rc = send_seq(priv, {0x80, XREG_POWER_DOWN, 0x00, 0x00});
-
 	priv->state = XC2028_SLEEP;
 
 	mutex_unlock(&priv->lock);
+*/
 
 	return rc;
 }