Coder Social home page Coder Social logo

acpi_call's Introduction

A kernel simple module that enables you to call ACPI methods by writing the method name followed by arguments to /proc/acpi/call.

This module is to be considered a proof-of-concept and has been superseeded by projects like bbswitch. It allows you to tamper with your system and should be used with caution.

Want to use acpi_call via graphic interface? Click here

Usage:

echo '<call>' | sudo tee /proc/acpi/call

You can then retrieve the result of the call by checking your dmesg or:

sudo cat /proc/acpi/call

An example to turn off discrete graphics card in a dual graphics environment (like NVIDIA Optimus):

# turn off discrete graphics card
echo '\_SB.PCI0.PEG1.GFX0.DOFF' > /proc/acpi/call
# turn it back on
echo '\_SB.PCI0.PEG1.GFX0.DON' > /proc/acpi/call

These work on my ASUS K52J notebook, but may not work for you. For a list of methods to try, see http://linux-hybrid-graphics.blogspot.com/ or try running the provided script examples/turn_off_gpu.sh

It SHOULD be ok to test all of the methods, until you see a drop in battery drain rate (grep rate /proc/acpi/battery/BAT0/state), however it comes with NO WARRANTY - it may hang your computer/laptop, fail to work, etc.

You can pass parameters to acpi_call by writing them after the method, separated by single space. Currently, you can pass the following parameter types:

  • ACPI_INTEGER - by writing NNN or 0xNNN, where NNN is an integer/hex
  • ACPI_STRING - by enclosing the string in quotes: "hello, world"
  • ACPI_BUFFER - by writing bXXXX, where XXXX is a hex string without spaces, or by writing { b1, b2, b3, b4 }, where b1-4 are integers

The status after a call can be read back from /proc/acpi/call:

  • 'not called' - nothing to report
  • 'Error: ' - the call failed
  • '0xNN' - the call succeeded, and returned an integer
  • '"..."' - the call succeeded, and returned a string
  • '{0xNN, ...}' - the call succeeded, and returned a buffer
  • '[...]' - the call succeeded, and returned a package which may contain the above types (integer, string and buffer) and other package types

Graphic interface

Found this too difficult? Try to use these programs provided by Marco Dalla Libera and do it via graphic interface:


Copyright (c) 2010: Michal Kottman

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

acpi_call's People

Contributors

archangegabriel avatar avilella avatar dimitry-ishenko avatar lekensteyn avatar marcodallas avatar mkottman avatar nowrep avatar peberlein avatar rzr avatar svolpe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

acpi_call's Issues

make KERN_INFO messages optional

Hi,

It would be nice if one could omit all messages with KERN_INFO severity during compilation.
Maybe with an optional -DNDEBUG or -DDEBUG compile flag?

Peter

Laptop turns off after wake-up from sleep mode

When I turn my Laptop into sleep mode (a.k.a suspend to ram), it turns off about 2 seconds after wake-up.

Hardware: HP G72 b20sg
Graphics: ATI Mobility Radeon HD 5470
Chipset: Mobile Intel HM55 Express

$ uname -a
Linux myhost 3.14.14-gentoo #3 SMP Sun Aug 31 16:08:56 CEST 2014 x86_64 Intel(R) Pentium(R) CPU P6100 @ 2.00GHz GenuineIntel GNU/Linux

Nevertheless: nice project, well done!

Unsafe use of fixed-size buffer

The static buffer result_buffer is declared to have size 256, but the unsafe functions sprintf() and strcpy() are used instead of snprintf() and strncpy(). For long results (such as on my Dell L702X when powering on the discrete graphics), this causes result_buffer to be overflowed, stomping on whatever kernel memory lies after it. On kernels after 2.6.38, this causes a BUG for me, but the fact that it works at all on earlier kernels is a fluke (and simply adding some debugging printks can make 2.6.38+ "work").

temporary_buffer might also be affected, but I haven't checked it.

At the very least, increase the 256 to something larger like 2048. Preferably, fix the code to handle this array correctly and avoid any overflows. (I might attempt a patch if I get time, for now I have simply increased the size so as to get things working for the time being on my system.)

It hangs up the computer in Ubuntu 11.10 beta1

After a couple of seconds (or maybe 1 or 2 mins) the computer freezes out and doesn't recover.
Just git pulled, ran make, then inserted the module and then did: sudo insmod acpi_call.ko

This is in an Alienware m11x-R2

$ lsb_release -rd
Description: Ubuntu oneiric (development branch)
Release: 11.10

$ uname -a
Linux tezcatlipoca 3.0.0-10-generic #16-Ubuntu SMP Fri Sep 2 18:32:04 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux

Build errors in Ubuntu 19.10

OS: Ubuntu 19.10
Kernel: 5.3.0-20-generic

$ make && sudo make install
make -C /lib/modules/5.3.0-20-generic/build M=/home/xxx/osmods/acpi_call modules
make[1]: Entering directory '/usr/src/linux-headers-5.3.0-20-generic'
  CC [M]  /home/xxx/osmods/acpi_call/acpi_call.o
In file included from ./include/acpi/platform/acenv.h:152,
                 from ./include/acpi/acpi.h:22,
                 from /home/xxx/osmods/acpi_call/acpi_call.c:9:
./include/acpi/platform/aclinux.h:18:2: error: #error "Please don't include <acpi/acpi.h> directly, include <linux/acpi.h> instead."
   18 | #error "Please don't include <acpi/acpi.h> directly, include <linux/acpi.h> instead."
      |  ^~~~~
/home/xxx/osmods/acpi_call/acpi_call.c: In function ‘acpi_proc_write’:
/home/xxx/osmods/acpi_call/acpi_call.c:277:9: error: implicit declaration of function ‘copy_from_user’; did you mean ‘raw_copy_from_user’? [-Werror=implicit-function-declaration]
  277 |     if (copy_from_user( input, buff, len )) {
      |         ^~~~~~~~~~~~~~
      |         raw_copy_from_user
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:290: /home/xxx/osmods/acpi_call/acpi_call.o] Error 1
make[1]: *** [Makefile:1655: _module_/home/xxx/osmods/acpi_call] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.3.0-20-generic'
make: *** [Makefile:8: default] Error 2

test_off.sh just sits there and does nothing

I cloned from git then

rick@Abigail:/acpi_call$ ls
acpi_call.c m11xr2.sh query_dsdt.pl test_off.sh
asus1215n.sh Makefile README windump_hack
rick@Abigail:
/acpi_call$ make
make -C /lib/modules/3.0.0-0300-generic/build M=/home/rick/acpi_call modules
make[1]: Entering directory /usr/src/linux-headers-3.0.0-0300-generic' CC [M] /home/rick/acpi_call/acpi_call.o Building modules, stage 2. MODPOST 1 modules CC /home/rick/acpi_call/acpi_call.mod.o LD [M] /home/rick/acpi_call/acpi_call.ko make[1]: Leaving directory/usr/src/linux-headers-3.0.0-0300-generic'
rick@Abigail:/acpi_call$ ls
acpi_call.c acpi_call.mod.o m11xr2.sh Module.symvers test_off.sh
acpi_call.ko acpi_call.o Makefile query_dsdt.pl windump_hack
acpi_call.mod.c asus1215n.sh modules.order README
rick@Abigail:
/acpi_call$ ./test_off.sh

This is sitting there for 10 mins now. The laptop is Acer 5742G with NV optimus and Geforce gt 540M

HP DV6Z AMD Fusion Llano Notebook, I found a code

I have a HP DV6Z notebook with AMD fusion A8-3530 processor with integrated ATI 6620 chipset and 6670 discrete graphics crossfired together.
I found this code with acpi_call to switch off discrete graphics or at least it lowers power consumption.
echo '_SB _.PCI0.VGA.PX02' > /proc/acpi/call

