* ACPI patches for rc3 - part 2
@ 2007-12-02 19:48 Len Brown
[not found] ` <357dc4c3f13cb5c1e3b40a09cbe6ff1b0df2c7c3.1196624815.git.len.brown@intel.com>
2007-12-03 16:55 ` ACPI patches for rc3 - part 2 Rafael J. Wysocki
0 siblings, 2 replies; 9+ messages in thread
From: Len Brown @ 2007-12-02 19:48 UTC (permalink / raw)
To: linux-acpi
Two urgent patches to get upstream before rc4...
^ permalink raw reply [flat|nested] 9+ messages in thread[parent not found: <357dc4c3f13cb5c1e3b40a09cbe6ff1b0df2c7c3.1196624815.git.len.brown@intel.com>]
* [PATCH 1/2] ACPI: Delete the IRQ operation in throttling controll via PTC [not found] ` <357dc4c3f13cb5c1e3b40a09cbe6ff1b0df2c7c3.1196624815.git.len.brown@intel.com> @ 2007-12-02 19:48 ` Len Brown [not found] ` <152c300d007c70c4a1847dad39ecdaba22e7d457.1196624815.git.len.brown@intel.com> 1 sibling, 0 replies; 9+ messages in thread From: Len Brown @ 2007-12-02 19:48 UTC (permalink / raw) To: linux-acpi; +Cc: Zhao Yakui, Len Brown From: Zhao Yakui <yakui.zhao@intel.com> The IRQ operation(enable/disable) should be avoided when throttling is controlled via PTC method. It is replaced by the migration of task. This fixes an oops on T61 -- a regression due to f79f06ab9f86 b/c FixedHW support tried to read remote MSR with interrupts disabled. Signed-off-by: Zhao Yakui <yakui.zhao@intel.com> Signed-off-by: Len Brown <len.brown@intel.com> --- drivers/acpi/processor_throttling.c | 36 +++++++++++++++++++++++++++------- 1 files changed, 28 insertions(+), 8 deletions(-) diff --git a/drivers/acpi/processor_throttling.c b/drivers/acpi/processor_throttling.c index c26c61f..6742d7b 100644 --- a/drivers/acpi/processor_throttling.c +++ b/drivers/acpi/processor_throttling.c @@ -29,6 +29,7 @@ #include <linux/kernel.h> #include <linux/module.h> #include <linux/init.h> +#include <linux/sched.h> #include <linux/cpufreq.h> #include <linux/proc_fs.h> #include <linux/seq_file.h> @@ -413,7 +414,7 @@ static int acpi_throttling_rdmsr(struct acpi_processor *pr, } else { msr_low = 0; msr_high = 0; - rdmsr_on_cpu(cpu, MSR_IA32_THERM_CONTROL, + rdmsr_safe(MSR_IA32_THERM_CONTROL, (u32 *)&msr_low , (u32 *) &msr_high); msr = (msr_high << 32) | msr_low; *value = (acpi_integer) msr; @@ -438,7 +439,7 @@ static int acpi_throttling_wrmsr(struct acpi_processor *pr, acpi_integer value) "HARDWARE addr space,NOT supported yet\n"); } else { msr = value; - wrmsr_on_cpu(cpu, MSR_IA32_THERM_CONTROL, + wrmsr_safe(MSR_IA32_THERM_CONTROL, msr & 0xffffffff, msr >> 32); ret = 0; } @@ -572,21 +573,32 @@ static int acpi_processor_get_throttling_ptc(struct acpi_processor *pr) return -ENODEV; pr->throttling.state = 0; - local_irq_disable(); + value = 0; ret = acpi_read_throttling_status(pr, &value); if (ret >= 0) { state = acpi_get_throttling_state(pr, value); pr->throttling.state = state; } - local_irq_enable(); return 0; } static int acpi_processor_get_throttling(struct acpi_processor *pr) { - return pr->throttling.acpi_processor_get_throttling(pr); + cpumask_t saved_mask; + int ret; + + /* + * Migrate task to the cpu pointed by pr. + */ + saved_mask = current->cpus_allowed; + set_cpus_allowed(current, cpumask_of_cpu(pr->id)); + ret = pr->throttling.acpi_processor_get_throttling(pr); + /* restore the previous state */ + set_cpus_allowed(current, saved_mask); + + return ret; } static int acpi_processor_get_fadt_info(struct acpi_processor *pr) @@ -717,21 +729,29 @@ static int acpi_processor_set_throttling_ptc(struct acpi_processor *pr, if (state < pr->throttling_platform_limit) return -EPERM; - local_irq_disable(); value = 0; ret = acpi_get_throttling_value(pr, state, &value); if (ret >= 0) { acpi_write_throttling_state(pr, value); pr->throttling.state = state; } - local_irq_enable(); return 0; } int acpi_processor_set_throttling(struct acpi_processor *pr, int state) { - return pr->throttling.acpi_processor_set_throttling(pr, state); + cpumask_t saved_mask; + int ret; + /* + * Migrate task to the cpu pointed by pr. + */ + saved_mask = current->cpus_allowed; + set_cpus_allowed(current, cpumask_of_cpu(pr->id)); + ret = pr->throttling.acpi_processor_set_throttling(pr, state); + /* restore the previous state */ + set_cpus_allowed(current, saved_mask); + return ret; } int acpi_processor_get_throttling_info(struct acpi_processor *pr) -- 1.5.3.7.949.g2221a6 ^ permalink raw reply related [flat|nested] 9+ messages in thread
[parent not found: <152c300d007c70c4a1847dad39ecdaba22e7d457.1196624815.git.len.brown@intel.com>]
* [PATCH 2/2] ACPICA: fix acpi-cpufreq boot crash due to _PSD return-by-reference [not found] ` <152c300d007c70c4a1847dad39ecdaba22e7d457.1196624815.git.len.brown@intel.com> @ 2007-12-02 19:48 ` Len Brown 0 siblings, 0 replies; 9+ messages in thread From: Len Brown @ 2007-12-02 19:48 UTC (permalink / raw) To: linux-acpi; +Cc: Bob Moore, Len Brown From: Bob Moore <robert.moore@intel.com> Changed resolution of named references in packages Fixed a problem with the Package operator where all named references were created as object references and left otherwise unresolved. According to the ACPI specification, a Package can only contain Data Objects or references to control methods. The implication is that named references to Data Objects (Integer, Buffer, String, Package, BufferField, Field) should be resolved immediately upon package creation. This is the approach taken with this change. References to all other named objects (Methods, Devices, Scopes, etc.) are all now properly created as reference objects. http://bugzilla.kernel.org/show_bug.cgi?id=5328 http://bugzilla.kernel.org/show_bug.cgi?id=9429 Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Len Brown <len.brown@intel.com> --- drivers/acpi/dispatcher/dsobject.c | 91 +++++++++++++++++++++++++++++++++-- 1 files changed, 85 insertions(+), 6 deletions(-) diff --git a/drivers/acpi/dispatcher/dsobject.c b/drivers/acpi/dispatcher/dsobject.c index a474ca2..954ac8c 100644 --- a/drivers/acpi/dispatcher/dsobject.c +++ b/drivers/acpi/dispatcher/dsobject.c @@ -137,6 +137,71 @@ acpi_ds_build_internal_object(struct acpi_walk_state *walk_state, return_ACPI_STATUS(status); } } + + /* Special object resolution for elements of a package */ + + if ((op->common.parent->common.aml_opcode == AML_PACKAGE_OP) || + (op->common.parent->common.aml_opcode == + AML_VAR_PACKAGE_OP)) { + /* + * Attempt to resolve the node to a value before we insert it into + * the package. If this is a reference to a common data type, + * resolve it immediately. According to the ACPI spec, package + * elements can only be "data objects" or method references. + * Attempt to resolve to an Integer, Buffer, String or Package. + * If cannot, return the named reference (for things like Devices, + * Methods, etc.) Buffer Fields and Fields will resolve to simple + * objects (int/buf/str/pkg). + * + * NOTE: References to things like Devices, Methods, Mutexes, etc. + * will remain as named references. This behavior is not described + * in the ACPI spec, but it appears to be an oversight. + */ + obj_desc = (union acpi_operand_object *)op->common.node; + + status = + acpi_ex_resolve_node_to_value(ACPI_CAST_INDIRECT_PTR + (struct + acpi_namespace_node, + &obj_desc), + walk_state); + if (ACPI_FAILURE(status)) { + return_ACPI_STATUS(status); + } + + switch (op->common.node->type) { + /* + * For these types, we need the actual node, not the subobject. + * However, the subobject got an extra reference count above. + */ + case ACPI_TYPE_MUTEX: + case ACPI_TYPE_METHOD: + case ACPI_TYPE_POWER: + case ACPI_TYPE_PROCESSOR: + case ACPI_TYPE_EVENT: + case ACPI_TYPE_REGION: + case ACPI_TYPE_DEVICE: + case ACPI_TYPE_THERMAL: + + obj_desc = + (union acpi_operand_object *)op->common. + node; + break; + + default: + break; + } + + /* + * If above resolved to an operand object, we are done. Otherwise, + * we have a NS node, we must create the package entry as a named + * reference. + */ + if (ACPI_GET_DESCRIPTOR_TYPE(obj_desc) != + ACPI_DESC_TYPE_NAMED) { + goto exit; + } + } } /* Create and init a new internal ACPI object */ @@ -156,6 +221,7 @@ acpi_ds_build_internal_object(struct acpi_walk_state *walk_state, return_ACPI_STATUS(status); } + exit: *obj_desc_ptr = obj_desc; return_ACPI_STATUS(AE_OK); } @@ -356,12 +422,25 @@ acpi_ds_build_internal_package_obj(struct acpi_walk_state *walk_state, arg = arg->common.next; for (i = 0; arg && (i < element_count); i++) { if (arg->common.aml_opcode == AML_INT_RETURN_VALUE_OP) { - - /* This package element is already built, just get it */ - - obj_desc->package.elements[i] = - ACPI_CAST_PTR(union acpi_operand_object, - arg->common.node); + if (arg->common.node->type == ACPI_TYPE_METHOD) { + /* + * A method reference "looks" to the parser to be a method + * invocation, so we special case it here + */ + arg->common.aml_opcode = AML_INT_NAMEPATH_OP; + status = + acpi_ds_build_internal_object(walk_state, + arg, + &obj_desc-> + package. + elements[i]); + } else { + /* This package element is already built, just get it */ + + obj_desc->package.elements[i] = + ACPI_CAST_PTR(union acpi_operand_object, + arg->common.node); + } } else { status = acpi_ds_build_internal_object(walk_state, arg, &obj_desc-> -- 1.5.3.7.949.g2221a6 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: ACPI patches for rc3 - part 2 2007-12-02 19:48 ACPI patches for rc3 - part 2 Len Brown [not found] ` <357dc4c3f13cb5c1e3b40a09cbe6ff1b0df2c7c3.1196624815.git.len.brown@intel.com> @ 2007-12-03 16:55 ` Rafael J. Wysocki 2007-12-03 17:01 ` [PATCH 1/2] HWMON: coretemp, suspend fix Rafael J. Wysocki 2007-12-03 17:03 ` [PATCH 2/2] Freezer: Fix JFFS2 garbage collector freezing issue Rafael J. Wysocki 1 sibling, 2 replies; 9+ messages in thread From: Rafael J. Wysocki @ 2007-12-03 16:55 UTC (permalink / raw) To: Len Brown; +Cc: linux-acpi On Sunday, 2 of December 2007, Len Brown wrote: > Two urgent patches to get upstream before rc4... I have two more urgent patches, related to suspend. Both of them fix recent regressions. Please push upstream. Greetings, Rafael ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 1/2] HWMON: coretemp, suspend fix 2007-12-03 16:55 ` ACPI patches for rc3 - part 2 Rafael J. Wysocki @ 2007-12-03 17:01 ` Rafael J. Wysocki 2007-12-04 6:29 ` Len Brown 2007-12-03 17:03 ` [PATCH 2/2] Freezer: Fix JFFS2 garbage collector freezing issue Rafael J. Wysocki 1 sibling, 1 reply; 9+ messages in thread From: Rafael J. Wysocki @ 2007-12-03 17:01 UTC (permalink / raw) To: Len Brown; +Cc: linux-acpi, pm list, Mark M. Hoffman, Jiri Slaby, Andrew Morton From: Rafael J. Wysocki <rjw@sisk.pl> It's not permitted to unregister a device after devices have been suspended. It causes deadlocks to appear on systems with coretemp hwmon loaded. To avoid this, we can make coretemp_cpu_callback() do nothing if the _FROZEN bit is set in action. Also, in other cases it's generally too late to unregister the coretemp device if the CPU is already dead, so it should be unregistered on CPU_DOWN_PREPARE. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Acked-by: Mark M. Hoffman <mhoffman@lightlink.com> Cc: Jiri Slaby <jirislaby@gmail.com> Cc: Andrew Morton <akpm@linux-foundation.org> --- drivers/hwmon/coretemp.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) Index: linux-2.6/drivers/hwmon/coretemp.c =================================================================== --- linux-2.6.orig/drivers/hwmon/coretemp.c +++ linux-2.6/drivers/hwmon/coretemp.c @@ -337,11 +337,10 @@ static int coretemp_cpu_callback(struct switch (action) { case CPU_ONLINE: - case CPU_ONLINE_FROZEN: + case CPU_DOWN_FAILED: coretemp_device_add(cpu); break; - case CPU_DEAD: - case CPU_DEAD_FROZEN: + case CPU_DOWN_PREPARE: coretemp_device_remove(cpu); break; } - To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/2] HWMON: coretemp, suspend fix 2007-12-03 17:01 ` [PATCH 1/2] HWMON: coretemp, suspend fix Rafael J. Wysocki @ 2007-12-04 6:29 ` Len Brown 2007-12-04 19:59 ` Rafael J. Wysocki 0 siblings, 1 reply; 9+ messages in thread From: Len Brown @ 2007-12-04 6:29 UTC (permalink / raw) To: Rafael J. Wysocki Cc: linux-acpi, pm list, Mark M. Hoffman, Jiri Slaby, Andrew Morton Applied to suspend branch. thanks, -Len On Monday 03 December 2007 12:01, Rafael J. Wysocki wrote: > From: Rafael J. Wysocki <rjw@sisk.pl> > > It's not permitted to unregister a device after devices have been suspended. > It causes deadlocks to appear on systems with coretemp hwmon loaded. To avoid > this, we can make coretemp_cpu_callback() do nothing if the _FROZEN bit is set > in action. > > Also, in other cases it's generally too late to unregister the coretemp device > if the CPU is already dead, so it should be unregistered on CPU_DOWN_PREPARE. > > Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> > Acked-by: Mark M. Hoffman <mhoffman@lightlink.com> > Cc: Jiri Slaby <jirislaby@gmail.com> > Cc: Andrew Morton <akpm@linux-foundation.org> > --- > drivers/hwmon/coretemp.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > Index: linux-2.6/drivers/hwmon/coretemp.c > =================================================================== > --- linux-2.6.orig/drivers/hwmon/coretemp.c > +++ linux-2.6/drivers/hwmon/coretemp.c > @@ -337,11 +337,10 @@ static int coretemp_cpu_callback(struct > > switch (action) { > case CPU_ONLINE: > - case CPU_ONLINE_FROZEN: > + case CPU_DOWN_FAILED: > coretemp_device_add(cpu); > break; > - case CPU_DEAD: > - case CPU_DEAD_FROZEN: > + case CPU_DOWN_PREPARE: > coretemp_device_remove(cpu); > break; > } > > - To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/2] HWMON: coretemp, suspend fix 2007-12-04 6:29 ` Len Brown @ 2007-12-04 19:59 ` Rafael J. Wysocki 0 siblings, 0 replies; 9+ messages in thread From: Rafael J. Wysocki @ 2007-12-04 19:59 UTC (permalink / raw) To: Len Brown; +Cc: linux-acpi, pm list, Mark M. Hoffman, Jiri Slaby, Andrew Morton On Tuesday, 4 of December 2007, Len Brown wrote: > Applied to suspend branch. Thanks! BTW, the 4 topmost non-merge commits from the suspend branch are supposed to go to Linus ASAP. Any chance to push them upstream? Rafael > On Monday 03 December 2007 12:01, Rafael J. Wysocki wrote: > > From: Rafael J. Wysocki <rjw@sisk.pl> > > > > It's not permitted to unregister a device after devices have been suspended. > > It causes deadlocks to appear on systems with coretemp hwmon loaded. To avoid > > this, we can make coretemp_cpu_callback() do nothing if the _FROZEN bit is set > > in action. > > > > Also, in other cases it's generally too late to unregister the coretemp device > > if the CPU is already dead, so it should be unregistered on CPU_DOWN_PREPARE. > > > > Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> > > Acked-by: Mark M. Hoffman <mhoffman@lightlink.com> > > Cc: Jiri Slaby <jirislaby@gmail.com> > > Cc: Andrew Morton <akpm@linux-foundation.org> > > --- > > drivers/hwmon/coretemp.c | 5 ++--- > > 1 file changed, 2 insertions(+), 3 deletions(-) > > > > Index: linux-2.6/drivers/hwmon/coretemp.c > > =================================================================== > > --- linux-2.6.orig/drivers/hwmon/coretemp.c > > +++ linux-2.6/drivers/hwmon/coretemp.c > > @@ -337,11 +337,10 @@ static int coretemp_cpu_callback(struct > > > > switch (action) { > > case CPU_ONLINE: > > - case CPU_ONLINE_FROZEN: > > + case CPU_DOWN_FAILED: > > coretemp_device_add(cpu); > > break; > > - case CPU_DEAD: > > - case CPU_DEAD_FROZEN: > > + case CPU_DOWN_PREPARE: > > coretemp_device_remove(cpu); > > break; > > } > > > > > > -- "Premature optimization is the root of all evil." - Donald Knuth - To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 2/2] Freezer: Fix JFFS2 garbage collector freezing issue 2007-12-03 16:55 ` ACPI patches for rc3 - part 2 Rafael J. Wysocki 2007-12-03 17:01 ` [PATCH 1/2] HWMON: coretemp, suspend fix Rafael J. Wysocki @ 2007-12-03 17:03 ` Rafael J. Wysocki 2007-12-03 23:59 ` Rafael J. Wysocki 1 sibling, 1 reply; 9+ messages in thread From: Rafael J. Wysocki @ 2007-12-03 17:03 UTC (permalink / raw) To: Len Brown; +Cc: linux-acpi, pm list, Pete MacKay, Andrew Morton From: Rafael J. Wysocki <rjw@sisk.pl> Fix breakage caused by commit d5d8c5976d6adeddb8208c240460411e2198b393 "freezer: do not send signals to kernel threads" in jffs2_garbage_collect_thread() that assumed it would be sent signals by the freezer. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Cc: Pete MacKay <armlinux@architechnical.net> Cc: Andrew Morton <akpm@linux-foundation.org> --- fs/jffs2/background.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) Index: linux-2.6/fs/jffs2/background.c =================================================================== --- linux-2.6.orig/fs/jffs2/background.c +++ linux-2.6/fs/jffs2/background.c @@ -103,15 +103,17 @@ static int jffs2_garbage_collect_thread( get there first. */ yield(); + /* If system suspend is in progress, go to the refrigerator and + start again when the suspend is done */ + if (try_to_freeze()) + goto again; + /* Put_super will send a SIGKILL and then wait on the sem. */ while (signal_pending(current)) { siginfo_t info; unsigned long signr; - if (try_to_freeze()) - goto again; - signr = dequeue_signal_lock(current, ¤t->blocked, &info); switch(signr) { ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 2/2] Freezer: Fix JFFS2 garbage collector freezing issue 2007-12-03 17:03 ` [PATCH 2/2] Freezer: Fix JFFS2 garbage collector freezing issue Rafael J. Wysocki @ 2007-12-03 23:59 ` Rafael J. Wysocki 0 siblings, 0 replies; 9+ messages in thread From: Rafael J. Wysocki @ 2007-12-03 23:59 UTC (permalink / raw) To: Len Brown; +Cc: linux-acpi, pm list, Pete MacKay, Andrew Morton On Monday, 3 of December 2007, Rafael J. Wysocki wrote: > From: Rafael J. Wysocki <rjw@sisk.pl> > > Fix breakage caused by commit d5d8c5976d6adeddb8208c240460411e2198b393 > "freezer: do not send signals to kernel threads" in > jffs2_garbage_collect_thread() that assumed it would be sent signals > by the freezer. Scratch this one. I'll send an updated version. The other one is fine, though. Thanks, Rafael > Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> > Cc: Pete MacKay <armlinux@architechnical.net> > Cc: Andrew Morton <akpm@linux-foundation.org> > --- > fs/jffs2/background.c | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) > > Index: linux-2.6/fs/jffs2/background.c > =================================================================== > --- linux-2.6.orig/fs/jffs2/background.c > +++ linux-2.6/fs/jffs2/background.c > @@ -103,15 +103,17 @@ static int jffs2_garbage_collect_thread( > get there first. */ > yield(); > > + /* If system suspend is in progress, go to the refrigerator and > + start again when the suspend is done */ > + if (try_to_freeze()) > + goto again; > + > /* Put_super will send a SIGKILL and then wait on the sem. > */ > while (signal_pending(current)) { > siginfo_t info; > unsigned long signr; > > - if (try_to_freeze()) > - goto again; > - > signr = dequeue_signal_lock(current, ¤t->blocked, &info); > > switch(signr) { > - > To unsubscribe from this list: send the line "unsubscribe linux-acpi" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2007-12-04 19:41 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-02 19:48 ACPI patches for rc3 - part 2 Len Brown
[not found] ` <357dc4c3f13cb5c1e3b40a09cbe6ff1b0df2c7c3.1196624815.git.len.brown@intel.com>
2007-12-02 19:48 ` [PATCH 1/2] ACPI: Delete the IRQ operation in throttling controll via PTC Len Brown
[not found] ` <152c300d007c70c4a1847dad39ecdaba22e7d457.1196624815.git.len.brown@intel.com>
2007-12-02 19:48 ` [PATCH 2/2] ACPICA: fix acpi-cpufreq boot crash due to _PSD return-by-reference Len Brown
2007-12-03 16:55 ` ACPI patches for rc3 - part 2 Rafael J. Wysocki
2007-12-03 17:01 ` [PATCH 1/2] HWMON: coretemp, suspend fix Rafael J. Wysocki
2007-12-04 6:29 ` Len Brown
2007-12-04 19:59 ` Rafael J. Wysocki
2007-12-03 17:03 ` [PATCH 2/2] Freezer: Fix JFFS2 garbage collector freezing issue Rafael J. Wysocki
2007-12-03 23:59 ` Rafael J. Wysocki
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox