From mboxrd@z Thu Jan 1 00:00:00 1970 From: pavel@ucw.cz (Pavel Machek) Date: Wed, 30 Sep 2009 22:32:52 +0200 Subject: [patch for 2.6.31-stable] zaurus c3000 aka spitz: fix resume Message-ID: <20090930203251.GA1893@ucw.cz> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Spitz resume was broken for year or likely two, and it would be very nice to fix it for 2.6.31-stable release. One liner is below... It is in 2.6.32-rc1/2, with some more signoffs... Pavel --- sharpsl_pm.c code tries to read battery state very early during resume, but those battery meters are connected on SPI and that's only resumed way later. Replace the check with simple checking of battery fatal signal, that actually works at this stage. Signed-off-by: Pavel Machek Tested-by: Stanislav Brabec Acked-by: Dmitry Eremin-Solenikov --- linux-rc/arch/arm.ofic/mach-pxa/sharpsl_pm.c 2009-08-28 00:19:10.000000000 +0200 +++ linux-rc/arch/arm/mach-pxa/sharpsl_pm.c 2009-09-04 11:18:33.000000000 +0200 @@ -678,8 +678,8 @@ dev_dbg(sharpsl_pm.dev, "User triggered wakeup in offline charger.\n"); } - if ((!sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_LOCK)) || (sharpsl_fatal_check() < 0) ) - { + if ((!sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_LOCK)) || + (!sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_FATAL))) { dev_err(sharpsl_pm.dev, "Fatal condition. Suspend.\n"); corgi_goto_sleep(alarm_time, alarm_enable, state); return 1; -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html ----- End forwarded message ----- -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753737AbZI3UdF (ORCPT ); Wed, 30 Sep 2009 16:33:05 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753074AbZI3UdE (ORCPT ); Wed, 30 Sep 2009 16:33:04 -0400 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:36127 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752802AbZI3UdD (ORCPT ); Wed, 30 Sep 2009 16:33:03 -0400 Date: Wed, 30 Sep 2009 22:32:52 +0200 From: Pavel Machek To: rpurdie@rpsys.net, lenz@cs.wisc.edu, kernel list , Dirk@Opfer-Online.de, arminlitzel@web.de, Cyril Hrubis , thommycheck@gmail.com, linux-arm-kernel , dbaryshkov@gmail.com, omegamoon@gmail.com, eric.y.miao@gmail.com, utx@penguin.cz, stable@kernel.org Subject: [patch for 2.6.31-stable] zaurus c3000 aka spitz: fix resume Message-ID: <20090930203251.GA1893@ucw.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Spitz resume was broken for year or likely two, and it would be very nice to fix it for 2.6.31-stable release. One liner is below... It is in 2.6.32-rc1/2, with some more signoffs... Pavel --- sharpsl_pm.c code tries to read battery state very early during resume, but those battery meters are connected on SPI and that's only resumed way later. Replace the check with simple checking of battery fatal signal, that actually works at this stage. Signed-off-by: Pavel Machek Tested-by: Stanislav Brabec Acked-by: Dmitry Eremin-Solenikov --- linux-rc/arch/arm.ofic/mach-pxa/sharpsl_pm.c 2009-08-28 00:19:10.000000000 +0200 +++ linux-rc/arch/arm/mach-pxa/sharpsl_pm.c 2009-09-04 11:18:33.000000000 +0200 @@ -678,8 +678,8 @@ dev_dbg(sharpsl_pm.dev, "User triggered wakeup in offline charger.\n"); } - if ((!sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_LOCK)) || (sharpsl_fatal_check() < 0) ) - { + if ((!sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_LOCK)) || + (!sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_FATAL))) { dev_err(sharpsl_pm.dev, "Fatal condition. Suspend.\n"); corgi_goto_sleep(alarm_time, alarm_enable, state); return 1; -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html ----- End forwarded message ----- -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html