Drivers: hv: vmbus: Teardown clockevent devices on module unload

Newly introduced clockevent devices made it impossible to unload hv_vmbus
module as clockevents_config_and_register() takes additional reverence to
the module. To make it possible again we do the following:
- avoid setting dev->owner for clockevent devices;
- implement hv_synic_clockevents_cleanup() doing clockevents_unbind_device();
- call it from vmbus_exit().

In theory hv_synic_clockevents_cleanup() can be merged with hv_synic_cleanup(),
however, we call hv_synic_cleanup() from smp_call_function_single() and this
doesn't work for clockevents_unbind_device() as it does such call on its own. I
opted for a separate function.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
此提交包含在:
Vitaly Kuznetsov
2015-02-27 11:25:57 -08:00
提交者 Greg Kroah-Hartman
父節點 32a158325a
當前提交 e086748c65
共有 3 個檔案被更改,包括 27 行新增1 行删除

查看文件

@@ -1032,6 +1032,7 @@ static void __exit vmbus_exit(void)
int cpu;
vmbus_connection.conn_state = DISCONNECTED;
hv_synic_clockevents_cleanup();
hv_remove_vmbus_irq();
vmbus_free_channels();
bus_unregister(&hv_bus);