Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'pm+acpi-3.12-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull ACPI and power management fixes from Rafael Wysocki:
"These fix one recent cpufreq regression, a few older bugs that may
harm users and a kerneldoc typo.

Specifics:

1) After the recent locking changes in the cpufreq core it is
possible to trigger BUG_ON(!policy) in lock_policy_rwsem_read() if
cpufreq_get() is called before registering a cpufreq driver. Fix
from Viresh Kumar.

2) If intel_pstate has been loaded already, it doesn't make sense to
do anything in acpi_cpufreq_init() and moreover doing something in
there in that case may be harmful, so make that function return
immediately if another cpufreq driver is already present. From
Yinghai Lu.

3) The ACPI IPMI driver sometimes attempts to acquire a mutex from
interrupt context, which can be avoided by replacing that mutex
with a spinlock. From Lv Zheng.

4) A NULL pointer may be dereferenced by the exynos5440 cpufreq
driver if a memory allocation made by it fails. Fix from Sachin
Kamat.

5) Hanjun Guo's commit fixes a typo in the kerneldoc comment
documenting acpi_bus_unregister_driver()"

* tag 'pm+acpi-3.12-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
ACPI / scan: fix typo in comments of acpi_bus_unregister_driver()
cpufreq: exynos5440: Fix potential NULL pointer dereference
cpufreq: check cpufreq driver is valid and cpufreq isn't disabled in cpufreq_get()
acpi-cpufreq: skip loading acpi_cpufreq after intel_pstate
ACPI / IPMI: Fix atomic context requirement of ipmi_msg_handler()

