From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965063AbbDJOur (ORCPT ); Fri, 10 Apr 2015 10:50:47 -0400 Received: from mail-bn1on0132.outbound.protection.outlook.com ([157.56.110.132]:35472 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S964873AbbDJOum convert rfc822-to-8bit (ORCPT ); Fri, 10 Apr 2015 10:50:42 -0400 From: KY Srinivasan To: Vitaly Kuznetsov CC: "devel@linuxdriverproject.org" , "Haiyang Zhang" , "linux-kernel@vger.kernel.org" , Dexuan Cui , Jake Oshins Subject: RE: [PATCH 2/3] Drivers: hv: vmbus: introduce vmbus_acpi_remove Thread-Topic: [PATCH 2/3] Drivers: hv: vmbus: introduce vmbus_acpi_remove Thread-Index: AQHQc4yWz4PweF6/NkSG6HXXNMMj951GVDNw Date: Fri, 10 Apr 2015 14:50:39 +0000 Message-ID: References: <1421866929-20167-1-git-send-email-vkuznets@redhat.com> <1421866929-20167-3-git-send-email-vkuznets@redhat.com> <87fv88up36.fsf@vitty.brq.redhat.com> In-Reply-To: <87fv88up36.fsf@vitty.brq.redhat.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [131.107.192.145] authentication-results: redhat.com; dkim=none (message not signed) header.d=none; x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY2PR0301MB0774; x-o365ent-eop-header: Message processed by - O365_ENT: Allow from ranges (Engineering ONLY) x-forefront-antispam-report: BMV:1;SFV:NSPM;SFS:(10019020)(6009001)(13464003)(164054003)(479174004)(377454003)(51704005)(62966003)(19580395003)(99286002)(110136001)(33656002)(40100003)(77156002)(93886004)(46102003)(106116001)(2950100001)(87936001)(15975445007)(54356999)(76176999)(122556002)(66066001)(50986999)(92566002)(76576001)(86362001)(19580405001)(2900100001)(86612001)(74316001)(2656002)(102836002);DIR:OUT;SFP:1102;SCL:1;SRVR:BY2PR0301MB0774;H:BY2PR0301MB0711.namprd03.prod.outlook.com;FPR:;SPF:None;MLV:sfv;LANG:en; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(601004)(5002010)(5005006);SRVR:BY2PR0301MB0774;BCL:0;PCL:0;RULEID:;SRVR:BY2PR0301MB0774; x-forefront-prvs: 054231DC40 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-OriginatorOrg: microsoft.onmicrosoft.com X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Apr 2015 14:50:39.2533 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR0301MB0774 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > -----Original Message----- > From: Vitaly Kuznetsov [mailto:vkuznets@redhat.com] > Sent: Friday, April 10, 2015 5:48 AM > To: KY Srinivasan > Cc: devel@linuxdriverproject.org; Haiyang Zhang; linux- > kernel@vger.kernel.org; Dexuan Cui; Jake Oshins > Subject: Re: [PATCH 2/3] Drivers: hv: vmbus: introduce vmbus_acpi_remove > > KY Srinivasan writes: > > >> -----Original Message----- > >> From: Vitaly Kuznetsov [mailto:vkuznets@redhat.com] > >> Sent: Wednesday, January 21, 2015 11:02 AM > >> To: KY Srinivasan; devel@linuxdriverproject.org > >> Cc: Haiyang Zhang; linux-kernel@vger.kernel.org; Dexuan Cui > >> Subject: [PATCH 2/3] Drivers: hv: vmbus: introduce vmbus_acpi_remove > >> > >> In case we do request_resource() in vmbus_acpi_add() we need to tear it > >> down to be able to load the driver again. Otherwise the following crash in > >> oberved when hv_vmbus unload/load sequence is performed on > >> Generation2 instance: > >> > >> [ 38.165701] BUG: unable to handle kernel paging request at > ffffffffa00075a0 > >> [ 38.166315] IP: [] __request_resource+0x2f/0x50 > >> [ 38.166315] PGD 1f34067 PUD 1f35063 PMD 3f723067 PTE 0 > >> [ 38.166315] Oops: 0000 [#1] SMP > >> [ 38.166315] Modules linked in: hv_vmbus(+) [last unloaded: hv_vmbus] > >> [ 38.166315] CPU: 0 PID: 267 Comm: modprobe Not tainted 3.19.0- > >> rc5_bug923184+ #486 > >> [ 38.166315] Hardware name: Microsoft Corporation Virtual > Machine/Virtual > >> Machine, BIOS Hyper-V UEFI Release v1.0 11/26/2012 > >> [ 38.166315] task: ffff88003f401cb0 ti: ffff88003f60c000 task.ti: > >> ffff88003f60c000 > >> [ 38.166315] RIP: 0010:[] [] > >> __request_resource+0x2f/0x50 > >> [ 38.166315] RSP: 0018:ffff88003f60fb58 EFLAGS: 00010286 > >> ... > >> > >> Signed-off-by: Vitaly Kuznetsov > >> --- > >> drivers/hv/vmbus_drv.c | 10 ++++++++++ > >> 1 file changed, 10 insertions(+) > >> > >> diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c index > >> 4d6b269..b06cb87 100644 > >> --- a/drivers/hv/vmbus_drv.c > >> +++ b/drivers/hv/vmbus_drv.c > >> @@ -902,6 +902,15 @@ acpi_walk_err: > >> return ret_val; > >> } > >> > >> +static int vmbus_acpi_remove(struct acpi_device *device) { > >> + int ret = 0; > >> + > >> + if (hyperv_mmio.start && hyperv_mmio.end) > >> + ret = release_resource(&hyperv_mmio); > >> + return ret; > >> +} > >> + > >> static const struct acpi_device_id vmbus_acpi_device_ids[] = { > >> {"VMBUS", 0}, > >> {"VMBus", 0}, > >> @@ -914,6 +923,7 @@ static struct acpi_driver vmbus_acpi_driver = { > >> .ids = vmbus_acpi_device_ids, > >> .ops = { > >> .add = vmbus_acpi_add, > >> + .remove = vmbus_acpi_remove, > >> }, > >> }; > > > > Vitaly, > > > > Jake has sent the following patch that has fixed retrieving of the mmio > resources: > > https://lkml.org/lkml/2015/1/20/876 > > > > This patch also deals with the resource cleanup that you have in this patch. > > > > Hi K.Y., > > it looks like Jake was forced to redo his work, do you think it would > make sense to have this simple fix for mainline in the meantime? I can > rebase/resend in case you do. Please do. Thanks. K. Y > > Thanks, > > -- > Vitaly