From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755352AbbDTORS (ORCPT ); Mon, 20 Apr 2015 10:17:18 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39721 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753396AbbDTORP (ORCPT ); Mon, 20 Apr 2015 10:17:15 -0400 From: Vitaly Kuznetsov To: KY Srinivasan Cc: "gregkh\@linuxfoundation.org" , "linux-kernel\@vger.kernel.org" , "devel\@linuxdriverproject.org" , "olaf\@aepfle.de" , "apw\@canonical.com" , "jasowang\@redhat.com" Subject: Re: [PATCH 5/5] Drivers: hv: vmbus: Implement the protocol for tearing down vmbus state References: <1429515878-13710-1-git-send-email-kys@microsoft.com> <1429515905-13749-1-git-send-email-kys@microsoft.com> <1429515905-13749-5-git-send-email-kys@microsoft.com> <87twwbcf4h.fsf@vitty.brq.redhat.com> Date: Mon, 20 Apr 2015 16:17:11 +0200 In-Reply-To: (KY Srinivasan's message of "Mon, 20 Apr 2015 14:12:13 +0000") Message-ID: <87vbgqc2ag.fsf@vitty.brq.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org KY Srinivasan writes: >> -----Original Message----- >> From: Vitaly Kuznetsov [mailto:vkuznets@redhat.com] >> Sent: Monday, April 20, 2015 2:40 AM >> To: KY Srinivasan >> Cc: gregkh@linuxfoundation.org; linux-kernel@vger.kernel.org; >> devel@linuxdriverproject.org; olaf@aepfle.de; apw@canonical.com; >> jasowang@redhat.com >> Subject: Re: [PATCH 5/5] Drivers: hv: vmbus: Implement the protocol for >> tearing down vmbus state >> >> "K. Y. Srinivasan" writes: >> >> > Implement the protocol for tearing down the monitor state established >> with >> > the host. >> > >> > Signed-off-by: K. Y. Srinivasan >> >> Unfortunatelly this patch leads to the following crash: > > Thanks for testing Vitaly. The unload handling is what we want, maybe I need to > Invoke unload a little earlier. I actually sent two letters this morning :-) The other was: The problem is that we call vmbus_disconnect() too late in vmbus_exit(). We need to call it: 1) Before hv_cleanup() call as we free hypercall page there (that's what you see in my crash) 2) Before hv_remove_vmbus_irq() as we're waiting for the hypervisor to reply. This simple patch fixes the issue: diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c index 7870a90..2b56260 100644 --- a/drivers/hv/vmbus_drv.c +++ b/drivers/hv/vmbus_drv.c @@ -1106,6 +1106,7 @@ static void __exit vmbus_exit(void) vmbus_connection.conn_state = DISCONNECTED; hv_synic_clockevents_cleanup(); + vmbus_disconnect(); hv_remove_vmbus_irq(); vmbus_free_channels(); if (ms_hyperv.features & HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE) { @@ -1118,7 +1119,6 @@ static void __exit vmbus_exit(void) smp_call_function_single(cpu, hv_synic_cleanup, NULL, 1); acpi_bus_unregister_driver(&vmbus_acpi_driver); hv_cpu_hotplug_quirk(false); - vmbus_disconnect(); } I suggest we incorporate it into your PATCH 5/5. -- Vitaly