Have ATI proprietary drivers 11.8 running with igpu set as active, but power consumption was still high until I used this code
Cannot use command before loading "fglrx" module otherwise X.org won't start, don't know how it works with open source module
These commands do things too but I don't know what or if they are power states.
echo 'SB .PCI0.VGA.PX03' > /proc/acpi/call
echo 'SB .PCI0.VGA.PX04' > /proc/acpi/call (note no space after SB_ in real command for some reason this site wouldn't display _ without space in case you try to copy and paste)
Post if you find more efficient ways to use this command or other commands.

error: "radeon 0000:01:00.0: Userspace still has active objects !" using acpi_call on 3.12

I'm using acpi_call on a Fedora 20 too switch off my graphic card:
01:00.0 Display controller: Advanced Micro Devices, Inc. [AMD/ATI] Mars [Radeon HD 8730M](rev ff)
My laptop is a Samsung 7 ultra.

Using the 3.11 kernel acpi_call works fine, but as soon as I switch to a 3.12.x kernel the system become unusable after a few seconds after starting X.
I've compiled acpi_call with the debug prints, but the logs show it terminates correctly. However, a few seconds after switching off the radeon card, the system become very slow (it appear to be frozen).
The errors in the log file are the following:

Dec 22 17:46:38 localhost.localdomain kernel: [sched_delayed] sched: RT throttling activated
Dec 22 17:46:38 localhost.localdomain kernel: radeon 0000:01:00.0: Userspace still has active objects !
Dec 22 17:46:38 localhost.localdomain kernel: radeon 0000:01:00.0: ffff8801a34c4a60 ffff8801a34c4800 4096 4294967297 force free
Dec 22 17:46:38 localhost.localdomain kernel: radeon 0000:01:00.0: ffff8801a34c7660 ffff8801a34c7400 4096 4294967297 force free
Dec 22 17:46:38 localhost.localdomain kernel: radeon 0000:01:00.0: ffff8801a34c7a60 ffff8801a34c7800 4096 4294967297 force free
Dec 22 17:46:38 localhost.localdomain kernel: radeon 0000:01:00.0: ffff8801a34c5660 ffff8801a34c5400 4096 4294967297 force free
Dec 22 17:46:38 localhost.localdomain kernel: radeon 0000:01:00.0: ffff8801a34c6660 ffff8801a34c6400 4096 4294967297 force free
Dec 22 17:46:38 localhost.localdomain kernel: radeon 0000:01:00.0: ffff8801a34c5260 ffff8801a34c5000 16384 4294967297 force free
Dec 22 17:46:38 localhost.localdomain kernel: ------------[ cut here ]------------
Dec 22 17:46:38 localhost.localdomain kernel: WARNING: CPU: 0 PID: 162 at drivers/gpu/drm/radeon/radeon_gart.c:235 radeon_gart_unbind+0xca/0xe0 radeon
Dec 22 17:46:38 localhost.localdomain kernel: trying to unbind memory from uninitialized GART !
Dec 22 17:46:38 localhost.localdomain kernel: Modules linked in: fuse acpi_call(OF) nf_conntrack_netbios_ns nf_conntrack_broadcast ipt_MASQUERADE ip6t_REJECT xt_conntrack bnep bluetooth ebtable_nat ebtable_broute bridge stp llc ebtable_filter ebtables ip6table_nat nf_conntrack_ipv6 nf_defrag_ipv6 nf_nat_ipv6 ip6table_mangle ip6table_security ip6table_raw ip6table_filter ip6_tables iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat nf_conntrack iptable_mangle iptable_security iptable_raw snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_intel snd_hda_codec snd_hwdep snd_seq iTCO_wdt snd_seq_device iTCO_vendor_support x86_pkg_temp_thermal arc4 coretemp kvm_intel kvm iwldvm snd_pcm mac80211 crct10dif_pclmul uvcvideo crc32_pclmul crc32c_intel videobuf2_vmalloc videobuf2_memops videobuf2_core ghash_clmulni_intel microcode
Dec 22 17:46:38 localhost.localdomain kernel: joydev videodev samsung_laptop iwlwifi i2c_i801 media serio_raw cfg80211 snd_page_alloc snd_timer lpc_ich snd mfd_core rfkill r8169 mii mei_me soundcore mei wmi shpchp radeon i915 i2c_algo_bit ttm drm_kms_helper drm i2c_core video
Dec 22 17:46:38 localhost.localdomain kernel: CPU: 0 PID: 162 Comm: kworker/0:2 Tainted: GF O 3.12.5-302.fc20.x86_64 #1
Dec 22 17:46:38 localhost.localdomain kernel: Hardware name: SAMSUNG ELECTRONICS CO., LTD. 730U3E/740U3E/NP730U3E-S03IT, BIOS P06ABW.063.130905.dg 09/05/2013
Dec 22 17:46:38 localhost.localdomain kernel: Workqueue: kacpi_hotplug hotplug_event_work
Dec 22 17:46:38 localhost.localdomain kernel: 0000000000000009 ffff8801a352f970 ffffffff81662d11 ffff8801a352f9b8
Dec 22 17:46:38 localhost.localdomain kernel: ffff8801a352f9a8 ffffffff810691dd ffff8800c4c98000 ffff8801a34c13c0
Dec 22 17:46:38 localhost.localdomain kernel: ffff8801a34c5048 ffff8801a34c5078 ffff8800c4c98eb0 ffff8801a352fa08
Dec 22 17:46:38 localhost.localdomain kernel: Call Trace:
Dec 22 17:46:38 localhost.localdomain kernel: [] dump_stack+0x45/0x56
Dec 22 17:46:38 localhost.localdomain kernel: [] warn_slowpath_common+0x7d/0xa0
Dec 22 17:46:38 localhost.localdomain kernel: [] warn_slowpath_fmt+0x4c/0x50
Dec 22 17:46:38 localhost.localdomain kernel: [] radeon_gart_unbind+0xca/0xe0 [radeon]
Dec 22 17:46:38 localhost.localdomain kernel: [] radeon_ttm_backend_unbind+0x1a/0x20 [radeon]
Dec 22 17:46:38 localhost.localdomain kernel: [] ttm_tt_unbind+0x27/0x40 [ttm]
Dec 22 17:46:38 localhost.localdomain kernel: [] ttm_bo_cleanup_memtype_use+0x33/0x80 [ttm]
Dec 22 17:46:38 localhost.localdomain kernel: [] ttm_bo_release+0x1fc/0x230 [ttm]
Dec 22 17:46:38 localhost.localdomain kernel: [] ttm_bo_unref+0x29/0x30 [ttm]
Dec 22 17:46:38 localhost.localdomain kernel: [] radeon_bo_unref+0x42/0x70 [radeon]
Dec 22 17:46:38 localhost.localdomain kernel: [] radeon_gem_object_free+0x3c/0x40 [radeon]
Dec 22 17:46:38 localhost.localdomain kernel: [] drm_gem_object_free+0x2a/0x30 [drm]
Dec 22 17:46:38 localhost.localdomain kernel: [] radeon_bo_force_delete+0xf0/0x120 [radeon]
Dec 22 17:46:38 localhost.localdomain kernel: [] radeon_gem_fini+0xe/0x10 [radeon]
Dec 22 17:46:38 localhost.localdomain kernel: [] si_fini+0xb1/0x100 [radeon]
Dec 22 17:46:38 localhost.localdomain kernel: [] radeon_device_fini+0x3e/0x120 [radeon]
Dec 22 17:46:38 localhost.localdomain kernel: [] radeon_driver_unload_kms+0x3d/0x60 [radeon]
Dec 22 17:46:38 localhost.localdomain kernel: [] drm_put_dev+0x63/0x180 [drm]
Dec 22 17:46:38 localhost.localdomain kernel: [] radeon_pci_remove+0x1d/0x20 [radeon]
Dec 22 17:46:38 localhost.localdomain kernel: [] pci_device_remove+0x3b/0xb0
Dec 22 17:46:38 localhost.localdomain kernel: [] __device_release_driver+0x7f/0xf0
Dec 22 17:46:38 localhost.localdomain kernel: [] device_release_driver+0x23/0x30
Dec 22 17:46:38 localhost.localdomain kernel: [] bus_remove_device+0x108/0x180
Dec 22 17:46:38 localhost.localdomain kernel: [] device_del+0x135/0x1d0
Dec 22 17:46:38 localhost.localdomain kernel: [] pci_stop_bus_device+0x94/0xa0
Dec 22 17:46:38 localhost.localdomain kernel: [] pci_stop_and_remove_bus_device+0x12/0x20
Dec 22 17:46:38 localhost.localdomain kernel: [] disable_slot+0x76/0xd0
Dec 22 17:46:38 localhost.localdomain kernel: [] acpiphp_check_bridge+0xa8/0xd0
Dec 22 17:46:38 localhost.localdomain kernel: [] hotplug_event+0x10a/0x250
Dec 22 17:46:38 localhost.localdomain kernel: [] ? kmem_cache_free+0x1cd/0x1e0
Dec 22 17:46:38 localhost.localdomain kernel: [] ? acpi_os_execute_deferred+0x2d/0x32
Dec 22 17:46:38 localhost.localdomain kernel: [] hotplug_event_work+0x27/0x70
Dec 22 17:46:38 localhost.localdomain kernel: [] process_one_work+0x176/0x430
Dec 22 17:46:38 localhost.localdomain kernel: [] worker_thread+0x11b/0x3a0
Dec 22 17:46:38 localhost.localdomain kernel: [] ? rescuer_thread+0x350/0x350
Dec 22 17:46:38 localhost.localdomain kernel: [] kthread+0xc0/0xd0
Dec 22 17:46:38 localhost.localdomain kernel: [] ? insert_kthread_work+0x40/0x40
Dec 22 17:46:38 localhost.localdomain kernel: [] ret_from_fork+0x7c/0xb0
Dec 22 17:46:38 localhost.localdomain kernel: [] ? insert_kthread_work+0x40/0x40
Dec 22 17:46:38 localhost.localdomain kernel: ---[ end trace 13087d87be6954a9 ]---
Dec 22 17:46:38 localhost.localdomain kernel: radeon 0000:01:00.0: ffff8801a3ba6e60 ffff8801a3ba6c00 65536 4294967297 force free
Dec 22 17:46:38 localhost.localdomain kernel: ------------[ cut here ]------------
Dec 22 17:46:38 localhost.localdomain kernel: WARNING: CPU: 0 PID: 162 at drivers/gpu/drm/radeon/radeon_gart.c:235 radeon_gart_unbind+0xca/0xe0 radeon
Dec 22 17:46:38 localhost.localdomain kernel: trying to unbind memory from uninitialized GART !
Dec 22 17:46:38 localhost.localdomain kernel: Modules linked in: fuse acpi_call(OF) nf_conntrack_netbios_ns nf_conntrack_broadcast ipt_MASQUERADE ip6t_REJECT xt_conntrack bnep bluetooth ebtable_nat ebtable_broute bridge stp llc ebtable_filter ebtables ip6table_nat nf_conntrack_ipv6 nf_defrag_ipv6 nf_nat_ipv6 ip6table_mangle ip6table_security ip6table_raw ip6table_filter ip6_tables iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat nf_conntrack iptable_mangle iptable_security iptable_raw snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_intel snd_hda_codec snd_hwdep snd_seq iTCO_wdt snd_seq_device iTCO_vendor_support x86_pkg_temp_thermal arc4 coretemp kvm_intel kvm iwldvm snd_pcm mac80211 crct10dif_pclmul uvcvideo crc32_pclmul crc32c_intel videobuf2_vmalloc videobuf2_memops videobuf2_core ghash_clmulni_intel microcode
Dec 22 17:46:38 localhost.localdomain kernel: joydev videodev samsung_laptop iwlwifi i2c_i801 media serio_raw cfg80211 snd_page_alloc snd_timer lpc_ich snd mfd_core rfkill r8169 mii mei_me soundcore mei wmi shpchp radeon i915 i2c_algo_bit ttm drm_kms_helper drm i2c_core video
Dec 22 17:46:38 localhost.localdomain kernel: CPU: 0 PID: 162 Comm: kworker/0:2 Tainted: GF W O 3.12.5-302.fc20.x86_64 #1
Dec 22 17:46:38 localhost.localdomain kernel: Hardware name: SAMSUNG ELECTRONICS CO., LTD. 730U3E/740U3E/NP730U3E-S03IT, BIOS P06ABW.063.130905.dg 09/05/2013
Dec 22 17:46:38 localhost.localdomain kernel: Workqueue: kacpi_hotplug hotplug_event_work
Dec 22 17:46:38 localhost.localdomain kernel: 0000000000000009 ffff8801a352f970 ffffffff81662d11 ffff8801a352f9b8
Dec 22 17:46:38 localhost.localdomain kernel: ffff8801a352f9a8 ffffffff810691dd ffff8800c4c98000 ffff8801a34c13c0
Dec 22 17:46:38 localhost.localdomain kernel: ffff8801a3ba6c48 ffff8801a3ba6c78 ffff8800c4c98eb0 ffff8801a352fa08
Dec 22 17:46:38 localhost.localdomain kernel: Call Trace:
Dec 22 17:46:38 localhost.localdomain kernel: [] dump_stack+0x45/0x56
Dec 22 17:46:38 localhost.localdomain kernel: [] warn_slowpath_common+0x7d/0xa0
Dec 22 17:46:38 localhost.localdomain kernel: [] warn_slowpath_fmt+0x4c/0x50
Dec 22 17:46:38 localhost.localdomain kernel: [] ? radeon_ttm_bo_destroy+0xa3/0xb0 [radeon]
Dec 22 17:46:38 localhost.localdomain kernel: [] radeon_gart_unbind+0xca/0xe0 [radeon]
Dec 22 17:46:38 localhost.localdomain kernel: [] radeon_ttm_backend_unbind+0x1a/0x20 [radeon]
Dec 22 17:46:38 localhost.localdomain kernel: [] ttm_tt_unbind+0x27/0x40 [ttm]
Dec 22 17:46:38 localhost.localdomain kernel: [] ttm_bo_cleanup_memtype_use+0x33/0x80 [ttm]
Dec 22 17:46:38 localhost.localdomain kernel: [] ttm_bo_release+0x1fc/0x230 [ttm]
Dec 22 17:46:38 localhost.localdomain kernel: [] ttm_bo_unref+0x29/0x30 [ttm]
Dec 22 17:46:38 localhost.localdomain kernel: [] radeon_bo_unref+0x42/0x70 [radeon]
Dec 22 17:46:38 localhost.localdomain kernel: [] radeon_gem_object_free+0x3c/0x40 [radeon]
Dec 22 17:46:38 localhost.localdomain kernel: [] drm_gem_object_free+0x2a/0x30 [drm]
Dec 22 17:46:38 localhost.localdomain kernel: [] radeon_bo_force_delete+0xf0/0x120 [radeon]
Dec 22 17:46:38 localhost.localdomain kernel: [] radeon_gem_fini+0xe/0x10 [radeon]
Dec 22 17:46:38 localhost.localdomain kernel: [] si_fini+0xb1/0x100 [radeon]
Dec 22 17:46:38 localhost.localdomain kernel: [] radeon_device_fini+0x3e/0x120 [radeon]
Dec 22 17:46:38 localhost.localdomain kernel: [] radeon_driver_unload_kms+0x3d/0x60 [radeon]
Dec 22 17:46:38 localhost.localdomain kernel: [] drm_put_dev+0x63/0x180 [drm]
Dec 22 17:46:38 localhost.localdomain kernel: [] radeon_pci_remove+0x1d/0x20 [radeon]
Dec 22 17:46:38 localhost.localdomain kernel: [] pci_device_remove+0x3b/0xb0
Dec 22 17:46:38 localhost.localdomain kernel: [] __device_release_driver+0x7f/0xf0
Dec 22 17:46:38 localhost.localdomain kernel: [] device_release_driver+0x23/0x30
Dec 22 17:46:38 localhost.localdomain kernel: [] bus_remove_device+0x108/0x180
Dec 22 17:46:38 localhost.localdomain kernel: [] device_del+0x135/0x1d0
Dec 22 17:46:38 localhost.localdomain kernel: [] pci_stop_bus_device+0x94/0xa0
Dec 22 17:46:38 localhost.localdomain kernel: [] pci_stop_and_remove_bus_device+0x12/0x20
Dec 22 17:46:38 localhost.localdomain kernel: [] disable_slot+0x76/0xd0
Dec 22 17:46:38 localhost.localdomain kernel: [] acpiphp_check_bridge+0xa8/0xd0
Dec 22 17:46:38 localhost.localdomain kernel: [] hotplug_event+0x10a/0x250
Dec 22 17:46:38 localhost.localdomain kernel: [] ? kmem_cache_free+0x1cd/0x1e0
Dec 22 17:46:38 localhost.localdomain kernel: [] ? acpi_os_execute_deferred+0x2d/0x32
Dec 22 17:46:38 localhost.localdomain kernel: [] hotplug_event_work+0x27/0x70
Dec 22 17:46:38 localhost.localdomain kernel: [] process_one_work+0x176/0x430
Dec 22 17:46:38 localhost.localdomain kernel: [] worker_thread+0x11b/0x3a0
Dec 22 17:46:38 localhost.localdomain kernel: [] ? rescuer_thread+0x350/0x350
Dec 22 17:46:38 localhost.localdomain kernel: [] kthread+0xc0/0xd0
Dec 22 17:46:38 localhost.localdomain kernel: [] ? insert_kthread_work+0x40/0x40
Dec 22 17:46:38 localhost.localdomain kernel: [] ret_from_fork+0x7c/0xb0
Dec 22 17:46:38 localhost.localdomain kernel: [] ? insert_kthread_work+0x40/0x40
Dec 22 17:46:38 localhost.localdomain kernel: ---[ end trace 13087d87be6954aa ]---
Dec 22 17:46:38 localhost.localdomain kernel: radeon 0000:01:00.0: ffff8801a3ba6260 ffff8801a3ba6000 16384 4294967297 force free
Dec 22 17:46:38 localhost.localdomain kernel: radeon 0000:01:00.0: ffff8801a3ba6660 ffff8801a3ba6400 16384 4294967297 force free
Dec 22 17:46:38 localhost.localdomain kernel: radeon 0000:01:00.0: ffff8801a3ba6a60 ffff8801a3ba6800 3145728 8589934595 force free
Dec 22 17:46:38 localhost.localdomain kernel: radeon 0000:01:00.0: ffff8801a314ae60 ffff8801a314ac00 262144 4294967297 force free
Dec 22 17:46:38 localhost.localdomain kernel: radeon 0000:01:00.0: ffff8801a454c660 ffff8801a454c400 1310720 4294967297 force free
Dec 22 17:46:38 localhost.localdomain kernel: ------------[ cut here ]------------
Dec 22 17:46:38 localhost.localdomain kernel: WARNING: CPU: 0 PID: 162 at drivers/gpu/drm/radeon/radeon_gart.c:235 radeon_gart_unbind+0xca/0xe0 radeon
Dec 22 17:46:38 localhost.localdomain kernel: trying to unbind memory from uninitialized GART !
Dec 22 17:46:38 localhost.localdomain kernel: Modules linked in: fuse acpi_call(OF) nf_conntrack_netbios_ns nf_conntrack_broadcast ipt_MASQUERADE ip6t_REJECT xt_conntrack bnep bluetooth ebtable_nat ebtable_broute bridge stp llc ebtable_filter ebtables ip6table_nat nf_conntrack_ipv6 nf_defrag_ipv6 nf_nat_ipv6 ip6table_mangle ip6table_security ip6table_raw ip6table_filter ip6_tables iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat nf_conntrack iptable_mangle iptable_security iptable_raw snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_intel snd_hda_codec snd_hwdep snd_seq iTCO_wdt snd_seq_device iTCO_vendor_support x86_pkg_temp_thermal arc4 coretemp kvm_intel kvm iwldvm snd_pcm mac80211 crct10dif_pclmul uvcvideo crc32_pclmul crc32c_intel videobuf2_vmalloc videobuf2_memops videobuf2_core ghash_clmulni_intel microcode
Dec 22 17:46:38 localhost.localdomain kernel: joydev videodev samsung_laptop iwlwifi i2c_i801 media serio_raw cfg80211 snd_page_alloc snd_timer lpc_ich snd mfd_core rfkill r8169 mii mei_me soundcore mei wmi shpchp radeon i915 i2c_algo_bit ttm drm_kms_helper drm i2c_core video
Dec 22 17:46:38 localhost.localdomain kernel: CPU: 0 PID: 162 Comm: kworker/0:2 Tainted: GF W O 3.12.5-302.fc20.x86_64 #1
Dec 22 17:46:38 localhost.localdomain kernel: Hardware name: SAMSUNG ELECTRONICS CO., LTD. 730U3E/740U3E/NP730U3E-S03IT, BIOS P06ABW.063.130905.dg 09/05/2013
Dec 22 17:46:38 localhost.localdomain kernel: Workqueue: kacpi_hotplug hotplug_event_work
Dec 22 17:46:38 localhost.localdomain kernel: 0000000000000009 ffff8801a352f970 ffffffff81662d11 ffff8801a352f9b8
Dec 22 17:46:38 localhost.localdomain kernel: ffff8801a352f9a8 ffffffff810691dd ffff8800c4c98000 ffff8801a34c13c0
Dec 22 17:46:38 localhost.localdomain kernel: ffff8801a454c448 ffff8801a454c478 ffff8800c4c98eb0 ffff8801a352fa08
Dec 22 17:46:38 localhost.localdomain kernel: Call Trace:
Dec 22 17:46:38 localhost.localdomain kernel: [] dump_stack+0x45/0x56
Dec 22 17:46:38 localhost.localdomain kernel: [] warn_slowpath_common+0x7d/0xa0
Dec 22 17:46:38 localhost.localdomain kernel: [] warn_slowpath_fmt+0x4c/0x50
Dec 22 17:46:38 localhost.localdomain kernel: [] ? radeon_ttm_bo_destroy+0xa3/0xb0 [radeon]
Dec 22 17:46:38 localhost.localdomain kernel: [] radeon_gart_unbind+0xca/0xe0 [radeon]
Dec 22 17:46:38 localhost.localdomain kernel: [] radeon_ttm_backend_unbind+0x1a/0x20 [radeon]
Dec 22 17:46:38 localhost.localdomain kernel: [] ttm_tt_unbind+0x27/0x40 [ttm]
Dec 22 17:46:38 localhost.localdomain kernel: [] ttm_bo_cleanup_memtype_use+0x33/0x80 [ttm]
Dec 22 17:46:38 localhost.localdomain kernel: [] ttm_bo_release+0x1fc/0x230 [ttm]
Dec 22 17:46:38 localhost.localdomain kernel: [] ttm_bo_unref+0x29/0x30 [ttm]
Dec 22 17:46:38 localhost.localdomain kernel: [] radeon_bo_unref+0x42/0x70 [radeon]
Dec 22 17:46:38 localhost.localdomain kernel: [] radeon_gem_object_free+0x3c/0x40 [radeon]
Dec 22 17:46:38 localhost.localdomain kernel: [] drm_gem_object_free+0x2a/0x30 [drm]
Dec 22 17:46:38 localhost.localdomain kernel: [] radeon_bo_force_delete+0xf0/0x120 [radeon]
Dec 22 17:46:38 localhost.localdomain kernel: [] radeon_gem_fini+0xe/0x10 [radeon]
Dec 22 17:46:38 localhost.localdomain kernel: [] si_fini+0xb1/0x100 [radeon]
Dec 22 17:46:38 localhost.localdomain kernel: [] radeon_device_fini+0x3e/0x120 [radeon]
Dec 22 17:46:38 localhost.localdomain kernel: [] radeon_driver_unload_kms+0x3d/0x60 [radeon]
Dec 22 17:46:38 localhost.localdomain kernel: [] drm_put_dev+0x63/0x180 [drm]
Dec 22 17:46:38 localhost.localdomain kernel: [] radeon_pci_remove+0x1d/0x20 [radeon]
Dec 22 17:46:38 localhost.localdomain kernel: [] pci_device_remove+0x3b/0xb0
Dec 22 17:46:38 localhost.localdomain kernel: [] __device_release_driver+0x7f/0xf0
Dec 22 17:46:38 localhost.localdomain systemd-journal[252]: Missed 18 kernel messages
Dec 22 17:46:38 localhost.localdomain kernel: radeon 0000:01:00.0: ffff8801a454e260 ffff8801a454e000 4096 4294967297 force free
Dec 22 17:46:38 localhost.localdomain systemd-journal[252]: Missed 853 kernel messages
Dec 22 17:46:38 localhost.localdomain kernel: [TTM] Cleanup eviction failed
Dec 22 17:46:38 localhost.localdomain systemd-journal[252]: Missed 1864 kernel messages
Dec 22 17:46:38 localhost.localdomain kernel: [TTM] Cleanup eviction failed
Dec 22 17:46:38 localhost.localdomain systemd-journal[252]: Missed 598 kernel messages
Dec 22 17:46:38 localhost.localdomain kernel: [TTM] Cleanup eviction failed
Dec 22 17:46:38 localhost.localdomain systemd-journal[252]: Missed 241 kernel messages

The system continues to repeat the last two lines and does not respond to any other input
I had similar symptoms with ubuntu 13.10, but I did not check the log, hence I cannot confirm that it is due to the same issue.

Cannot reboot after using acpi_call

Hi,
acpi_call works fine to turn off my discrete nvidia card, however after installing acpi_call, system
fails to reboot...it only shuts down on any reboot command.
Unloading acpi_call module before reboot does not correct the problem.
I googled around for this, but no one else seems to report this problem.

Asus k42jc laptop
lspci|grep VGA
00:02.0 VGA compatible controller: Intel Corporation Core Processor Integrated Graphics Controller (rev 18)
01:00.0 VGA compatible controller: nVidia Corporation GT218 [GeForce 310M](rev ff)

Any help appreciated, thanks

AE_NOT_FOUND

Hello.
When I click "Turn off discrete GPU" I got error:
"Error: AE_NOT_FOUND�
Process Complete."
That is it?
My PC is "MSI CX 620MX" and I use code "_SB.PCI0.RP00.VGA._PS3" (for model "CX640 MS-16Y1 1.0" it's OK?

Overwriting return values when read?

Why does the module overwrite the return value once it is read? It could do that when a new call is written, but the current solution breaks code that iterates and reads fixed-size blocks at a time e.g. Rust's I/O code when trying to read a long ACPI_PACKAGE value

kernel 3.0 module acpi_call not found

Hello,

Archlinux
kernel 3.0 (core)
acpi_call-git (aur)

$> sudo modprobe acpi_call
FATAL: Module acpi_call not found.

(And LOAD MODULES [FAIL] at boot)

I can load the module with make; sudo make load manualy from the git: acpi_call is in lsmod and test_off.sh works, but modprobe still not found the module.

Thanks.

Problems with Kernel 3.2.1

Hi,

While using acpi_call with kernel 3.2.1-1, I am unable to suspend/resume my machine. Resulting in a black screen with a cursor and an unresponsive system, a hard reboot being the only way out.

Sorry I can't be more helpful.
Cheers

(Arch x86-64)

Doesn't work with Linux 3.1 and higher

135.568662] acpi_call: Module loaded successfully
[ 135.568674] BUG: unable to handle kernel paging request at ffff8800e806c884
[ 135.568731] IP: [] module_put+0x2c/0x90
[ 135.568771] PGD 1c07063 PUD 0
[ 135.568799] Oops: 0002 [#1] SMP
[ 135.568828] CPU 0
[ 135.568841] Modules linked in: acpi_call rfcomm bnep parport_pc ppdev binfmt_misc snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_intel snd_hda_codec snd_hwdep snd_pcm arc4 ath9k uvcvideo videodev snd_seq_midi mac80211 v4l2_compat_ioctl32 snd_rawmidi snd_seq_midi_event btusb i915 ath9k_common ath9k_hw mei(C) ath snd_seq snd_timer snd_seq_device bluetooth cfg80211 snd joydev soundcore snd_page_alloc drm_kms_helper drm psmouse serio_raw asus_laptop sparse_keymap intel_ips i2c_algo_bit video mxm_wmi wmi lp parport usbhid hid jme ahci libahci sdhci_pci sdhci
[ 135.569356]
[ 135.569372] Pid: 1861, comm: modprobe Tainted: G C 3.1.0-0301rc10-generic #201110181253 ASUSTeK Computer Inc. K42Jc/K42Jc
[ 135.569463] RIP: 0010:[] [] module_put+0x2c/0x90
[ 135.569512] RSP: 0018:ffff880119d0df28 EFLAGS: 00010286
[ 135.569543] RAX: ffffffffa046c884 RBX: ffffffffa046e000 RCX: 0000000000000000
[ 135.569582] RDX: ffff880119d0dfd8 RSI: 0000000000000286 RDI: ffffffffa046e000
[ 135.569622] RBP: ffff880119d0df48 R08: 0000000000000000 R09: 0000000000000006
[ 135.569661] R10: 00000000ffffffff R11: 0000000000000000 R12: 0000000000000000
[ 135.569700] R13: 00007f8b181a0000 R14: 0000000000000000 R15: 0000000000405e30
[ 135.569741] FS: 00007f8b18180720(0000) GS:ffff880147c00000(0000) knlGS:0000000000000000
[ 135.569785] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 135.569817] CR2: ffff8800e806c884 CR3: 0000000119d50000 CR4: 00000000000006f0
[ 135.569856] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 135.569896] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
[ 135.569935] Process modprobe (pid: 1861, threadinfo ffff880119d0c000, task ffff8801289496f0)
[ 135.569980] Stack:
[ 135.569995] ffff880119d0df48 ffffffffa046e000 0000000000000000 00007f8b181a0000
[ 135.570045] ffff880119d0df78 ffffffff810a7a06 0000000000405e30 000000000116fce0
[ 135.570094] 0000000000000000 000000000116c080 000000000116d430 ffffffff815fe142
[ 135.570146] Call Trace:
[ 135.570166] [] sys_init_module+0x126/0x220
[ 135.570201] [] system_call_fastpath+0x16/0x1b
[ 135.570235] Code: 48 89 e5 48 83 ec 20 48 89 5d e8 4c 89 65 f0 4c 89 6d f8 66 66 66 66 90 48 85 ff 48 89 fb 74 21 48 8b 87 48 02 00 00 48 83 c0 04
[ 135.570459] ff 00 8b 05 63 33 c1 00 4c 8b 65 08 85 c0 75 13 83 3b 02 74
[ 135.572423] RIP [] module_put+0x2c/0x90
[ 135.574321] RSP
[ 135.576170] CR2: ffff8800e806c884
[ 135.644144] ---[ end trace 1c6ad3f10155cf79 ]---
[ 160.337530] [drm:drm_mode_getfb] ERROR invalid framebuffer id

