Re: [PATCH v12 3/5] firmware: ti_sci: Add system suspend and resume call

From: Kamlesh Gurudasani
Date: Tue Sep 17 2024 - 07:12:41 EST


Markus Schneider-Pargmann <msp@xxxxxxxxxxxx> writes:
...
>
> +static int ti_sci_prepare_system_suspend(struct ti_sci_info *info)
> +{
> + /*
> + * Map and validate the target Linux suspend state to TISCI LPM.
> + * Default is to let Device Manager select the low power mode.
> + */
> + switch (pm_suspend_target_state) {
> + case PM_SUSPEND_MEM:
> + if (info->fw_caps & MSG_FLAG_CAPS_LPM_DM_MANAGED) {
> + /*
> + * For the DM_MANAGED mode the context is reserved for
> + * internal use and can be 0
> + */
> + return ti_sci_cmd_prepare_sleep(&info->handle,
> + TISCI_MSG_VALUE_SLEEP_MODE_DM_MANAGED,
> + 0, 0, 0);
> + } else {
> + /* DM Managed is not supported by the firmware. */
> + dev_err(info->dev, "Suspend to memory is not supported by the firmware\n");
> + return -EOPNOTSUPP;
> + }
> + break;
> + default:
> + /*
> + * Do not fail if we don't have action to take for a
> + * specific suspend mode.
> + */
> + return 0;
> + }
> +
> + return 0;

Looks like this statement is unreachable, may be generating a warning as well.

> +}
> +
...