From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:58292 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752429AbcIHVKa (ORCPT ); Thu, 8 Sep 2016 17:10:30 -0400 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id u88LAE2t072171 for ; Thu, 8 Sep 2016 17:10:29 -0400 Received: from e24smtp05.br.ibm.com (e24smtp05.br.ibm.com [32.104.18.26]) by mx0a-001b2d01.pphosted.com with ESMTP id 25bc35hjmp-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 08 Sep 2016 17:10:29 -0400 Received: from localhost by e24smtp05.br.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 8 Sep 2016 18:10:26 -0300 Received: from d24relay03.br.ibm.com (d24relay03.br.ibm.com [9.18.232.225]) by d24dlp02.br.ibm.com (Postfix) with ESMTP id 40C251DC0054 for ; Thu, 8 Sep 2016 17:10:25 -0400 (EDT) Received: from d24av04.br.ibm.com (d24av04.br.ibm.com [9.8.31.97]) by d24relay03.br.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u88LAOvN21626890 for ; Thu, 8 Sep 2016 18:10:24 -0300 Received: from d24av04.br.ibm.com (localhost [127.0.0.1]) by d24av04.br.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u88LANP9005977 for ; Thu, 8 Sep 2016 18:10:24 -0300 From: Gabriel Krisman Bertazi To: Jiri Slaby Cc: gregkh@linuxfoundation.org, stable@vger.kernel.org, stewart@linux.vnet.ibm.com, mniyer@us.ibm.com, keith.busch@intel.com Subject: Re: [PATCH] NVMe: Don't unmap controller registers on reset References: <1472767561-11912-1-git-send-email-krisman@linux.vnet.ibm.com> <3616480f-2d71-e89b-cd94-91118d0e3bd1@suse.cz> Date: Thu, 08 Sep 2016 18:10:23 -0300 In-Reply-To: <3616480f-2d71-e89b-cd94-91118d0e3bd1@suse.cz> (Jiri Slaby's message of "Wed, 7 Sep 2016 18:06:20 +0200") MIME-Version: 1.0 Content-Type: text/plain Message-Id: <87h99qf680.fsf@linux.vnet.ibm.com> Sender: stable-owner@vger.kernel.org List-ID: Jiri Slaby writes: > >> @@ -2734,18 +2724,21 @@ static int nvme_dev_map(struct nvme_dev *dev) >> >> return 0; >> >> - unmap: >> - iounmap(dev->bar); >> - dev->bar = NULL; >> disable: >> pci_release_regions(pdev); >> - disable_pci: >> - pci_disable_device(pdev); > > Is this a correct backport? > > The original removes pci_release_regions, not pci_disable_device. > Hi Jiri, Oh, you are correct. We need pci_disable_device here to reverse pci_enable_device_mem on error, while should go pci_release_regions into nvme_dev_map to reverse the pci_request_selected_regions call. Unfortunately, my test case never touched this error path. Greg, would you take the fix below into the -stable tree? -- >8 -- Subject: [PATCH] nvme: Call pci_disable_device on the error path. Commit 5706aca74fe4 ("NVMe: Don't unmap controller registers on reset"), which backported b00a726a9fd8 to the 4.4.y kernel introduced a regression in which it didn't call pci_disable_device in the error path of nvme_pci_enable. Reported-by: Jiri Slaby Embarassed-developer: Gabriel Krisman Bertazi Signed-off-by: Gabriel Krisman Bertazi --- drivers/nvme/host/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index 289a5df0d44a..c851bc53831c 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -2725,7 +2725,7 @@ static int nvme_pci_enable(struct nvme_dev *dev) return 0; disable: - pci_release_regions(pdev); + pci_disable_device(pdev); return result; } -- 2.7.4