Patch for kernel 4.12.4

The uaccess.h has moved from asm to linux in Kernel 4.12, so would you like add the following patch?

-#include <asm/uaccess.h>	         /* copy_*_user */
+#include <linux/version.h>
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,12,0)
+#include <asm/uaccess.h>             /* copy_*_user */
+#else
+#include <linux/uaccess.h>           /* copy_*_user */
+#endif

SSL error on make install

Hi,

Thanks for great work! I'm trying run the installer but I get this strange error. Not sure it's related to this but it's worth a shot to ask I guess :)

Whenever I try to run sudo make install I get an SSL error saying it's missing sign-file. Do you have any ideas what I'm missing here?

$ make
make -C /lib/modules/5.3.0-24-generic/build M=/home/mattias/Repositories/acpi_call modules
make[1]: Entering directory '/usr/src/linux-headers-5.3.0-24-generic'
Building modules, stage 2.
MODPOST 1 modules
make[1]: Leaving directory '/usr/src/linux-headers-5.3.0-24-generic'

$ sudo make install
make -C /lib/modules/5.3.0-24-generic/build M=/home/mattias/Repositories/acpi_call modules_install
make[1]: Entering directory '/usr/src/linux-headers-5.3.0-24-generic'
INSTALL /home/mattias/Repositories/acpi_call/acpi_call.ko
At main.c:160:

  • SSL error:02001002:system library:fopen:No such file or directory: ../crypto/bio/bss_file.c:72
  • SSL error:2006D080:BIO routines:BIO_new_file:no such file: ../crypto/bio/bss_file.c:79
    sign-file: certs/signing_key.pem: No such file or directory
    DEPMOD 5.3.0-24-generic
    Warning: modules_install: missing 'System.map' file. Skipping depmod.
    make[1]: Leaving directory '/usr/src/linux-headers-5.3.0-24-generic'

~/Repositories/acpi_call (master) $ sudo insmod acpi_call.ko
insmod: ERROR: could not insert module acpi_call.ko: File exists

But I still get an error when running:
$ sudo ./xmm2usb
Found XMM7360 modem at 0000:03:00.0 (_SB_.PCI0.RP03.PXSX)
Parent port is at 0000:00:1c.2
modprobe: FATAL: Module acpi_call not found in directory /lib/modules/5.3.0-24-generic
ERROR Could not load acpi_call module. Is it missing?

Not sure how to proceed here. Any ideas?

Ubuntu 18.04 how build?

~/acpi_call# make
make -C /lib/modules/4.15.0-42-generic/build M=/home/maximus/acpi_call modules
make[1]: вход в каталог «/usr/src/linux-headers-4.15.0-42-generic»
  CC [M]  /home/maximus/acpi_call/acpi_call.o
In file included from ./include/linux/list.h:5:0,
                 from ./include/linux/module.h:9,
                 from /home/maximus/acpi_call/acpi_call.c:5:
./include/linux/types.h:17:9: error: unknown type name ‘__kernel_ino_t’
 typedef __kernel_ino_t  ino_t;
         ^~~~~~~~~~~~~~
./include/linux/types.h:18:9: error: unknown type name ‘__kernel_mode_t’
 typedef __kernel_mode_t  mode_t;
         ^~~~~~~~~~~~~~~
