Skip to contentSkip to conversation

the scheduled ACPI_PROCFS removal

PATCH NAK Adrian Bunk 9 participants 12 messages Jul 9, 2007 – Jul 16, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 the scheduled ACPI_PROCFS removal

This patch contains the scheduled removal of the ACPI procfs interface.

---

 Documentation/feature-removal-schedule.txt |    8 -
 drivers/acpi/Kconfig                       |   13 -
 drivers/acpi/debug.c                       |  143 ---------------------
 drivers/acpi/system.c                      |  129 ------------------
 4 files changed, 293 deletions(-)
Documentation/feature-removal-schedule.txt renamed from Documentation/feature-removal-schedule.txt.old +0 -8
@@ -190,14 +190,6 @@
 
 ---------------------------
 
-What:	ACPI procfs interface
-When:	July 2007
-Why:	After ACPI sysfs conversion, ACPI attributes will be duplicated
-	in sysfs and the ACPI procfs interface should be removed.
-Who:	Zhang Rui <[email protected]>
-
----------------------------
-
 What:	/proc/acpi/button
 When:	August 2007
 Why:	/proc/acpi/button has been replaced by events to the input layer
drivers/acpi/Kconfig renamed from drivers/acpi/Kconfig.old +0 -13
@@ -75,19 +75,6 @@
 	  Create /proc/acpi/sleep
 	  Deprecated by /sys/power/state
 
-config ACPI_PROCFS
-	bool "Procfs interface (deprecated)"
-	default y
-	---help---
-	  The Procfs interface for ACPI is made optional for backward compatibility.
-	  As the same functions are duplicated in the sysfs interface
-	  and this proc interface will be removed some time later,
-	  it's marked as deprecated.
-	  ( /proc/acpi/debug_layer && debug_level are deprecated by
-	    /sys/module/acpi/parameters/debug_layer && debug_level.
-	    /proc/acpi/info is deprecated by
-	    /sys/module/acpi/parameters/acpica_version )
-
 config ACPI_AC
 	tristate "AC Adapter"
 	depends on X86
drivers/acpi/debug.c renamed from drivers/acpi/debug.c.old +0 -143

146 lines not on this page · raw message

drivers/acpi/system.c renamed from drivers/acpi/system.c.old +0 -129

141 lines not on this page · raw message

#1 lore raw
Quoted 1 line · Adrian Bunk

This patch contains the scheduled removal of the ACPI procfs interface.

This was only flagged deprecated in January. Userspace hasn't really caught up, so I think removing it now is premature. Given the quantity of software that's been written to use the old /proc interface, I don't think we're realistically going to be able to remove it in the forseeable future.

Signature · 1 line
Matthew Garrett | [email protected]
#2 lore raw
In reply to Adrian Bunk
Quoted 1 line · On Mon, 9 Jul 2007 16:57:56 +0200 Adrian Bunk <[email protected]> wrote:

This patch contains the scheduled removal of the ACPI procfs interface.

NAK

What part of "we do not gratuitously break user space interfaces" is so hard for people to understand.

#3 lore raw
Quoted 5 lines · Alan Cox
Quoted 2 lines

This patch contains the scheduled removal of the ACPI procfs interface.

What part of "we do not gratuitously break user space interfaces" is so hard for people to understand.

Generally I am with you on that, but if everyone keeps on using /proc -- and I do[*] -- we will never get rid of it.

[*] Does someone have an alternative for /proc/acpi/battery/BAT1/{state,info}?

Thanks,
Jan

#4 lore raw
Quoted 5 lines · Jan Engelhardt

Generally I am with you on that, but if everyone keeps on using /proc -- and I do[*] -- we will never get rid of it.

[*] Does someone have an alternative for /proc/acpi/battery/BAT1/{state,info}?

The battery class work will provide one in the long run, but it's not mainline yet.

Signature · 1 line
Matthew Garrett | [email protected]
#5 lore raw
In reply to Jan Engelhardt
Quoted 10 lines · On Mon, 9 Jul 2007 20:46:20 +0200 (CEST) Jan Engelhardt…
Quoted 5 lines · Alan Cox
Quoted 2 lines

This patch contains the scheduled removal of the ACPI procfs interface.

What part of "we do not gratuitously break user space interfaces" is so hard for people to understand.

Generally I am with you on that, but if everyone keeps on using /proc -- and I do[*] -- we will never get rid of it.

And why do we need to get rid of it ?

#6 lore raw
In reply to Jan Engelhardt
Quoted 8 lines · Jan Engelhardt
Quoted 3 lines · Alan Cox
Quoted 1 line

