public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Michael Clark <michael@metaparadigm.com>
To: Sebastian Kloska <kloska@scienion.de>
Cc: Hugh Dickins <hugh@veritas.com>,
	Matt_Domsch@dell.com, linux-kernel@vger.kernel.org
Subject: Re: APM realy sucks on 2.6.x
Date: Sun, 06 Jun 2004 11:29:32 +0800	[thread overview]
Message-ID: <40C28F9C.9050004@metaparadigm.com> (raw)
In-Reply-To: <40C2004A.8050706@scienion.de>

On 06/06/04 01:18, Sebastian Kloska wrote:
> Thanks for the patch
> 
> Unfortunately that didn't do the trick. It does not even suspend
> sometimes when hitting the suspend button. This is very strange.
> It reproducible does not resume the second time.  Seems like
> the system has been left in an unstable state after the first
> suspend/resume cycle. I'm definitely not the born hardware/BIOS
> programmer although I have been involved in graphic device
> programming (a pain) but in this this case which is a real pain I
> would be willing to at least help by further debugging the issue.
> Kernel 2.4.x proved that the BIOS can be talked into properly
> interacting with linux. So it's at least not totally brain dead.

One possibility is code sections incorrectly marked as discardable.
I once had problems with this which caused resume to fail with ooops
when certain drivers were in use (and IIRC 2nd resume would lock up).

