acpi_call

Recently I've implemented acpi_call module https://gitorious.org/acpi_call-freebsd

Installation (requires kernel sources):
Code:
 $ git clone git://gitorious.org/acpi_call-freebsd/acpi_call-freebsd.git acpi_call
 $ cd acpi_call
 $ make && make util
 # kldload ./acpi_call.ko

Basic usage:
Code:
 # ./acpi_call -p '\_OS'
 Microsoft Windows NT
 # ./acpi_call -p '\_OSI' -s 'Windows'
 0
 # ./acpi_call -p '\_OSI' -s 'Windows 2000'
 4294967295
 # ./acpi_call -p '\_OSI' -s 'Windows 2000' -v
 Path: \_OSI
 Number of arguments: 1
 Argument 1 type: String
 Argument 1 value: Windows 2000
 Status: 0
 Result: 4294967295

Soon I will make port for it, but there is one issue: when the module is loaded from loader.conf it crashes the system early in boot process: http://i.imgur.com/fLPen.png (I've added some printf's in acpi.c)
Can someone help me with this issue?
 
Module is useful for nvidia ion videocards switch: needs grab arguments for your hardware in github forks of linux acpi-call.

For example, commands to disable ion chip on asus eee pc 1215N (based on http://github.com/peberlein/acpi_call.git)
Code:
./acpi_call -p "\\_SB.PCI0.P0P4.GFX0._DSM" -b "F8D886A4DA0B1B47A72B6042A6B5BEE0" -i 256 -i 26 -b "01000003" -v 
./acpi_call -p "\\_SB.PCI0.P0P4.GFX0._PS3" -v
Test it:
Code:
./acpi_call -p "\_SB.PCI0.P0P4.GFX0.P3MO" -v
./acpi_call -p "\_SB.PCI0.P0P4.GFX0.DGPS" -v
./acpi_call -p "\_SB.PCI0.P0P4.GFX0._PSC" -v
Last method should return 0x03 for disabled chip. Also, acpiconf -i0 should show lowest discharging.

2 SirDice:
gelraen knows why module crashes, he needs a pile to fix this.
 
Try DRIVER_MODULE(9) instead of DECLARE_MODULE(9).

acpi uses DRIVER_MODULE
http://fxr.watson.org/fxr/source/dev/acpica/acpi.c?im=bigexcerpts#L229
so that, sysinit_sub_id is SI_SUB_DRIVERS
http://fxr.watson.org/fxr/source/sys/bus.h?im=10#L615
You use SI_SUB_KLD.
SI_SUB_DRIVERS=0x3100000
SI_SUB_KLD=0x2000000
http://fxr.watson.org/fxr/source/sys/kernel.h#L70
Your module will be loaded before freebsd acip and before acpi_mutex being initialized. (yet acpi_mutex is defined http://fxr.watson.org/fxr/source/dev/acpica/acpi.c?im=bigexcerpts#L95, fault address isn't NULL. It is most likely leftover garbage bits.)

I'm not acpi expert, but USB drivers use DRIVER_MODULE, i.e.
http://fxr.watson.org/fxr/source/dev/usb/usb_hub.c#L172
http://fxr.watson.org/fxr/source/dev/usb/wlan/if_run.c?im=10#L4949
So, uhub will be loaded before usb dangle drivers.
 
Did someone tested with acpi_call recently. Let's say against 11.2 ?

I'm trying to make use of acpi_call to disable my Optimus Nvidia card in my laptop.
So I issued a call as root:
acpi_call "\\134_SB.PCI0.RP01.PXSX._DSM"

Above command leads to an instant reboot.
If I check the crash dump, I can find:

Code:
ACPI Warning: \134_SB.PCI0.RP01.PXSX._DSM: Insufficient arguments - Caller passed 0, ACPI requires 4 (20180629/nsarguments-414)

@nirnr00t How did you figure out the arguments you have to pass in ?

Just out of curiosity I issued as mentioned above by @gelraen:
acpi_call -p '\_OS'
This also leads to an instant reboot. Unfortunately I can"t find any related log line in /var/crash/core.txt.x this time.

So I'm wondering. Are these crashes only happening because of the way I use acpi_call, not passing the right arguments ?
 
Did someone tested with acpi_call recently. Let's say against 11.2 ?

Yes, I am using acpi_call with 12.0 with custom BIOS & ACPI tables and it works without reboot.

Code:
ACPI Warning: \134_SB.PCI0.RP01.PXSX._DSM: Insufficient arguments - Caller passed 0, ACPI requires 4 (20180629/nsarguments-414)

@nirnr00t How did you figure out the arguments you have to pass in ?

Maybe this will be helpful:
Code:
pkg install -y acpica-tools
mkdir acpi-dump
cd acpi-dump
/usr/local/bin/acpidump -b
iasl -d dsdt.dat
$EDITOR dsdt.asl
 
Maybe worth to add that the current port of acpi_call works for me for 12-Release. There has been an update to the port which fixed the reboot issue I had.
 
Back
Top