Received: by 10.223.176.5 with SMTP id f5csp975089wra; Sat, 3 Feb 2018 14:55:26 -0800 (PST) X-Google-Smtp-Source: AH8x225PqQuxmCF3kq4bZMncrsw3DnXCGWQCYbQAS0Vvv2Z/53Cc+yyrKGvzJnMRKkZp9Xb+Loh2 X-Received: by 2002:a17:902:3183:: with SMTP id x3-v6mr39117050plb.290.1517698526157; Sat, 03 Feb 2018 14:55:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517698526; cv=none; d=google.com; s=arc-20160816; b=EEqF3FGCN8iYNmyh8NjRIsmM8PsDjI1shy0asPTRUEjcpVku+/TraOqp7zYWkFnwgq AXQ45uUlBBT4JQ+o1PL9Ef0OjPUeYjZxP6TykbWm3NSYh3m5Qjy03HH1AnM0yv7JTSy3 7tE5wPhsrEP1l4xT4HsZT4khJA3OYf7RlKTTNsryP0noFlUeoWIq7VyFezQX5cm7hZcg CsXEpC4EcLpLaXYsyDzxoL91iT84ZIM3n/qVlXgumyoe1xnjLLhRAbUhBqOw5o7drLIv f0Grfk4Vs6Hzvy0xJcKAWl4X8lX0VfumlikoDgYlr4UHRNikjZ9rrOOsLD5y2aJPWL5n zG+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=vURbp9sH1BRNIgwcoDgQix4nS507fBCGRMcQMH8gWNM=; b=qR6rYQ/jpE+NG95RhP4DZjHrESh9542hZGZVcagh2zZDy5LxICuXZURM56Wfw1sPbU pl6LC7u9pr5J1Zl7w6q5g/aCT02noSBWS7awnsT4n3BjgEJHW3RH9t04aQ3aWp50Jyeu TAlhltoJOAid3L3CWt1LbP/mku5yUYZbSNeazffDPIkiEcf3Ivx5QK+/Xy8kmkkMCLLs HxfqgCJsmhtBPFaWvIlJVeItvGfZKQQ3QlZhpxcYBQEtoXMJI/i7PTwj0MeMnBM7PMT9 +LQrR8wtMulDqTaA/w9UDlhdEysKIgDnFliBHwTWTv/RttzOobMW63IidsET6GKJR1uZ BE0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=h2qd1pQx; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d63si218410pfk.73.2018.02.03.14.55.12; Sat, 03 Feb 2018 14:55:26 -0800 (PST) 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; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=h2qd1pQx; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753269AbeBCSsO (ORCPT + 99 others); Sat, 3 Feb 2018 13:48:14 -0500 Received: from mail-co1nam03on0092.outbound.protection.outlook.com ([104.47.40.92]:4928 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752944AbeBCSBj (ORCPT ); Sat, 3 Feb 2018 13:01:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=vURbp9sH1BRNIgwcoDgQix4nS507fBCGRMcQMH8gWNM=; b=h2qd1pQxWyzB6bduecWrd/oxhAxgrSm5NM9HheuFF4pAKK2a4079BPRYIhFnlenNx4jUYtlPej+8/h3FqfsmHVmKxplO+xqgumx8oTiHVNjL/uhQfiTa7XvU2qHZ8eOc6bNW2Dd0fAbyhN0diZwFthCYepe0HJOjrKqC0C63Ngk= Received: from BL0PR2101MB1027.namprd21.prod.outlook.com (52.132.20.161) by BL0PR2101MB1092.namprd21.prod.outlook.com (52.132.24.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.485.4; Sat, 3 Feb 2018 18:01:22 +0000 Received: from BL0PR2101MB1027.namprd21.prod.outlook.com ([fe80::a8da:b5d9:d710:9bf9]) by BL0PR2101MB1027.namprd21.prod.outlook.com ([fe80::a8da:b5d9:d710:9bf9%3]) with mapi id 15.20.0485.006; Sat, 3 Feb 2018 18:01:22 +0000 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Moshe Shemesh , Saeed Mahameed , Sasha Levin Subject: [PATCH AUTOSEL for 4.14 042/110] net/mlx5: Cleanup IRQs in case of unload failure Thread-Topic: [PATCH AUTOSEL for 4.14 042/110] net/mlx5: Cleanup IRQs in case of unload failure Thread-Index: AQHTnRjsCNVZnWPcBEmC9W8bgYtYmQ== Date: Sat, 3 Feb 2018 18:00:48 +0000 Message-ID: <20180203180015.29073-42-alexander.levin@microsoft.com> References: <20180203180015.29073-1-alexander.levin@microsoft.com> In-Reply-To: <20180203180015.29073-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BL0PR2101MB1092;7:ExlYxcP0AP3zi929suB8eac+rS5ZrxS9a/EcyCTAaca3Y3sLggU3V11lIyaesh0U6a6wwUQvMg3dLA3Ry8tIU4czUMietERnRZXWhYjbi6V53bs6XYBl2wAzoaFj4UADZqzKHWuiI4gM4IkCg+loRLK6wC3+RdtVcsYRDuqRS7Qr2Px1ifRWaSj4s8/qg5gTya8XvKILqC14SayA5zIZLQgDpGt8n5SGHpuWT2M/WDZDXbm4UeUFh5HUbH+QaU/w x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: f92cd441-6514-4a6e-f994-08d56b30228e x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(3008032)(2017052603307)(7193020);SRVR:BL0PR2101MB1092; x-ms-traffictypediagnostic: BL0PR2101MB1092: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(61425038)(6040501)(2401047)(5005006)(8121501046)(3002001)(10201501046)(93006095)(93001095)(3231101)(2400082)(944501161)(6055026)(61426038)(61427038)(6041288)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011);SRVR:BL0PR2101MB1092;BCL:0;PCL:0;RULEID:;SRVR:BL0PR2101MB1092; x-forefront-prvs: 05724A8921 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(39860400002)(39380400002)(376002)(346002)(396003)(366004)(189003)(199004)(3280700002)(14454004)(3660700001)(105586002)(3846002)(6666003)(22452003)(6116002)(99286004)(305945005)(7736002)(2950100002)(66066001)(478600001)(54906003)(110136005)(68736007)(316002)(86362001)(106356001)(186003)(26005)(59450400001)(6506007)(76176011)(6346003)(10090500001)(102836004)(6436002)(4326008)(8936002)(5890100001)(2501003)(53936002)(86612001)(2900100001)(6486002)(2906002)(6512007)(25786009)(97736004)(72206003)(1076002)(107886003)(36756003)(5660300001)(5250100002)(8676002)(81156014)(81166006)(10290500003)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:BL0PR2101MB1092;H:BL0PR2101MB1027.namprd21.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-message-info: hE+Mg5t4WLqadMDPvqmQAQahi2M5OjiD1ajQF1++20YjJnnWxkL84iFucPc/FwdIYScnltxUksYzG/FOaVa17g== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: f92cd441-6514-4a6e-f994-08d56b30228e X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Feb 2018 18:00:48.8471 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR2101MB1092 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Moshe Shemesh [ Upstream commit d6b2785cd55ee72e9608762650b3ef299f801b1b ] When mlx5_stop_eqs fails to destroy any of the eqs it returns with an error= . In such failure flow the function will return without releasing all EQs irqs and then pci_free_irq_vectors will fail. Fix by only warn on destroy EQ failure and continue to release other EQs and their irqs. It fixes the following kernel trace: kernel: kernel BUG at drivers/pci/msi.c:352! ... ... kernel: Call Trace: kernel: pci_disable_msix+0xd3/0x100 kernel: pci_free_irq_vectors+0xe/0x20 kernel: mlx5_load_one.isra.17+0x9f5/0xec0 [mlx5_core] Fixes: e126ba97dba9 ("mlx5: Add driver for Mellanox Connect-IB adapters") Signed-off-by: Moshe Shemesh Signed-off-by: Saeed Mahameed Signed-off-by: Sasha Levin --- drivers/net/ethernet/mellanox/mlx5/core/eq.c | 20 +++++++++++++------- include/linux/mlx5/driver.h | 2 +- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eq.c b/drivers/net/eth= ernet/mellanox/mlx5/core/eq.c index fc606bfd1d6e..494726f02e3e 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/eq.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/eq.c @@ -776,7 +776,7 @@ err1: return err; } =20 -int mlx5_stop_eqs(struct mlx5_core_dev *dev) +void mlx5_stop_eqs(struct mlx5_core_dev *dev) { struct mlx5_eq_table *table =3D &dev->priv.eq_table; int err; @@ -785,22 +785,28 @@ int mlx5_stop_eqs(struct mlx5_core_dev *dev) if (MLX5_CAP_GEN(dev, pg)) { err =3D mlx5_destroy_unmap_eq(dev, &table->pfault_eq); if (err) - return err; + mlx5_core_err(dev, "failed to destroy page fault eq, err(%d)\n", + err); } #endif =20 err =3D mlx5_destroy_unmap_eq(dev, &table->pages_eq); if (err) - return err; + mlx5_core_err(dev, "failed to destroy pages eq, err(%d)\n", + err); =20 - mlx5_destroy_unmap_eq(dev, &table->async_eq); + err =3D mlx5_destroy_unmap_eq(dev, &table->async_eq); + if (err) + mlx5_core_err(dev, "failed to destroy async eq, err(%d)\n", + err); mlx5_cmd_use_polling(dev); =20 err =3D mlx5_destroy_unmap_eq(dev, &table->cmd_eq); - if (err) + if (err) { + mlx5_core_err(dev, "failed to destroy command eq, err(%d)\n", + err); mlx5_cmd_use_events(dev); - - return err; + } } =20 int mlx5_core_eq_query(struct mlx5_core_dev *dev, struct mlx5_eq *eq, diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h index a13525daf09b..574a01caa193 100644 --- a/include/linux/mlx5/driver.h +++ b/include/linux/mlx5/driver.h @@ -1017,7 +1017,7 @@ int mlx5_create_map_eq(struct mlx5_core_dev *dev, str= uct mlx5_eq *eq, u8 vecidx, enum mlx5_eq_type type); int mlx5_destroy_unmap_eq(struct mlx5_core_dev *dev, struct mlx5_eq *eq); int mlx5_start_eqs(struct mlx5_core_dev *dev); -int mlx5_stop_eqs(struct mlx5_core_dev *dev); +void mlx5_stop_eqs(struct mlx5_core_dev *dev); int mlx5_vector2eqn(struct mlx5_core_dev *dev, int vector, int *eqn, unsigned int *irqn); int mlx5_core_attach_mcg(struct mlx5_core_dev *dev, union ib_gid *mgid, u3= 2 qpn); --=20 2.11.0