Someone here may know how to disable discarding of discardable sections
temporarily to test this by modifiying arch/i386/kernel/vmlinux.lds.S
(although personally I don't know how to do this).

Have you tried suspend/resume on a kernel with minimal devices
compiled/loaded running single user with just apmd? If this works
then do a binary divide and conquer until you find the misbehaving
driver.

> One might argue that the hardware is already a little bit out dated
> but I really do not have the resources to buy a new
> laptop every year and  it  also represents some kind of masochistic
> challenge to get this thing going.  But I really do not know how
> to debug the stuff or where to look.
> 
> Any hints how to proceed would be highly appreciated
> 
> Sebastian
> 
> 
> Hugh Dickins wrote:
> 
>> On Fri, 4 Jun 2004, Sebastian Kloska wrote:
>>  
>>
>>> I'm really having a hard time with APM on 2.6.x. I have a DELL Latitude
>>> L400 with the newest BIOS release. The most important functionality
>>> of  APM  for  me  is  the  'suspend to RAM' function which worked like
>>> it should on all 2.4.x kernels I've tested. Under 2.6.x it simply 
>>> does not resume the second time.
>>>   
>>
>>
>> Here's a patch I've been using to resume on Dell Latitude C610 for the
>> last eight months or so.  I've never sent it in because I guess it's
>> just papering over some deeper issue (with the BIOS?  originally some
>> earlier revision, I updated to latest A16 back then, but no change).
>>
>> The funny thing is, that the code which resumes is relying on an APM
>> event to tell it that it's resuming, and that event sometimes doesn't
>> arrive.  This patch lets the resuming code jump to the wild conclusion
>> that it's resuming, without relying on that event.  I hope this helps
>> you, but fear your issue may be something else.
>>
>> Hugh
>>
>> --- 2.6.6/arch/i386/kernel/apm.c    2004-05-10 03:33:36.000000000 +0100
>> +++ linux/arch/i386/kernel/apm.c    2004-05-10 07:29:55.021595384 +0100
>> @@ -389,7 +389,9 @@ static int            suspends_pending;
>> static int            standbys_pending;
>> static int            ignore_sys_suspend;
>> static int            ignore_normal_resume;
>> +static int            ignore_bounce;
>> static int            bounce_interval = DEFAULT_BOUNCE_INTERVAL;
>> +static unsigned long        last_resume;
>>
>> #ifdef CONFIG_APM_RTC_IS_GMT
>> #    define    clock_cmos_diff    0
>> @@ -1225,11 +1227,14 @@ static int suspend(int vetoable)
>>     spin_lock(&i8253_lock);
>>     reinit_timer();
>>     set_time();
>> -    ignore_normal_resume = 1;
>> -
>>     spin_unlock(&i8253_lock);
>>     write_sequnlock_irq(&xtime_lock);
>>
>> +    ignore_normal_resume = 1;
>> +    ignore_sys_suspend = -1;
>> +    last_resume = jiffies;
>> +    ignore_bounce = 1;
>> +
>>     if (err == APM_NO_ERROR)
>>         err = APM_SUCCESS;
>>     if (err != APM_SUCCESS)
>> @@ -1239,6 +1244,7 @@ static int suspend(int vetoable)
>>     device_resume();
>>     pm_send_all(PM_RESUME, (void *)0);
>>     queue_event(APM_NORMAL_RESUME, NULL);
>> +    ignore_normal_resume = 0;
>>  out:
>>     spin_lock(&user_list_lock);
>>     for (as = user_list; as != NULL; as = as->next) {
>> @@ -1289,8 +1295,6 @@ static apm_event_t get_event(void)
>> static void check_events(void)
>> {
>>     apm_event_t        event;
>> -    static unsigned long    last_resume;
>> -    static int        ignore_bounce;
>>
>>     while ((event = get_event()) != 0) {
>>         if (debug) {
>> @@ -1333,8 +1337,10 @@ static void check_events(void)
>>              * sending a SUSPEND event until something else
>>              * happens!
>>              */
>> -            if (ignore_sys_suspend)
>> +            if (ignore_sys_suspend > 0)
>>                 return;
>> +            if (ignore_sys_suspend < 0)
>> +                printk("suspend: missed resume event\n");
>>             ignore_sys_suspend = 1;
>>             queue_event(event, NULL);
>>             if (suspends_pending <= 0)

  reply	other threads:[~2004-06-06  3:29 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-04 21:26 APM realy sucks on 2.6.x Sebastian Kloska
2004-06-04 23:14 ` Keith Duthie
2004-06-05  8:03   ` Sebastian Kloska
2004-06-04 23:54 ` Hugh Dickins
2004-06-05 17:18   ` Sebastian Kloska
2004-06-06  3:29     ` Michael Clark [this message]
2004-06-06  4:25       ` Andrew Morton
2004-06-06 13:56         ` Sebastian Kloska
2004-06-07 12:38 ` Pavel Machek
2004-06-07 13:37   ` Sebastian Kloska
2004-06-07 14:05     ` Pavel Machek
2004-06-07 14:28       ` Sebastian Kloska
2004-06-07 14:48         ` Pavel Machek
2004-06-07 19:53           ` Felipe Alfaro Solana
2004-06-07 21:13             ` Sebastian Kloska
2004-06-08  4:16           ` Clemens Schwaighofer
2004-06-08  7:12             ` Sebastian Kloska
2004-06-08  8:58             ` Pavel Machek
2004-06-08  9:02               ` Clemens Schwaighofer
2004-06-08  9:17                 ` Pavel Machek
2004-06-08  9:50                   ` Clemens Schwaighofer
2004-06-08  9:55                     ` Pavel Machek
2004-06-08 23:59                       ` Clemens Schwaighofer
2004-06-08 17:48               ` Bill Davidsen
2004-06-08 18:59                 ` Daniel Gryniewicz
2004-06-08 20:18                 ` Ian Stirling
2004-06-07 14:42     ` Keith Duthie
2004-06-07 14:44       ` Pavel Machek
2004-06-07 14:47       ` Sebastian Kloska
2004-06-07 14:51         ` Pavel Machek
2004-06-07 15:09           ` Sebastian Kloska
2004-06-07 16:26             ` Pavel Machek
2004-06-07 15:19         ` Keith Duthie
  -- strict thread matches above, loose matches on Subject: below --
2004-06-07  8:11 Sebastian Kloska
2004-06-08  9:49 Sau Dan Lee

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=40C28F9C.9050004@metaparadigm.com \
    --to=michael@metaparadigm.com \
    --cc=Matt_Domsch@dell.com \
    --cc=hugh@veritas.com \
    --cc=kloska@scienion.de \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox