-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
This solves the amazing "can't mount rootfs if you don't have a battery"
problem.
The problem existed on 2.6.22.5 and GTA01 as well but it seemed you
could mount there without a Garbage Collector thread (!)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org
iD8DBQFHrERDOjLpvpq7dMoRAgo5AKCU8ez/rc9O20fSDzsPaDp+b8nyCwCffF0A
XNTlLzbatJ2vaa788oS5Zwc=
=vsxj
-----END PGP SIGNATURE-----
fix-pcf50633-LOWBAT-kill-init.patch
From: Andy Green <[EMAIL PROTECTED]>
Until now the driver treats LOWBAT as a fatal crisis and responds
by going postal on init. But the driver didn't think that we can
have adapter or USB power and no battery, which is fine.
This patch reserves the crisis behaviour for when we have no
adapter / USB power and just acknowledges the PMU exception when
we do.
Signed-off-by: Andy Green <[EMAIL PROTECTED]>
---
drivers/i2c/chips/pcf50633.c | 24 +++++++++++++++++-------
1 files changed, 17 insertions(+), 7 deletions(-)
diff --git a/drivers/i2c/chips/pcf50633.c b/drivers/i2c/chips/pcf50633.c
index e0b09f8..1152f8d 100644
--- a/drivers/i2c/chips/pcf50633.c
+++ b/drivers/i2c/chips/pcf50633.c
@@ -776,15 +776,25 @@ static void pcf50633_work(struct work_struct *work)
}
if (int4 & (PCF50633_INT4_LOWBAT|PCF50633_INT4_LOWSYS)) {
- /* Really low battery voltage, we have 8 seconds left */
- DEBUGPC("LOWBAT ");
- apm_queue_event(APM_LOW_BATTERY);
- DEBUGPC("SIGPWR(init) ");
- kill_proc(1, SIGPWR, 1);
+ if (__reg_read(pcf, PCF50633_REG_MBCS1) &
+ (PCF50633_MBCS1_USBPRES | PCF50633_MBCS1_USBOK) ==
+ (PCF50633_MBCS1_USBPRES | PCF50633_MBCS1_USBOK)) {
+ /*
+ * hey no need to freak out, we have some kind of
+ * valid charger power
+ */
+ DEBUGPC("(NO)BAT ");
+ } else {
+ /* Really low battery voltage, we have 8 seconds left */
+ DEBUGPC("LOWBAT ");
+ apm_queue_event(APM_LOW_BATTERY);
+ DEBUGPC("SIGPWR(init) ");
+ kill_proc(1, SIGPWR, 1);
+ }
/* Tell PMU we are taking care of this */
reg_set_bit_mask(pcf, PCF50633_REG_OOCSHDWN,
- PCF50633_OOCSHDWN_TOTRST,
- PCF50633_OOCSHDWN_TOTRST);
+ PCF50633_OOCSHDWN_TOTRST,
+ PCF50633_OOCSHDWN_TOTRST);
}
if (int4 & PCF50633_INT4_HIGHTMP) {
/* High temperature */