OpenCloudOS-Kernel/drivers/acpi
Daisuke HATAYAMA 083ca8c417 ACPI / sysfs: Set file size for each exposed ACPI table
Currently, each of the ACPI tables exported from
/sys/firmware/acpi/tables is of zero size:

$ LANG=C ls -ld /sys/firmware/acpi/tables/*
-r-------- 1 root root 0 Nov 19 09:48 /sys/firmware/acpi/tables/APIC
-r-------- 1 root root 0 Nov 19 09:48 /sys/firmware/acpi/tables/BOOT
-r-------- 1 root root 0 Nov 19 14:25 /sys/firmware/acpi/tables/DSDT
-r-------- 1 root root 0 Nov 19 14:25 /sys/firmware/acpi/tables/FACP
-r-------- 1 root root 0 Nov 19 14:25 /sys/firmware/acpi/tables/FACS
-r-------- 1 root root 0 Nov 19 14:25 /sys/firmware/acpi/tables/MCFG
-r-------- 1 root root 0 Nov 19 14:25 /sys/firmware/acpi/tables/SRAT
drwxr-xr-x 2 root root 0 Nov 19 09:48 /sys/firmware/acpi/tables/dynamic/

due to which, user-land tools fail reading each table. For example:

$ acpidump -f /sys/firmware/acpi/tables/SRAT
Could not get input file size: /sys/firmware/acpi/tables/SRAT

To deal with the issue, this patch assigns size of each ACPI table to
the corresponding sysfs file.

$ LANG=C ls -hld /sys/firmware/acpi/tables/*
-r-------- 1 root root  94 Nov 19 16:45 /sys/firmware/acpi/tables/APIC
-r-------- 1 root root  40 Nov 19 16:45 /sys/firmware/acpi/tables/BOOT
-r-------- 1 root root 58K Nov 19 16:55 /sys/firmware/acpi/tables/DSDT
-r-------- 1 root root 244 Nov 19 16:55 /sys/firmware/acpi/tables/FACP
-r-------- 1 root root  64 Nov 19 16:55 /sys/firmware/acpi/tables/FACS
-r-------- 1 root root  60 Nov 19 16:55 /sys/firmware/acpi/tables/MCFG
-r-------- 1 root root 168 Nov 19 16:45 /sys/firmware/acpi/tables/SRAT
drwxr-xr-x 2 root root   0 Nov 19 16:55 /sys/firmware/acpi/tables/dynamic/

Then, user-land tools work well like:

$ acpidump -f /sys/firmware/acpi/tables/SRAT
SRAT @ 0x0000000000000000
  0000: 53 52 41 54 A8 00 00 00 02 65 56 4D 57 41 52 45  SRAT.....eVMWARE
  0010: 4D 45 4D 50 4C 55 47 20 00 00 04 06 56 4D 57 20  MEMPLUG ....VMW
  0020: 01 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00  ................
  0030: 01 28 00 00 00 00 00 00 00 00 00 00 00 00 00 00  .(..............
  0040: 00 00 0A 00 00 00 00 00 00 00 00 00 01 00 00 00  ................
  0050: 00 00 00 00 00 00 00 00 01 28 00 00 00 00 00 00  .........(......
  0060: 00 00 10 00 00 00 00 00 00 00 F0 BF 00 00 00 00  ................
  0070: 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00  ................
  0080: 01 28 00 00 00 00 00 00 00 00 00 00 01 00 00 00  .(..............
  0090: 00 00 00 40 00 00 00 00 00 00 00 00 01 00 00 00  ...@............
  00A0: 00 00 00 00 00 00 00 00                          ........

Signed-off-by: HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com>
Acked-by: Toshi Kani <toshi.kani@hp.com>
Acked-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2013-11-21 14:18:41 +01:00
..
acpica Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2013-11-15 16:47:22 -08:00
apei PCI changes for the v3.13 merge window: 2013-11-14 14:02:00 +09:00
Kconfig Merge branch 'acpi-config' 2013-11-16 15:45:00 +01:00
Makefile ACPI and power management updates for 3.13-rc1 2013-11-14 13:41:48 +09:00
ac.c ACPI / AC: Remove struct acpi_device pointer from struct acpi_ac 2013-11-14 23:23:14 +01:00
acpi_cmos_rtc.c ACPI: Add CMOS RTC Operation Region handler support 2013-06-27 21:35:37 +02:00
acpi_extlog.c ACPI, x86: Extended error log driver for x86 platform 2013-10-23 10:09:07 -07:00
acpi_ipmi.c ACPI / IPMI: Cleanup coding styles 2013-09-30 19:46:13 +02:00
acpi_lpss.c Merge branch 'acpi-lpss' 2013-11-16 15:45:13 +01:00
acpi_memhotplug.c Merge branch 'acpi-hotplug' 2013-10-28 01:12:41 +01:00
acpi_pad.c PTR_RET() is a weird name, and led to some confusing usage. We ended 2013-09-04 17:31:11 -07:00
acpi_platform.c ACPI / driver core: Store an ACPI device pointer in struct acpi_dev_node 2013-11-14 23:14:43 +01:00
acpi_processor.c Merge branch 'acpi-processor' 2013-10-28 01:11:24 +01:00
battery.c ACPI / Battery: Remove battery's proc directory 2013-10-12 00:19:44 +02:00
bgrt.c acpi: bgrt: fix build error due to attribute change 2013-08-22 08:34:39 -07:00
blacklist.c Merge branch 'acpi-config' 2013-11-16 15:45:00 +01:00
bus.c PCI changes for the v3.13 merge window: 2013-11-14 14:02:00 +09:00
button.c ACPI / button: Using input_set_capability() to mark device's event capability 2013-09-25 17:11:57 +02:00
container.c Merge branch 'acpi-assorted' 2013-04-28 01:54:08 +02:00
custom_method.c The sweeping change is to make add_taint() explicitly indicate whether to disable 2013-02-25 15:41:43 -08:00
debugfs.c acpi: add export.h to files using THIS_MODULE/EXPORT_SYMBOL 2011-10-31 19:30:34 -04:00
device_pm.c ACPI: Eliminate the DEVICE_ACPI_HANDLE() macro 2013-11-14 23:17:21 +01:00
dock.c Merge branch 'acpi-hotplug' 2013-11-07 19:31:15 +01:00
ec.c Merge branch 'acpi-ec' 2013-11-19 01:06:06 +01:00
ec_sys.c ACPI / EC: access user space with get_user()/put_user() 2013-06-19 23:29:20 +02:00
event.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2013-11-19 15:50:47 -08:00
fan.c ACP / fan: trivial style cleanup 2013-09-24 01:40:38 +02:00
glue.c ACPI / bind: Use (put|get)_device() on ACPI device objects too 2013-11-14 23:18:32 +01:00
hed.c ACPI: Remove useless type argument of driver .remove() operation 2013-01-26 00:37:24 +01:00
internal.h Merge branch 'acpi-hotplug' 2013-11-07 19:31:15 +01:00
numa.c ACPI / mm: use NUMA_NO_NODE 2013-09-24 01:40:38 +02:00
nvs.c ACPI / PM: print physical addresses consistently with other parts of kernel 2012-03-30 02:46:57 -04:00
osl.c Merge branch 'acpi-hotplug' 2013-11-07 19:31:15 +01:00
pci_irq.c PCI/ACPI: Don't cache _PRT, and don't associate them with bus numbers 2013-02-16 11:58:34 -07:00
pci_link.c ACPI: Set length even for TYPE_END_TAG acpi resource 2013-03-24 01:00:38 +01:00
pci_root.c Merge branch 'acpi-hotplug' 2013-11-19 01:05:46 +01:00
pci_slot.c ACPI / PCI: Make bus registration and unregistration symmetric 2013-07-23 03:58:42 +02:00
power.c ACPI / power: Drop automaitc resume of power resource dependent devices 2013-10-16 23:05:42 +02:00
proc.c ACPI / proc: Remove alarm proc file 2013-10-12 00:19:45 +02:00
processor_core.c ACPI / processor: Introduce apic_id in struct processor to save parsed APIC id 2013-09-24 01:39:39 +02:00
processor_driver.c ACPI / processor: Do not request ACPI cpufreq module directly 2013-10-30 00:00:30 +01:00
processor_idle.c ACPI and power management updates for 3.13-rc1 2013-11-14 13:41:48 +09:00
processor_perflib.c ACPI / processor: Do not request ACPI cpufreq module directly 2013-10-30 00:00:30 +01:00
processor_thermal.c ACPI / processor: Remove acpi_processor_get_limit_info() 2013-08-13 12:11:22 +02:00
processor_throttling.c ACPI: suppress compiler warnings in processor_throttling.c 2013-03-25 00:05:48 +01:00
reboot.c Revert "ACPI: ignore FADT reset-reg-sup flag" 2012-04-20 11:19:35 -07:00
resource.c ACPI: introduce helper function acpi_has_method() 2013-07-15 01:33:10 +02:00
sbs.c ACPI / SBS: Remove SBS's proc directory 2013-10-12 00:19:44 +02:00
sbshc.c ACPI: Remove useless type argument of driver .remove() operation 2013-01-26 00:37:24 +01:00
sbshc.h
scan.c Merge branch 'acpi-hotplug' 2013-11-19 01:05:46 +01:00
sleep.c Merge branch 'acpi-assorted' 2013-08-27 01:29:04 +02:00
sleep.h ACPI: Drop power resources driver 2013-01-17 14:11:06 +01:00
sysfs.c ACPI / sysfs: Set file size for each exposed ACPI table 2013-11-21 14:18:41 +01:00
tables.c ACPICA: Cleanup table handler naming conflicts. 2013-01-11 13:10:16 +01:00
thermal.c Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux 2013-11-14 14:42:31 +09:00
utils.c ACPI: Fix spelling mistake in error messages 2013-10-30 00:02:42 +01:00
video.c ACPI / video: clean up DMI table for initial black screen problem 2013-11-15 23:23:17 +01:00
video_detect.c ACPI / video: Add Lenovo IdeaPad Yoga 13 to acpi video detect blacklist 2013-10-16 01:27:33 +02:00
wakeup.c ACPI / Wakeup: Enable button GPEs unconditionally during initialization 2011-02-12 01:39:53 +01:00