mkottman / acpi_call

A linux kernel module that enables calls to ACPI methods through /proc/acpi/call. Now with support for Integer, String and Buffer parameters.
309 stars 130 forks source link

ACPI call output string terminates with the suffix 'lled' that comes from the string 'not called' #43

Open FabriceSalvaire opened 10 years ago

FabriceSalvaire commented 10 years ago

How to reproduce:

First add debug in acpi_proc_read:

static ssize_t acpi_proc_read( struct file *filp, char __user *buff,
            size_t count, loff_t *off )
{
    ssize_t ret;
    int len = strlen(result_buffer);

#ifdef DEBUG
    printk(KERN_INFO "acpi_call_read: length %u, '%s'\n", len, result_buffer);
#endif
...

Run:

echo '_SB.PCI0.LPC.EC.HKEY.BCTG 0x1' > /proc/acpi/call ; cat /proc/acpi/call 0x327lled

should return 0x327

dmsg return: [86483.844220] acpi_call: Calling _SB.PCI0.LPC.EC.HKEY.BCTG [86483.844768] acpi_call: Call successful: 0x327 [86483.848402] acpi_call_read: length 5, '0x327' [86483.848439] acpi_call_read: length 10, 'not called' [86483.848455] acpi_call_read: length 10, 'not called'

It shows acpi_proc_read is called 3 times.

How to fix: comment line in acpi_proc_read: strcpy(result_buffer, "not called");

I don't understand what happen.

nuklea commented 10 years ago

Approve. Hame same problem.