Merge branches 'acpi-scan', 'acpi-hotplug' and 'acpi-pci'
* acpi-scan: ACPI / scan: do not scan fixed hardware on HW-reduced platform * acpi-hotplug: ACPI: add dynamic_debug support ACPI / notify: Clean up handling of hotplug events * acpi-pci: ACPI / PCI: Stub out pci_acpi_crs_quirks() and make it x86 specific
This commit is contained in:
@@ -340,16 +340,18 @@ static void acpi_bus_notify(acpi_handle handle, u32 type, void *data)
|
||||
{
|
||||
struct acpi_device *adev;
|
||||
struct acpi_driver *driver;
|
||||
acpi_status status;
|
||||
u32 ost_code = ACPI_OST_SC_NON_SPECIFIC_FAILURE;
|
||||
bool hotplug_event = false;
|
||||
|
||||
switch (type) {
|
||||
case ACPI_NOTIFY_BUS_CHECK:
|
||||
acpi_handle_debug(handle, "ACPI_NOTIFY_BUS_CHECK event\n");
|
||||
hotplug_event = true;
|
||||
break;
|
||||
|
||||
case ACPI_NOTIFY_DEVICE_CHECK:
|
||||
acpi_handle_debug(handle, "ACPI_NOTIFY_DEVICE_CHECK event\n");
|
||||
hotplug_event = true;
|
||||
break;
|
||||
|
||||
case ACPI_NOTIFY_DEVICE_WAKE:
|
||||
@@ -358,6 +360,7 @@ static void acpi_bus_notify(acpi_handle handle, u32 type, void *data)
|
||||
|
||||
case ACPI_NOTIFY_EJECT_REQUEST:
|
||||
acpi_handle_debug(handle, "ACPI_NOTIFY_EJECT_REQUEST event\n");
|
||||
hotplug_event = true;
|
||||
break;
|
||||
|
||||
case ACPI_NOTIFY_DEVICE_CHECK_LIGHT:
|
||||
@@ -393,16 +396,9 @@ static void acpi_bus_notify(acpi_handle handle, u32 type, void *data)
|
||||
(driver->flags & ACPI_DRIVER_ALL_NOTIFY_EVENTS))
|
||||
driver->ops.notify(adev, type);
|
||||
|
||||
switch (type) {
|
||||
case ACPI_NOTIFY_BUS_CHECK:
|
||||
case ACPI_NOTIFY_DEVICE_CHECK:
|
||||
case ACPI_NOTIFY_EJECT_REQUEST:
|
||||
status = acpi_hotplug_schedule(adev, type);
|
||||
if (ACPI_SUCCESS(status))
|
||||
return;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (hotplug_event && ACPI_SUCCESS(acpi_hotplug_schedule(adev, type)))
|
||||
return;
|
||||
|
||||
acpi_bus_put_acpi_device(adev);
|
||||
return;
|
||||
|
||||
|
@@ -2259,12 +2259,16 @@ int __init acpi_scan_init(void)
|
||||
if (result)
|
||||
goto out;
|
||||
|
||||
result = acpi_bus_scan_fixed();
|
||||
if (result) {
|
||||
acpi_detach_data(acpi_root->handle, acpi_scan_drop_device);
|
||||
acpi_device_del(acpi_root);
|
||||
put_device(&acpi_root->dev);
|
||||
goto out;
|
||||
/* Fixed feature devices do not exist on HW-reduced platform */
|
||||
if (!acpi_gbl_reduced_hardware) {
|
||||
result = acpi_bus_scan_fixed();
|
||||
if (result) {
|
||||
acpi_detach_data(acpi_root->handle,
|
||||
acpi_scan_drop_device);
|
||||
acpi_device_del(acpi_root);
|
||||
put_device(&acpi_root->dev);
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
acpi_update_all_gpes();
|
||||
|
@@ -30,6 +30,7 @@
|
||||
#include <linux/types.h>
|
||||
#include <linux/hardirq.h>
|
||||
#include <linux/acpi.h>
|
||||
#include <linux/dynamic_debug.h>
|
||||
|
||||
#include "internal.h"
|
||||
|
||||
@@ -456,6 +457,24 @@ acpi_evaluate_ost(acpi_handle handle, u32 source_event, u32 status_code,
|
||||
}
|
||||
EXPORT_SYMBOL(acpi_evaluate_ost);
|
||||
|
||||
/**
|
||||
* acpi_handle_path: Return the object path of handle
|
||||
*
|
||||
* Caller must free the returned buffer
|
||||
*/
|
||||
static char *acpi_handle_path(acpi_handle handle)
|
||||
{
|
||||
struct acpi_buffer buffer = {
|
||||
.length = ACPI_ALLOCATE_BUFFER,
|
||||
.pointer = NULL
|
||||
};
|
||||
|
||||
if (in_interrupt() ||
|
||||
acpi_get_name(handle, ACPI_FULL_PATHNAME, &buffer) != AE_OK)
|
||||
return NULL;
|
||||
return buffer.pointer;
|
||||
}
|
||||
|
||||
/**
|
||||
* acpi_handle_printk: Print message with ACPI prefix and object path
|
||||
*
|
||||
@@ -469,29 +488,50 @@ acpi_handle_printk(const char *level, acpi_handle handle, const char *fmt, ...)
|
||||
{
|
||||
struct va_format vaf;
|
||||
va_list args;
|
||||
struct acpi_buffer buffer = {
|
||||
.length = ACPI_ALLOCATE_BUFFER,
|
||||
.pointer = NULL
|
||||
};
|
||||
const char *path;
|
||||
|
||||
va_start(args, fmt);
|
||||
vaf.fmt = fmt;
|
||||
vaf.va = &args;
|
||||
|
||||
if (in_interrupt() ||
|
||||
acpi_get_name(handle, ACPI_FULL_PATHNAME, &buffer) != AE_OK)
|
||||
path = "<n/a>";
|
||||
else
|
||||
path = buffer.pointer;
|
||||
|
||||
printk("%sACPI: %s: %pV", level, path, &vaf);
|
||||
path = acpi_handle_path(handle);
|
||||
printk("%sACPI: %s: %pV", level, path ? path : "<n/a>" , &vaf);
|
||||
|
||||
va_end(args);
|
||||
kfree(buffer.pointer);
|
||||
kfree(path);
|
||||
}
|
||||
EXPORT_SYMBOL(acpi_handle_printk);
|
||||
|
||||
#if defined(CONFIG_DYNAMIC_DEBUG)
|
||||
/**
|
||||
* __acpi_handle_debug: pr_debug with ACPI prefix and object path
|
||||
*
|
||||
* This function is called through acpi_handle_debug macro and debug
|
||||
* prints a message with ACPI prefix and object path. This function
|
||||
* acquires the global namespace mutex to obtain an object path. In
|
||||
* interrupt context, it shows the object path as <n/a>.
|
||||
*/
|
||||
void
|
||||
__acpi_handle_debug(struct _ddebug *descriptor, acpi_handle handle,
|
||||
const char *fmt, ...)
|
||||
{
|
||||
struct va_format vaf;
|
||||
va_list args;
|
||||
const char *path;
|
||||
|
||||
va_start(args, fmt);
|
||||
vaf.fmt = fmt;
|
||||
vaf.va = &args;
|
||||
|
||||
path = acpi_handle_path(handle);
|
||||
__dynamic_pr_debug(descriptor, "ACPI: %s: %pV", path ? path : "<n/a>", &vaf);
|
||||
|
||||
va_end(args);
|
||||
kfree(path);
|
||||
}
|
||||
EXPORT_SYMBOL(__acpi_handle_debug);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* acpi_has_method: Check whether @handle has a method named @name
|
||||
* @handle: ACPI device handle
|
||||
|
Viittaa uudesa ongelmassa
Block a user