Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2025301pxa; Mon, 3 Aug 2020 05:42:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx1tX2k51DB5YtuJxidmf/JdK8AZBldF6EId7Y00ffpCYgJDYUj3CJ15Bwc5wRgb6mtTs3d X-Received: by 2002:a17:906:3fc4:: with SMTP id k4mr17105259ejj.315.1596458538896; Mon, 03 Aug 2020 05:42:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596458538; cv=none; d=google.com; s=arc-20160816; b=XZeaCEscI+R+X2I+ia+gbxkjc7MdD0/onekBuDokvFiYSEu/B5oIdVea4UyoJrv0oJ Gbq/s+kpWaY1TBPb1LeumsHgHY3IgGHvWZjoR8yyp12D+SIx4ZEWzbF2Dj8QR1KSbr6D aQ7jldvvKymTuRVHDNFCmutxOtv0cYo5TrgXYrHRJVTIyTcak5AQqA659qJurFT3Yzc/ cC99DmdDY1j65N7ETgHs+4sALR7JGPa0Ip8+IGIFz6uPq7W7/fHFUILNz7chPnpJGAyx /3quLZHe3MA1Krq0KBdhIJbh+cKHCyozrvUV4FCSnwO8i5PA8BhNR9iI9f/5GIblSypV IgVA== 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=SSaqJIYNXThITPq73Vl58i31gsHJLxdszsC8WGTC3zU=; b=B7nOLzMZ4/0Bz3w5mEVE2sLIbG9XkqSn3uyGh1xQqFsk+z0vQk7IC9WN/z4XwtAyAX fTucc/UYQhUr0LbAR2GM0PRGQTSBus1CE/ZrJZxlaox/+IlBrJgOjIQpce0QvVEfCrgE pbyUoPclfIKTef7VOYt+erpR1mwG3QObW6rvzLjnAQb1hXYt+akJqRrDrO0STIBBDhRK GL8t7ppmfxMmL4lgd9Yw1saye44Ranngv8FbJdyVZPDr+R6ck9qFGErMTEVevKBSJvSC Ww+9QX69I1hcYJdui9qPD1bJv8bi5WDG/ekVqkXhP5oEojmw5ejKtnyTS1t2Trn2qsG5 3LDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=16SaL6C8; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gs14si10564104ejb.615.2020.08.03.05.41.56; Mon, 03 Aug 2020 05:42:18 -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=16SaL6C8; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728730AbgHCMcN (ORCPT + 99 others); Mon, 3 Aug 2020 08:32:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:60030 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728268AbgHCMcM (ORCPT ); Mon, 3 Aug 2020 08:32:12 -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 4063B20781; Mon, 3 Aug 2020 12:32:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596457930; bh=p/dz+IbuPkwaKp2FQ2XQx+DORgDOLu18VaROnkcbRzE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=16SaL6C8axa9Ng0hYnR602I/tt9y+5Dtt3P+7el+2DehSpoJ+t2KPfUr0GeYynXJs loJYvaYI7BOaefqgnQoygM7w3cpEX8drr3hhdIluvKFLkK6b5SQNedGeId0jgzolfX sbB4RUmQDiGJr71IYh6Q1dQ5nfpzwCzLckRR9yx4= 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.19 34/56] mlx4: disable device on shutdown Date: Mon, 3 Aug 2020 14:19:49 +0200 Message-Id: <20200803121851.999149414@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200803121850.306734207@linuxfoundation.org> References: <20200803121850.306734207@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 f7825c7b92fe3..8d7bb9a889677 100644 --- a/drivers/net/ethernet/mellanox/mlx4/main.c +++ b/drivers/net/ethernet/mellanox/mlx4/main.c @@ -4311,12 +4311,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