Re: [PATCH v3] net: wwan: iosm: Fix hibernation by re-binding the driver around it

From: Paolo Abeni
Date: Tue Jan 14 2025 - 03:50:14 EST


On 1/9/25 12:33 AM, Maciej S. Szmigiero wrote:
@@ -530,3 +531,56 @@ void ipc_pcie_kfree_skb(struct iosm_pcie
*ipc_pcie, struct sk_buff *skb)
> IPC_CB(skb)->mapping = 0;
> dev_kfree_skb(skb);
> }
> +
> +static int pm_notify(struct notifier_block *nb, unsigned long mode, void *_unused)
> +{
> + if (mode == PM_HIBERNATION_PREPARE || mode == PM_RESTORE_PREPARE) {
> + if (pci_registered) {

Out of sheer ignorance on my side, why 'mode == PM_RESTORE_PREPARE' is
required above? Isn't the driver already unregistered by the previous
PM_HIBERNATION_PREPARE call?

Thanks,

Paolo