Re: [PATCH v8 2/4] scsi: Add PM_EVENT_POWEROFF into suspend callbacks

Bjorn Helgaas
2025-09-18T19:57:03Z

On Wed, Sep 17, 2025 at 10:44:25PM -0500, Mario Limonciello (AMD) wrote:
> When the ACPI core uses hibernation callbacks for shutdown drivers
> will receive PM_EVENT_POWEROFF and should handle it the same as
> PM_EVENT_HIBERNATE would have been used.

Apparently ACPI hibernation means PM_EVENT_POWEROFF, and something
else means PM_EVENT_HIBERNATE? That's confusing to me at least.

> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
> Tested-by: Eric Naim <dnaim@cachyos.org>
> Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
> ---
> v8:
> * Break up series to 3 parts
> * Pick up tag
> v5:
> * Re-order
> v4:
> * https://lore.kernel.org/linux-pci/20250616175019.3471583-1-superm1@kernel.org/
> ---
> drivers/scsi/mesh.c | 1 +
> drivers/scsi/stex.c | 1 +
> 2 files changed, 2 insertions(+)
>
> diff --git a/drivers/scsi/mesh.c b/drivers/scsi/mesh.c
> index 1c15cac41d80..768b85eecc8f 100644
> --- a/drivers/scsi/mesh.c
> +++ b/drivers/scsi/mesh.c
> @@ -1762,6 +1762,7 @@ static int mesh_suspend(struct macio_dev *mdev, pm_message_t mesg)
> case PM_EVENT_SUSPEND:
> case PM_EVENT_HIBERNATE:
> case PM_EVENT_FREEZE:
> + case PM_EVENT_POWEROFF:
> break;
> default:
> return 0;
> diff --git a/drivers/scsi/stex.c b/drivers/scsi/stex.c
> index 63ed7f9aaa93..ee9372e1f7f0 100644
> --- a/drivers/scsi/stex.c
> +++ b/drivers/scsi/stex.c
> @@ -1965,6 +1965,7 @@ static int stex_choice_sleep_mic(struct st_hba *hba, pm_message_t state)
> case PM_EVENT_SUSPEND:
> return ST_S3;
> case PM_EVENT_HIBERNATE:
> + case PM_EVENT_POWEROFF:
> hba->msi_lock = 0;
> return ST_S4;
> default:
> --
> 2.51.0
>