public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] [suspend/resume] wrong wakeup address
@ 2004-10-15  9:21 Li, Shaohua
       [not found] ` <16A54BF5D6E14E4D916CE26C9AD30575546CFA-4yWAQGcml66iAffOGbnezLfspsVTdybXVpNB7YpNyf8@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: Li, Shaohua @ 2004-10-15  9:21 UTC (permalink / raw)
  To: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f; +Cc: Brown, Len, Pavel Machek

[-- Attachment #1: Type: text/plain, Size: 1164 bytes --]

Hi,
acpi_wakeup_address is returned by 'alloc_bootmem_low', so it's a
virtual address, but 'acpi_set_firmware_wakeing_vector' requires a
physical address. But what makes me confused is my Toshiba works (S3)
with/without the patch. Hope this patch (against 2.6.9-rc4) fixes some
systems which can't resume.

Thanks,
Shaohua

Signed-off-by Li Shaohua <Shaohua.li-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

===== drivers/acpi/sleep/main.c 1.40 vs edited =====
--- 1.40/drivers/acpi/sleep/main.c	2004-08-17 23:15:34 +08:00
+++ edited/drivers/acpi/sleep/main.c	2004-10-15 16:58:33 +08:00
@@ -12,6 +12,7 @@
 #include <linux/irq.h>
 #include <linux/dmi.h>
 #include <linux/device.h>
+#include <asm/io.h>
 #include <linux/suspend.h>
 #include <acpi/acpi_bus.h>
 #include <acpi/acpi_drivers.h>
@@ -56,7 +57,8 @@ static int acpi_pm_prepare(u32 pm_state)
 		if (!acpi_wakeup_address)
 			return -EFAULT;
 		acpi_set_firmware_waking_vector(
-			(acpi_physical_address) acpi_wakeup_address);
+			(acpi_physical_address) virt_to_phys(
+			(void *)acpi_wakeup_address));
 	}
 	ACPI_FLUSH_CPU_CACHE();
 	acpi_enable_wakeup_device_prep(acpi_state);

[-- Attachment #2: wakeup_addr.patch --]
[-- Type: application/octet-stream, Size: 728 bytes --]

===== drivers/acpi/sleep/main.c 1.40 vs edited =====
--- 1.40/drivers/acpi/sleep/main.c	2004-08-17 23:15:34 +08:00
+++ edited/drivers/acpi/sleep/main.c	2004-10-15 16:58:33 +08:00
@@ -12,6 +12,7 @@
 #include <linux/irq.h>
 #include <linux/dmi.h>
 #include <linux/device.h>
+#include <asm/io.h>
 #include <linux/suspend.h>
 #include <acpi/acpi_bus.h>
 #include <acpi/acpi_drivers.h>
@@ -56,7 +57,8 @@ static int acpi_pm_prepare(u32 pm_state)
 		if (!acpi_wakeup_address)
 			return -EFAULT;
 		acpi_set_firmware_waking_vector(
-			(acpi_physical_address) acpi_wakeup_address);
+			(acpi_physical_address) virt_to_phys(
+			(void *)acpi_wakeup_address));
 	}
 	ACPI_FLUSH_CPU_CACHE();
 	acpi_enable_wakeup_device_prep(acpi_state);

^ permalink raw reply	[flat|nested] 12+ messages in thread
* RE: [PATCH] [suspend/resume] wrong wakeup address
@ 2004-10-17  7:35 Li, Shaohua
       [not found] ` <16A54BF5D6E14E4D916CE26C9AD30575546F88-4yWAQGcml66iAffOGbnezLfspsVTdybXVpNB7YpNyf8@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: Li, Shaohua @ 2004-10-17  7:35 UTC (permalink / raw)
  To: Pavel Machek, ole.rohne-vJEk5272eHo
  Cc: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, Brown, Len

Yes, I guess the BIOS ignored the high bits. The difference is
unsurprised PAGE_OFFSET. Somebody has verified the patch helps his
system.
http://bugme.osdl.org/show_bug.cgi?id=3390


Thanks,
Shaohua

