APPLIED[B/F/G:aws]: [PATCH 1/1][SRU][B/aws, F/aws, G/aws] UBUNTU: SAUCE: xen-netfront: prevent unnecessary close on hibernate

Ian May ian.may at canonical.com
Thu Dec 17 19:04:40 UTC 2020


Applied to:
  bionic/linux-aws
  focal/linux-aws
  groovy/linux-aws

Thanks,
Ian

On 2020-12-04 17:12:18 , Andrea Righi wrote:
> BugLink: https://bugs.launchpad.net/bugs/1906850
> 
> If the device in the Xen bus is already in the "closed" state when
> hibernating there's no need to close the bus again. Doing so can only
> cause errors that would prevent the system to hibernate correctly.
> 
> Signed-off-by: Andrea Righi <andrea.righi at canonical.com>
> ---
>  drivers/net/xen-netfront.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
> index 2d4f43522581..8462eefbf714 100644
> --- a/drivers/net/xen-netfront.c
> +++ b/drivers/net/xen-netfront.c
> @@ -1843,6 +1843,9 @@ static int netfront_freeze(struct xenbus_device *dev)
>  
>  	netif_device_detach(info->netdev);
>  
> +	if (dev->state == XenbusStateClosed)
> +		goto closed;
> +
>  	info->freeze_state = NETIF_FREEZE_STATE_FREEZING;
>  
>  	/* Kick the backend to disconnect */
> @@ -1859,7 +1862,7 @@ static int netfront_freeze(struct xenbus_device *dev)
>  				 "the device may become inconsistent state");
>  		return err;
>  	}
> -
> +closed:
>  	/* Tear down queues */
>  	xennet_disconnect_backend(info);
>  	xennet_destroy_queues(info);
> -- 
> 2.29.2
> 
> 
> -- 
> kernel-team mailing list
> kernel-team at lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team



More information about the kernel-team mailing list