This patch contains the scheduled removal of the ACPI procfs interface.

What part of "we do not gratuitously break user space interfaces" is so hard for people to understand.

Generally I am with you on that, but if everyone keeps on using /proc -- and I do[*] -- we will never get rid of it.

Is there some reason why you should get rid of it? Is it causing a lot work to maintain?

Quoted 3 lines

[*] Does someone have an alternative for /proc/acpi/battery/BAT1/{state,info}?

Signature · 3 lines
Bill Davidsen <[email protected]>
  "We have more to fear from the bungling of the incompetent than from
the machinations of the wicked."  - from Slashdot
#7 lore raw
Quoted 2 lines
Quoted 2 lines

[*] Does someone have an alternative for
/proc/acpi/battery/BAT1/{state,info}?

I'm working on it. Should have proto by the end of week.

Regards,
Alex

#8 lore raw
Quoted 3 lines · Alexey Starikovskiy
Quoted 2 lines
Quoted 2 lines

[*] Does someone have an alternative for
/proc/acpi/battery/BAT1/{state,info}?

I'm working on it. Should have proto by the end of week.

If you are using the power_supply class (i hope you are ;-) then a HAL from freedesktop git should make userspace continue to just work. Please yell if you notice any differences.

Richard.

#9 lore raw
Quoted 8 lines · Richard Hughes
Quoted 3 lines · Alexey Starikovskiy
Quoted 2 lines
Quoted 2 lines

[*] Does someone have an alternative for
/proc/acpi/battery/BAT1/{state,info}?

I'm working on it. Should have proto by the end of week.

If you are using the power_supply class (i hope you are ;-) then a HAL from freedesktop git should make userspace continue to just work. Please yell if you notice any differences.

Well, both SBS and CM batteries were able to set an alarm capacity. I did not found write capability to property in power_supply class yet. So consider this a yelling :)

Thanks,
Alex.

#10 lore raw
In reply to Richard Hughes
Quoted 7 lines · Richard Hughes
Quoted 3 lines · Alexey Starikovskiy
Quoted 2 lines
Quoted 2 lines

[*] Does someone have an alternative for
/proc/acpi/battery/BAT1/{state,info}?

I'm working on it. Should have proto by the end of week.

If you are using the power_supply class (i hope you are ;-) then a HAL from freedesktop git should make userspace continue to just work.

Having to update HAL is not my definition of "does not break userspace". And, BTW, there is more than just HAL out there using /proc/acpi, and this should continue to work.

Signature · 10 lines
Stefan Seyfried
QA / R&D Team Mobile Devices        |              "Any ideas, John?"
SUSE LINUX Products GmbH, Nürnberg  | "Well, surrounding them's out." 

This footer brought to you by insane German lawmakers:
SUSE Linux Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)
-
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
#11 lore raw
In reply to Adrian Bunk

Hi,

I really appreciate your help.
The ACPI sysfs conversion work is still in progress. We'll update the ACPI_PROCFS removal plan soon. Sorry to make you confused.

Thanks,
Rui

Quoted 389 lines · Adrian Bunk

This patch contains the scheduled removal of the ACPI procfs interface.

---

 Documentation/feature-removal-schedule.txt |    8 -
 drivers/acpi/Kconfig                       |   13 -
 drivers/acpi/debug.c                       |  143
---------------------
 drivers/acpi/system.c                      |  129 ------------------
 4 files changed, 293 deletions(-)

--- linux-2.6.22-rc6-mm1/Documentation/feature-removal- schedule.txt.old 2007-07-09 02:04:01.000000000 +0200
+++ linux-2.6.22-rc6-mm1/Documentation/feature-removal-schedule.txt

2007-07-09 02:04:32.000000000 +0200
Documentation/feature-removal-schedule.txt renamed from Documentation/feature-removal-schedule.txt.old +0 -3
@@ -190,14 +190,6 @@
 
 ---------------------------
 
-What:  ACPI procfs interface
-When:  July 2007
-Why:   After ACPI sysfs conversion, ACPI attributes will be

duplicated

Documentation/feature-removal-schedule.txt renamed from Documentation/feature-removal-schedule.txt.old +0 -5
-       in sysfs and the ACPI procfs interface should be removed.
-Who:   Zhang Rui <[email protected]>
-
----------------------------
-
 What:  /proc/acpi/button
 When:  August 2007
 Why:   /proc/acpi/button has been replaced by events to the input

