Commit 603f162a authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull ACPI updates from Rafael Wysocki:
 "The most significant change here is replacing msleep() in
  acpi_os_sleep() with usleep_range() to reduce spurious sleep time due
  to timer inaccuracy which may spectacularly reduce the duration of
  system suspend and resume transitions on some systems.

  All of the other changes fall into the fixes and cleanups category
  this time.

  Specifics:

   - Use usleep_range() instead of msleep() in acpi_os_sleep() to reduce
     excessive delays due to timer inaccuracy, mostly affecting system
     suspend and resume (Rafael Wysocki)

   - Use str_enabled_disabled() string helpers in the ACPI tables
     parsing code to make it easier to follow (Sunil V L)

   - Update device properties parsing on systems using ACPI so that data
     firmware nodes resulting from _DSD evaluation are treated as
     available in firmware nodes walks (Sakari Ailus)

   - Fix missing guid_t declaration in linux/prmt.h (Robert Richter)

   - Update the GHES handling code to follow the global panic= policy
     instead of overriding it by force-rebooting the system after a
     fatal HW error has been reported (Borislav Petkov)

   - Update messages printed by the ACPI battery driver to always refer
     to driver extensions as "hooks" to avoid confusion with similar
     functionality in the power supply subsystem in the future (Thomas
     Weißschuh)

   - Fix .probe() error path cleanup in the ACPI fan driver to avoid
     memory leaks (Joe Hattori)

   - Constify 'struct bin_attribute' in some places in the ACPI
     subsystem and mark it as __ro_after_init in one place to prevent
     binary blob attributes from being updated (Thomas Weißschuh)

   - Add empty stubs for several ACPI-related symbols so that they can
     be used when CONFIG_ACPI is unset and use them for removing
     unnecessary conditional compilation from the ipu-bridge driver
     (Ricardo Ribalda)"

* tag 'acpi-6.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  APEI: GHES: Have GHES honor the panic= setting
  ACPI: PRM: Fix missing guid_t declaration in linux/prmt.h
  ACPI: tables: Use string choice helpers
  ACPI: property: Consider data nodes as being available
  media: ipu-bridge: Remove unneeded conditional compilations
  ACPI: bus: implement acpi_device_hid when !ACPI
  ACPI: bus: implement for_each_acpi_consumer_dev when !ACPI
  ACPI: header: implement acpi_device_handle when !ACPI
  ACPI: bus: implement acpi_get_physical_device_location when !ACPI
  ACPI: bus: implement for_each_acpi_dev_match when !ACPI
  ACPI: bus: change the prototype for acpi_get_physical_device_location
  ACPI: fan: cleanup resources in the error path of .probe()
  ACPI: battery: Rename extensions to hook in messages
  ACPI: OSL: Use usleep_range() in acpi_os_sleep()
  ACPI: sysfs: Constify 'struct bin_attribute'
  ACPI: BGRT: Constify 'struct bin_attribute'
  ACPI: BGRT: Mark bin_attribute as __ro_after_init
parents f4b9d3bf d1ddf946
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -173,8 +173,6 @@ static struct gen_pool *ghes_estatus_pool;
static struct ghes_estatus_cache __rcu *ghes_estatus_caches[GHES_ESTATUS_CACHES_SIZE];
static atomic_t ghes_estatus_cache_alloced;

static int ghes_panic_timeout __read_mostly = 30;

static void __iomem *ghes_map(u64 pfn, enum fixed_addresses fixmap_idx)
{
	phys_addr_t paddr;
@@ -983,14 +981,16 @@ static void __ghes_panic(struct ghes *ghes,
			 struct acpi_hest_generic_status *estatus,
			 u64 buf_paddr, enum fixed_addresses fixmap_idx)
{
	const char *msg = GHES_PFX "Fatal hardware error";

	__ghes_print_estatus(KERN_EMERG, ghes->generic, estatus);

	ghes_clear_estatus(ghes, estatus, buf_paddr, fixmap_idx);

	/* reboot to log the error! */
	if (!panic_timeout)
		panic_timeout = ghes_panic_timeout;
	panic("Fatal hardware error!");
		pr_emerg("%s but panic disabled\n", msg);

	panic(msg);
}

static int ghes_proc(struct ghes *ghes)
+7 −7
Original line number Diff line number Diff line
@@ -717,7 +717,7 @@ static void battery_hook_unregister_unlocked(struct acpi_battery_hook *hook)
	}
	list_del_init(&hook->list);

	pr_info("extension unregistered: %s\n", hook->name);
	pr_info("hook unregistered: %s\n", hook->name);
}

