mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Charles Lepple <clepple@ghz.cc>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [REPOST] "apm: suspend: Unable to enter requested state" after 2.5.31 (incl. 2.6.0testX)
Date: Wed, 30 Jul 2003 12:21:45 +1000	[thread overview]
Message-ID: <20030730122145.77592840.sfr@canb.auug.org.au> (raw)
In-Reply-To: <82E003DC-C22E-11D7-BB43-003065DC6B50@ghz.cc>

On Tue, 29 Jul 2003 21:38:25 -0400 Charles Lepple <clepple@ghz.cc> wrote:
>
> On Tuesday, July 29, 2003, at 09:05  PM, Stephen Rothwell wrote:
> 
> > I may have missed this, but do you have the APIC or IO-APIC enabled?
> 
> Not sure that I have one on this system... it's pre-i686 (Pentium MMX).

OK.

> > The patch in question merely moved where the 0x40 descriptor was 
> > installed
> > in the descriptor table.
> 
> You mean it appears at a different table index? For some reason, I 
> thought that was a different patch (but I can't seem to find anything 
> else from that time period).

I meant that it puts it on the same place in the descriptor table, but the
insertion is done for each APM call instead of once at initialisation
time.

> Do you think it's worth checking the initialized value of the 
> bad_bios_desc fields in a 2.5 kernel with working APM? Or do you have 
> any other ideas on where to look?

I have appended two test patches - both are against 2.6.0-test2.

You could see if this matters at all by applying the first patch below. Be
warned, though, that if your BIOS is broken enough to need the
bad_bios_desc workaround, then this change will cause your machine to OOPS
and burn ... :-)

If you get no OOPS from running the above, then you could try the second
patch below. If your machine still behaves the same way, then you have
completely ruled out that change to the apm code ... so we need to look
elsewhere.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

-------------------first patch----------------------------------------
diff -ruN 2.6.0-test2/arch/i386/kernel/apm.c 2.6.0-test2-apm.1/arch/i386/kernel/apm.c
--- 2.6.0-test2/arch/i386/kernel/apm.c	2003-05-27 12:12:46.000000000 +1000
+++ 2.6.0-test2-apm.1/arch/i386/kernel/apm.c	2003-07-30 12:06:30.000000000 +1000
@@ -425,6 +425,7 @@
 static struct apm_user *	user_list;
 static spinlock_t		user_list_lock = SPIN_LOCK_UNLOCKED;
 static struct desc_struct	bad_bios_desc = { 0, 0x00409200 };
+static struct desc_struct	dummy_bios_desc = { 0, 0};
 
 static char			driver_version[] = "1.16ac";	/* no spaces */
 
@@ -601,7 +602,7 @@
 	
 	cpu = get_cpu();
 	save_desc_40 = cpu_gdt_table[cpu][0x40 / 8];
-	cpu_gdt_table[cpu][0x40 / 8] = bad_bios_desc;
+	cpu_gdt_table[cpu][0x40 / 8] = dummy_bios_desc;
 
 	local_save_flags(flags);
 	APM_DO_CLI;
@@ -644,7 +645,7 @@
 	
 	cpu = get_cpu();
 	save_desc_40 = cpu_gdt_table[cpu][0x40 / 8];
-	cpu_gdt_table[cpu][0x40 / 8] = bad_bios_desc;
+	cpu_gdt_table[cpu][0x40 / 8] = dummy_bios_desc;
 
 	local_save_flags(flags);
 	APM_DO_CLI;
-------------------second patch----------------------------------------
diff -ruN 2.6.0-test2/arch/i386/kernel/apm.c 2.6.0-test2-apm.2/arch/i386/kernel/apm.c
--- 2.6.0-test2/arch/i386/kernel/apm.c	2003-05-27 12:12:46.000000000 +1000
+++ 2.6.0-test2-apm.2/arch/i386/kernel/apm.c	2003-07-30 12:14:02.000000000 +1000
@@ -594,23 +594,15 @@
 	APM_DECL_SEGS
 	unsigned long		flags;
 	unsigned long		cpus;
-	int			cpu;
-	struct desc_struct	save_desc_40;
 
 	cpus = apm_save_cpus();
 	
-	cpu = get_cpu();
-	save_desc_40 = cpu_gdt_table[cpu][0x40 / 8];
-	cpu_gdt_table[cpu][0x40 / 8] = bad_bios_desc;
-
 	local_save_flags(flags);
 	APM_DO_CLI;
 	APM_DO_SAVE_SEGS;
 	apm_bios_call_asm(func, ebx_in, ecx_in, eax, ebx, ecx, edx, esi);
 	APM_DO_RESTORE_SEGS;
 	local_irq_restore(flags);
-	cpu_gdt_table[cpu][0x40 / 8] = save_desc_40;
-	put_cpu();
 	apm_restore_cpus(cpus);
 	
 	return *eax & 0xff;
@@ -636,24 +628,16 @@
 	APM_DECL_SEGS
 	unsigned long		flags;
 	unsigned long		cpus;
-	int			cpu;
-	struct desc_struct	save_desc_40;
 
 
 	cpus = apm_save_cpus();
 	
-	cpu = get_cpu();
-	save_desc_40 = cpu_gdt_table[cpu][0x40 / 8];
-	cpu_gdt_table[cpu][0x40 / 8] = bad_bios_desc;
-
 	local_save_flags(flags);
 	APM_DO_CLI;
 	APM_DO_SAVE_SEGS;
 	error = apm_bios_call_simple_asm(func, ebx_in, ecx_in, eax);
 	APM_DO_RESTORE_SEGS;
 	local_irq_restore(flags);
-	cpu_gdt_table[smp_processor_id()][0x40 / 8] = save_desc_40;
-	put_cpu();
 	apm_restore_cpus(cpus);
 	return error;
 }

  reply	other threads:[~2003-07-30  2:22 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-29 14:50 Charles Lepple
2003-07-29 15:07 ` Alan Cox
2003-07-29 16:05   ` Charles Lepple
2003-07-29 18:10     ` Alan Cox
2003-07-30  1:05       ` Stephen Rothwell
2003-07-30  1:38         ` Charles Lepple
2003-07-30  2:21           ` Stephen Rothwell [this message]
2003-07-30 16:48             ` [REPOST] "apm: suspend: Unable to enter requested state" after2.5.31 " Charles Lepple
2003-07-30 14:43         ` [REPOST] "apm: suspend: Unable to enter requested state" after 2.5.31 " Alan Cox
2003-07-30 15:16           ` Stephen Rothwell

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=20030730122145.77592840.sfr@canb.auug.org.au \
    --to=sfr@canb.auug.org.au \
    --cc=clepple@ghz.cc \
    --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

all inboxes | Powered by JetHome®