[ACPI] PATCH-ACPI based CPU hotplug[1/6]-ACPI core enhancement support

linux

Re: [ACPI] PATCH-ACPI based CPU hotplug[1/6]-ACPI core enhancement support

Postby Keshavamurthy Anil S » Wed, 22 Sep 2004 04:10:09 GMT




> > +acpi_bus_trim(struct acpi_devicestart,
>>>> +nt rmdevice)
>>>> +{
>>>> +cpi_statustatus = AE_OK;
>>>> +truct acpi_device*parent = NULL;
>>>> +truct acpi_device*child = NULL;
>>>> +cpi_handlehandle = 0;
>>>> +cpi_handlehandle = 0;
>>>> +
>>>> +arent  start;>
> > +handle = star>->handle;>
> >
> >
> Why do all these variables have to be initialized? parent and phandle are>
> set up explicitly couple of lines below, the rest is only used safely>
> as well...
You are correct, variable initialization can be removed. I will do this.
>
> >
> Also, introducing recursion (depth does not seem to be limited here) is>
> not a good idea IMHO - better convert it into iteration to avoid stack>
> problems down teh road.
Humm, I guess recursion should be fine and even though the code does not have
an explicit limit, the ACPI namespace describing the Ejectable device will limit the
number of recursible devices. And I believe this won;t be more than 3 to 4 level depth.
Hence recursion is fine here.

If you still strongly believe that recursion is not the right choice here, 
let me know and I will convert it to iteration.

Thanks,
Anil
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to  XXXX@XXXXX.COM 
More majordomo info at   http://www.**--****.com/ 
Please read the FAQ at   http://www.**--****.com/ 

Re: [ACPI] PATCH-ACPI based CPU hotplug[1/6]-ACPI core enhancement support

Postby Bjorn Helgaas » Wed, 22 Sep 2004 05:40:09 GMT





I'm also in favor of removing the recursion, if only because it
allows local analysis.  I.e., a correctness argument based solely
on the code in the patch is much more useful than one that relies
on properties of an external and mostly unknown ACPI namespace.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to  XXXX@XXXXX.COM 
More majordomo info at   http://www.**--****.com/ 
Please read the FAQ at   http://www.**--****.com/ 

Re: [ACPI] PATCH-ACPI based CPU hotplug[1/6]-ACPI core enhancement support

Postby Keshavamurthy Anil S » Wed, 22 Sep 2004 05:50:08 GMT







Okay, I am convinced, I will post an updated patch to address this soon.
Again thanks for the feedback and more comments are welcome:)

-Anil

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to  XXXX@XXXXX.COM 
More majordomo info at   http://www.**--****.com/ 
Please read the FAQ at   http://www.**--****.com/ 

Re: [ACPI] PATCH-ACPI based CPU hotplug[1/6]-ACPI core enhancement support

Postby Keshavamurthy Anil S » Sun, 26 Sep 2004 08:30:12 GMT

n Mon, Sep 20, 2004 at 01:44:32PM -0700, Keshavamurthy Anil S wrote:

Hi Bjorn,
I reworked my patch based on the review feedback I got. Please let me know
if you have any other issues.

Changes from previous version
- Changed acpi_bus_trim() from recursion version to non-recursive version
- Removed unnecessary local varable initializations.

Thanks,
Anil


---
Name:acpi_core.patch
Status: Tested on 2.6.9-rc2
Signed-off-by: Anil S Keshavamurthy < XXXX@XXXXX.COM >
Depends: None
Version: applies on 2.6.9-rc2

Description:
This patch provides core hotplug support in acpi by providing
acpi_bus_trim(), acpi_bus_remove() and acpi_pci_unbind()
which does exactly reverse of acpi_bus_scan(), acpi_bus_add()
and acpi_pci_bind().
Changes from previous version
- Changed acpi_bus_trim() from recursion version to interation version
- Removed unnecessary local varable initializations.
---

linux-2.6.9-rc2-askeshav/drivers/acpi/acpi_ksyms.c | 3
linux-2.6.9-rc2-askeshav/drivers/acpi/bus.c | 4
linux-2.6.9-rc2-askeshav/drivers/acpi/pci_bind.c | 45 ++++++
linux-2.6.9-rc2-askeshav/drivers/acpi/pci_irq.c | 42 +++++-
linux-2.6.9-rc2-askeshav/drivers/acpi/scan.c | 131 +++++++++++++++++--
linux-2.6.9-rc2-askeshav/include/acpi/acpi_bus.h | 10 +
linux-2.6.9-rc2-askeshav/include/acpi/acpi_drivers.h | 2
7 files changed, 220 insertions(+), 17 deletions(-)

diff -puN include/acpi/acpi_bus.h~acpi_core include/acpi/acpi_bus.h
--- linux-2.6.9-rc2/include/acpi/acpi_bus.h~acpi_core 2004-09-24 15:26:16.673473776 -0700
+++ linux-2.6.9-rc2-askeshav/include/acpi/acpi_bus.h 2004-09-24 15:26:16.797497212 -0700
@@ -104,6 +104,7 @@ typedef int (*acpi_op_suspend) (struct a
typedef int (*acpi_op_resume) (struct acpi_device *device, int state);
typedef int (*acpi_op_scan) (struct acpi_device *device);
typedef int (*acpi_op_bind) (struct acpi_device *device);
+typedef int (*acpi_op_unbind) (struct acpi_device *device);

struct acpi_device_ops {
acpi_op_add add;
@@ -115,6 +116,7 @@ struct acpi_device_ops {
acpi_op_resume resume;
acpi_op_scan scan;
acpi_op_bind bind;
+ acpi_op_unbind unbind;
};

struct acpi_driver {
@@ -313,7 +315,8 @@ extern struct subsystem acpi_subsys;
* External Functions
*/

-int acpi_bus_get_device(acpi_handle, struct acpi_device **device);
+int acpi_bus_get_device(acpi_handle handle, struct acpi_device **device);
+void acpi_bus_data_handler(acpi_handle handle, u32 function, void *context);
int acpi_bus_get_status (struct acpi_device *device);
int acpi_bus_get_power (acpi_handle handle, int *state);
int acpi_bus_set_power (acpi_handle handle, int state);
@@ -321,6 +324,11 @@ int acpi_bus_generate_event (struct acpi
int acpi_bus_receive_event (struct acpi_bus_event *event);
int acpi_bus_register_driver (struct acpi_driver *driver);
int acpi_bus_unregister_driver (struct acpi_driver *driver);
+int acpi_bus_scan (struct acpi_device *start);
+int acpi_bus_trim(struct acpi_device *start, int rmdevice);
+int acpi_bus_add (struct acpi_device **child, struct acpi_device *parent,
+ acpi_handle handle, int type);
+

int acpi_create_dir(struct acpi_device *);
void acpi_remove_dir(struct acpi_device *);
diff -puN drivers/acpi/acpi_ksyms.c~acpi_core drivers/acpi/acpi_ksyms.c
--- linux-2.6.9-rc2/drivers/acpi/acpi_ksyms.c~acpi_core 2004-09-24 15:26:16.681286276 -0700
+++ linux-2.6.9-rc2-a



Return to linux

 

Who is online

Users browsing this forum: No registered users and 38 guest