./include/linux/types.h:21:9: error: unknown type name ‘__kernel_off_t’
 typedef __kernel_off_t  off_t;
         ^~~~~~~~~~~~~~
./include/linux/types.h:22:9: error: unknown type name ‘__kernel_pid_t’
 typedef __kernel_pid_t  pid_t;
         ^~~~~~~~~~~~~~
./include/linux/types.h:23:9: error: unknown type name ‘__kernel_daddr_t’
 typedef __kernel_daddr_t daddr_t;
         ^~~~~~~~~~~~~~~~
./include/linux/types.h:25:9: error: unknown type name ‘__kernel_suseconds_t’
 typedef __kernel_suseconds_t suseconds_t;
         ^~~~~~~~~~~~~~~~~~~~
./include/linux/types.h:26:9: error: unknown type name ‘__kernel_timer_t’
 typedef __kernel_timer_t timer_t;
         ^~~~~~~~~~~~~~~~
./include/linux/types.h:27:9: error: unknown type name ‘__kernel_clockid_t’
 typedef __kernel_clockid_t clockid_t;
         ^~~~~~~~~~~~~~~~~~
./include/linux/types.h:32:9: error: unknown type name ‘__kernel_uid32_t’
 typedef __kernel_uid32_t uid_t;
         ^~~~~~~~~~~~~~~~
