Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1194543pxa; Thu, 20 Aug 2020 05:18:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyWlX/ixv0r2mY7oOk1yMteSLNhKv8kkERizXlbmvtqdoY/dJ2mrqTZ3aVJT36pD8g769ff X-Received: by 2002:a17:906:5f8a:: with SMTP id a10mr3031928eju.379.1597925916407; Thu, 20 Aug 2020 05:18:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597925916; cv=none; d=google.com; s=arc-20160816; b=Uu+7pjh9PUgLRNxlg7Oqs80CXZJiOPj6mHjFFY+fp295IYR4yS7VPGCrDUj02eOwXq kE9THqW4M9sUGg0shQX8DkVq37oybqF1pdlwXBZECNJgUlzis5Ujd5iPRJUwJVDt1tky FNpbN6J7/FT+Tbl6tPSRuaYexiH5E5ilM5KMx8danA4+AKTnmnQUjlYQZRxUSg5dXKFR //KqBSRJYQ24YmuNBFUK0M9pOHVRxG8KVXM1A5Vd+Stk90nLfuy/vL8FAiI5UOVuMLji tCasR01jRpb7dV9WUFWU23RyttcYiBQSlEweID5lgmghLLo5yNqOkDPNbsGJol1W2VYD okxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=YoGmzcjDRCO9egJSt4XgZi9EGt49Yft3XmfoBXOJXoM=; b=SOFZBVKu3leTgaf5oCtzSZ+2hrVWYTwvwRh7feUq74DQwWlnzpad4knKP2GoqNG8qx 2bu2MFLtUpJUnZcJuk5AT0TdPU+nBe1AzVNjdwuPPYoXXAKb9mfb6yC1kKwK48xNb10O LaMi19KcYEZbHqxBjECjltwSL1o4/LiisD9qzuWMR0a9dilZ8xmSqSpeET9eMNp9+f6n brzucVN94cnkxeeXUsfVsnvmX2HOcwrXWSjFyBSBcwSdWIgQTLnLE3t75r6zsyaxyist o4fgbnkoh0BHNn2XUDQq3EaUv0Sb+OgCMTKaZduR6jRUSmyfXWrUNlOryuiKXn5s0maU 1rBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="MubAb/ny"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bo26si1030709edb.598.2020.08.20.05.18.12; Thu, 20 Aug 2020 05:18:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="MubAb/ny"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730274AbgHTMPr (ORCPT + 99 others); Thu, 20 Aug 2020 08:15:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:40922 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730284AbgHTJ5O (ORCPT ); Thu, 20 Aug 2020 05:57:14 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 12DFF207FB; Thu, 20 Aug 2020 09:57:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597917432; bh=u6ylgvF3a70s7jbsRyPlk1EhsaX9pQjQ0ZZ7WGWehbY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MubAb/nyi6x020MJ9bjVJ8CyegCuOmdhyNBgHSooj8tjAWt4bfCBwO/5KTpfkcyHU TXEDUOumxtjgErgPwK6tZfxc9CBjd/wPVo4jsh3x2W5rA325RNiMHPcDv2VGVEFLH2 i5/NjqwGg7KPM2BNiPXFWWz1/cs4wyWZpizW+Bbg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jake Lawrence , Jakub Kicinski , Saeed Mahameed , "David S. Miller" , Sasha Levin Subject: [PATCH 4.9 029/212] mlx4: disable device on shutdown Date: Thu, 20 Aug 2020 11:20:02 +0200 Message-Id: <20200820091603.820443770@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200820091602.251285210@linuxfoundation.org> References: <20200820091602.251285210@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jakub Kicinski [ Upstream commit 3cab8c65525920f00d8f4997b3e9bb73aecb3a8e ] It appears that not disabling a PCI device on .shutdown may lead to a Hardware Error with particular (perhaps buggy) BIOS versions: mlx4_en: eth0: Close port called mlx4_en 0000:04:00.0: removed PHC reboot: Restarting system {1}[Hardware Error]: Hardware error from APEI Generic Hardware Error Source: 1 {1}[Hardware Error]: event severity: fatal {1}[Hardware Error]: Error 0, type: fatal {1}[Hardware Error]: section_type: PCIe error {1}[Hardware Error]: port_type: 4, root port {1}[Hardware Error]: version: 1.16 {1}[Hardware Error]: command: 0x4010, status: 0x0143 {1}[Hardware Error]: device_id: 0000:00:02.2 {1}[Hardware Error]: slot: 0 {1}[Hardware Error]: secondary_bus: 0x04 {1}[Hardware Error]: vendor_id: 0x8086, device_id: 0x2f06 {1}[Hardware Error]: class_code: 000604 {1}[Hardware Error]: bridge: secondary_status: 0x2000, control: 0x0003 {1}[Hardware Error]: aer_uncor_status: 0x00100000, aer_uncor_mask: 0x00000000 {1}[Hardware Error]: aer_uncor_severity: 0x00062030 {1}[Hardware Error]: TLP Header: 40000018 040000ff 791f4080 00000000 [hw error repeats] Kernel panic - not syncing: Fatal hardware error! CPU: 0 PID: 2189 Comm: reboot Kdump: loaded Not tainted 5.6.x-blabla #1 Hardware name: HP ProLiant DL380 Gen9/ProLiant DL380 Gen9, BIOS P89 05/05/2017 Fix the mlx4 driver. This is a very similar problem to what had been fixed in: commit 0d98ba8d70b0 ("scsi: hpsa: disable device during shutdown") to address https://bugzilla.kernel.org/show_bug.cgi?id=199779. Fixes: 2ba5fbd62b25 ("net/mlx4_core: Handle AER flow properly") Reported-by: Jake Lawrence Signed-off-by: Jakub Kicinski Reviewed-by: Saeed Mahameed Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/mellanox/mlx4/main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c index 751aac54f2d55..9b6a96074df80 100644 --- a/drivers/net/ethernet/mellanox/mlx4/main.c +++ b/drivers/net/ethernet/mellanox/mlx4/main.c @@ -4176,12 +4176,14 @@ end: static void mlx4_shutdown(struct pci_dev *pdev) { struct mlx4_dev_persistent *persist = pci_get_drvdata(pdev); + struct mlx4_dev *dev = persist->dev; mlx4_info(persist->dev, "mlx4_shutdown was called\n"); mutex_lock(&persist->interface_state_mutex); if (persist->interface_state & MLX4_INTERFACE_STATE_UP) mlx4_unload_one(pdev); mutex_unlock(&persist->interface_state_mutex); + mlx4_pci_disable_device(dev); } static const struct pci_error_handlers mlx4_err_handler = { -- 2.25.1