Commit ada0629b authored by Rafael J. Wysocki's avatar Rafael J. Wysocki
Browse files

Merge branches 'pm-core', 'pm-sleep', 'pm-acpi' and 'pm-domains'

* pm-core:
  PM: runtime: Add pm_runtime_get_if_active()

* pm-sleep:
  PM: sleep: wakeup: Skip wakeup_source_sysfs_remove() if device is not there
  PM / hibernate: Remove unnecessary compat ioctl overrides
  PM: hibernate: fix docs for ioctls that return loff_t via pointer
  PM: sleep: wakeup: Use built-in RCU list checking
  PM: sleep: core: Use built-in RCU list checking

* pm-acpi:
  ACPI: PM: s2idle: Refine active GPEs check
  ACPICA: Allow acpi_any_gpe_status_set() to skip one GPE
  ACPI: PM: s2idle: Fix comment in acpi_s2idle_prepare_late()

* pm-domains:
  cpuidle: psci: Split psci_dt_cpu_init_idle()
  PM / Domains: Allow no domain-idle-states DT property in genpd when parsing
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -382,6 +382,12 @@ drivers/base/power/runtime.c and include/linux/pm_runtime.h:
      nonzero, increment the counter and return 1; otherwise return 0 without
      changing the counter

  `int pm_runtime_get_if_active(struct device *dev, bool ign_usage_count);`
    - return -EINVAL if 'power.disable_depth' is nonzero; otherwise, if the
      runtime PM status is RPM_ACTIVE, and either ign_usage_count is true
      or the device's usage_count is non-zero, increment the counter and
      return 1; otherwise return 0 without changing the counter

  `void pm_runtime_put_noidle(struct device *dev);`
    - decrement the device's usage counter

+5 −3
Original line number Diff line number Diff line
@@ -69,11 +69,13 @@ SNAPSHOT_PREF_IMAGE_SIZE

SNAPSHOT_GET_IMAGE_SIZE
	return the actual size of the hibernation image
	(the last argument should be a pointer to a loff_t variable that
	will contain the result if the call is successful)

SNAPSHOT_AVAIL_SWAP_SIZE
	return the amount of available swap in bytes (the
	last argument should be a pointer to an unsigned int variable that will
	contain the result if the call is successful).
	return the amount of available swap in bytes
	(the last argument should be a pointer to a loff_t variable that
	will contain the result if the call is successful)

SNAPSHOT_ALLOC_SWAP_PAGE
	allocate a swap page from the resume partition
+1 −1
Original line number Diff line number Diff line
@@ -101,7 +101,7 @@ acpi_status acpi_hw_enable_all_runtime_gpes(void);

acpi_status acpi_hw_enable_all_wakeup_gpes(void);

u8 acpi_hw_check_all_gpes(void);
u8 acpi_hw_check_all_gpes(acpi_handle gpe_skip_device, u32 gpe_skip_number);

acpi_status
acpi_hw_enable_runtime_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
+12 −5
Original line number Diff line number Diff line
@@ -799,17 +799,19 @@ ACPI_EXPORT_SYMBOL(acpi_enable_all_wakeup_gpes)
 *
 * FUNCTION:    acpi_any_gpe_status_set
 *
 * PARAMETERS:  None
 * PARAMETERS:  gpe_skip_number      - Number of the GPE to skip
 *
 * RETURN:      Whether or not the status bit is set for any GPE
 *
 * DESCRIPTION: Check the status bits of all enabled GPEs and return TRUE if any
 *              of them is set or FALSE otherwise.
 * DESCRIPTION: Check the status bits of all enabled GPEs, except for the one
 *              represented by the "skip" argument, and return TRUE if any of
 *              them is set or FALSE otherwise.
 *
 ******************************************************************************/