./include/linux/types.h:33:9: error: unknown type name ‘__kernel_gid32_t’
 typedef __kernel_gid32_t gid_t;
         ^~~~~~~~~~~~~~~~
./include/linux/types.h:34:9: error: unknown type name ‘__kernel_uid16_t’
 typedef __kernel_uid16_t        uid16_t;
         ^~~~~~~~~~~~~~~~
./include/linux/types.h:35:9: error: unknown type name ‘__kernel_gid16_t’
 typedef __kernel_gid16_t        gid16_t;
         ^~~~~~~~~~~~~~~~
./include/linux/types.h:41:9: error: unknown type name ‘__kernel_old_uid_t’
 typedef __kernel_old_uid_t old_uid_t;
         ^~~~~~~~~~~~~~~~~~
./include/linux/types.h:42:9: error: unknown type name ‘__kernel_old_gid_t’
 typedef __kernel_old_gid_t old_gid_t;
         ^~~~~~~~~~~~~~~~~~
./include/linux/types.h:46:9: error: unknown type name ‘__kernel_loff_t’
 typedef __kernel_loff_t  loff_t;
         ^~~~~~~~~~~~~~~
./include/linux/types.h:55:9: error: unknown type name ‘__kernel_size_t’
 typedef __kernel_size_t  size_t;
         ^~~~~~~~~~~~~~~
./include/linux/types.h:60:9: error: unknown type name ‘__kernel_ssize_t’
 typedef __kernel_ssize_t ssize_t;
         ^~~~~~~~~~~~~~~~
./include/linux/types.h:65:9: error: unknown type name ‘__kernel_ptrdiff_t’
 typedef __kernel_ptrdiff_t ptrdiff_t;
         ^~~~~~~~~~~~~~~~~~
./include/linux/types.h:70:9: error: unknown type name ‘__kernel_time_t’
 typedef __kernel_time_t  time_t;
         ^~~~~~~~~~~~~~~
./include/linux/types.h:75:9: error: unknown type name ‘__kernel_clock_t’
 typedef __kernel_clock_t clock_t;
         ^~~~~~~~~~~~~~~~
./include/linux/types.h:80:9: error: unknown type name ‘__kernel_caddr_t’
 typedef __kernel_caddr_t caddr_t;
         ^~~~~~~~~~~~~~~~
./include/linux/types.h:199:2: error: unknown type name ‘__kernel_daddr_t’
  __kernel_daddr_t f_tfree;
  ^~~~~~~~~~~~~~~~
./include/linux/types.h:200:2: error: unknown type name ‘__kernel_ino_t’
  __kernel_ino_t  f_tinode;
  ^~~~~~~~~~~~~~
In file included from ./include/linux/kernel.h:7:0,
                 from ./include/linux/list.h:9,
                 from ./include/linux/module.h:9,
                 from /home/maximus/acpi_call/acpi_call.c:5:
./include/linux/linkage.h:8:10: fatal error: asm/linkage.h: Нет такого файла или каталога
 #include <asm/linkage.h>
          ^~~~~~~~~~~~~~~
compilation terminated.
scripts/Makefile.build:339: recipe for target '/home/maximus/acpi_call/acpi_call.o' failed
make[2]: *** [/home/maximus/acpi_call/acpi_call.o] Error 1
Makefile:1551: recipe for target '_module_/home/maximus/acpi_call' failed
make[1]: *** [_module_/home/maximus/acpi_call] Error 2
make[1]: выход из каталога «/usr/src/linux-headers-4.15.0-42-generic»
Makefile:10: recipe for target 'default' failed
make: *** [default] Error 2

Mainlining effort

I know the issue has been already brought up in #29, but it was 7 years ago, so maybe it's time to rethink it. Is there any plan to submit acpi_call for inclusion in the mainline Linux kernel?

dkms makes it easy to compile and install the module from source, but in many distributions using dkms weakens the UEFI secure boot, so it is better to avoid it when possible.

Thanks!

modprobe: FATAL: Module acpi_call not found.

Hi,

[marco@Marco-HP acpi_call]$ sudo make
make -C /lib/modules/3.9.6-200.fc18.x86_64/build M=/usr/local/bin/acpi_call modules
make[1]: Entering directory `/usr/src/kernels/3.9.6-200.fc18.x86_64'
  Building modules, stage 2.
  MODPOST 1 modules
make[1]: Leaving directory `/usr/src/kernels/3.9.6-200.fc18.x86_64'
[marco@Marco-HP acpi_call]$ insmod acpi_call.ko
[marco@Marco-HP acpi_call]$ modprobe acpi_call
modprobe: FATAL: Module acpi_call not found.
[marco@Marco-HP acpi_call]$ sudo bash 
[root@Marco-HP acpi_call]# echo "\_SB.PCI0.PEG0.PEGP._OFF" > /proc/acpi/call
[root@Marco-HP acpi_call]# cat /proc/acpi/call
0x0[root@Marco-HP acpi_call]#

This call succeeds, but after a reboot /proc/acpi/call no longer exists.

[root@Marco-HP marco]# echo "\_SB.PCI0.PEG0.PEGP._OFF" > /proc/acpi/call
bash: /proc/acpi/call: File o directory non esistente

Already tried to do a depmod -a but nothing changes

makefile install target

Hi,

The acpi_call makefile currently only has a load target.

Could you add something along the following to install the module?

install:
$(MAKE) -C $(KDIR) M=$(PWD) INSTALL_MOD_DIR=updates/drivers/acpi INSTALL_MOD_STRIP=1 modules_install

Thanks,
Peter

Can't install on alpine linux

make -C /lib/modules/4.19.80-0-vanilla/build M=/home/axpira/workspaces/acpi_call modules
make[1]: *** /lib/modules/4.19.80-0-vanilla/build: No such file or directory.  Stop.
make: *** [Makefile:8: default] Error 2

Loading errors under kernel 4.8.10

The building seems no problem, but when I run: sudo depmod acpi_call.ko, the output is:

   depmod: ERROR: Bad version passed acpi_call.ko

If running sudo depmod -eF acpi_call.ko, the output looks like:

   depmod: ERROR: acpi_call.ko:1: invalid line: ELF���
   depmod: ERROR: acpi_call.ko:2: invalid line: H�����������!�%����t���������
   depmod: ERROR: acpi_call.ko:3: invalid line: H�����������!�%����t���������
   ... ...
   depmod: ERROR: acpi_call.ko:7025: invalid line: ��U�

   depmod: ERROR: acpi_call.ko:7027: invalid line: kd�����$)�c<÷f��;�>!��7��
   G�>�G�&|i�l�e*;FqV���^��.ko:7028: invalid line: +��#�l�nW
                    ��ld퇑�C�+
   0�����0������1 acpi_call.ko:7029: invalid line: 0����	*�H��
    �	`�H�e����0
   ��1���0������0m0`1�	*�H��
              0

   depmod: ERROR: acpi_call.ko:7030: invalid line: ��U�

Thank you.

AMD HD8870

On my laptop (with an AMD HD8870), the call to disable the discrete GPU is:

_SB.PCI0.PEG0.PEGP.SGOF

Maybe you can add it to your script. :)

Can't insert kernel module after turning on discrete card

Now I think this issue become relevant since we are able to actually use the discrete card without a hardware mux (thanks to Bumblebee). So here comes the second part of the problem: turning the discrete card back on and be able to use it.

I've called method "_SB.PCI0.P0P1.PEGP._OFF" to turn off the card. It worked fine since the power consumption went down about 30% ~ 40%

When calling "_SB.PCI0.P0P1.PEGP._ON" (I was guessing about the on) i got the card back consuming power, the kernel recognizes it "lspci -k" lists it and the modules available to use with it but when i try to modprobe nvidia module or nouveau module I got an error: No Such Device (the nouveau driver actually prints nothing but is not loaded)

I'm using a Dell Vostro 3500 and the DSDT.dsl and SSDT tables are listed according to http://linux-hybrid-graphics.blogspot.com/ in the Launchpad tracker:
https://bugs.launchpad.net/lpbugreporter/+bug/752542/+attachment/2149902/+files/Vostro%203550.tar.gz