+23 -12
+14 -10
drivers/acpi/acpi_ipmi.c
··· 39 39 #include <linux/ipmi.h> 40 40 #include <linux/device.h> 41 41 #include <linux/pnp.h> 42 + #include <linux/spinlock.h> 42 43 43 44 MODULE_AUTHOR("Zhao Yakui"); 44 45 MODULE_DESCRIPTION("ACPI IPMI Opregion driver"); ··· 58 57 struct list_head head; 59 58 /* the IPMI request message list */ 60 59 struct list_head tx_msg_list; 61 - struct mutex tx_msg_lock; 60 + spinlock_t tx_msg_lock; 62 61 acpi_handle handle; 63 62 struct pnp_dev *pnp_dev; 64 63 ipmi_user_t user_interface; ··· 148 147 struct kernel_ipmi_msg *msg; 149 148 struct acpi_ipmi_buffer *buffer; 150 149 struct acpi_ipmi_device *device; 150 + unsigned long flags; 151 151 152 152 msg = &tx_msg->tx_message; 153 153 /* ··· 179 177 180 178 /* Get the msgid */ 181 179 device = tx_msg->device; 182 - mutex_lock(&device->tx_msg_lock); 180 + spin_lock_irqsave(&device->tx_msg_lock, flags); 183 181 device->curr_msgid++; 184 182 tx_msg->tx_msgid = device->curr_msgid; 185 - mutex_unlock(&device->tx_msg_lock); 183 + spin_unlock_irqrestore(&device->tx_msg_lock, flags); 186 184 } 187 185 188 186 static void acpi_format_ipmi_response(struct acpi_ipmi_msg *msg, ··· 244 242 int msg_found = 0; 245 243 struct acpi_ipmi_msg *tx_msg; 246 244 struct pnp_dev *pnp_dev = ipmi_device->pnp_dev; 245 + unsigned long flags; 247 246 248 247 if (msg->user != ipmi_device->user_interface) { 249 248 dev_warn(&pnp_dev->dev, "Unexpected response is returned. " ··· 253 250 ipmi_free_recv_msg(msg); 254 251 return; 255 252 } 256 - mutex_lock(&ipmi_device->tx_msg_lock); 253 + spin_lock_irqsave(&ipmi_device->tx_msg_lock, flags); 257 254 list_for_each_entry(tx_msg, &ipmi_device->tx_msg_list, head) { 258 255 if (msg->msgid == tx_msg->tx_msgid) { 259 256 msg_found = 1; ··· 261 258 } 262 259 } 263 260 264 - mutex_unlock(&ipmi_device->tx_msg_lock); 261 + spin_unlock_irqrestore(&ipmi_device->tx_msg_lock, flags); 265 262 if (!msg_found) { 266 263 dev_warn(&pnp_dev->dev, "Unexpected response (msg id %ld) is " 267 264 "returned.\n", msg->msgid); ··· 381 378 struct acpi_ipmi_device *ipmi_device = handler_context; 382 379 int err, rem_time; 383 380 acpi_status status; 381 + unsigned long flags; 384 382 /* 385 383 * IPMI opregion message. 386 384 * IPMI message is firstly written to the BMC and system software ··· 399 395 return AE_NO_MEMORY; 400 396 401 397 acpi_format_ipmi_msg(tx_msg, address, value); 402 - mutex_lock(&ipmi_device->tx_msg_lock); 398 + spin_lock_irqsave(&ipmi_device->tx_msg_lock, flags); 403 399 list_add_tail(&tx_msg->head, &ipmi_device->tx_msg_list); 404 - mutex_unlock(&ipmi_device->tx_msg_lock); 400 + spin_unlock_irqrestore(&ipmi_device->tx_msg_lock, flags); 405 401 err = ipmi_request_settime(ipmi_device->user_interface, 406 402 &tx_msg->addr, 407 403 tx_msg->tx_msgid, ··· 417 413 status = AE_OK; 418 414 419 415 end_label: 420 - mutex_lock(&ipmi_device->tx_msg_lock); 416 + spin_lock_irqsave(&ipmi_device->tx_msg_lock, flags); 421 417 list_del(&tx_msg->head); 422 - mutex_unlock(&ipmi_device->tx_msg_lock); 418 + spin_unlock_irqrestore(&ipmi_device->tx_msg_lock, flags); 423 419 kfree(tx_msg); 424 420 return status; 425 421 } ··· 461 457 462 458 INIT_LIST_HEAD(&ipmi_device->head); 463 459 464 - mutex_init(&ipmi_device->tx_msg_lock); 460 + spin_lock_init(&ipmi_device->tx_msg_lock); 465 461 INIT_LIST_HEAD(&ipmi_device->tx_msg_list); 466 462 ipmi_install_space_handler(ipmi_device); 467 463
+1 -1
drivers/acpi/scan.c
··· 1121 1121 EXPORT_SYMBOL(acpi_bus_register_driver); 1122 1122 1123 1123 /** 1124 - * acpi_bus_unregister_driver - unregisters a driver with the APIC bus 1124 + * acpi_bus_unregister_driver - unregisters a driver with the ACPI bus 1125 1125 * @driver: driver to unregister 1126 1126 * 1127 1127 * Unregisters a driver with the ACPI bus. Searches the namespace for all
+4
drivers/cpufreq/acpi-cpufreq.c
··· 986 986 { 987 987 int ret; 988 988 989 + /* don't keep reloading if cpufreq_driver exists */ 990 + if (cpufreq_get_current_driver()) 991 + return 0; 992 + 989 993 if (acpi_disabled) 990 994 return 0; 991 995
+3
drivers/cpufreq/cpufreq.c
··· 1460 1460 { 1461 1461 unsigned int ret_freq = 0; 1462 1462 1463 + if (cpufreq_disabled() || !cpufreq_driver) 1464 + return -ENOENT; 1465 + 1463 1466 if (!down_read_trylock(&cpufreq_rwsem)) 1464 1467 return 0; 1465 1468
+1 -1
drivers/cpufreq/exynos5440-cpufreq.c
··· 457 457 opp_free_cpufreq_table(dvfs_info->dev, &dvfs_info->freq_table); 458 458 err_put_node: 459 459 of_node_put(np); 460 - dev_err(dvfs_info->dev, "%s: failed initialization\n", __func__); 460 + dev_err(&pdev->dev, "%s: failed initialization\n", __func__); 461 461 return ret; 462 462 } 463 463