u32 acpi_any_gpe_status_set(void)
u32 acpi_any_gpe_status_set(u32 gpe_skip_number)
{
	acpi_status status;
	acpi_handle gpe_device;
	u8 ret;

	ACPI_FUNCTION_TRACE(acpi_any_gpe_status_set);
@@ -819,7 +821,12 @@ u32 acpi_any_gpe_status_set(void)
		return (FALSE);
	}

	ret = acpi_hw_check_all_gpes();
	status = acpi_get_gpe_device(gpe_skip_number, &gpe_device);
	if (ACPI_FAILURE(status)) {
		gpe_device = NULL;
	}

	ret = acpi_hw_check_all_gpes(gpe_device, gpe_skip_number);
	(void)acpi_ut_release_mutex(ACPI_MTX_EVENTS);

	return (ret);
+38 −9
Original line number Diff line number Diff line
@@ -444,12 +444,19 @@ acpi_hw_enable_wakeup_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
	return (AE_OK);
}

struct acpi_gpe_block_status_context {
	struct acpi_gpe_register_info *gpe_skip_register_info;
	u8 gpe_skip_mask;
	u8 retval;
};

/******************************************************************************
 *
 * FUNCTION:    acpi_hw_get_gpe_block_status
 *
 * PARAMETERS:  gpe_xrupt_info      - GPE Interrupt info
 *              gpe_block           - Gpe Block info
 *              context             - GPE list walk context data
 *
 * RETURN:      Success
 *
@@ -460,12 +467,13 @@ acpi_hw_enable_wakeup_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
static acpi_status
acpi_hw_get_gpe_block_status(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
			     struct acpi_gpe_block_info *gpe_block,
			     void *ret_ptr)
			     void *context)
{
	struct acpi_gpe_block_status_context *c = context;
	struct acpi_gpe_register_info *gpe_register_info;
	u64 in_enable, in_status;
	acpi_status status;
	u8 *ret = ret_ptr;
	u8 ret_mask;
	u32 i;

	/* Examine each GPE Register within the block */
@@ -485,7 +493,11 @@ acpi_hw_get_gpe_block_status(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
			continue;
		}

		*ret |= in_enable & in_status;
		ret_mask = in_enable & in_status;
		if (ret_mask && c->gpe_skip_register_info == gpe_register_info) {
			ret_mask &= ~c->gpe_skip_mask;
		}
		c->retval |= ret_mask;
	}

	return (AE_OK);
@@ -561,24 +573,41 @@ acpi_status acpi_hw_enable_all_wakeup_gpes(void)
 *
 * FUNCTION:    acpi_hw_check_all_gpes
 *
 * PARAMETERS:  None
 * PARAMETERS:  gpe_skip_device      - GPE devoce of the GPE to skip
 *              gpe_skip_number      - Number of the GPE to skip
 *
 * RETURN:      Combined status of all GPEs
 *
 * DESCRIPTION: Check all enabled GPEs in all GPE blocks and return TRUE if the
 * DESCRIPTION: Check all enabled GPEs in all GPE blocks, except for the one
 *              represented by the "skip" arguments, and return TRUE if the
 *              status bit is set for at least one of them of FALSE otherwise.
 *
 ******************************************************************************/

u8 acpi_hw_check_all_gpes(void)
u8 acpi_hw_check_all_gpes(acpi_handle gpe_skip_device, u32 gpe_skip_number)
{
	u8 ret = 0;
	struct acpi_gpe_block_status_context context = {
		.gpe_skip_register_info = NULL,
		.retval = 0,
	};
	struct acpi_gpe_event_info *gpe_event_info;
	acpi_cpu_flags flags;

	ACPI_FUNCTION_TRACE(acpi_hw_check_all_gpes);

	(void)acpi_ev_walk_gpe_list(acpi_hw_get_gpe_block_status, &ret);
	flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock);

	gpe_event_info = acpi_ev_get_gpe_event_info(gpe_skip_device,
						    gpe_skip_number);
	if (gpe_event_info) {
		context.gpe_skip_register_info = gpe_event_info->register_info;
		context.gpe_skip_mask = acpi_hw_get_gpe_register_bit(gpe_event_info);
	}

	acpi_os_release_lock(acpi_gbl_gpe_lock, flags);

	return (ret != 0);
	(void)acpi_ev_walk_gpe_list(acpi_hw_get_gpe_block_status, &context);
	return (context.retval != 0);
}

#endif				/* !ACPI_REDUCED_HARDWARE */
Loading