linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] virtio-net: fix module unloading
@ 2017-07-24 13:38 Andrew Jones
  2017-07-26  3:52 ` Jason Wang
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Jones @ 2017-07-24 13:38 UTC (permalink / raw)
  To: linux-kernel; +Cc: mst, jasowang, virtualization, Sebastian Andrzej Siewior

Unregister the driver before removing multi-instance hotplug
callbacks. This order avoids the warning issued from
__cpuhp_remove_state_cpuslocked when the number of remaining
instances isn't yet zero.

Fixes: 8017c279196a ("net/virtio-net: Convert to hotplug state machine")
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Andrew Jones <drjones@redhat.com>
---
 drivers/net/virtio_net.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 99a26a9efec1..f41ab0ea942a 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -2743,9 +2743,9 @@ module_init(virtio_net_driver_init);
 
 static __exit void virtio_net_driver_exit(void)
 {
+	unregister_virtio_driver(&virtio_net_driver);
 	cpuhp_remove_multi_state(CPUHP_VIRT_NET_DEAD);
 	cpuhp_remove_multi_state(virtionet_online);
-	unregister_virtio_driver(&virtio_net_driver);
 }
 module_exit(virtio_net_driver_exit);
 
-- 
2.13.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] virtio-net: fix module unloading
  2017-07-24 13:38 [PATCH] virtio-net: fix module unloading Andrew Jones
@ 2017-07-26  3:52 ` Jason Wang
  2017-07-26 12:50   ` Michael S. Tsirkin
  0 siblings, 1 reply; 3+ messages in thread
From: Jason Wang @ 2017-07-26  3:52 UTC (permalink / raw)
  To: Andrew Jones, linux-kernel; +Cc: mst, virtualization, Sebastian Andrzej Siewior



On 2017年07月24日 21:38, Andrew Jones wrote:
> Unregister the driver before removing multi-instance hotplug
> callbacks. This order avoids the warning issued from
> __cpuhp_remove_state_cpuslocked when the number of remaining
> instances isn't yet zero.
>
> Fixes: 8017c279196a ("net/virtio-net: Convert to hotplug state machine")
> Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> Signed-off-by: Andrew Jones <drjones@redhat.com>
> ---
>   drivers/net/virtio_net.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> index 99a26a9efec1..f41ab0ea942a 100644
> --- a/drivers/net/virtio_net.c
> +++ b/drivers/net/virtio_net.c
> @@ -2743,9 +2743,9 @@ module_init(virtio_net_driver_init);
>   
>   static __exit void virtio_net_driver_exit(void)
>   {
> +	unregister_virtio_driver(&virtio_net_driver);
>   	cpuhp_remove_multi_state(CPUHP_VIRT_NET_DEAD);
>   	cpuhp_remove_multi_state(virtionet_online);
> -	unregister_virtio_driver(&virtio_net_driver);
>   }
>   module_exit(virtio_net_driver_exit);
>   

Acked-by: Jason Wang <jasowang@redhat.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] virtio-net: fix module unloading
  2017-07-26  3:52 ` Jason Wang
@ 2017-07-26 12:50   ` Michael S. Tsirkin
  0 siblings, 0 replies; 3+ messages in thread
From: Michael S. Tsirkin @ 2017-07-26 12:50 UTC (permalink / raw)
  To: Jason Wang
  Cc: Andrew Jones, linux-kernel, virtualization, Sebastian Andrzej Siewior

On Wed, Jul 26, 2017 at 11:52:07AM +0800, Jason Wang wrote:
> 
> 
> On 2017年07月24日 21:38, Andrew Jones wrote:
> > Unregister the driver before removing multi-instance hotplug
> > callbacks. This order avoids the warning issued from
> > __cpuhp_remove_state_cpuslocked when the number of remaining
> > instances isn't yet zero.
> > 
> > Fixes: 8017c279196a ("net/virtio-net: Convert to hotplug state machine")
> > Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> > Signed-off-by: Andrew Jones <drjones@redhat.com>
> > ---
> >   drivers/net/virtio_net.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> > index 99a26a9efec1..f41ab0ea942a 100644
> > --- a/drivers/net/virtio_net.c
> > +++ b/drivers/net/virtio_net.c
> > @@ -2743,9 +2743,9 @@ module_init(virtio_net_driver_init);
> >   static __exit void virtio_net_driver_exit(void)
> >   {
> > +	unregister_virtio_driver(&virtio_net_driver);
> >   	cpuhp_remove_multi_state(CPUHP_VIRT_NET_DEAD);
> >   	cpuhp_remove_multi_state(virtionet_online);
> > -	unregister_virtio_driver(&virtio_net_driver);
> >   }
> >   module_exit(virtio_net_driver_exit);
> 
> Acked-by: Jason Wang <jasowang@redhat.com>

Thanks for the review!
I merged it before the tag and don't want to rebase.
Sorry about that.

-- 
MST

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-07-26 12:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-24 13:38 [PATCH] virtio-net: fix module unloading Andrew Jones
2017-07-26  3:52 ` Jason Wang
2017-07-26 12:50   ` Michael S. Tsirkin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).