I'm not looking for a solution to my case in particular but for an increasing number of users. Here is a GitHub issue that was opened in Martin's bumblebee tracker: https://github.com/MrMEEE/bumblebee/issues/229

Apparently there are some steps missing in turning on/off discrete card.

Thank you very much for your effort and we are almost there in Optimus support

compilation error 3.12.1 kernel

Hi,

I have compile error since 3.12 kernel:

make -C /lib/modules/3.12-1-686-pae/build M=/home/efhalo/acpi_call-1.1.0 modules
make[1]: Entering directory /usr/src/linux-headers-3.12-1-686-pae' Makefile:10: *** mixed implicit and normal rules. Stop. make[1]: Leaving directory/usr/src/linux-headers-3.12-1-686-pae'
make: *** [default] Error 2

uname -a
Linux thamuz 3.12-1-686-pae #1 SMP Debian 3.12.6-1 (2013-12-21) i686 GNU/Linux

test_off script failed on XPS 17 L701x Intel and Nvidia GeForce 435M

Hi

I am new to ubuntu. please give me some advice.

Trying _SB.PCI0.P0P1.VGA._OFF: failed
Trying _SB.PCI0.P0P2.VGA._OFF: failed
Trying SB.PCI0.OVGA.ATPX: failed
Trying SB.PCI0.OVGA.XTPX: failed
Trying _SB.PCI0.P0P3.PEGP._OFF: failed
Trying _SB.PCI0.P0P2.PEGP._OFF: failed
Trying _SB.PCI0.P0P1.PEGP._OFF: failed
Trying _SB.PCI0.MXR0.MXM0._OFF: failed
Trying _SB.PCI0.PEG1.GFX0._OFF: failed
Trying _SB.PCI0.PEG0.GFX0.DOFF: failed
Trying _SB.PCI0.PEG1.GFX0.DOFF: failed
Trying _SB.PCI0.PEG0.PEGP._OFF: failed
Trying _SB.PCI0.XVR0.Z01I.DGOF: failed
Trying _SB.PCI0.PEGR.GFX0._OFF: failed
Trying _SB.PCI0.PEG.VID._OFF: failed
Trying _SB.PCI0.PEG0.VID._OFF: failed
Trying _SB.PCI0.P0P2.DGPU._OFF: failed
Trying _SB.PCI0.P0P4.DGPU.DOFF: failed
Trying _SB.PCI0.IXVE.IGPU.DGOF: failed
Trying _SB.PCI0.RP00.VGA._PS3: failed
Trying _SB.PCI0.RP00.VGA.P3MO: failed
Trying _SB.PCI0.GFX0.DSM._T_0: failed
Trying _SB.PCI0.LPC.EC.PUBS._OFF: failed
Trying _SB.PCI0.P0P2.NVID._OFF: failed

After linux-3.2.1 update, module has disappeared?

After kernel update, acpi_call module fails to load. Modprobe reports that it doesn't exist. I downgraded to the most recent kernel version I had working; same issue. I have done a full re-clone, no effect.

debian with kernel 4.19

~ ❯❯❯ cat /var/lib/dkms/acpi-call/1.1.0/build/make.log ✘ 10
DKMS make.log for acpi-call-1.1.0 for kernel 4.19.0-rc6-amd64 (x86_64)
Mon Oct 8 02:58:58 -03 2018
make: Entering directory '/usr/src/linux-headers-4.19.0-rc6-amd64'
/usr/src/linux-headers-4.19.0-rc6-common/Makefile:302: scripts/subarch.include: No such file or directory
make[2]: *** No rule to make target 'scripts/subarch.include'. Stop.
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [Makefile:146: sub-make] Error 2
make: *** [Makefile:8: all] Error 2
make: Leaving directory '/usr/src/linux-headers-4.19.0-rc6-amd64'

Lenovo v570 323A-3, Debian sid, onboard intel hd 3000, nvidia gt 525m

Thanks for that great work, fella!

Well, my thing is module worked for my lenovo only to turn off my discrete card, but can not turn it on back, well that seems to be unsupported:

root@lenovo:/home/sevenfourk/sources/git/acpi_call# ./test_off.sh 
Trying \_SB.PCI0.P0P1.VGA._OFF: failed
Trying \_SB.PCI0.P0P2.VGA._OFF: failed
Trying \_SB_.PCI0.OVGA.ATPX: failed
Trying \_SB_.PCI0.OVGA.XTPX: failed
Trying \_SB.PCI0.P0P3.PEGP._OFF: failed
Trying \_SB.PCI0.P0P2.PEGP._OFF: failed
Trying \_SB.PCI0.P0P1.PEGP._OFF: failed
Trying \_SB.PCI0.MXR0.MXM0._OFF: failed
Trying \_SB.PCI0.PEG1.GFX0._OFF: failed
Trying \_SB.PCI0.PEG0.GFX0.DOFF: failed
Trying \_SB.PCI0.PEG1.GFX0.DOFF: failed
Trying \_SB.PCI0.PEG0.PEGP._OFF: works!

any suggestions ?

Won't compile with kernel 2.6.38-11

Was using this in an earlier kernel without issue, but since upgrading the kernel to 2.6.38-11 I get the following when trying to compile:

oliver@hubert:~/bin/acpi_call$ make
make -C /lib/modules/2.6.38-11-generic/build M=/home/oliver/bin/acpi_call modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.38-11-generic'
  CC [M]  /home/oliver/bin/acpi_call/acpi_call.o
In file included from /usr/src/linux-headers-2.6.38-11-generic/arch/x86/include/asm/percpu.h:44:0,
                 from /usr/src/linux-headers-2.6.38-11-generic/arch/x86/include/asm/current.h:5,
                 from /usr/src/linux-headers-2.6.38-11-generic/arch/x86/include/asm/processor.h:15,
                 from ./include/linux/prefetch.h:14,
                 from ./include/linux/list.h:7,
                 from ./include/linux/module.h:9,
                 from /home/oliver/bin/acpi_call/acpi_call.c:3:
./include/linux/kernel.h:12:20: fatal error: stdarg.h: No such file or directory
compilation terminated.
make[2]: *** [/home/oliver/bin/acpi_call/acpi_call.o] Error 1
make[1]: *** [_module_/home/oliver/bin/acpi_call] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-2.6.38-11-generic'
make: *** [default] Error 2

GPU will not turn back on

I ran the example turn off gpu script which is supposed to turn off the GPU which should then turn back on after reboot, but the GPU is not turning back on.

bug since kernel-3.12

hi guys,i've been using the acpi_call and the turn_off_gpu.sh method for a while,but since kernel-3.12 update,there seem to be a bug.To see what happen,i comment out related lines in my autostart scripts and manually compile and run it.what i did:
go to the folder that contains the code
%make
%sudo insmod acpi_call.ko
%sudo ./example/turn_off_gpu.sh

yes,it seems that a method in the turn_off_gpu.sh works(as printed on the screen),but a few seconds later ,a strange thing happened,the terminal become unable to type in anything,meanwhile through conky i see the cpu keep running at highest speed.But my openbox's keyboard shortcut still works so i can still use firefox or anything,but the terminal emulator(lilyterm/uxterm/xterm,none of them works).

something about my system:
kernel:3.12.1-2-ck
gcc 4.8.2
and i got a samsung ativ book 5,with a i5-3337u and amd hd8750m gpu.
i'm not so much a hacker so that's all i know.
many thanks!

how to permanently install?

Hi,

How do I permanently install acpi_call.ko so that bumblebee can call it?

I tried insmod and then depmod -a but it doesn't work...

EEE 1215N All Tests Failed

I am running an Asus EEE PC 1215N with Ubuntu 11.04. Installation appeared to work, but the test_off script fails completely.