layer
--- linux-2.6.22-rc6-mm1/drivers/acpi/Kconfig.old 2007-07-09
02:04:39.000000000 +0200
+++ linux-2.6.22-rc6-mm1/drivers/acpi/Kconfig 2007-07-09
02:04:57.000000000 +0200

drivers/acpi/Kconfig renamed from drivers/acpi/Kconfig.old +0 -5
@@ -75,19 +75,6 @@
          Create /proc/acpi/sleep
          Deprecated by /sys/power/state
 
-config ACPI_PROCFS
-       bool "Procfs interface (deprecated)"
-       default y
-       ---help---
-         The Procfs interface for ACPI is made optional for backward

compatibility.

drivers/acpi/Kconfig renamed from drivers/acpi/Kconfig.old +0 -9
-         As the same functions are duplicated in the sysfs interface
-         and this proc interface will be removed some time later,
-         it's marked as deprecated.
-         ( /proc/acpi/debug_layer && debug_level are deprecated by
-           /sys/module/acpi/parameters/debug_layer && debug_level.
-           /proc/acpi/info is deprecated by
-           /sys/module/acpi/parameters/acpica_version )
-
 config ACPI_AC
        tristate "AC Adapter"
        depends on X86
--- linux-2.6.22-rc6-mm1/drivers/acpi/debug.c.old       2007-07-09

02:05:04.000000000 +0200
+++ linux-2.6.22-rc6-mm1/drivers/acpi/debug.c 2007-07-09
02:05:41.000000000 +0200

(quoted diff) +0 -0
@@ -130,146 +130,3 @@
 module_param_call(debug_layer, param_set_uint, param_get_debug_layer,
 &acpi_dbg_layer, 0644);
 module_param_call(debug_level, param_set_uint, param_get_debug_level,

&acpi_dbg_level, 0644);

drivers/acpi/debug.c renamed from drivers/acpi/debug.c.old +0 -12
-/*
--------------------------------------------------------------------------
-                              FS Interface (/proc)
-
-------------------------------------------------------------------------- */
-#ifdef CONFIG_ACPI_PROCFS
-#define ACPI_SYSTEM_FILE_DEBUG_LAYER   "debug_layer"
-#define ACPI_SYSTEM_FILE_DEBUG_LEVEL           "debug_level"
-
-static int
-acpi_system_read_debug(char *page,
-                      char **start, off_t off, int count, int *eof,

void *data)