void battery_hook_unregister(struct acpi_battery_hook *hook)
@@ -751,18 +751,18 @@ void battery_hook_register(struct acpi_battery_hook *hook)
		if (hook->add_battery(battery->bat, hook)) {
			/*
			 * If a add-battery returns non-zero,
			 * the registration of the extension has failed,
			 * the registration of the hook has failed,
			 * and we will not add it to the list of loaded
			 * hooks.
			 */
			pr_err("extension failed to load: %s", hook->name);
			pr_err("hook failed to load: %s", hook->name);
			battery_hook_unregister_unlocked(hook);
			goto end;
		}

		power_supply_changed(battery->bat);
	}
	pr_info("new extension: %s\n", hook->name);
	pr_info("new hook: %s\n", hook->name);
end:
	mutex_unlock(&hook_mutex);
}
@@ -805,10 +805,10 @@ static void battery_hook_add_battery(struct acpi_battery *battery)
	list_for_each_entry_safe(hook_node, tmp, &battery_hook_list, list) {
		if (hook_node->add_battery(battery->bat, hook_node)) {
			/*
			 * The notification of the extensions has failed, to
			 * prevent further errors we will unload the extension.
			 * The notification of the hook has failed, to
			 * prevent further errors we will unload the hook.
			 */
			pr_err("error in extension, unloading: %s",
			pr_err("error in hook, unloading: %s",
					hook_node->name);
			battery_hook_unregister_unlocked(hook_node);
		}
+3 −3
Original line number Diff line number Diff line
@@ -29,7 +29,7 @@ BGRT_SHOW(type, image_type);
BGRT_SHOW(xoffset, image_offset_x);
BGRT_SHOW(yoffset, image_offset_y);

static BIN_ATTR_SIMPLE_RO(image);
static __ro_after_init BIN_ATTR_SIMPLE_RO(image);

static struct attribute *bgrt_attributes[] = {
	&bgrt_attr_version.attr,
@@ -40,14 +40,14 @@ static struct attribute *bgrt_attributes[] = {
	NULL,
};

static struct bin_attribute *bgrt_bin_attributes[] = {
static const struct bin_attribute *const bgrt_bin_attributes[] = {
	&bin_attr_image,
	NULL,
};

static const struct attribute_group bgrt_attribute_group = {
	.attrs = bgrt_attributes,
	.bin_attrs = bgrt_bin_attributes,
	.bin_attrs_new = bgrt_bin_attributes,
};

int __init acpi_parse_bgrt(struct acpi_table_header *table)
+8 −2
Original line number Diff line number Diff line
@@ -371,19 +371,25 @@ static int acpi_fan_probe(struct platform_device *pdev)
	result = sysfs_create_link(&pdev->dev.kobj,
				   &cdev->device.kobj,
				   "thermal_cooling");
	if (result)
	if (result) {
		dev_err(&pdev->dev, "Failed to create sysfs link 'thermal_cooling'\n");
		goto err_unregister;
	}

	result = sysfs_create_link(&cdev->device.kobj,
				   &pdev->dev.kobj,
				   "device");
	if (result) {
		dev_err(&pdev->dev, "Failed to create sysfs link 'device'\n");
		goto err_end;
		goto err_remove_link;
	}

	return 0;

err_remove_link:
	sysfs_remove_link(&pdev->dev.kobj, "thermal_cooling");
err_unregister:
	thermal_cooling_device_unregister(cdev);
err_end:
	if (fan->acpi4)
		acpi_fan_delete_attributes(device);
+1 −2
Original line number Diff line number Diff line
@@ -624,8 +624,7 @@ static void init_crs_csi2_swnodes(struct crs_csi2 *csi2)
	if (!fwnode_property_present(adev_fwnode, "rotation")) {
		struct acpi_pld_info *pld;

		status = acpi_get_physical_device_location(handle, &pld);
		if (ACPI_SUCCESS(status)) {
		if (acpi_get_physical_device_location(handle, &pld)) {
			swnodes->dev_props[NEXT_PROPERTY(prop_index, DEV_ROTATION)] =
					PROPERTY_ENTRY_U32("rotation",
							   pld->rotation * 45U);
Loading