uname@1215N:$ git clone http://github.com/mkottman/acpi_call.git
Cloning into acpi_call...
remote: Counting objects: 101, done.
remote: Compressing objects: 100% (57/57), done.
remote: Total 101 (delta 58), reused 76 (delta 42)
Receiving objects: 100% (101/101), 14.97 KiB, done.
Resolving deltas: 100% (58/58), done.
uname@1215N:
$ cd acpi_call
uname@1215N:/acpi_call$ make
make -C /lib/modules/2.6.38-10-generic-pae/build M=/home/uname/acpi_call modules
make[1]: Entering directory /usr/src/linux-headers-2.6.38-10-generic-pae' CC [M] /home/uname/acpi_call/acpi_call.o Building modules, stage 2. MODPOST 1 modules CC /home/uname/acpi_call/acpi_call.mod.o LD [M] /home/uname/acpi_call/acpi_call.ko make[1]: Leaving directory/usr/src/linux-headers-2.6.38-10-generic-pae'
uname@1215N:
/acpi_call$ sudo insmod acpi_call.ko
[sudo] password for uname:
uname@1215N:~/acpi_call$ ./test_off.sh
Trying _SB.PCI0.P0P1.VGA._OFF: failed
Trying _SB.PCI0.P0P2.VGA._OFF: failed
Trying SB.PCI0.OVGA.ATPX: failed
Trying SB.PCI0.OVGA.XTPX: failed
Trying _SB.PCI0.P0P3.PEGP._OFF: failed
Trying _SB.PCI0.P0P2.PEGP._OFF: failed
Trying _SB.PCI0.P0P1.PEGP._OFF: failed
Trying _SB.PCI0.MXR0.MXM0._OFF: failed
Trying _SB.PCI0.PEG1.GFX0._OFF: failed
Trying _SB.PCI0.PEG0.GFX0.DOFF: failed
Trying _SB.PCI0.PEG1.GFX0.DOFF: failed
Trying _SB.PCI0.PEG0.PEGP._OFF: failed
Trying _SB.PCI0.XVR0.Z01I.DGOF: failed
Trying _SB.PCI0.PEGR.GFX0._OFF: failed
Trying _SB.PCI0.PEG.VID._OFF: failed
Trying _SB.PCI0.PEG0.VID._OFF: failed
Trying _SB.PCI0.P0P2.DGPU._OFF: failed
Trying _SB.PCI0.P0P4.DGPU.DOFF: failed
Trying _SB.PCI0.IXVE.IGPU.DGOF: failed
Trying _SB.PCI0.RP00.VGA._PS3: failed
Trying _SB.PCI0.RP00.VGA.P3MO: failed
Trying _SB.PCI0.GFX0.DSM._T_0: failed
Trying _SB.PCI0.LPC.EC.PUBS._OFF: failed
Trying _SB.PCI0.P0P2.NVID._OFF: failed

Module don't work with kernel 2.6.38-10 on Ubuntu (invalid module format)

acpi_call$ ls
Makefile  README  acpi_call.c  asus1215n.sh*  m11xr2.sh*  test_off.sh*
acpi_call$ make
make -C /lib/modules/2.6.38-10-generic-pae/build M=/home/bruno/projects/misc/acpi_call modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.38-10-generic'
  CC [M]  /home/bruno/projects/misc/acpi_call/acpi_call.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /home/bruno/projects/misc/acpi_call/acpi_call.mod.o
  LD [M]  /home/bruno/projects/misc/acpi_call/acpi_call.ko
make[1]: Leaving directory `/usr/src/linux-headers-2.6.38-10-generic'
acpi_call$ sudo insmod acpi_call.ko
insmod: error inserting 'acpi_call.ko': -1 Invalid module format
acpi_call$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5.2/lto-wrapper
Target: i686-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.5.2-8ubuntu4' --with-bugurl=file:///usr/share/doc/gcc-4.5/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.5 --enable-shared --enable-multiarch --with-multiarch-defaults=i386-linux-gnu --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib/i386-linux-gnu --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.5 --libdir=/usr/lib/i386-linux-gnu --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-plugin --enable-gold --enable-ld=default --with-plugin-ld=ld.gold --enable-objc-gc --enable-targets=all --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=i686-linux-gnu --host=i686-linux-gnu --target=i686-linux-gnu
Thread model: posix
gcc version 4.5.2 (Ubuntu/Linaro 4.5.2-8ubuntu4) 
acpi_call$ uname -a
Linux asgard 2.6.38-10-generic-pae #44+kamal~mjgbacklight4-Ubuntu SMP Mon Jun 6 19:58:20 UTC 2011 i686 i686 i386 GNU/Linux

Lenovo E520 acpi methods.

To switch the ATI gfx card off:

_SB.PCI0.PEG0.PEGP._OFF

and on:

_SB.PCI0.PEG0.PEGP._ON

Neither takes any args.

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

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.

#error "Please don't include <acpi/acpi.h> directly, include <linux/acpi.h> instead.

Kernel: 3.17-rc5

Issue: Compilation terminates with the following error message:

make -C /usr/lib/modules/3.17.0-rc5-zenbook/build M=/tmp/makepkg/acpi_call-git/src/acpi_call-build modules
make[1]: Entering directory '/usr/src/3.17.0-rc5-zenbook'
CC [M] /tmp/makepkg/acpi_call-git/src/acpi_call-build/acpi_call.o
In file included from include/acpi/platform/acenv.h:172:0,
from include/acpi/acpi.h:56,
from /tmp/makepkg/acpi_call-git/src/acpi_call-build/acpi_call.c:9:
include/acpi/platform/aclinux.h:52:2: error: #error "Please don't include <acpi/acpi.h> directly, include <linux/acpi.h> instead."
#error "Please don't include <acpi/acpi.h> directly, include <linux/acpi.h> instead."
^
scripts/Makefile.build:263: recipe for target '/tmp/makepkg/acpi_call-git/src/acpi_call-build/acpi_call.o' failed
make[2]: *** [/tmp/makepkg/acpi_call-git/src/acpi_call-build/acpi_call.o] Error 1
Makefile:1373: recipe for target 'module/tmp/makepkg/acpi_call-git/src/acpi_call-build' failed
make[1]: *** [module/tmp/makepkg/acpi_call-git/src/acpi_call-build] Error 2
make[1]: Leaving directory '/usr/src/3.17.0-rc5-zenbook'
Makefile:8: recipe for target 'default' failed
make: *** [default] Error 2

Apparent solution:

Replace '#include <acpi/acpi.h>' with '#include <linux/acpi.h>':
sed -i -e 's:<acpi/acpi.h>:<linux/acpi.h>:' acpi_call.c

module then builds, installs, loads and seems to work

How to build on Debian 10 - Warning: modules_install: missing 'System.map' file. Skipping depmod

I am trying to build with a fresh Debian 10 installation and I have the following error :

kopax@dka:~/workspace/tmp/acpi_call$ make
make -C /lib/modules/4.19.0-6-amd64/build M=/home/kopax/workspace/tmp/acpi_call modules
make[1]: Entering directory '/usr/src/linux-headers-4.19.0-6-amd64'
  CC [M]  /home/kopax/workspace/tmp/acpi_call/acpi_call.o
In file included from /usr/src/linux-headers-4.19.0-6-common/include/acpi/platform/acenv.h:152,
                 from /usr/src/linux-headers-4.19.0-6-common/include/acpi/acpi.h:22,
                 from /home/kopax/workspace/tmp/acpi_call/acpi_call.c:9:
/usr/src/linux-headers-4.19.0-6-common/include/acpi/platform/aclinux.h:18:2: error: #error "Please don't include <acpi/acpi.h> directly, include <linux/acpi.h> instead."
 #error "Please don't include <acpi/acpi.h> directly, include <linux/acpi.h> instead."
  ^~~~~
/home/kopax/workspace/tmp/acpi_call/acpi_call.c: In function ‘acpi_proc_write’:
/home/kopax/workspace/tmp/acpi_call/acpi_call.c:277:9: error: implicit declaration of function ‘copy_from_user’; did you mean ‘raw_copy_from_user’? [-Werror=implicit-function-declaration]
     if (copy_from_user( input, buff, len )) {
         ^~~~~~~~~~~~~~
         raw_copy_from_user
cc1: some warnings being treated as errors
make[4]: *** [/usr/src/linux-headers-4.19.0-6-common/scripts/Makefile.build:315: /home/kopax/workspace/tmp/acpi_call/acpi_call.o] Error 1
make[3]: *** [/usr/src/linux-headers-4.19.0-6-common/Makefile:1534: _module_/home/kopax/workspace/tmp/acpi_call] Error 2
make[2]: *** [Makefile:146: sub-make] Error 2
make[1]: *** [Makefile:8: all] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.19.0-6-amd64'
make: *** [Makefile:8: default] Error 2

I have tried the fork of acpi_call here

But then I have Warning: modules_install: missing 'System.map' file. Skipping depmod.

Is there anything I am missing to build acpi_call? Thanks for sharing!

HP Elitebook 850 G1 ACPI calls

Found the following in the decompiled ACPI mess:

Scope (\_SB.PCI0.RP05.DGFX)
        Method (_ON, 0, Serialized)  // _ON_: Power On
        Method (_OFF, 0, Serialized)  // _OFF: Power Off

Testing currently if it actually makes a difference, but echo'ing to /proc/acpi/call gets accepted at least.

Disable D945GCLF2 GPU

hello,

Is it possible to disable the GPU in this motherboard?
I would like to less consume...

Sorry for my bad english.

Adam

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.