drivers/acpi/debug.c renamed from drivers/acpi/debug.c.old +0 -17
-{
-       char *p = page;
-       int size = 0;
-       unsigned int i;
-
-       if (off != 0)
-               goto end;
-
-       p += sprintf(p, "%-25s\tHex        SET\n", "Description");
-
-       switch ((unsigned long)data) {
-       case 0:
-               for (i = 0; i < ARRAY_SIZE(acpi_debug_layers); i++) {
-                       p += sprintf(p, "%-25s\t0x%08lX [%c]\n",
-                                    acpi_debug_layers[i].name,
-                                    acpi_debug_layers[i].value,
-                                    (acpi_dbg_layer &

acpi_debug_layers[i].

drivers/acpi/debug.c renamed from drivers/acpi/debug.c.old +0 -3
-                                     value) ? '*' : ' ');
-               }
-               p += sprintf(p, "%-25s\t0x%08X [%c]\n",

"ACPI_ALL_DRIVERS",

drivers/acpi/debug.c renamed from drivers/acpi/debug.c.old +0 -3
-                            ACPI_ALL_DRIVERS,
-                            (acpi_dbg_layer & ACPI_ALL_DRIVERS) ==
-                            ACPI_ALL_DRIVERS ? '*' : (acpi_dbg_layer

&
-
ACPI_ALL_DRIVERS) ==

drivers/acpi/debug.c renamed from drivers/acpi/debug.c.old +0 -3
-                            0 ? ' ' : '-');
-               p += sprintf(p,
-                            "--\ndebug_layer = 0x%08X (* = enabled, -

= partial)\n",

drivers/acpi/debug.c renamed from drivers/acpi/debug.c.old +0 -8
-                            acpi_dbg_layer);
-               break;
-       case 1:
-               for (i = 0; i < ARRAY_SIZE(acpi_debug_levels); i++) {
-                       p += sprintf(p, "%-25s\t0x%08lX [%c]\n",
-                                    acpi_debug_levels[i].name,
-                                    acpi_debug_levels[i].value,
-                                    (acpi_dbg_level &

acpi_debug_levels[i].

drivers/acpi/debug.c renamed from drivers/acpi/debug.c.old +0 -3
-                                     value) ? '*' : ' ');
-               }
-               p += sprintf(p, "--\ndebug_level = 0x%08X (* =

enabled)\n",

drivers/acpi/debug.c renamed from drivers/acpi/debug.c.old +0 -40
-                            acpi_dbg_level);
-               break;
-       default:
-               p += sprintf(p, "Invalid debug option\n");
-               break;
-       }
-
-      end:
-       size = (p - page);
-       if (size <= off + count)
-               *eof = 1;
-       *start = page + off;
-       size -= off;
-       if (size > count)
-               size = count;
-       if (size < 0)
-               size = 0;
-
-       return size;
-}
-
-static int
-acpi_system_write_debug(struct file *file,
-                       const char __user * buffer,
-                       unsigned long count, void *data)
-{
-       char debug_string[12] = { '\0' };
-
-
-       if (count > sizeof(debug_string) - 1)
-               return -EINVAL;
-
-       if (copy_from_user(debug_string, buffer, count))
-               return -EFAULT;
-
-       debug_string[count] = '\0';
-
-       switch ((unsigned long)data) {
-       case 0:
-               acpi_dbg_layer = simple_strtoul(debug_string, NULL,

0);

drivers/acpi/debug.c renamed from drivers/acpi/debug.c.old +0 -3
-               break;
-       case 1:
-               acpi_dbg_level = simple_strtoul(debug_string, NULL,

0);

drivers/acpi/debug.c renamed from drivers/acpi/debug.c.old +0 -23
-               break;
-       default:
-               return -EINVAL;
-       }
-
-       return count;
-}
-
-static int __init acpi_debug_init(void)
-{
-       struct proc_dir_entry *entry;
-       int error = 0;
-       char *name;
-
-
-       if (acpi_disabled)
-               return 0;
-
-       /* 'debug_layer' [R/W] */
-       name = ACPI_SYSTEM_FILE_DEBUG_LAYER;
-       entry =
-           create_proc_read_entry(name, S_IFREG | S_IRUGO | S_IWUSR,
-                                  acpi_root_dir,

acpi_system_read_debug,

drivers/acpi/debug.c renamed from drivers/acpi/debug.c.old +0 -11
-                                  (void *)0);
-       if (entry)
-               entry->write_proc = acpi_system_write_debug;
-       else
-               goto Error;
-
-       /* 'debug_level' [R/W] */
-       name = ACPI_SYSTEM_FILE_DEBUG_LEVEL;
-       entry =
-           create_proc_read_entry(name, S_IFREG | S_IRUGO | S_IWUSR,
-                                  acpi_root_dir,

acpi_system_read_debug,

drivers/acpi/debug.c renamed from drivers/acpi/debug.c.old +0 -11
-                                  (void *)1);
-       if (entry)
-               entry->write_proc = acpi_system_write_debug;
-       else
-               goto Error;
-
-      Done:
-       return error;
-
-      Error:
-       remove_proc_entry(ACPI_SYSTEM_FILE_DEBUG_LEVEL,

acpi_root_dir);
- remove_proc_entry(ACPI_SYSTEM_FILE_DEBUG_LAYER,
acpi_root_dir);

drivers/acpi/debug.c renamed from drivers/acpi/debug.c.old +0 -7
-       error = -ENODEV;
-       goto Done;
-}
-
-subsys_initcall(acpi_debug_init);
-#endif
--- linux-2.6.22-rc6-mm1/drivers/acpi/system.c.old      2007-07-09

02:05:48.000000000 +0200
+++ linux-2.6.22-rc6-mm1/drivers/acpi/system.c 2007-07-09 02:06:30.000000000 +0200

drivers/acpi/system.c renamed from drivers/acpi/system.c.old +0 -31
@@ -167,131 +167,6 @@
        return 0;
 }
 
-/*
--------------------------------------------------------------------------
-                              FS Interface (/proc)
-
-------------------------------------------------------------------------- */
-#ifdef CONFIG_ACPI_PROCFS
-#define ACPI_SYSTEM_FILE_INFO          "info"
-#define ACPI_SYSTEM_FILE_EVENT         "event"
-#define ACPI_SYSTEM_FILE_DSDT          "dsdt"
-#define ACPI_SYSTEM_FILE_FADT          "fadt"
-
-static int acpi_system_read_info(struct seq_file *seq, void *offset)
-{
-
-       seq_printf(seq, "version:                 %x\n",
 ACPI_CA_VERSION);
-       return 0;
-}
-
-static int acpi_system_info_open_fs(struct inode *inode, struct file
 *file)