>-----Original Message-----
>From: Pavel Machek [mailto:pavel-+ZI9xUNit7I@public.gmane.org]
>Sent: Friday, October 15, 2004 7:16 PM
>To: Li, Shaohua
>Cc: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org; Brown, Len
>Subject: Re: [PATCH] [suspend/resume] wrong wakeup address
>
>Hi!
>
>> acpi_wakeup_address is returned by 'alloc_bootmem_low', so it's a
>> virtual address, but 'acpi_set_firmware_wakeing_vector' requires a
>> physical address. But what makes me confused is my Toshiba works (S3)
>> with/without the patch. Hope this patch (against 2.6.9-rc4) fixes
some
>> systems which can't resume.
>
>Could you verify that address passed to firmware_waking_vector() is
>actually different? If the toshiba works with wrong return
>address... perhaps only high bits differ and toshiba just ignores
>them?
>
>Anyway it could explain quite a lot of failures.
>
>								Pavel
>
>> Thanks,
>> Shaohua
>>
>> Signed-off-by Li Shaohua <Shaohua.li-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
>>
>> ===== drivers/acpi/sleep/main.c 1.40 vs edited =====
>> --- 1.40/drivers/acpi/sleep/main.c	2004-08-17 23:15:34 +08:00
>> +++ edited/drivers/acpi/sleep/main.c	2004-10-15 16:58:33 +08:00
>> @@ -12,6 +12,7 @@
>>  #include <linux/irq.h>
>>  #include <linux/dmi.h>
>>  #include <linux/device.h>
>> +#include <asm/io.h>
>>  #include <linux/suspend.h>
>>  #include <acpi/acpi_bus.h>
>>  #include <acpi/acpi_drivers.h>
>> @@ -56,7 +57,8 @@ static int acpi_pm_prepare(u32 pm_state)
>>  		if (!acpi_wakeup_address)
>>  			return -EFAULT;
>>  		acpi_set_firmware_waking_vector(
>> -			(acpi_physical_address) acpi_wakeup_address);
>> +			(acpi_physical_address) virt_to_phys(
>> +			(void *)acpi_wakeup_address));
>>  	}
>>  	ACPI_FLUSH_CPU_CACHE();
>>  	acpi_enable_wakeup_device_prep(acpi_state);
>
>
>
>--
>People were complaining that M$ turns users into beta-testers...
>...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!


-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl

^ permalink raw reply	[flat|nested] 12+ messages in thread
* RE: [PATCH] [suspend/resume] wrong wakeup address
@ 2004-10-17  7:47 Li, Shaohua
       [not found] ` <16A54BF5D6E14E4D916CE26C9AD30575546F8B-4yWAQGcml66iAffOGbnezLfspsVTdybXVpNB7YpNyf8@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: Li, Shaohua @ 2004-10-17  7:47 UTC (permalink / raw)
  To: Hiroshi 2 Itoh
  Cc: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	acpi-devel-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, Brown, Len,
	Pavel Machek

>I checked acpi_wakeup_address and
>*acpi_gbl_common.fACS.firmware_waking_vector after virt_to_phys().
>Both values are 0xC0002000 (width=32bit) on my ThinkPad. This means
BIOS
>must call the wakeup entry in big-real mode?
The address with the patch is still 0xC0002000? How do you test it? The
patch doesn't change the address of acpi_wakeup_address, but fACS..
should be changed. The patch just tells BIOS a correct physical address.

As for your another email, the purpose of the patch isn't to change the
position of wakeup code, again, it just tells BIOS the physical address.
In the first resume time, there is no virtual/physical memory mapping. 

Thanks,
Shaohua


-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl

^ permalink raw reply	[flat|nested] 12+ messages in thread
* RE: [PATCH] [suspend/resume] wrong wakeup address
@ 2004-10-18  3:06 Li, Shaohua
       [not found] ` <16A54BF5D6E14E4D916CE26C9AD3057554732B-4yWAQGcml66iAffOGbnezLfspsVTdybXVpNB7YpNyf8@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: Li, Shaohua @ 2004-10-18  3:06 UTC (permalink / raw)
  To: Pavel Machek
  Cc: ole.rohne-vJEk5272eHo,
	acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, Brown, Len

