Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3003060imm; Sun, 1 Jul 2018 10:05:24 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIyDMBNFxoFEwECekd73yTuVERnuYu/GgP11xLO/SlS/2I0k3kn4m9SeqFbU8XJmsQpuTLs X-Received: by 2002:a17:902:8308:: with SMTP id bd8-v6mr22904568plb.329.1530464724063; Sun, 01 Jul 2018 10:05:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530464724; cv=none; d=google.com; s=arc-20160816; b=qfLhSfJloabdGnxPRBNJuOkOoMTYejkU+0326AnLRU2tvsZseVdODcoLCTkDovPkOF 6+yanHOfylMnq8Ji4E7h3A2C3hIeztwnnPyqRwA9sDHjZfWiocMkL2KMZXH6J0JT83NC fkMK82W4dFKHKIcYake2ASwvooIpOAdvlCiioMSAIse0CmETDKs9/hmEQA6Kfk3LKo7r 8cADEOz0WcP6Ylsan2Pc3lwmdCXlH3zsEDwAziiD1nM4flg8j0nggroCZlCVLPCDNy9R +ayQItAWiyW5jTRD0fQYX49pRY5UWzNb8GLLXseK4NPJEu7Kx52ULiln3Sntkx3+VGHr db4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=H9KTX1M/4sHJ9CNC1OZa+Hu9ojuAFvK+yXA5s92gph4=; b=zIvjgJcIHdOKZxlMXyKN/gxJRCFTK+rTjusdm2ppdzqK94G2C4Xv1jmRnus68Z/XxA ove6XCM8wvGiP9vmSgKCAcJWL/O3KGXjICgfj1OLU81/nP9WpVUBjGVDo1b3ZWfefRz0 MaGs5siTajdImT0C8oxcRE6jPeUPx3TJuKV1bT3pC6jH9yFCUVY0ySn/adWkEPIbFOAo FZniXqdvT/4pfQW0HbcD1/sg5nGa8FEeY9qLqLjP3tqBU7IPkNEpSGuXG9n3SMGfbUwa VSUoOVj3h9HomtTWrNDFoJDSj8cvSnOqlxUL+1k/7kTywlOv58spMZo1cyrtwTUdrv14 6w/A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s2-v6si14173854plq.372.2018.07.01.10.05.09; Sun, 01 Jul 2018 10:05:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1032234AbeGAQms (ORCPT + 99 others); Sun, 1 Jul 2018 12:42:48 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:37674 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031796AbeGAQmk (ORCPT ); Sun, 1 Jul 2018 12:42:40 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id D81E1AA6; Sun, 1 Jul 2018 16:42:39 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sinan Kaya , Ryan Finnie , Don Brace , "Martin K. Petersen" Subject: [PATCH 4.17 133/220] scsi: hpsa: disable device during shutdown Date: Sun, 1 Jul 2018 18:22:37 +0200 Message-Id: <20180701160913.874870942@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180701160908.272447118@linuxfoundation.org> References: <20180701160908.272447118@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.17-stable review patch. If anyone has any objections, please let me know. ------------------ From: Sinan Kaya commit 0d98ba8d70b0070ac117452ea0b663e26bbf46bf upstream. 'Commit cc27b735ad3a ("PCI/portdrv: Turn off PCIe services during shutdown")' has been added to kernel to shutdown pending PCIe port service interrupts during reboot so that a newly started kexec kernel wouldn't observe pending interrupts. pcie_port_device_remove() is disabling the root port and switches by calling pci_disable_device() after all PCIe service drivers are shutdown. This has been found to cause crashes on HP DL360 Gen9 machines during reboot due to hpsa driver not clearing the bus master bit during the shutdown procedure by calling pci_disable_device(). Disable device as part of the shutdown sequence. Signed-off-by: Sinan Kaya Link: https://bugzilla.kernel.org/show_bug.cgi?id=199779 Fixes: cc27b735ad3a ("PCI/portdrv: Turn off PCIe services during shutdown") Cc: stable@vger.kernel.org Reported-by: Ryan Finnie Tested-by: Don Brace Acked-by: Don Brace Signed-off-by: Martin K. Petersen Signed-off-by: Greg Kroah-Hartman --- drivers/scsi/hpsa.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) --- a/drivers/scsi/hpsa.c +++ b/drivers/scsi/hpsa.c @@ -8869,7 +8869,7 @@ out: kfree(options); } -static void hpsa_shutdown(struct pci_dev *pdev) +static void __hpsa_shutdown(struct pci_dev *pdev) { struct ctlr_info *h; @@ -8884,6 +8884,12 @@ static void hpsa_shutdown(struct pci_dev hpsa_disable_interrupt_mode(h); /* pci_init 2 */ } +static void hpsa_shutdown(struct pci_dev *pdev) +{ + __hpsa_shutdown(pdev); + pci_disable_device(pdev); +} + static void hpsa_free_device_info(struct ctlr_info *h) { int i; @@ -8927,7 +8933,7 @@ static void hpsa_remove_one(struct pci_d scsi_remove_host(h->scsi_host); /* init_one 8 */ /* includes hpsa_free_irqs - init_one 4 */ /* includes hpsa_disable_interrupt_mode - pci_init 2 */ - hpsa_shutdown(pdev); + __hpsa_shutdown(pdev); hpsa_free_device_info(h); /* scan */