-{
-       return single_open(file, acpi_system_read_info, PDE(inode)-
 >data);
-}
-
-static const struct file_operations acpi_system_info_ops = {
-       .open = acpi_system_info_open_fs,
-       .read = seq_read,
-       .llseek = seq_lseek,
-       .release = single_release,
-};
-
-static ssize_t acpi_system_read_dsdt(struct file *, char __user *,

size_t,

drivers/acpi/system.c renamed from drivers/acpi/system.c.old +0 -9
-                                    loff_t *);
-
-static const struct file_operations acpi_system_dsdt_ops = {
-       .read = acpi_system_read_dsdt,
-};
-
-static ssize_t
-acpi_system_read_dsdt(struct file *file,
-                     char __user * buffer, size_t count, loff_t *

ppos)

drivers/acpi/system.c renamed from drivers/acpi/system.c.old +0 -10
-{
-       acpi_status status = AE_OK;
-       struct acpi_table_header *dsdt = NULL;
-       ssize_t res;
-
-       status = acpi_get_table(ACPI_SIG_DSDT, 1, &dsdt);
-       if (ACPI_FAILURE(status))
-               return -ENODEV;
-
-       res = simple_read_from_buffer(buffer, count, ppos, dsdt, dsdt-
Quoted 1 line

length);

drivers/acpi/system.c renamed from drivers/acpi/system.c.old +0 -5
-
-       return res;
-}
-
-static ssize_t acpi_system_read_fadt(struct file *, char __user *,

size_t,

drivers/acpi/system.c renamed from drivers/acpi/system.c.old +0 -9
-                                    loff_t *);
-
-static const struct file_operations acpi_system_fadt_ops = {
-       .read = acpi_system_read_fadt,
-};
-
-static ssize_t
-acpi_system_read_fadt(struct file *file,
-                     char __user * buffer, size_t count, loff_t *

ppos)

drivers/acpi/system.c renamed from drivers/acpi/system.c.old +0 -10
-{
-       acpi_status status = AE_OK;
-       struct acpi_table_header *fadt = NULL;
-       ssize_t res;
-
-       status = acpi_get_table(ACPI_SIG_FADT, 1, &fadt);
-       if (ACPI_FAILURE(status))
-               return -ENODEV;
-
-       res = simple_read_from_buffer(buffer, count, ppos, fadt, fadt-
Quoted 1 line

length);

drivers/acpi/system.c renamed from drivers/acpi/system.c.old +0 -57
-
-       return res;
-}
-
-static int acpi_system_procfs_init(void)
-{
-       struct proc_dir_entry *entry;
-       int error = 0;
-       char *name;
-
-       /* 'info' [R] */
-       name = ACPI_SYSTEM_FILE_INFO;
-       entry = create_proc_entry(name, S_IRUGO, acpi_root_dir);
-       if (!entry)
-               goto Error;
-       else {
-               entry->proc_fops = &acpi_system_info_ops;
-       }
-
-       /* 'dsdt' [R] */
-       name = ACPI_SYSTEM_FILE_DSDT;
-       entry = create_proc_entry(name, S_IRUSR, acpi_root_dir);
-       if (entry)
-               entry->proc_fops = &acpi_system_dsdt_ops;
-       else
-               goto Error;
-
-       /* 'fadt' [R] */
-       name = ACPI_SYSTEM_FILE_FADT;
-       entry = create_proc_entry(name, S_IRUSR, acpi_root_dir);
-       if (entry)
-               entry->proc_fops = &acpi_system_fadt_ops;
-       else
-               goto Error;
-
-      Done:
-       return error;
-
-      Error:
-       remove_proc_entry(ACPI_SYSTEM_FILE_FADT, acpi_root_dir);
-       remove_proc_entry(ACPI_SYSTEM_FILE_DSDT, acpi_root_dir);
-       remove_proc_entry(ACPI_SYSTEM_FILE_INFO, acpi_root_dir);
-
-       error = -EFAULT;
-       goto Done;
-}
-#else
-static int acpi_system_procfs_init(void)
-{
-       return 0;
-}
-#endif
-
 static int __init acpi_system_init(void)
 {
        int result = 0;
@@ -299,10 +174,6 @@
        if (acpi_disabled)
                return 0;
 
-       result = acpi_system_procfs_init();
-       if (result)
-               return result;
-
        result = acpi_system_sysfs_init();
 
        return result;