[-- Attachment #1: Type: text/plain, Size: 817 bytes --]

>Hi!
>
>> Yes, I guess the BIOS ignored the high bits. The difference is
>> unsurprised PAGE_OFFSET. Somebody has verified the patch helps his
>> system.
>> http://bugme.osdl.org/show_bug.cgi?id=3390
>
>Okay, patch looks like to me, except..
>
>===== drivers/acpi/sleep/main.c 1.40 vs edited =====
>--- 1.40/drivers/acpi/sleep/main.c	2004-08-17 23:15:34 +08:00
>+++ edited/drivers/acpi/sleep/main.c	2004-10-15 16:58:33 +08:00
>@@ -12,6 +12,7 @@
> #include <linux/irq.h>
> #include <linux/dmi.h>
> #include <linux/device.h>
>+#include <asm/io.h>
> #include <linux/suspend.h>
> #include <acpi/acpi_bus.h>
> #include <acpi/acpi_drivers.h>
>
>Normally asm/ includes are placed after linux/ includes. (Cosmetic
>problem only).
Yes, indeed. Len, please apply the attached patch.

Thanks,
Shaohua

[-- Attachment #2: wakeup_addr.patch --]
[-- Type: application/octet-stream, Size: 724 bytes --]

===== drivers/acpi/sleep/main.c 1.40 vs edited =====
--- 1.40/drivers/acpi/sleep/main.c	2004-08-17 23:15:34 +08:00
+++ edited/drivers/acpi/sleep/main.c	2004-10-18 10:56:10 +08:00
@@ -13,6 +13,7 @@
 #include <linux/dmi.h>
 #include <linux/device.h>
 #include <linux/suspend.h>
+#include <asm/io.h>
 #include <acpi/acpi_bus.h>
 #include <acpi/acpi_drivers.h>
 #include "sleep.h"
@@ -56,7 +57,8 @@ static int acpi_pm_prepare(u32 pm_state)
 		if (!acpi_wakeup_address)
 			return -EFAULT;
 		acpi_set_firmware_waking_vector(
-			(acpi_physical_address) acpi_wakeup_address);
+			(acpi_physical_address) virt_to_phys(
+			(void *)acpi_wakeup_address));
 	}
 	ACPI_FLUSH_CPU_CACHE();
 	acpi_enable_wakeup_device_prep(acpi_state);

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2004-10-18 18:37 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-15  9:21 [PATCH] [suspend/resume] wrong wakeup address Li, Shaohua
     [not found] ` <16A54BF5D6E14E4D916CE26C9AD30575546CFA-4yWAQGcml66iAffOGbnezLfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2004-10-15 11:15   ` Pavel Machek
2004-10-15 11:40     ` ole.rohne-vJEk5272eHo
2004-10-16 17:39   ` Hiroshi 2 Itoh
2004-10-16 23:55   ` Hiroshi 2 Itoh
  -- strict thread matches above, loose matches on Subject: below --
2004-10-17  7:35 Li, Shaohua
     [not found] ` <16A54BF5D6E14E4D916CE26C9AD30575546F88-4yWAQGcml66iAffOGbnezLfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2004-10-17  9:28   ` Pavel Machek
2004-10-17  7:47 Li, Shaohua
     [not found] ` <16A54BF5D6E14E4D916CE26C9AD30575546F8B-4yWAQGcml66iAffOGbnezLfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2004-10-17  8:24   ` Hiroshi 2 Itoh
     [not found]     ` <OF2CF4B186.1A9399E0-ON49256F30.002B9799-49256F30.002DBAC1-JE5g2YyFxFHQT0dZR+AlfA@public.gmane.org>
2004-10-17  9:05       ` Hiroshi 2 Itoh
2004-10-18  3:06 Li, Shaohua
     [not found] ` <16A54BF5D6E14E4D916CE26C9AD3057554732B-4yWAQGcml66iAffOGbnezLfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2004-10-18 18:37   ` Len Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox