Re: 2.6.24-rc3-mm1 - Kernel Panic on IO-APIC

2007-11-20 Thread Andrew Morton
On Wed, 21 Nov 2007 11:41:23 +0530 Kamalesh Babulal <[EMAIL PROTECTED]> wrote:

> Hi Andrew,
> 
> Kernel panic's across different architectures like powerpc, x86_64, 

powerpc complains about IO-APICs??

> Dentry cache hash table entries: 8388608 (order: 14, 67108864 bytes)
> Inode-cache hash table entries: 4194304 (order: 13, 33554432 bytes)
> Mount-cache hash table entries: 256
> SMP alternatives: switching to UP code
> ACPI: Core revision 20070126
> ..MP-BIOS bug: 8254 timer not connected to IO-APIC
> Kernel panic - not syncing: IO-APIC + timer doesn't work! Try using the 
> 'noapic' kernel parameter

ACPI or x86 breakage, I guess.

Did 'noapic' work?
-
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


dmidecode from Chaintech Summit MK8M800 motherboard ( VIA K8M800 )

2007-11-20 Thread Jaakan Shorter
My system locked up randomly with the 2.6.22 kernel ( even with a live
CD ubuntu 7.10  )

I think it's related to the bios and the kernel

I don't remember the 2.6.20 kernel having that issue but that was
before I got an NV GF6200 256Mb AGP card



anything else I can do to help let me know
# dmidecode 2.9
SMBIOS 2.3 present.
33 structures occupying 926 bytes.
Table at 0x000F.

Handle 0x, DMI type 0, 20 bytes
BIOS Information
Vendor: Phoenix Technologies, LTD
Version: 6.00 PG
Release Date: 09/27/2005
Address: 0xE
Runtime Size: 128 kB
ROM Size: 512 kB
Characteristics:
ISA is supported
PCI is supported
PNP is supported
APM is supported
BIOS is upgradeable
BIOS shadowing is allowed
Boot from CD is supported
Selectable boot is supported
BIOS ROM is socketed
EDD is supported
5.25"/360 KB floppy services are supported (int 13h)
5.25"/1.2 MB floppy services are supported (int 13h)
3.5"/720 KB floppy services are supported (int 13h)
3.5"/2.88 MB floppy services are supported (int 13h)
Print screen service is supported (int 5h)
8042 keyboard services are supported (int 9h)
Serial services are supported (int 14h)
Printer services are supported (int 17h)
CGA/mono video services are supported (int 10h)
ACPI is supported
USB legacy is supported
AGP is supported
LS-120 boot is supported
ATAPI Zip drive boot is supported
BIOS boot specification is supported

Handle 0x0001, DMI type 1, 25 bytes
System Information
Manufacturer:  
Product Name:  
Version:  
Serial Number:  
UUID: Not Present
Wake-up Type: Power Switch

Handle 0x0002, DMI type 2, 8 bytes
Base Board Information
Manufacturer:  
Product Name: K8M800-8237
Version:  
Serial Number:  

Handle 0x0003, DMI type 3, 17 bytes
Chassis Information
Manufacturer:  
Type: Desktop
Lock: Not Present
Version:  
Serial Number:  
Asset Tag:  
Boot-up State: Unknown
Power Supply State: Unknown
Thermal State: Unknown
Security Status: Unknown
OEM Information: 0x

Handle 0x0004, DMI type 4, 35 bytes
Processor Information
Socket Designation: Socket 754
Type: Central Processor
Family: Athlon 64
Manufacturer: AMD
ID: C0 0F 00 00 FF FB 8B 07
Signature: Family 15, Model 12, Stepping 0
Flags:
FPU (Floating-point unit on-chip)
VME (Virtual mode extension)
DE (Debugging extension)
PSE (Page size extension)
TSC (Time stamp counter)
MSR (Model specific registers)
PAE (Physical address extension)
MCE (Machine check exception)
CX8 (CMPXCHG8 instruction supported)
APIC (On-chip APIC hardware supported)
SEP (Fast system call)
MTRR (Memory type range registers)
PGE (Page global enable)
MCA (Machine check architecture)
CMOV (Conditional move instruction supported)
PAT (Page attribute table)
PSE-36 (36-bit page size extension)
CLFSH (CLFLUSH instruction supported)
MMX (MMX technology supported)
FXSR (Fast floating-point save and restore)
SSE (Streaming SIMD extensions)
SSE2 (Streaming SIMD extensions 2)
Version: AMD Athlon(tm) 64 Processor 2800+
Voltage: 1.5 V
External Clock: 200 MHz
Max Speed: 3000 MHz
Current Speed: 1800 MHz
Status: Populated, Enabled
Upgrade: Socket 754
L1 Cache Handle: 0x0008
L2 Cache Handle: 0x0009
L3 Cache Handle: Not Provided
Serial Number:  
Asset Tag:  
Part Number:  

Handle 0x0005, DMI type 5, 20 bytes
Memory Controller Information
Error Detecting Method: 64-bit ECC
Error Correcting Capabilities:
None
Supported Interleave: One-way Interleave
Current Interleave: One-way Interleave
Maximum Memory Module Size: 4096 MB
Maximum Total Memory Size: 8192 MB
Supported Speeds:
70 ns
60 ns
50 ns
Supported Memory Types:
Standard
DIMM
Memory Module Voltage: 2.9 V
Associated Memory Slots: 2
0x0006
0x0007
Enabled Error Correcting Capabilitie

RE: ACPI: disable stray GPE, prevent ACPI interrupt storm

2007-11-20 Thread Zhang Rui

On Wed, 2007-11-21 at 07:11 +0800, Moore, Robert wrote:
> BTW, this kind of change begs for a comment
> 
Sounds good. :)

Thanks,
Rui
> default:
> /*
>  * Even if we don't know the GPE type, make sure that we always
>  * disable it. This can prevent a certain type of GPE flood,
> where
>  * the GPE has no _Lxx/_Exx method, and it cannot be determined

>  * whether the GPE is wake, run, or wake/run.
>  */
> Status = AcpiHwWriteGpeEnableReg (GpeEventInfo);
> break;
> 
> 
> >-Original Message-
> >From: Len Brown [mailto:[EMAIL PROTECTED]
> >Sent: Tuesday, November 20, 2007 10:43 AM
> >To: Moore, Robert
> >Cc: linux-acpi@vger.kernel.org; Zhang, Rui; Alexey Starikovskiy
> >Subject: ACPI: disable stray GPE, prevent ACPI interrupt storm
> >
> >Bob,
> >Rui's Linux patch below modifies an ACPICA file.
> >
> >thanks,
> >-Len
> >
> >commit a7f9b1f24974da287771e2d70b30d9ca7bd66684
> >Author: Zhang Rui <[EMAIL PROTECTED]>
> >Date:   Tue Nov 20 13:38:59 2007 -0500
> >
> >ACPI: disable stray GPE, prevent ACPI interrupt storm
> >
> >GPEs are disabled depending on their type --
> >WAKE, WAKE_RUN, and RUNTIME.  An error is returned
> >if we are asked to disable a GPE that has no type.
> >
> >But at least one system exists that enables a GPE from AML
> >that is not the EC GPE, and has no _Lxx/_Exx AML handler,
> >and is thus never initialized.
> >
> >In this case, when an external CRT is plugged in,
> >the GPE fires, we attempt to disable the GPE,
> >but instead just return an error.
> >So the GPE stays asserted and an ACPI interrupt storm follows.
> >
> >The fix is to disable a firing GPE,
> >even if it comes from outer space.
> >
> >http://bugzilla.kernel.org/show_bug.cgi?id=6217
> >
> >Signed-off-by: Zhang Rui <[EMAIL PROTECTED]>
> >Acked-by: Alexey Starikovskiy <[EMAIL PROTECTED]>
> >Signed-off-by: Len Brown <[EMAIL PROTECTED]>
> >
> >diff --git a/drivers/acpi/events/evgpe.c b/drivers/acpi/events/evgpe.c
> >index e22f4a9..056b788 100644
> >--- a/drivers/acpi/events/evgpe.c
> >+++ b/drivers/acpi/events/evgpe.c
> >@@ -270,18 +270,18 @@ acpi_status acpi_ev_disable_gpe(struct
> >acpi_gpe_event_info *gpe_event_info)
> > case ACPI_GPE_TYPE_WAKE_RUN:
> > ACPI_CLEAR_BIT(gpe_event_info->flags,
> ACPI_GPE_WAKE_ENABLED);
> >
> >-/*lint -fallthrough */
> >+/* fallthrough */
> >
> > case ACPI_GPE_TYPE_RUNTIME:
> >
> > /* Disable the requested runtime GPE */
> >
> > ACPI_CLEAR_BIT(gpe_event_info->flags,
> ACPI_GPE_RUN_ENABLED);
> >-status = acpi_hw_write_gpe_enable_reg(gpe_event_info);
> >-break;
> >+
> >+/* fallthrough */
> >
> > default:
> >-return_ACPI_STATUS(AE_BAD_PARAMETER);
> >+acpi_hw_write_gpe_enable_reg(gpe_event_info);
> > }
> >
> > return_ACPI_STATUS(AE_OK);
-
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 0/8] Suspend/hibernation patches for 2.6.25

2007-11-20 Thread Len Brown
On Tuesday 20 November 2007 18:59, Rafael J. Wysocki wrote:
> On Tuesday, 20 of November 2007, Len Brown wrote:
> > thanks for re-sending, Rafael.
> > 
> > I've created a new "suspend" branch -- currently
> > rooted on Linus' latest.
> > 
> > git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6.git 
> > suspend
> > 
> > I've re-based the older hibernate patches onto
> > the new branch, and added the batch you just sent.
> > 
> > Note that the suspend branch is included in my test branch,
> > which akpm pulls into -mm.
> 
> Thanks for all that!
> 
> I'm now seeing the suspend branch on gitweb, but when I do
> 
> $ git clone git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6
> 
> I get a repository with only one branch which is "test" and indeed
> .git/refs/heads contains this one only.  What should I do to get the suspend
> branch (and the others) too with git clone (or git fetch)?

per http://www.lesswatts.org/projects/acpi/git.php

$ git branch -r

to see the branches

$ git checkout -b origin/suspend

to get onto that particular branch.

cheers,
-Len
-
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/2] ACPI: EC: Add debug printks.

2007-11-20 Thread Len Brown
1 and 2 applied.

thanks,
-Len

On Tuesday 20 November 2007 19:23, Alexey Starikovskiy wrote:
> Sometimes it is usefull to see raw protocol dump.
> Uncomment '#define DEBUG' at the beginning of file to make EC 
> really verbose.
> 
> Signed-off-by: Márton Németh <[EMAIL PROTECTED]>
> Signed-off-by: Alexey Starikovskiy <[EMAIL PROTECTED]>
> ---
> 
>  drivers/acpi/ec.c |   50 +++---
>  1 files changed, 31 insertions(+), 19 deletions(-)
> 
> diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
> index 06b78e5..d5a5958 100644
> --- a/drivers/acpi/ec.c
> +++ b/drivers/acpi/ec.c
> @@ -47,6 +47,9 @@
>  #undef PREFIX
>  #define PREFIX   "ACPI: EC: "
>  
> +/* Uncomment next line to get verbose print outs*/
> +/* #define DEBUG */
> +
>  /* EC status register */
>  #define ACPI_EC_FLAG_OBF 0x01/* Output buffer full */
>  #define ACPI_EC_FLAG_IBF 0x02/* Input buffer full */
> @@ -131,21 +134,27 @@ static struct acpi_ec {
>  
>  static inline u8 acpi_ec_read_status(struct acpi_ec *ec)
>  {
> - return inb(ec->command_addr);
> + u8 x = inb(ec->command_addr);
> + pr_debug(PREFIX "---> status = 0x%2x\n", x);
> + return x;
>  }
>  
>  static inline u8 acpi_ec_read_data(struct acpi_ec *ec)
>  {
> + u8 x = inb(ec->data_addr);
> + pr_debug(PREFIX "---> data = 0x%2x\n", x);
>   return inb(ec->data_addr);
>  }
>  
>  static inline void acpi_ec_write_cmd(struct acpi_ec *ec, u8 command)
>  {
> + pr_debug(PREFIX "<--- command = 0x%2x\n", command);
>   outb(command, ec->command_addr);
>  }
>  
>  static inline void acpi_ec_write_data(struct acpi_ec *ec, u8 data)
>  {
> + pr_debug(PREFIX "<--- data = 0x%2x\n", data);
>   outb(data, ec->data_addr);
>  }
>  
> @@ -175,13 +184,14 @@ static int acpi_ec_wait(struct acpi_ec *ec, enum 
> ec_event event, int force_poll)
>   if (acpi_ec_check_status(ec, event)) {
>   if (event == ACPI_EC_EVENT_OBF_1) {
>   /* miss OBF = 1 GPE, don't expect it anymore */
> - printk(KERN_INFO PREFIX "missing OBF_1 
> confirmation,"
> + pr_info(PREFIX "missing OBF_1 confirmation,"
>   "switching to degraded mode.\n");
>   set_bit(EC_FLAGS_ONLY_IBF_GPE, &ec->flags);
>   } else {
>   /* missing GPEs, switch back to poll mode */
> - printk(KERN_INFO PREFIX "missing IBF_1 
> confirmations,"
> - "switch off interrupt mode.\n");
> + if (printk_ratelimit())
> + pr_info(PREFIX "missing IBF_1 
> confirmations,"
> + "switch off interrupt mode.\n");
>   clear_bit(EC_FLAGS_GPE_MODE, &ec->flags);
>   }
>   return 0;
> @@ -194,7 +204,7 @@ static int acpi_ec_wait(struct acpi_ec *ec, enum ec_event 
> event, int force_poll)
>   return 0;
>   }
>   }
> - printk(KERN_ERR PREFIX "acpi_ec_wait timeout,"
> + pr_err(PREFIX "acpi_ec_wait timeout,"
>  " status = %d, expect_event = %d\n",
>  acpi_ec_read_status(ec), event);
>   return -ETIME;
> @@ -208,11 +218,11 @@ static int acpi_ec_transaction_unlocked(struct acpi_ec 
> *ec, u8 command,
>   int result = 0;
>   set_bit(EC_FLAGS_WAIT_GPE, &ec->flags);
>   acpi_ec_write_cmd(ec, command);
> -
> + pr_debug(PREFIX "transaction start\n");
>   for (; wdata_len > 0; --wdata_len) {
>   result = acpi_ec_wait(ec, ACPI_EC_EVENT_IBF_0, force_poll);
>   if (result) {
> - printk(KERN_ERR PREFIX
> + pr_err(PREFIX
>  "write_cmd timeout, command = %d\n", command);
>   goto end;
>   }
> @@ -223,7 +233,7 @@ static int acpi_ec_transaction_unlocked(struct acpi_ec 
> *ec, u8 command,
>   if (!rdata_len) {
>   result = acpi_ec_wait(ec, ACPI_EC_EVENT_IBF_0, force_poll);
>   if (result) {
> - printk(KERN_ERR PREFIX
> + pr_err(PREFIX
>  "finish-write timeout, command = %d\n", command);
>   goto end;
>   }
> @@ -235,8 +245,7 @@ static int acpi_ec_transaction_unlocked(struct acpi_ec 
> *ec, u8 command,
>   force_poll = 1;
>   result = acpi_ec_wait(ec, ACPI_EC_EVENT_OBF_1, force_poll);
>   if (result) {
> - printk(KERN_ERR PREFIX "read timeout, command = %d\n",
> -command);
> + pr_err(PREFIX "read timeout, command = %d\n", command);
>   

Suspend to ram on Toshiba U200

2007-11-20 Thread Marc Deop i Argemí
Hi everybody,

I have this mentioned laptop, exactly a Toshiba U200-141. Well, the reason of 
this email is that with the actual kernel I have the known problem of 
spending 5 to 10 minutes to get the laptop to suspend to ram.

Well, looking at my dmidecode and the drivers/ata/ata_piix.c I see an 
¿important?  difference:

dmidecode: Product Name: SATELLITE U200

ata_piix.c:   .ident = "Satellite U200",
  DMI_MATCH(DMI_PRODUCT_NAME, "Satellite U200"),

Notice the capital letters on my dmidecode. I have changed the ata_piix.c to 
have the name in capital letters and now the laptop suspends correctly.

Is this information usefull? Don't really know if this list is where I should 
write to...

Damnshock


signature.asc
Description: This is a digitally signed message part.


[PATCH 2/2] ACPI: EC: Workaround for optimized controllers (version 3)

2007-11-20 Thread Alexey Starikovskiy
Some controllers fail to send confirmation GPE after address or data write.
Detect this and don't expect such confirmation in future.
This is a generalization of previous workaround 
(66c5f4e7367b0085652931b2f3366de29e7ff5ec), which did only read address.

Reference: http://bugzilla.kernel.org/show_bug.cgi?id=9327

Signed-off-by: Alexey Starikovskiy <[EMAIL PROTECTED]>
Tested-by: Romano Giannetti <[EMAIL PROTECTED]>
---

 drivers/acpi/ec.c |   46 +
 drivers/acpi/processor_core.c |5 
 2 files changed, 37 insertions(+), 14 deletions(-)

diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index d5a5958..7d6b841 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -78,7 +78,10 @@ enum {
EC_FLAGS_WAIT_GPE = 0,  /* Don't check status until GPE arrives 
*/
EC_FLAGS_QUERY_PENDING, /* Query is pending */
EC_FLAGS_GPE_MODE,  /* Expect GPE to be sent for status 
change */
-   EC_FLAGS_ONLY_IBF_GPE,  /* Expect GPE only for IBF = 0 event */
+   EC_FLAGS_NO_ADDRESS_GPE,/* Expect GPE only for non-address 
event */
+   EC_FLAGS_ADDRESS,   /* Address is being written */
+   EC_FLAGS_NO_WDATA_GPE,  /* Don't expect WDATA GPE event */
+   EC_FLAGS_WDATA, /* Data is being written */
 };
 
 static int acpi_ec_remove(struct acpi_device *device, int type);
@@ -175,39 +178,54 @@ static inline int acpi_ec_check_status(struct acpi_ec 
*ec, enum ec_event event)
 
 static int acpi_ec_wait(struct acpi_ec *ec, enum ec_event event, int 
force_poll)
 {
+   int ret = 0;
+   if (unlikely(test_bit(EC_FLAGS_ADDRESS, &ec->flags) &&
+test_bit(EC_FLAGS_NO_ADDRESS_GPE, &ec->flags)))
+   force_poll = 1;
+   if (unlikely(test_bit(EC_FLAGS_WDATA, &ec->flags) &&
+test_bit(EC_FLAGS_NO_WDATA_GPE, &ec->flags)))
+   force_poll = 1;
if (likely(test_bit(EC_FLAGS_GPE_MODE, &ec->flags)) &&
likely(!force_poll)) {
if (wait_event_timeout(ec->wait, acpi_ec_check_status(ec, 
event),
   msecs_to_jiffies(ACPI_EC_DELAY)))
-   return 0;
+   goto end;
clear_bit(EC_FLAGS_WAIT_GPE, &ec->flags);
if (acpi_ec_check_status(ec, event)) {
-   if (event == ACPI_EC_EVENT_OBF_1) {
-   /* miss OBF = 1 GPE, don't expect it anymore */
-   pr_info(PREFIX "missing OBF_1 confirmation,"
-   "switching to degraded mode.\n");
-   set_bit(EC_FLAGS_ONLY_IBF_GPE, &ec->flags);
+   if (test_bit(EC_FLAGS_ADDRESS, &ec->flags)) {
+   /* miss address GPE, don't expect it anymore */
+   pr_info(PREFIX "missing address confirmation, "
+   "don't expect it any longer.\n");
+   set_bit(EC_FLAGS_NO_ADDRESS_GPE, &ec->flags);
+   } else if (test_bit(EC_FLAGS_WDATA, &ec->flags)) {
+   /* miss write data GPE, don't expect it */
+   pr_info(PREFIX "missing write data 
confirmation, "
+   "don't expect it any longer.\n");
+   set_bit(EC_FLAGS_NO_WDATA_GPE, &ec->flags);
} else {
/* missing GPEs, switch back to poll mode */
if (printk_ratelimit())
-   pr_info(PREFIX "missing IBF_1 
confirmations,"
+   pr_info(PREFIX "missing confirmations, "
"switch off interrupt mode.\n");
clear_bit(EC_FLAGS_GPE_MODE, &ec->flags);
}
-   return 0;
+   goto end;
}
} else {
unsigned long delay = jiffies + msecs_to_jiffies(ACPI_EC_DELAY);
clear_bit(EC_FLAGS_WAIT_GPE, &ec->flags);
while (time_before(jiffies, delay)) {
if (acpi_ec_check_status(ec, event))
-   return 0;
+   goto end;
}
}
pr_err(PREFIX "acpi_ec_wait timeout,"
   " status = %d, expect_event = %d\n",
   acpi_ec_read_status(ec), event);
-   return -ETIME;
+   ret = -ETIME;
+  end:
+   clear_bit(EC_FLAGS_ADDRESS, &ec->flags);
+   return ret;
 }
 
 static int acpi_ec_transaction_unlocked(struct acpi_ec *ec, u8 command,
@@ -226,11 +244,15 @@ static int acpi_ec_transaction_unlocked(struct acpi_ec 
*ec, u8 co

[PATCH 1/2] ACPI: EC: Add debug printks.

2007-11-20 Thread Alexey Starikovskiy
Sometimes it is usefull to see raw protocol dump.
Uncomment '#define DEBUG' at the beginning of file to make EC 
really verbose.

Signed-off-by: Márton Németh <[EMAIL PROTECTED]>
Signed-off-by: Alexey Starikovskiy <[EMAIL PROTECTED]>
---

 drivers/acpi/ec.c |   50 +++---
 1 files changed, 31 insertions(+), 19 deletions(-)

diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index 06b78e5..d5a5958 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -47,6 +47,9 @@
 #undef PREFIX
 #define PREFIX "ACPI: EC: "
 
+/* Uncomment next line to get verbose print outs*/
+/* #define DEBUG */
+
 /* EC status register */
 #define ACPI_EC_FLAG_OBF   0x01/* Output buffer full */
 #define ACPI_EC_FLAG_IBF   0x02/* Input buffer full */
@@ -131,21 +134,27 @@ static struct acpi_ec {
 
 static inline u8 acpi_ec_read_status(struct acpi_ec *ec)
 {
-   return inb(ec->command_addr);
+   u8 x = inb(ec->command_addr);
+   pr_debug(PREFIX "---> status = 0x%2x\n", x);
+   return x;
 }
 
 static inline u8 acpi_ec_read_data(struct acpi_ec *ec)
 {
+   u8 x = inb(ec->data_addr);
+   pr_debug(PREFIX "---> data = 0x%2x\n", x);
return inb(ec->data_addr);
 }
 
 static inline void acpi_ec_write_cmd(struct acpi_ec *ec, u8 command)
 {
+   pr_debug(PREFIX "<--- command = 0x%2x\n", command);
outb(command, ec->command_addr);
 }
 
 static inline void acpi_ec_write_data(struct acpi_ec *ec, u8 data)
 {
+   pr_debug(PREFIX "<--- data = 0x%2x\n", data);
outb(data, ec->data_addr);
 }
 
@@ -175,13 +184,14 @@ static int acpi_ec_wait(struct acpi_ec *ec, enum ec_event 
event, int force_poll)
if (acpi_ec_check_status(ec, event)) {
if (event == ACPI_EC_EVENT_OBF_1) {
/* miss OBF = 1 GPE, don't expect it anymore */
-   printk(KERN_INFO PREFIX "missing OBF_1 
confirmation,"
+   pr_info(PREFIX "missing OBF_1 confirmation,"
"switching to degraded mode.\n");
set_bit(EC_FLAGS_ONLY_IBF_GPE, &ec->flags);
} else {
/* missing GPEs, switch back to poll mode */
-   printk(KERN_INFO PREFIX "missing IBF_1 
confirmations,"
-   "switch off interrupt mode.\n");
+   if (printk_ratelimit())
+   pr_info(PREFIX "missing IBF_1 
confirmations,"
+   "switch off interrupt mode.\n");
clear_bit(EC_FLAGS_GPE_MODE, &ec->flags);
}
return 0;
@@ -194,7 +204,7 @@ static int acpi_ec_wait(struct acpi_ec *ec, enum ec_event 
event, int force_poll)
return 0;
}
}
-   printk(KERN_ERR PREFIX "acpi_ec_wait timeout,"
+   pr_err(PREFIX "acpi_ec_wait timeout,"
   " status = %d, expect_event = %d\n",
   acpi_ec_read_status(ec), event);
return -ETIME;
@@ -208,11 +218,11 @@ static int acpi_ec_transaction_unlocked(struct acpi_ec 
*ec, u8 command,
int result = 0;
set_bit(EC_FLAGS_WAIT_GPE, &ec->flags);
acpi_ec_write_cmd(ec, command);
-
+   pr_debug(PREFIX "transaction start\n");
for (; wdata_len > 0; --wdata_len) {
result = acpi_ec_wait(ec, ACPI_EC_EVENT_IBF_0, force_poll);
if (result) {
-   printk(KERN_ERR PREFIX
+   pr_err(PREFIX
   "write_cmd timeout, command = %d\n", command);
goto end;
}
@@ -223,7 +233,7 @@ static int acpi_ec_transaction_unlocked(struct acpi_ec *ec, 
u8 command,
if (!rdata_len) {
result = acpi_ec_wait(ec, ACPI_EC_EVENT_IBF_0, force_poll);
if (result) {
-   printk(KERN_ERR PREFIX
+   pr_err(PREFIX
   "finish-write timeout, command = %d\n", command);
goto end;
}
@@ -235,8 +245,7 @@ static int acpi_ec_transaction_unlocked(struct acpi_ec *ec, 
u8 command,
force_poll = 1;
result = acpi_ec_wait(ec, ACPI_EC_EVENT_OBF_1, force_poll);
if (result) {
-   printk(KERN_ERR PREFIX "read timeout, command = %d\n",
-  command);
+   pr_err(PREFIX "read timeout, command = %d\n", command);
goto end;
}
/* Don't expect GPE after last read */
@@ -245,6 +254,7 @@ static int acpi_ec_transaction_unlocked(struct acpi_ec *ec, 
u8 command,
*(

[PATCH 2/2] ACPI: EC: Workaround for optimized controllers (version 3)

2007-11-20 Thread Alexey Starikovskiy
Some controllers fail to send confirmation GPE after address or data write.
Detect this and don't expect such confirmation in future.
This is a generalization of previous workaround 
(66c5f4e7367b0085652931b2f3366de29e7ff5ec), which did only read address.

Reference: http://bugzilla.kernel.org/show_bug.cgi?id=9327

Signed-off-by: Alexey Starikovskiy <[EMAIL PROTECTED]>
Tested-by: Romano Giannetti <[EMAIL PROTECTED]>
---

 drivers/acpi/ec.c |   46 +-
 1 files changed, 33 insertions(+), 13 deletions(-)

diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index 74b9407..69ad2fc 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -78,7 +78,10 @@ enum {
EC_FLAGS_WAIT_GPE = 0,  /* Don't check status until GPE arrives 
*/
EC_FLAGS_QUERY_PENDING, /* Query is pending */
EC_FLAGS_GPE_MODE,  /* Expect GPE to be sent for status 
change */
-   EC_FLAGS_ONLY_IBF_GPE,  /* Expect GPE only for IBF = 0 event */
+   EC_FLAGS_NO_ADDRESS_GPE,/* Expect GPE only for non-address 
event */
+   EC_FLAGS_ADDRESS,   /* Address is being written */
+   EC_FLAGS_NO_WDATA_GPE,  /* Don't expect WDATA GPE event */
+   EC_FLAGS_WDATA, /* Data is being written */
 };
 
 static int acpi_ec_remove(struct acpi_device *device, int type);
@@ -175,39 +178,54 @@ static inline int acpi_ec_check_status(struct acpi_ec 
*ec, enum ec_event event)
 
 static int acpi_ec_wait(struct acpi_ec *ec, enum ec_event event, int 
force_poll)
 {
+   int ret = 0;
+   if (unlikely(test_bit(EC_FLAGS_ADDRESS, &ec->flags) &&
+test_bit(EC_FLAGS_NO_ADDRESS_GPE, &ec->flags)))
+   force_poll = 1;
+   if (unlikely(test_bit(EC_FLAGS_WDATA, &ec->flags) &&
+test_bit(EC_FLAGS_NO_WDATA_GPE, &ec->flags)))
+   force_poll = 1;
if (likely(test_bit(EC_FLAGS_GPE_MODE, &ec->flags)) &&
likely(!force_poll)) {
if (wait_event_timeout(ec->wait, acpi_ec_check_status(ec, 
event),
   msecs_to_jiffies(ACPI_EC_DELAY)))
-   return 0;
+   goto end;
clear_bit(EC_FLAGS_WAIT_GPE, &ec->flags);
if (acpi_ec_check_status(ec, event)) {
-   if (event == ACPI_EC_EVENT_OBF_1) {
-   /* miss OBF = 1 GPE, don't expect it anymore */
-   pr_info(PREFIX "missing OBF_1 confirmation,"
-   "switching to degraded mode.\n");
-   set_bit(EC_FLAGS_ONLY_IBF_GPE, &ec->flags);
+   if (test_bit(EC_FLAGS_ADDRESS, &ec->flags)) {
+   /* miss address GPE, don't expect it anymore */
+   pr_info(PREFIX "missing address confirmation, "
+   "don't expect it any longer.\n");
+   set_bit(EC_FLAGS_NO_ADDRESS_GPE, &ec->flags);
+   } else if (test_bit(EC_FLAGS_WDATA, &ec->flags)) {
+   /* miss write data GPE, don't expect it */
+   pr_info(PREFIX "missing write data 
confirmation, "
+   "don't expect it any longer.\n");
+   set_bit(EC_FLAGS_NO_WDATA_GPE, &ec->flags);
} else {
/* missing GPEs, switch back to poll mode */
if (!printk_ratelimit())
-   pr_info(PREFIX "missing IBF_1 
confirmations,"
+   pr_info(PREFIX "missing confirmations, "
"switch off interrupt mode.\n");
clear_bit(EC_FLAGS_GPE_MODE, &ec->flags);
}
-   return 0;
+   goto end;
}
} else {
unsigned long delay = jiffies + msecs_to_jiffies(ACPI_EC_DELAY);
clear_bit(EC_FLAGS_WAIT_GPE, &ec->flags);
while (time_before(jiffies, delay)) {
if (acpi_ec_check_status(ec, event))
-   return 0;
+   goto end;
}
}
pr_err(PREFIX "acpi_ec_wait timeout,"
   " status = %d, expect_event = %d\n",
   acpi_ec_read_status(ec), event);
-   return -ETIME;
+   ret = -ETIME;
+  end:
+   clear_bit(EC_FLAGS_ADDRESS, &ec->flags);
+   return ret;
 }
 
 static int acpi_ec_transaction_unlocked(struct acpi_ec *ec, u8 command,
@@ -226,11 +244,15 @@ static int acpi_ec_transaction_unlocked(struct acpi_ec 
*ec, u8 command,
   "write_cmd 

[PATCH 1/2] ACPI: EC: Add debug printks.

2007-11-20 Thread Alexey Starikovskiy
Sometimes it is usefull to see raw protocol dump.
Uncomment '#define DEBUG' at the beginning of file to make EC 
really verbose.

Signed-off-by: Márton Németh <[EMAIL PROTECTED]>
Signed-off-by: Alexey Starikovskiy <[EMAIL PROTECTED]>
---

 drivers/acpi/ec.c |   50 +++---
 1 files changed, 31 insertions(+), 19 deletions(-)

diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index 06b78e5..74b9407 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -47,6 +47,9 @@
 #undef PREFIX
 #define PREFIX "ACPI: EC: "
 
+/* Uncomment next line to get verbose print outs*/
+/* #define DEBUG */
+
 /* EC status register */
 #define ACPI_EC_FLAG_OBF   0x01/* Output buffer full */
 #define ACPI_EC_FLAG_IBF   0x02/* Input buffer full */
@@ -131,21 +134,27 @@ static struct acpi_ec {
 
 static inline u8 acpi_ec_read_status(struct acpi_ec *ec)
 {
-   return inb(ec->command_addr);
+   u8 x = inb(ec->command_addr);
+   pr_debug(PREFIX "---> status = 0x%2x\n", x);
+   return x;
 }
 
 static inline u8 acpi_ec_read_data(struct acpi_ec *ec)
 {
+   u8 x = inb(ec->data_addr);
+   pr_debug(PREFIX "---> data = 0x%2x\n", x);
return inb(ec->data_addr);
 }
 
 static inline void acpi_ec_write_cmd(struct acpi_ec *ec, u8 command)
 {
+   pr_debug(PREFIX "<--- command = 0x%2x\n", command);
outb(command, ec->command_addr);
 }
 
 static inline void acpi_ec_write_data(struct acpi_ec *ec, u8 data)
 {
+   pr_debug(PREFIX "<--- data = 0x%2x\n", data);
outb(data, ec->data_addr);
 }
 
@@ -175,13 +184,14 @@ static int acpi_ec_wait(struct acpi_ec *ec, enum ec_event 
event, int force_poll)
if (acpi_ec_check_status(ec, event)) {
if (event == ACPI_EC_EVENT_OBF_1) {
/* miss OBF = 1 GPE, don't expect it anymore */
-   printk(KERN_INFO PREFIX "missing OBF_1 
confirmation,"
+   pr_info(PREFIX "missing OBF_1 confirmation,"
"switching to degraded mode.\n");
set_bit(EC_FLAGS_ONLY_IBF_GPE, &ec->flags);
} else {
/* missing GPEs, switch back to poll mode */
-   printk(KERN_INFO PREFIX "missing IBF_1 
confirmations,"
-   "switch off interrupt mode.\n");
+   if (!printk_ratelimit())
+   pr_info(PREFIX "missing IBF_1 
confirmations,"
+   "switch off interrupt mode.\n");
clear_bit(EC_FLAGS_GPE_MODE, &ec->flags);
}
return 0;
@@ -194,7 +204,7 @@ static int acpi_ec_wait(struct acpi_ec *ec, enum ec_event 
event, int force_poll)
return 0;
}
}
-   printk(KERN_ERR PREFIX "acpi_ec_wait timeout,"
+   pr_err(PREFIX "acpi_ec_wait timeout,"
   " status = %d, expect_event = %d\n",
   acpi_ec_read_status(ec), event);
return -ETIME;
@@ -208,11 +218,11 @@ static int acpi_ec_transaction_unlocked(struct acpi_ec 
*ec, u8 command,
int result = 0;
set_bit(EC_FLAGS_WAIT_GPE, &ec->flags);
acpi_ec_write_cmd(ec, command);
-
+   pr_debug(PREFIX "transaction start\n");
for (; wdata_len > 0; --wdata_len) {
result = acpi_ec_wait(ec, ACPI_EC_EVENT_IBF_0, force_poll);
if (result) {
-   printk(KERN_ERR PREFIX
+   pr_err(PREFIX
   "write_cmd timeout, command = %d\n", command);
goto end;
}
@@ -223,7 +233,7 @@ static int acpi_ec_transaction_unlocked(struct acpi_ec *ec, 
u8 command,
if (!rdata_len) {
result = acpi_ec_wait(ec, ACPI_EC_EVENT_IBF_0, force_poll);
if (result) {
-   printk(KERN_ERR PREFIX
+   pr_err(PREFIX
   "finish-write timeout, command = %d\n", command);
goto end;
}
@@ -235,8 +245,7 @@ static int acpi_ec_transaction_unlocked(struct acpi_ec *ec, 
u8 command,
force_poll = 1;
result = acpi_ec_wait(ec, ACPI_EC_EVENT_OBF_1, force_poll);
if (result) {
-   printk(KERN_ERR PREFIX "read timeout, command = %d\n",
-  command);
+   pr_err(PREFIX "read timeout, command = %d\n", command);
goto end;
}
/* Don't expect GPE after last read */
@@ -245,6 +254,7 @@ static int acpi_ec_transaction_unlocked(struct acpi_ec *ec, 
u8 command,
*

Re: acpi_osi=!Linux work better than acpi_osi=Linux

2007-11-20 Thread Len Brown
On Friday 26 October 2007 21:13, 陳王展 wrote:
> Dear all,
> after trying all the combinations from en.opensuse.org/S2ram, the
> s2ram still hang or immediately shutdown the system.
> But, I try to pass the acpi_osi=!Linux to the kernel, it work well!
> 
> the following settings is ok for me.
> s2ram --force  --vbe_post
> 
> If you still need any further information, please contact to me.
> 
> PS. I don't known how to set the gnome-power-manager to use the
> settings above, is there anyone can give me some advices?  I only can
> use root to use the s2ram command to STR. Thanks
> PS. s2disk is ok whether or not I pass the acpi_osi=Linux to the kernel.
> 
> Best Regards,
> Peter Chen
> 
> # dmidecode 2.9
> SMBIOS 2.4 present.
> 28 structures occupying 1179 bytes.
> Table at 0x7FEDF000.
> 
> Handle 0x, DMI type 0, 24 bytes
> BIOS Information
> Vendor: Phoenix Technologies LTD
> Version: V1.06
> Release Date: 07/11/2007
> Address: 0xE5F80
> Runtime Size: 106624 bytes
> ROM Size: 1024 kB
> Characteristics:
> ISA is supported
> PCI is supported
> PC Card (PCMCIA) is supported
> PNP is supported
> BIOS is upgradeable
> BIOS shadowing is allowed
> ESCD support is available
> Boot from CD is supported
> ACPI is supported
> USB legacy is supported
> AGP is supported
> BIOS boot specification is supported
> Targeted content distribution is supported
> 
> Handle 0x0001, DMI type 1, 27 bytes
> System Information
> Manufacturer: Acer
> Product Name: Aspire 4920

Thanks for the note.

What release of Linux are you running?
acpi_osi=!Linux is the default starting in 2.6.23.

Any chance you can open a bug report and put the output of acpidump there?
I'd like to see what Acer is doing in this case.

thanks,
-Len
-
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 0/8] Suspend/hibernation patches for 2.6.25

2007-11-20 Thread Rafael J. Wysocki
On Tuesday, 20 of November 2007, Len Brown wrote:
> thanks for re-sending, Rafael.
> 
> I've created a new "suspend" branch -- currently
> rooted on Linus' latest.
> 
> git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6.git suspend
> 
> I've re-based the older hibernate patches onto
> the new branch, and added the batch you just sent.
> 
> Note that the suspend branch is included in my test branch,
> which akpm pulls into -mm.

Thanks for all that!

I'm now seeing the suspend branch on gitweb, but when I do

$ git clone git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6

I get a repository with only one branch which is "test" and indeed
.git/refs/heads contains this one only.  What should I do to get the suspend
branch (and the others) too with git clone (or git fetch)?

Rafael
-
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: ACPI: disable stray GPE, prevent ACPI interrupt storm

2007-11-20 Thread Moore, Robert
BTW, this kind of change begs for a comment, how about:

default:
/*
 * Even if we don't know the GPE type, make sure that we always
 * disable it. This can prevent a certain type of GPE flood,
where
 * the GPE has no _Lxx/_Exx method, and it cannot be determined
 * whether the GPE is wake, run, or wake/run.
 */
Status = AcpiHwWriteGpeEnableReg (GpeEventInfo);
break;


>-Original Message-
>From: Len Brown [mailto:[EMAIL PROTECTED]
>Sent: Tuesday, November 20, 2007 10:43 AM
>To: Moore, Robert
>Cc: linux-acpi@vger.kernel.org; Zhang, Rui; Alexey Starikovskiy
>Subject: ACPI: disable stray GPE, prevent ACPI interrupt storm
>
>Bob,
>Rui's Linux patch below modifies an ACPICA file.
>
>thanks,
>-Len
>
>commit a7f9b1f24974da287771e2d70b30d9ca7bd66684
>Author: Zhang Rui <[EMAIL PROTECTED]>
>Date:   Tue Nov 20 13:38:59 2007 -0500
>
>ACPI: disable stray GPE, prevent ACPI interrupt storm
>
>GPEs are disabled depending on their type --
>WAKE, WAKE_RUN, and RUNTIME.  An error is returned
>if we are asked to disable a GPE that has no type.
>
>But at least one system exists that enables a GPE from AML
>that is not the EC GPE, and has no _Lxx/_Exx AML handler,
>and is thus never initialized.
>
>In this case, when an external CRT is plugged in,
>the GPE fires, we attempt to disable the GPE,
>but instead just return an error.
>So the GPE stays asserted and an ACPI interrupt storm follows.
>
>The fix is to disable a firing GPE,
>even if it comes from outer space.
>
>http://bugzilla.kernel.org/show_bug.cgi?id=6217
>
>Signed-off-by: Zhang Rui <[EMAIL PROTECTED]>
>Acked-by: Alexey Starikovskiy <[EMAIL PROTECTED]>
>Signed-off-by: Len Brown <[EMAIL PROTECTED]>
>
>diff --git a/drivers/acpi/events/evgpe.c b/drivers/acpi/events/evgpe.c
>index e22f4a9..056b788 100644
>--- a/drivers/acpi/events/evgpe.c
>+++ b/drivers/acpi/events/evgpe.c
>@@ -270,18 +270,18 @@ acpi_status acpi_ev_disable_gpe(struct
>acpi_gpe_event_info *gpe_event_info)
>   case ACPI_GPE_TYPE_WAKE_RUN:
>   ACPI_CLEAR_BIT(gpe_event_info->flags,
ACPI_GPE_WAKE_ENABLED);
>
>-  /*lint -fallthrough */
>+  /* fallthrough */
>
>   case ACPI_GPE_TYPE_RUNTIME:
>
>   /* Disable the requested runtime GPE */
>
>   ACPI_CLEAR_BIT(gpe_event_info->flags,
ACPI_GPE_RUN_ENABLED);
>-  status = acpi_hw_write_gpe_enable_reg(gpe_event_info);
>-  break;
>+
>+  /* fallthrough */
>
>   default:
>-  return_ACPI_STATUS(AE_BAD_PARAMETER);
>+  acpi_hw_write_gpe_enable_reg(gpe_event_info);
>   }
>
>   return_ACPI_STATUS(AE_OK);
-
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/2] Sonypi: fit input devices into sysfs tree

2007-11-20 Thread Mattia Dongili
On Wed, Oct 31, 2007 at 12:43:10AM -0400, Dmitry Torokhov wrote:
> Subject: Sonypi: fit input devices into sysfs tree
> From: Dmitry Torokhov <[EMAIL PROTECTED]>
> 
> Properly set up parent on input devices registered by sonypi.
> 
> Signed-off-by: Dmitry Torokhov <[EMAIL PROTECTED]>

Acked-by: Mattia Dongili <[EMAIL PROTECTED]>

> ---
>  drivers/char/sonypi.c |6 --
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> Index: linux/drivers/char/sonypi.c
> ===
> --- linux.orig/drivers/char/sonypi.c
> +++ linux/drivers/char/sonypi.c
> @@ -1163,7 +1163,7 @@ static struct acpi_driver sonypi_acpi_dr
>  };
>  #endif
>  
> -static int __devinit sonypi_create_input_devices(void)
> +static int __devinit sonypi_create_input_devices(struct platform_device 
> *pdev)
>  {
>   struct input_dev *jog_dev;
>   struct input_dev *key_dev;
> @@ -1177,6 +1177,7 @@ static int __devinit sonypi_create_input
>   jog_dev->name = "Sony Vaio Jogdial";
>   jog_dev->id.bustype = BUS_ISA;
>   jog_dev->id.vendor = PCI_VENDOR_ID_SONY;
> + jog_dev->dev.parent = &pdev->dev;
>  
>   jog_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REL);
>   jog_dev->keybit[BIT_WORD(BTN_MOUSE)] = BIT_MASK(BTN_MIDDLE);
> @@ -1191,6 +1192,7 @@ static int __devinit sonypi_create_input
>   key_dev->name = "Sony Vaio Keys";
>   key_dev->id.bustype = BUS_ISA;
>   key_dev->id.vendor = PCI_VENDOR_ID_SONY;
> + key_dev->dev.parent = &pdev->dev;
>  
>   /* Initialize the Input Drivers: special keys */
>   key_dev->evbit[0] = BIT_MASK(EV_KEY);
> @@ -1385,7 +1387,7 @@ static int __devinit sonypi_probe(struct
>  
>   if (useinput) {
>  
> - error = sonypi_create_input_devices();
> + error = sonypi_create_input_devices(dev);
>   if (error) {
>   printk(KERN_ERR
>   "sonypi: failed to create input devices\n");
> 
-- 
mattia
:wq!
-
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/2] Sonypi: use synchronize_irq instead of sycnronize_sched

2007-11-20 Thread Mattia Dongili
On Wed, Oct 31, 2007 at 12:41:54AM -0400, Dmitry Torokhov wrote:
> Hi Mattia,
> 
> It looks like you are also looking after sonypi...
> 
> -- 
> Dmitry
> 
> Subject: Sonypi: use synchronize_irq instead of sycnronize_sched
> From: Dmitry Torokhov <[EMAIL PROTECTED]>
> 
> We know exactly what IRQ we are using, so synchronize_irq()
> suits much better. Plus synchronize_sched() will not work
> for us in -rt kernels.
> 
> Signed-off-by: Dmitry Torokhov <[EMAIL PROTECTED]>

Acked-by: Mattia Dongili <[EMAIL PROTECTED]>

> ---
>  drivers/char/sonypi.c |2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Index: linux/drivers/char/sonypi.c
> ===
> --- linux.orig/drivers/char/sonypi.c
> +++ linux/drivers/char/sonypi.c
> @@ -1432,7 +1432,7 @@ static int __devexit sonypi_remove(struc
>  {
>   sonypi_disable();
>  
> - synchronize_sched();  /* Allow sonypi interrupt to complete. */
> + synchronize_irq(sonypi_device.irq);
>   flush_scheduled_work();
>  
>   if (useinput) {
> 
-- 
mattia
:wq!
-
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] sony-laptop: fit input devices into sysfs tree

2007-11-20 Thread Mattia Dongili
On Wed, Oct 31, 2007 at 12:36:52AM -0400, Dmitry Torokhov wrote:
> Hi Mattia,

Hello Dmitry!

> Here is a small patch for sony-laptop. Untested since I don't
> have the hardware.

Now tested ;)
please go on and push it.

> 
> -- 
> Dmitry
> 
> Subject: sony-laptop: fit input devices into sysfs tree
> From: Dmitry Torokhov <[EMAIL PROTECTED]>
> 
> Properly set up parent on input devices registered by sony-laptop.
> 
> Signed-off-by: Dmitry Torokhov <[EMAIL PROTECTED]>

Acked-by: Mattia Dongili <[EMAIL PROTECTED]>

> ---
>  drivers/misc/sony-laptop.c |   10 ++
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> Index: linux/drivers/misc/sony-laptop.c
> ===
> --- linux.orig/drivers/misc/sony-laptop.c
> +++ linux/drivers/misc/sony-laptop.c
> @@ -338,7 +338,7 @@ static void sony_laptop_report_input_eve
>   dprintk("unknown input event %.2x\n", event);
>  }
>  
> -static int sony_laptop_setup_input(void)
> +static int sony_laptop_setup_input(struct acpi_device *acpi_device)
>  {
>   struct input_dev *jog_dev;
>   struct input_dev *key_dev;
> @@ -379,6 +379,7 @@ static int sony_laptop_setup_input(void)
>   key_dev->name = "Sony Vaio Keys";
>   key_dev->id.bustype = BUS_ISA;
>   key_dev->id.vendor = PCI_VENDOR_ID_SONY;
> + key_dev->dev.parent = &acpi_device->dev;
>  
>   /* Initialize the Input Drivers: special keys */
>   set_bit(EV_KEY, key_dev->evbit);
> @@ -410,6 +411,7 @@ static int sony_laptop_setup_input(void)
>   jog_dev->name = "Sony Vaio Jogdial";
>   jog_dev->id.bustype = BUS_ISA;
>   jog_dev->id.vendor = PCI_VENDOR_ID_SONY;
> + key_dev->dev.parent = &acpi_device->dev;
>  
>   jog_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REL);
>   jog_dev->keybit[BIT_WORD(BTN_MOUSE)] = BIT_MASK(BTN_MIDDLE);
> @@ -1006,7 +1008,7 @@ static int sony_nc_add(struct acpi_devic
>   }
>  
>   /* setup input devices and helper fifo */
> - result = sony_laptop_setup_input();
> + result = sony_laptop_setup_input(device);
>   if (result) {
>   printk(KERN_ERR DRV_PFX
>   "Unabe to create input devices.\n");
> @@ -1034,7 +1036,7 @@ static int sony_nc_add(struct acpi_devic
>   sony_backlight_device->props.brightness =
>   sony_backlight_get_brightness
>   (sony_backlight_device);
> - sony_backlight_device->props.max_brightness = 
> + sony_backlight_device->props.max_brightness =
>   SONY_MAX_BRIGHTNESS - 1;
>   }
>  
> @@ -2453,7 +2455,7 @@ static int sony_pic_add(struct acpi_devi
>   }
>  
>   /* setup input devices and helper fifo */
> - result = sony_laptop_setup_input();
> + result = sony_laptop_setup_input(device);
>   if (result) {
>   printk(KERN_ERR DRV_PFX
>   "Unabe to create input devices.\n");
> 
-- 
mattia
:wq!
-
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: ACPI: disable stray GPE, prevent ACPI interrupt storm

2007-11-20 Thread Moore, Robert
Ok

/*lint -fallthrough */

Our lint needs this


>-Original Message-
>From: Len Brown [mailto:[EMAIL PROTECTED]
>Sent: Tuesday, November 20, 2007 10:43 AM
>To: Moore, Robert
>Cc: linux-acpi@vger.kernel.org; Zhang, Rui; Alexey Starikovskiy
>Subject: ACPI: disable stray GPE, prevent ACPI interrupt storm
>
>Bob,
>Rui's Linux patch below modifies an ACPICA file.
>
>thanks,
>-Len
>
>commit a7f9b1f24974da287771e2d70b30d9ca7bd66684
>Author: Zhang Rui <[EMAIL PROTECTED]>
>Date:   Tue Nov 20 13:38:59 2007 -0500
>
>ACPI: disable stray GPE, prevent ACPI interrupt storm
>
>GPEs are disabled depending on their type --
>WAKE, WAKE_RUN, and RUNTIME.  An error is returned
>if we are asked to disable a GPE that has no type.
>
>But at least one system exists that enables a GPE from AML
>that is not the EC GPE, and has no _Lxx/_Exx AML handler,
>and is thus never initialized.
>
>In this case, when an external CRT is plugged in,
>the GPE fires, we attempt to disable the GPE,
>but instead just return an error.
>So the GPE stays asserted and an ACPI interrupt storm follows.
>
>The fix is to disable a firing GPE,
>even if it comes from outer space.
>
>http://bugzilla.kernel.org/show_bug.cgi?id=6217
>
>Signed-off-by: Zhang Rui <[EMAIL PROTECTED]>
>Acked-by: Alexey Starikovskiy <[EMAIL PROTECTED]>
>Signed-off-by: Len Brown <[EMAIL PROTECTED]>
>
>diff --git a/drivers/acpi/events/evgpe.c b/drivers/acpi/events/evgpe.c
>index e22f4a9..056b788 100644
>--- a/drivers/acpi/events/evgpe.c
>+++ b/drivers/acpi/events/evgpe.c
>@@ -270,18 +270,18 @@ acpi_status acpi_ev_disable_gpe(struct
>acpi_gpe_event_info *gpe_event_info)
>   case ACPI_GPE_TYPE_WAKE_RUN:
>   ACPI_CLEAR_BIT(gpe_event_info->flags,
ACPI_GPE_WAKE_ENABLED);
>
>-  /*lint -fallthrough */
>+  /* fallthrough */
>
>   case ACPI_GPE_TYPE_RUNTIME:
>
>   /* Disable the requested runtime GPE */
>
>   ACPI_CLEAR_BIT(gpe_event_info->flags,
ACPI_GPE_RUN_ENABLED);
>-  status = acpi_hw_write_gpe_enable_reg(gpe_event_info);
>-  break;
>+
>+  /* fallthrough */
>
>   default:
>-  return_ACPI_STATUS(AE_BAD_PARAMETER);
>+  acpi_hw_write_gpe_enable_reg(gpe_event_info);
>   }
>
>   return_ACPI_STATUS(AE_OK);
-
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/2] ACPI: EC: Workaround for optimized controllers (version 3)

2007-11-20 Thread Alexey Starikovskiy
Some controllers fail to send confirmation GPE after address or data write.
Detect this and don't expect such confirmation in future.
This is a generalization of previous workaround 
(66c5f4e7367b0085652931b2f3366de29e7ff5ec), which did only read address.

Reference: http://bugzilla.kernel.org/show_bug.cgi?id=9327

Signed-off-by: Alexey Starikovskiy <[EMAIL PROTECTED]>
Tested-by: Romano Giannetti <[EMAIL PROTECTED]>
---

 drivers/acpi/ec.c |   46 +-
 1 files changed, 33 insertions(+), 13 deletions(-)

diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index 710f600..e077dd8 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -78,7 +78,10 @@ enum {
EC_FLAGS_WAIT_GPE = 0,  /* Don't check status until GPE arrives 
*/
EC_FLAGS_QUERY_PENDING, /* Query is pending */
EC_FLAGS_GPE_MODE,  /* Expect GPE to be sent for status 
change */
-   EC_FLAGS_ONLY_IBF_GPE,  /* Expect GPE only for IBF = 0 event */
+   EC_FLAGS_NO_ADDRESS_GPE,/* Expect GPE only for non-address 
event */
+   EC_FLAGS_ADDRESS,   /* Address is being written */
+   EC_FLAGS_NO_WDATA_GPE,  /* Don't expect WDATA GPE event */
+   EC_FLAGS_WDATA, /* Data is being written */
 };
 
 static int acpi_ec_remove(struct acpi_device *device, int type);
@@ -175,38 +178,53 @@ static inline int acpi_ec_check_status(struct acpi_ec 
*ec, enum ec_event event)
 
 static int acpi_ec_wait(struct acpi_ec *ec, enum ec_event event, int 
force_poll)
 {
+   int ret = 0;
+   if (unlikely(test_bit(EC_FLAGS_ADDRESS, &ec->flags) &&
+test_bit(EC_FLAGS_NO_ADDRESS_GPE, &ec->flags)))
+   force_poll = 1;
+   if (unlikely(test_bit(EC_FLAGS_WDATA, &ec->flags) &&
+test_bit(EC_FLAGS_NO_WDATA_GPE, &ec->flags)))
+   force_poll = 1;
if (likely(test_bit(EC_FLAGS_GPE_MODE, &ec->flags)) &&
likely(!force_poll)) {
if (wait_event_timeout(ec->wait, acpi_ec_check_status(ec, 
event),
   msecs_to_jiffies(ACPI_EC_DELAY)))
-   return 0;
+   goto end;
clear_bit(EC_FLAGS_WAIT_GPE, &ec->flags);
if (acpi_ec_check_status(ec, event)) {
-   if (event == ACPI_EC_EVENT_OBF_1) {
-   /* miss OBF = 1 GPE, don't expect it anymore */
-   pr_info(PREFIX "missing OBF_1 confirmation,"
-   "switching to degraded mode.\n");
-   set_bit(EC_FLAGS_ONLY_IBF_GPE, &ec->flags);
+   if (test_bit(EC_FLAGS_ADDRESS, &ec->flags)) {
+   /* miss address GPE, don't expect it anymore */
+   pr_info(PREFIX "missing address confirmation, "
+   "don't expect it any longer.\n");
+   set_bit(EC_FLAGS_NO_ADDRESS_GPE, &ec->flags);
+   } else if (test_bit(EC_FLAGS_WDATA, &ec->flags)) {
+   /* miss write data GPE, don't expect it */
+   pr_info(PREFIX "missing write data 
confirmation, "
+   "don't expect it any longer.\n");
+   set_bit(EC_FLAGS_NO_WDATA_GPE, &ec->flags);
} else {
/* missing GPEs, switch back to poll mode */
-   pr_info(PREFIX "missing IBF_1 confirmations,"
+   pr_info(PREFIX "missing confirmations, "
"switch off interrupt mode.\n");
clear_bit(EC_FLAGS_GPE_MODE, &ec->flags);
}
-   return 0;
+   goto end;
}
} else {
unsigned long delay = jiffies + msecs_to_jiffies(ACPI_EC_DELAY);
clear_bit(EC_FLAGS_WAIT_GPE, &ec->flags);
while (time_before(jiffies, delay)) {
if (acpi_ec_check_status(ec, event))
-   return 0;
+   goto end;
}
}
pr_err(PREFIX "acpi_ec_wait timeout,"
   " status = %d, expect_event = %d\n",
   acpi_ec_read_status(ec), event);
-   return -ETIME;
+   ret = -ETIME;
+  end:
+   clear_bit(EC_FLAGS_ADDRESS, &ec->flags);
+   return ret;
 }
 
 static int acpi_ec_transaction_unlocked(struct acpi_ec *ec, u8 command,
@@ -225,11 +243,15 @@ static int acpi_ec_transaction_unlocked(struct acpi_ec 
*ec, u8 command,
   "write_cmd timeout, command = %d\n", command);
goto end;

[PATCH 1/2] ACPI: EC: Add debug printks.

2007-11-20 Thread Alexey Starikovskiy
Sometimes it is usefull to see raw protocol dump.
Uncomment '#define DEBUG' at the beginning of file to make EC 
really verbose.

Signed-off-by: Márton Németh <[EMAIL PROTECTED]>
Signed-off-by: Alexey Starikovskiy <[EMAIL PROTECTED]>
---

 drivers/acpi/ec.c |   41 ++---
 1 files changed, 26 insertions(+), 15 deletions(-)

diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index 06b78e5..710f600 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -47,6 +47,9 @@
 #undef PREFIX
 #define PREFIX "ACPI: EC: "
 
+/* Uncomment next line to get verbose print outs*/
+/* #define DEBUG */
+
 /* EC status register */
 #define ACPI_EC_FLAG_OBF   0x01/* Output buffer full */
 #define ACPI_EC_FLAG_IBF   0x02/* Input buffer full */
@@ -131,21 +134,27 @@ static struct acpi_ec {
 
 static inline u8 acpi_ec_read_status(struct acpi_ec *ec)
 {
-   return inb(ec->command_addr);
+   u8 x = inb(ec->command_addr);
+   pr_debug(PREFIX "---> status = 0x%2x\n", x);
+   return x;
 }
 
 static inline u8 acpi_ec_read_data(struct acpi_ec *ec)
 {
+   u8 x = inb(ec->data_addr);
+   pr_debug(PREFIX "---> data = 0x%2x\n", x);
return inb(ec->data_addr);
 }
 
 static inline void acpi_ec_write_cmd(struct acpi_ec *ec, u8 command)
 {
+   pr_debug(PREFIX "<--- command = 0x%2x\n", command);
outb(command, ec->command_addr);
 }
 
 static inline void acpi_ec_write_data(struct acpi_ec *ec, u8 data)
 {
+   pr_debug(PREFIX "<--- data = 0x%2x\n", data);
outb(data, ec->data_addr);
 }
 
@@ -175,12 +184,12 @@ static int acpi_ec_wait(struct acpi_ec *ec, enum ec_event 
event, int force_poll)
if (acpi_ec_check_status(ec, event)) {
if (event == ACPI_EC_EVENT_OBF_1) {
/* miss OBF = 1 GPE, don't expect it anymore */
-   printk(KERN_INFO PREFIX "missing OBF_1 
confirmation,"
+   pr_info(PREFIX "missing OBF_1 confirmation,"
"switching to degraded mode.\n");
set_bit(EC_FLAGS_ONLY_IBF_GPE, &ec->flags);
} else {
/* missing GPEs, switch back to poll mode */
-   printk(KERN_INFO PREFIX "missing IBF_1 
confirmations,"
+   pr_info(PREFIX "missing IBF_1 confirmations,"
"switch off interrupt mode.\n");
clear_bit(EC_FLAGS_GPE_MODE, &ec->flags);
}
@@ -194,7 +203,7 @@ static int acpi_ec_wait(struct acpi_ec *ec, enum ec_event 
event, int force_poll)
return 0;
}
}
-   printk(KERN_ERR PREFIX "acpi_ec_wait timeout,"
+   pr_err(PREFIX "acpi_ec_wait timeout,"
   " status = %d, expect_event = %d\n",
   acpi_ec_read_status(ec), event);
return -ETIME;
@@ -208,11 +217,11 @@ static int acpi_ec_transaction_unlocked(struct acpi_ec 
*ec, u8 command,
int result = 0;
set_bit(EC_FLAGS_WAIT_GPE, &ec->flags);
acpi_ec_write_cmd(ec, command);
-
+   pr_debug(PREFIX "transaction start\n");
for (; wdata_len > 0; --wdata_len) {
result = acpi_ec_wait(ec, ACPI_EC_EVENT_IBF_0, force_poll);
if (result) {
-   printk(KERN_ERR PREFIX
+   pr_err(PREFIX
   "write_cmd timeout, command = %d\n", command);
goto end;
}
@@ -223,7 +232,7 @@ static int acpi_ec_transaction_unlocked(struct acpi_ec *ec, 
u8 command,
if (!rdata_len) {
result = acpi_ec_wait(ec, ACPI_EC_EVENT_IBF_0, force_poll);
if (result) {
-   printk(KERN_ERR PREFIX
+   pr_err(PREFIX
   "finish-write timeout, command = %d\n", command);
goto end;
}
@@ -235,7 +244,7 @@ static int acpi_ec_transaction_unlocked(struct acpi_ec *ec, 
u8 command,
force_poll = 1;
result = acpi_ec_wait(ec, ACPI_EC_EVENT_OBF_1, force_poll);
if (result) {
-   printk(KERN_ERR PREFIX "read timeout, command = %d\n",
+   pr_err(PREFIX "read timeout, command = %d\n",
   command);
goto end;
}
@@ -245,6 +254,7 @@ static int acpi_ec_transaction_unlocked(struct acpi_ec *ec, 
u8 command,
*(rdata++) = acpi_ec_read_data(ec);
}
   end:
+   pr_debug(PREFIX "transaction end\n");
return result;
 }
 
@@ -273,7 +283,7 @@ static int acpi_ec_transaction(struct acpi_ec *ec, u8 
command,
 
status = acpi_ec_wait(ec, ACPI

Just spotted this message in messages file....

2007-11-20 Thread Dave Daniels

Hi,

Just spotted:

ACPI: System BIOS is requesting _OSI(Linux)
kernel: ACPI: If "acpi_osi=Linux" works better,
kernel: Please send dmidecode to linux-acpi@vger.kernel.org

So I thought I'd send you the dmidecode stuff as requested :-)

Cheers

Dave


# dmidecode 2.7
SMBIOS 2.4 present.
22 structures occupying 743 bytes.
Table at 0x000DF010.

Handle 0x, DMI type 0, 24 bytes.
BIOS Information
Vendor: Hewlett-Packard
Version: F.16 
Release Date: 02/02/2007
Address: 0xE6FF0
Runtime Size: 102416 bytes
ROM Size: 1024 kB
Characteristics:
ISA is supported
PCI is supported
PNP is supported
BIOS is upgradeable
BIOS shadowing is allowed
ESCD support is available
Boot from CD is supported
Selectable boot is supported
Print screen service is supported (int 5h)
8042 keyboard services are supported (int 9h)
Serial services are supported (int 14h)
Printer services are supported (int 17h)
ACPI is supported
USB legacy is supported
AGP is supported
Smart battery is supported
BIOS boot specification is supported
Targeted content distribution is supported

Handle 0x0001, DMI type 1, 27 bytes.
System Information
Manufacturer: Hewlett-Packard
Product Name: HP Pavilion dv6000 (GH885EA#ABU)  
Version: Rev 1
Serial Number: CNF7195RYM
UUID: 434E4637-3139-3552-594D-001B24272AEB
Wake-up Type: Power Switch
SKU Number: GH885EA#ABU
Family: 103C_5335KV

Handle 0x0002, DMI type 2, 8 bytes.
Base Board Information
Manufacturer: Quanta
Product Name: 30BC
Version: 66.37
Serial Number: None

Handle 0x0003, DMI type 3, 17 bytes.
Chassis Information
Manufacturer: Quanta
Type: Notebook
Lock: Not Present
Version: N/A
Serial Number: None
Asset Tag: 
Boot-up State: Safe
Power Supply State: Safe
Thermal State: Safe
Security Status: None
OEM Information: 0x1234

Handle 0x0004, DMI type 4, 35 bytes.
Processor Information
Socket Designation: U2E1
Type: Central Processor
Family: Other
Manufacturer: Intel
ID: F2 06 00 00 FF FB EB BF
Version: Intel(R) Core(TM)2 CPU T5300 
Voltage: 1.8 V
External Clock: 533 MHz
Max Speed: 1730 MHz
Current Speed: 1730 MHz
Status: Populated, Enabled
Upgrade: Socket 478
L1 Cache Handle: 0x0005
L2 Cache Handle: 0x0006
L3 Cache Handle: Not Provided
Serial Number: Not Specified
Asset Tag: Not Specified
Part Number: Not Specified

Handle 0x0005, DMI type 7, 19 bytes.
Cache Information
Socket Designation: L1 Cache
Configuration: Enabled, Socketed, Level 1
Operational Mode: Write Back
Location: Internal
Installed Size: 32 KB
Maximum Size: 32 KB
Supported SRAM Types:
Burst
Pipeline Burst
Asynchronous
Installed SRAM Type: Asynchronous
Speed: Unknown
Error Correction Type: Unknown
System Type: Unknown
Associativity: Unknown

Handle 0x0006, DMI type 7, 19 bytes.
Cache Information
Socket Designation: L2 Cache
Configuration: Enabled, Socketed, Level 2
Operational Mode: Write Back
Location: External
Installed Size: 2048 KB
Maximum Size: 2048 KB
Supported SRAM Types:
Burst
Pipeline Burst
Asynchronous
Installed SRAM Type: Burst
Speed: Unknown
Error Correction Type: Unknown
System Type: Unknown
Associativity: Unknown

Handle 0x0007, DMI type 9, 13 bytes.
System Slot Information
Designation: PCI Express Slot 1
Type: 64-bit PCI Express
Current Usage: Available
Length: Short
Characteristics:
5.0 V is provided
3.3 V is provided

Handle 0x0008, DMI type 9, 13 bytes.
System Slot Information
Designation: PCI Express Slot 2
Type: 64-bit PCI Express
Current Usage: Available
Length: Short
Characteristics:
5.0 V is provided
3.3 V is provided
PME signal is supported
Hot-plug devices are supported

Handle 0x0009, DMI type 9, 13 bytes.
System Slot Information
Designation: PCI Express Slot 3
Type: 64-bit PCI Express
Current Usage: Available
Length: Short
Characteristics:
5.0 V is provided
3.3 V is provided
PME signal is supp

Re: [PATCH 0/4, v3] Physical PCI slot objects

2007-11-20 Thread Gary Hade
On Tue, Nov 20, 2007 at 02:04:02AM +, Matthew Garrett wrote:
> On Mon, Nov 19, 2007 at 03:32:25PM -0800, Gary Hade wrote:
> 
> > Alex, What I was trying to suggest is a boot-time kernel option, 
> > not a kernel configuration option.  The basic idea is to give
> > the user (with a single binary kernel) the ability to include
> > your ACPI-PCI slot driver feature changes only when they are
> > really needed.  In addition to reducing the number of
> > system/PCI hotplug driver combinations where your changes
> > would need to be validated, I believe would also help 
> > alleviate other worries (e.g. Andi Kleen's memory consumption
> > concern).  I believe this goal could also be achieved with the
> > kernel config option by making the pci_slot module runtime
> > loadable with the PCI hotplug drivers only visiting your new
> > code when the pci_slot driver is loaded, although I think this
> > would be more difficult to implement.
> 
> If we're compiling something into the kernel, the default behaviour 
> should be for the functionality to be turned on unless the user 
> overrides it.

It seems like others could have a problem with this but as
long as there is a way to exclude the functionality in the
event of problems without a kernel rebuild, "on" by default
would work for me.

Thanks,
Gary

-- 
Gary Hade
System x Enablement
IBM Linux Technology Center
503-578-4503  IBM T/L: 775-4503
[EMAIL PROTECTED]
http://www.ibm.com/linux/ltc

-
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RFC] [PATCH]:Obtain FSB ratio from model string

2007-11-20 Thread Len Brown
On Friday 26 October 2007 01:43, Zhao Yakui wrote:
> Hi, all
> According to the document of 253369(intel), the ratio is
> undefined in MSR_FBC_REGSITER_ID. The following calculation is
> inappropriate.
> if (c->x86_model < 2)
> mult = msr_lo >> 27;
> 
> There are two ways to fix this problem.
> a. use the following patch. the ratio is obtained from model string.
> b. revert the commit until the proper patch is available.
> 
> http://git.kernel.org/?p=linux/kernel/git/torvalds/old-2.6-bkcvs.git;a=commit;h=3e4159ab35c88aef5e063ba78796b277b762a30a

Okay, I've reverted that patch -- so model 0&1 are back to where they were in 
2005
and random MHz is replaced by other random MHz.

> 
> Subject: ACPI :Obtain FSB ratio from model string when model is less than 2
> >From : Zhao Yakui <[EMAIL PROTECTED]>
> 
> The ratio is undefined in the register of MSR_FBC_REGSITER_ID 
> when the model for P4 is less than 2. The following calculation is 
> inappropriate.
> if (c->x86_model < 2)
>   mult = msr_lo >> 27;
> In order to support the speedstep , the FSb ratio can be obtained from 
> the model_id string. 
> For example:
> The ratio is 13 for model string:"Intel(R) Pentium(R) 4 CPU 1300MHz"
> 
> http://bugzilla.kernel.org/show_bug.cgi?id=7186
> 
> Signed-off-by: Zhao Yakui <[EMAIL PROTECTED]>
> ---
>  arch/i386/kernel/cpu/cpufreq/speedstep-lib.c |   40 
> +--
>  1 file changed, 38 insertions(+), 2 deletions(-)
> 
> Index: linux-2.6.23-rc9/arch/i386/kernel/cpu/cpufreq/speedstep-lib.c
> ===
> --- linux-2.6.23-rc9.orig/arch/i386/kernel/cpu/cpufreq/speedstep-lib.c
> +++ linux-2.6.23-rc9/arch/i386/kernel/cpu/cpufreq/speedstep-lib.c
> @@ -17,6 +17,7 @@
>  
>  #include 
>  #include "speedstep-lib.h"
> +#include 
>  
>  #define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, 
> "speedstep-lib", msg)
>  
> @@ -151,7 +152,40 @@ static unsigned int pentium_core_get_fre
>  
>   return (msr_tmp * fsb);
>  }
> -
> +/* When Model_id is less than 2, the FSB ratio is
> +obtained from the string of model_id */
> +static unsigned int p4_01_get_fsb_ratio(void)
> +{
> + struct cpuinfo_x86 *c = &boot_cpu_data;
> + unsigned int fsb_m;
> + char model_id[64];
> + unsigned int  freq_mhz;
> + unsigned int max_ratio;
> + char *ptr;
> + int i = 0;
> +
> + ptr = model_id;
> + strncpy(ptr, c->x86_model_id, strlen(c->x86_model_id));
> + for (i = 0; i < strlen(model_id); i++)
> + model_id[i] = tolower(model_id[i]);
> + if (strstr(model_id, "mhz"))
> + fsb_m = 100;
> + else
> + fsb_m = 0;
> + if (!fsb_m) {
> + printk(KERN_DEBUG "CPU doesn't support speedstep\n");
> + return 0;
> + }
> + ptr = strstr(model_id, "hz");
> + if (ptr)
> + *ptr = '\0';
> + freq_mhz = 0;
> + ptr = strrchr(model_id, ' ');
> + if (ptr)
> + sscanf(ptr, "%d", &freq_mhz);
> + max_ratio = freq_mhz / fsb_m;
> + return max_ratio;
> +}
>  
>  static unsigned int pentium4_get_frequency(void)
>  {
> @@ -189,8 +223,10 @@ static unsigned int pentium4_get_frequen
>   printk(KERN_DEBUG "speedstep-lib: couldn't detect FSB speed. 
> Please send an e-mail to <[EMAIL PROTECTED]>\n");
>  
>   /* Multiplier. */
> + /* if Model is less than 2 , the ratio is obtained from the
> +  * string of model_id */
>   if (c->x86_model < 2)
> - mult = msr_lo >> 27;
> + mult = p4_01_get_fsb_ratio();
>   else
>   mult = msr_lo >> 24;
>  

I'm not excited about adding code to parse the model string,
particularly when the justification is an early P4 model that
doesn't even support P-states.

I'd prefer to see p4-clockmod deleted from the kernel.

-Len

-
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


ACPI: disable stray GPE, prevent ACPI interrupt storm

2007-11-20 Thread Len Brown
Bob,
Rui's Linux patch below modifies an ACPICA file.

thanks,
-Len

commit a7f9b1f24974da287771e2d70b30d9ca7bd66684
Author: Zhang Rui <[EMAIL PROTECTED]>
Date:   Tue Nov 20 13:38:59 2007 -0500

ACPI: disable stray GPE, prevent ACPI interrupt storm

GPEs are disabled depending on their type --
WAKE, WAKE_RUN, and RUNTIME.  An error is returned
if we are asked to disable a GPE that has no type.

But at least one system exists that enables a GPE from AML
that is not the EC GPE, and has no _Lxx/_Exx AML handler,
and is thus never initialized.

In this case, when an external CRT is plugged in,
the GPE fires, we attempt to disable the GPE,
but instead just return an error.
So the GPE stays asserted and an ACPI interrupt storm follows.

The fix is to disable a firing GPE,
even if it comes from outer space.

http://bugzilla.kernel.org/show_bug.cgi?id=6217

Signed-off-by: Zhang Rui <[EMAIL PROTECTED]>
Acked-by: Alexey Starikovskiy <[EMAIL PROTECTED]>
Signed-off-by: Len Brown <[EMAIL PROTECTED]>

diff --git a/drivers/acpi/events/evgpe.c b/drivers/acpi/events/evgpe.c
index e22f4a9..056b788 100644
--- a/drivers/acpi/events/evgpe.c
+++ b/drivers/acpi/events/evgpe.c
@@ -270,18 +270,18 @@ acpi_status acpi_ev_disable_gpe(struct 
acpi_gpe_event_info *gpe_event_info)
case ACPI_GPE_TYPE_WAKE_RUN:
ACPI_CLEAR_BIT(gpe_event_info->flags, ACPI_GPE_WAKE_ENABLED);
 
-   /*lint -fallthrough */
+   /* fallthrough */
 
case ACPI_GPE_TYPE_RUNTIME:
 
/* Disable the requested runtime GPE */
 
ACPI_CLEAR_BIT(gpe_event_info->flags, ACPI_GPE_RUN_ENABLED);
-   status = acpi_hw_write_gpe_enable_reg(gpe_event_info);
-   break;
+
+   /* fallthrough */
 
default:
-   return_ACPI_STATUS(AE_BAD_PARAMETER);
+   acpi_hw_write_gpe_enable_reg(gpe_event_info);
}
 
return_ACPI_STATUS(AE_OK);
-
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GIT PATCH] ACPI patches for 2.6.24-rc3

2007-11-20 Thread Len Brown
Hi Linus,

please pull from:

git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6.git release

This request is larger than I'd prefer at -rc3,
but as I wasn't available for an -rc2 merge, some things waited until now.
The good news is that the larger text changes are low risk.

The EC changes are tweaks to the -rc0 update --
as we've learned about new and creative ways that vendors
can make their EC's violate spec...  Thanks to Alexey for
being extremely responsive in debugging these...

Fixed a popular battery oops regression.

Fixed a boot hang on some unusual AMD boxes seen with the new CPU_IDLE.

Fixed a long-standing IRQ8 issue that some OEMs
and Linux distros are eagerly awaiting.

Fixed the processor throttling extensions that we first
started supporting in 2.6.23.  The reality is that it took
until now to properly test the code, as only very new platforms
have it.

And a couple of small cleanups -- the larger ones are waiting for 2.6.25.

thanks!

-Len

ps. individual patches are available on linux-acpi@vger.kernel.org
and a consolidated plain patch is available here:
ftp://ftp.kernel.org/pub/linux/kernel/people/lenb/acpi/patches/release/2.6.24/acpi-release-20070126-2.6.24-rc3.diff.gz

 Documentation/thinkpad-acpi.txt |   73 +++---
 arch/x86/kernel/acpi/processor.c|3 
 arch/x86/kernel/acpi/sleep_64.c |3 
 arch/x86/kernel/io_apic_32.c|   21 +
 arch/x86/kernel/io_apic_64.c|   24 +-
 arch/x86/pci/acpi.c |2 
 drivers/acpi/Kconfig|   18 +
 drivers/acpi/Makefile   |2 
 drivers/acpi/ac.c   |   20 -
 drivers/acpi/battery.c  |   22 +
 drivers/acpi/ec.c   |   43 ++-
 drivers/acpi/osl.c  |   25 --
 drivers/acpi/processor_core.c   |   14 -
 drivers/acpi/processor_idle.c   |  111 +
 drivers/acpi/processor_throttling.c |  286 ++--
 drivers/acpi/sbs.c  |   43 ++-
 drivers/acpi/tables/tbutils.c   |2 
 drivers/acpi/video.c|  155 ++---
 drivers/misc/thinkpad_acpi.c|  231 ++-
 drivers/misc/thinkpad_acpi.h|4 
 drivers/pnp/pnpacpi/rsparser.c  |   24 +-
 include/acpi/processor.h|1 
 include/linux/acpi.h|5 
 include/linux/cpuidle.h |1 
 24 files changed, 769 insertions(+), 364 deletions(-)

through these commits:

Adrian Bunk (2):
  x86_64: remove acpi_pci_link_exit()
  x86: acpi_pciprobe_dmi_table[] must be __devinitdata

Alexey Starikovskiy (3):
  ACPI: EC: Workaround for optimized controllers
  ACPI: Split out control for /proc/acpi entries from battery, ac, and sbs.
  ACPI: EC: Don't init EC early if it has no _INI

Danny Baumann (1):
  ACPI: Video: Increase buffer size for writes to brightness proc file.

Dmitry Torokhov (4):
  ACPI: video - fit input device into sysfs tree
  ACPI: video - add missing input_free_device()
  ACPI: video - remove unsafe uses of list_for_each_safe()
  ACPI: video - convert semaphore to a mutex

Henrique de Moraes Holschuh (8):
  ACPI: thinkpad-acpi: revert keymap changes
  ACPI: thinkpad-acpi: support 16 levels of brightness (v3)
  ACPI: thinkpad-acpi: add brightness_force parameter
  ACPI: thinkpad-acpi: prefer standard ACPI backlight level control
  ACPI: thinkpad-acpi: bump up version to 0.17
  ACPI: thinkpad-acpi: allow for syscall restart in sysfs handlers
  ACPI: thinkpad-acpi: fix brightness_set error paths
  ACPI: thinkpad-acpi: fix oops when a module parameter has no value

Jeff Garzik (1):
  ACPI: SBS: Fix retval warning

Joe Perches (1):
  ACPI: Add missing spaces to printk format

Len Brown (4):
  ACPI: video - delete stray run-time printk
  Revert "ACPI: add documentation for deprecated /proc/acpi/battery in 
ACPI_PROCFS"
  Revert "acpi: make ACPI_PROCFS default to y"
  Revert "Fix very high interrupt rate for IRQ8 (rtc) unless pnpacpi=off"

Roland Dreier (1):
  ACPI: Always return valid 'status' from acpi_battery_get_property()

Shaohua Li (1):
  ACPI: fix two IRQ8 issues in IOAPIC mode

Venkatesh Pallipadi (3):
  cpuidle: fix C3 for no bus-master control case
  cpuidle: add sched_clock_idle_[sleep|wakeup]_event() hooks
  cpuidle: fix HP nx6125 regression

Zhao Yakui (7):
  ACPI: Enforce T-state limit changes immediately
  ACPI: Handle I/O access width requestst that are not a multiple of 8 bits.
  ACPI: If _TSS exists, do not access FADT.duty_width
  ACPI: throttle: Change internal APIs better handle _PTC
  ACPI: Use _TSS for throttling control, when present. Add error checks.
  ACPI: Get throttling info from BIOS only after evaluating _PDC
  ACPI: Enable MSR (FixedHW) support for T-States

with this log:

commit e6532b8883760bdf9d251c669a3919fc9457aeca
Merge: d89a9bd... 4fdb2a0...
Author: Len Brown

Re: Subject: ACPI: Check whether XSDT exists before dump ACPI tables

2007-11-20 Thread Len Brown
This patch is included in the latest release:

http://ftp.kernel.org/pub/linux/kernel/people/lenb/acpi/utils/pmtools-20071116.tar.gz

thanks,
-Len

On Tuesday 20 November 2007 03:33, Zhao Yakui wrote:
> Subject: ACPI: Check whether XSDT exists before dump ACPI tables
> From: Zhao Yakui <[EMAIL PROTECTED]>
> 
> The acpidump tool of 20070714 version has some problems on some
> machines.First it will first search XSDT table to
> dump ACPI tables. If XSDT exists it will continue search RSDT and
> only dump ACPI info that doesn't be dumped through XSDT.
> But if XSDT doesn't exist it will report that ACPI tables
> can't be found and exit.
> 
> So it is necessary to first check whether XSDT table exists.
> If XSDT exists(Not check the integrity of XSDT), it will be used to dump
> ACPI tables. Otherwise RSDT table will be used.
> 
> 
> Signed-off-by: Zhao Yakui  <[EMAIL PROTECTED]>
> ---
>  acpidump/acpidump.c |7 +--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> Index: pmtools-20070714/acpidump/acpidump.c
> ===
> --- pmtools-20070714.orig/acpidump/acpidump.c
> +++ pmtools-20070714/acpidump/acpidump.c
> @@ -521,8 +521,11 @@ int main(int argc, char **argv)
>   if (connect) {
>   lseek(fd, sizeof(struct acpi_rsdp_descriptor), SEEK_SET);
>   }
> - if (!acpi_dump_XSDT(fd, &rsdpx))
> - goto not_found;
> + if (rsdpx.revision > 1 && rsdpx.xsdt_physical_address) {
> + /* ACPIDUMP uses xsdt table */
> + if (!acpi_dump_XSDT(fd, &rsdpx))
> + goto not_found;
> + }
>   if (!acpi_dump_RSDT(fd, &rsdpx))
>   goto not_found;
>   if (connect) {
> 
-
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/2] ACPI: WMI: Add sysfs userspace interface

2007-11-20 Thread Carlos Corbacho
There is a userspace interface in /sys/firmware/acpi/wmi for WMI methods
and data.

/sys/firmware/acpi/wmi/
|
|-> /
  |-> type (method, data, event)

Method & data blocks
  |-> /
|-> data (binary data file - write input data to file, read file
  to execute method or retrieve data).

Method only
|-> method_id (write value of method id to execute)

Events - passed to userspace via netlink. However, the extra WMI data
associated with an event is exposed through sysfs.

  |-> notification (ACPI event value)
  |-> data (binary data file - WMI data associated with the event)

===
ChangeLog
==

v1 (2007-11-03)

* Initial release

v2 (2007-11-07)

* Split out into a separate patch

v3 (2007-11-20)

* Convert kobject storage to using kernel list structures.
* Change instance handling - store input data on a per instance basis,
  rather than a per GUID.
* Add locking to methods - method_id (write) and data (read & write)
  should all be mutually exclusive - we do not want the input data to
  change when we are trying to execute a method.
* Change method calling semantics: when input is written to 'data',
  store it, but don't execute the method until 'data' is read. This is
  due to the fact that it is perfectly acceptable to have a WMI method
  that does not take any input (and it is easier to trigger an execute
  on reading the file, and not return anything if there is nothing to
  return, rather than trying to write values that aren't required, or
  may cause ACPI evaluation to fail on the method).
* Do not try and convert String's from ASCII to Unicode - instead, only
  handle ASCII (as per ACPI), and leave it up to userspace to convert
  to/ from whatever encoding they wish to use.

Signed-off-by: Carlos Corbacho <[EMAIL PROTECTED]>
---
 drivers/acpi/wmi.c |  380 +++-
 1 files changed, 379 insertions(+), 1 deletions(-)

diff --git a/drivers/acpi/wmi.c b/drivers/acpi/wmi.c
index 93b9799..0bdb8ec 100644
--- a/drivers/acpi/wmi.c
+++ b/drivers/acpi/wmi.c
@@ -60,15 +60,31 @@ struct guid_block
u8 flags;
 };
 
+struct wmi_instance
+{
+   struct kobject kobj;
+   u32 method_id;
+   void *pointer;
+   acpi_size length;
+};
+
 struct wmi_block
 {
struct list_head list;
struct guid_block gblock;
acpi_handle handle;
+   struct kobject kobj;
+   struct wmi_instance *instances;
 };
 
 static struct wmi_block wmi_blocks;
 
+/*
+ * Temporary list - hold contents of each WMI device for sysfs initialisation,
+ * before adding to wmi_blocks
+ */
+static struct wmi_block wmi_block_sysfs;
+
 static wmi_notify_handler wmi_external_handler;
 static void *wmi_external_data;
 
@@ -198,6 +214,33 @@ static bool wmi_parse_guid(const u8 *src, u8 *dest)
return true;
 }
 
+/*
+ * Convert a raw GUID to the ACII string representation
+ */
+static int wmi_gtoa(const char *in, char *out)
+{
+   int i;
+
+   for (i = 3; i >= 0; i--)
+   out += sprintf(out, "%02X", in[i] & 0xFF);
+
+   out += sprintf(out, "-");
+   out += sprintf(out, "%02X", in[5] & 0xFF);
+   out += sprintf(out, "%02X", in[4] & 0xFF);
+   out += sprintf(out, "-");
+   out += sprintf(out, "%02X", in[7] & 0xFF);
+   out += sprintf(out, "%02X", in[6] & 0xFF);
+   out += sprintf(out, "-");
+   out += sprintf(out, "%02X", in[8] & 0xFF);
+   out += sprintf(out, "%02X", in[9] & 0xFF);
+   out += sprintf(out, "-");
+
+   for (i = 10; i <= 15; i++)
+   out += sprintf(out, "%02X", in[i] & 0xFF);
+
+   return 0;
+}
+
 static bool find_guid(const char *guid_string, struct wmi_block **out)
 {
char tmp[16], guid_input[16];
@@ -500,6 +543,323 @@ bool wmi_has_guid(const char *guid_string)
 }
 EXPORT_SYMBOL_GPL(wmi_has_guid);
 
+/*
+ * sysfs interface
+ */
+struct wmi_attribute {
+   struct attributeattr;
+   ssize_t (*show)(struct kobject *kobj, char *buf);
+   ssize_t (*store)(struct kobject *kobj, const char *buf, ssize_t count);
+};
+
+#define WMI_ATTR(_name, _mode, _show, _store) \
+struct wmi_attribute wmi_attr_##_name = __ATTR(_name, _mode, _show, _store);
+
+#define to_attr(a) container_of(a, struct wmi_attribute, attr)
+
+static ssize_t show(struct kobject *kobj, struct attribute *attr, char *buf)
+{
+   struct wmi_attribute *wmi_attr = to_attr(attr);
+   ssize_t ret = 0;
+
+   if (wmi_attr->show)
+   ret = wmi_attr->show(kobj, buf);
+   return ret;
+}
+
+static ssize_t store(struct kobject *kobj, struct attribute *attr, const
+   char *buf, size_t count)
+{
+   struct wmi_attribute *wmi_attr = to_attr(attr);
+   ssize_t ret = 0;
+
+   if (wmi_attr->store)
+   ret = wmi_attr->store(kobj, buf, count);
+   return ret;
+}
+
+static struct sysfs_ops wmi_sysfs_ops = {
+   .show   = show,
+   .store  = store,
+};
+
+static struct kobj_type ktype_wmi = {
+   .sysfs_ops  = &wmi_sysfs_

[PATCH 1/2] ACPI: WMI: Add WMI-ACPI mapper driver

2007-11-20 Thread Carlos Corbacho
The following is an implementation of the Windows Management
Instrumentation (WMI) ACPI interface mapper (PNP0C14).

What it does:

Parses the _WDG method and exports functions to process WMI method calls,
data block query/ set commands (both based on GUID) and does basic event
handling.

How: WMI presents two interfaces, an in kernel API and a userspace
sysfs API.

Kernel: (essentially, a minimal wrapper around ACPI)

(const char *guid assume the 36 character ASCII representation of
a GUID - e.g. 67C3371D-95A3-4C37-BB61-DD47B491DAAB)

wmi_evaluate_method(const char *guid, u8 instance, u32 method_id,
const struct acpi_buffer *in, struct acpi_buffer *out)

wmi_query_block(const char *guid, u8 instance,
struct acpi_buffer *out)

wmi_set_block(const char *guid, u38 instance,
const struct acpi_buffer *in)

wmi_install_notify_handler(acpi_notify_handler handler);

wmi_remove_notify_handler(void);

wmi_get_event_data(u32 event, struct acpi_buffer *out)

wmi_has_guid(const char guid*)

wmi_has_guid() is a helper function to find if a GUID exists or not on the
system (a quick and easy way for WMI dependant drivers to see if the
the method/ block they want exists, since GUIDs are supposed to be unique).

Event handling - allow a WMI based driver to register a notifier handler
with WMI. When a notification is sent to WMI, the handler registered with
WMI is then called (it is left to the caller to ask for the WMI event data,
if needed).

What it won't do:

Unicode - The MS article[1] calls for converting between ASCII and Unicode (or
vice versa) if a GUID is marked as "string". This is left up to the calling
driver.

Handle a MOF[1] - the WMI mapper just exports methods, data and events to
userspace. MOF handling is down to userspace.

[1] http://www.microsoft.com/whdc/system/pnppwr/wmi/wmi-acpi.mspx

===
ChangeLog
==

v1 (2007-10-02):

* Initial release

v2 (2007-10-05):

* Cleaned up code - split up super "wmi_evaluate_block" -> each external
  symbol now handles its own ACPI calls, rather than handing off to
  a "super" method (and in turn, is a lot simpler to read)
* Added a find_guid() symbol - return true if a given GUID exists on
  the system
* wmi_* functions now return type acpi_status (since they are just
  fancy wrappers around acpi_evaluate_object())
* Removed extra debug code

v3 (2007-10-27)

* More code clean up - now passes checkpatch.pl
* Change data block calls - ref MS spec, method ID is not required for
  them, so drop it from the function parameters.
* Const'ify guid in the function call parameters.
* Fix _WDG buffer handling - copy the data to our own private structure.
* Change WMI from tristate to bool - otherwise the external functions are
  not exported in linux/acpi.h if you try to build WMI as a module.
* Fix more flag comparisons.
* Add a maintainers entry - since I wrote this, I should take the blame
  for it.

v4 (2007-10-30)

* Add missing brace from after fixing checkpatch errors.
* Rewrote event handling - allow external drivers to register with WMI to
  handle WMI events
* Clean up flags and sanitise flag handling

v5 (2007-11-03)

* Add sysfs interface for userspace. Export events over netlink again.
* Remove module left overs, fully convert to built-in driver.
* Tweak in-kernel API to use u8 for instance, since this is what the GUID
  blocks use (so instance cannot be greater than u8).
* Export wmi_get_event_data() for in kernel WMI drivers.

v6 (2007-11-07)

* Split out userspace into a different patch

v7 (2007-11-20)

* Fix driver to handle multiple PNP0C14 devices - store all GUIDs using
  the kernel's built in list functions, and just keep adding to the list
  every time we handle a PNP0C14 devices - GUIDs will always be unique,
  and WMI callers do not know or care about different devices.
* Change WMI event handler registration to use its' own event handling
  struct; we should not pass an acpi_handle down to any WMI based drivers
  - they should be able to function with only the calls provided in WMI.
* Update my e-mail address

Signed-off-by: Carlos Corbacho <[EMAIL PROTECTED]>
---
 MAINTAINERS   |7 +
 drivers/acpi/Kconfig  |   11 +
 drivers/acpi/Makefile |1 +
 drivers/acpi/wmi.c|  614 +
 include/linux/acpi.h  |   20 ++
 5 files changed, 653 insertions(+), 0 deletions(-)
 create mode 100644 drivers/acpi/wmi.c

diff --git a/MAINTAINERS b/MAINTAINERS
index cad0882..3894da0 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -261,6 +261,13 @@ L: linux-acpi@vger.kernel.org
 W: http://acpi.sourceforge.net/
 S: Supported
 
+ACPI WMI DRIVER
+P:  Carlos Corbacho
+M:  [EMAIL PROTECTED]
+L:  linux-acpi@vger.kernel.org
+W:  http://www.lesswatts.org/projects/acpi/
+S:  Supported
+
 ADM1025 HARDWARE MONITOR DRIVER
 P: Jean Delvare
 M: [EMAIL PROTECTED]
diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig
index b9f923e..0451e22 100644
--- a/drivers/acpi/Kconfig
+++ b/drivers/acpi/Kconf

[PATCH 0/2 v7] ACPI: WMI: Patches

2007-11-20 Thread Carlos Corbacho
Here comes the next version of WMI.

Patch 1 (Add driver and in kernel interface):

IMNSHO, this patch is ready for testing . Ideally, I'd like to see it go up 
to -mm and start crash^working on other systems.

(Of course, outside review is always appreciated - reviewing my own patches is 
getting a tad boring).

(As a mild aside - the driver is currently available on all ACPI enabled 
architectures. However, if there are no ia64 systems with WMI ACPI devices, 
then we could later limit the driver to just x86).

Patch 2 (Add sysfs userspace interface):

This patch is the one that really needs another pair of eyes looking over it. 
It _works_, but I'm not sure if it's the best way to expose WMI ACPI to 
userspace.

In particular, I'm not sure now about creating kobjects for all the instances 
of each GUID, then having separate variables and data pointers for each 
instance; the alternative would be to add more sysfs files under each GUID 
kobject to handle the instance to call, in a similar way to how method_id is 
specified to methods. However, that starts making data queries/ writes more 
complicated, let alone method calls.

-Carlos
-- 
E-Mail: [EMAIL PROTECTED]
Web: strangeworlds.co.uk
GPG Key ID: 0x23EE722D
-
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


stgit (was Re: [PATCH 4/4, v4] ACPI, PCI: ACPI PCI slot detection driver)

2007-11-20 Thread Henrique de Moraes Holschuh
On Mon, 19 Nov 2007, Alex Chiang wrote:
> Ugh, seems that stacked git got very confused when I did a
> git-fetch && git-rebase origin. Also, guess it figures that I

Being a very heavy stgit user myself, I have to say you must give up git
rebase on any stgit branch, and use stg rebase instead... otherwise, bad
things can, and do happen.

Also, don't trust the stgit release schedule, it is "release eventually" and
not something more sensible, like "release often".  Instead, track the stgit
git tree.

I wish git learned to do the basic stgit's business by itself :(

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh
-
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH -v2] ACPI: disable the gpe that doesn't have a GPE handler correctly

2007-11-20 Thread Zhang Rui
From: Zhang Rui <[EMAIL PROTECTED]>

The current code only disable the GPE by judging the
GPE type, which is one of WAKE, RUNTIME and WAKE_RUN.
In bug 6217, GPE 17 is enabled by the AML code ...
And it will be triggerred when an extra CRT is connected.
As GPE 17 is not ec gpe, and there is no _Lxx/_Exx method
exists in the _GPE scope, the type flag of GPE 17 is none
of the three GPE types.
In this case, the GPE is not disabled correctly.

http://bugzilla.kernel..org/show_bug.cgi?id=6217

Signed-off-by: Zhang Rui <[EMAIL PROTECTED]>
---
 drivers/acpi/events/evgpe.c |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Index: linux-2.6/drivers/acpi/events/evgpe.c
===
--- linux-2.6.orig/drivers/acpi/events/evgpe.c
+++ linux-2.6/drivers/acpi/events/evgpe.c
@@ -277,11 +277,11 @@ acpi_status acpi_ev_disable_gpe(struct a
/* Disable the requested runtime GPE */
 
ACPI_CLEAR_BIT(gpe_event_info->flags, ACPI_GPE_RUN_ENABLED);
-   status = acpi_hw_write_gpe_enable_reg(gpe_event_info);
-   break;
+
+   /*lint -fallthrough */
 
default:
-   return_ACPI_STATUS(AE_BAD_PARAMETER);
+   acpi_hw_write_gpe_enable_reg(gpe_event_info);
}
 
return_ACPI_STATUS(AE_OK);
-
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] ACPI: disable the gpe that doesn't have a GPE handler correctly

2007-11-20 Thread Alexey Starikovskiy

Zhang Rui wrote:

On Mon, 2007-11-19 at 15:32 +0800, Zhang Rui wrote:
  

From: Zhang Rui <[EMAIL PROTECTED]>

The current code only disable the GPE by judging the
GPE type, which is one of WAKE, RUNTIME and WAKE_RUN.
In bug 6217, GPE 17 is enabled by the AML code ...
And it will be triggerred when an extra CRT is connected.
As GPE 17 is not ec gpe, and there is no _Lxx/_Exx method
exists in the _GPE scope, the type flag of GPE 17 is cleared
at the boot time and it's none of the three GPE types.
In this case, the GPE is not disabled correctly.

http://bugzilla.kernel.org/show_bug.cgi?id=6217



Hi, Alexey,
Any comments on this patch? :)

  

See below. Idea itself seem to be right.

Thanks,
Rui
  

Signed-off-by: Zhang Rui <[EMAIL PROTECTED]>
---
 drivers/acpi/events/evgpe.c |5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Index: linux-2.6/drivers/acpi/events/evgpe.c
===
--- linux-2.6.orig/drivers/acpi/events/evgpe.c
+++ linux-2.6/drivers/acpi/events/evgpe.c
@@ -277,11 +277,10 @@ acpi_status acpi_ev_disable_gpe(struct a
/* Disable the requested runtime GPE */
 
 		ACPI_CLEAR_BIT(gpe_event_info->flags, ACPI_GPE_RUN_ENABLED);

-   status = acpi_hw_write_gpe_enable_reg(gpe_event_info);
-   break;


put /* lint -fallthrough */ here, same as above.
 
 	default:

-   return_ACPI_STATUS(AE_BAD_PARAMETER);
+   acpi_hw_write_gpe_enable_reg(gpe_event_info);
+   break;


don't need this break...

}
 
 	return_ACPI_STATUS(AE_OK);


Regards,
Alex.
-
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Subject: ACPI: Check whether XSDT exists before dump ACPI tables

2007-11-20 Thread Zhao Yakui
Subject: ACPI: Check whether XSDT exists before dump ACPI tables
From: Zhao Yakui <[EMAIL PROTECTED]>

The acpidump tool of 20070714 version has some problems on some
machines.First it will first search XSDT table to
dump ACPI tables. If XSDT exists it will continue search RSDT and
only dump ACPI info that doesn't be dumped through XSDT.
But if XSDT doesn't exist it will report that ACPI tables
can't be found and exit.

So it is necessary to first check whether XSDT table exists.
If XSDT exists(Not check the integrity of XSDT), it will be used to dump
ACPI tables. Otherwise RSDT table will be used.


Signed-off-by: Zhao Yakui  <[EMAIL PROTECTED]>
---
 acpidump/acpidump.c |7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

Index: pmtools-20070714/acpidump/acpidump.c
===
--- pmtools-20070714.orig/acpidump/acpidump.c
+++ pmtools-20070714/acpidump/acpidump.c
@@ -521,8 +521,11 @@ int main(int argc, char **argv)
if (connect) {
lseek(fd, sizeof(struct acpi_rsdp_descriptor), SEEK_SET);
}
-   if (!acpi_dump_XSDT(fd, &rsdpx))
-   goto not_found;
+   if (rsdpx.revision > 1 && rsdpx.xsdt_physical_address) {
+   /* ACPIDUMP uses xsdt table */
+   if (!acpi_dump_XSDT(fd, &rsdpx))
+   goto not_found;
+   }
if (!acpi_dump_RSDT(fd, &rsdpx))
goto not_found;
if (connect) {
-
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html