Received: by 10.223.185.116 with SMTP id b49csp6422729wrg; Wed, 28 Feb 2018 09:08:44 -0800 (PST) X-Google-Smtp-Source: AH8x227NfRul1CKpPqGMD9CnSd5sMT7GVzgN0hWSH4ZRORyZX5TN4EUp6mIT4IhVk39J6HRmc5fv X-Received: by 2002:a17:902:b10b:: with SMTP id q11-v6mr18792475plr.275.1519837724491; Wed, 28 Feb 2018 09:08:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519837724; cv=none; d=google.com; s=arc-20160816; b=R1Au2t4VB3RUg+Xld4fIKeDmZCKuni9G77pCi/agt3hjZnhL4imbwAA7vqqY3ZF4As 2+T/+9ldHE3YVprrZ0p/r6MVhTycUiHvCW6muavWsINXiVTr6eAUUj3Bp3/wr113l8uA UNvSj836vygOUEa2GRzDjeFlEM/f9/Y5elug0VZWXF/YKOowgM/tJ52ENw90fq+eGj+Q 46MERqNjqXfDf5+tO2Ixt8IQArjJdWbYAcJMxBmjuSTnoo5ogrkQcBYeaOLCMyKxXQGJ k7dgJgIL/hb6zZyalV3TrORn22T46SLaxU3+E8ziXAquKKtB5MlQg7WjPcofZ59LbWCU 5UvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition :arc-authentication-results; bh=FTx03NvTK7nbWePrFwR1w0KaBFMgL9MD5U3Hp/B1LJ0=; b=wdg2bZu+IopLRKk3nmPDiFUMZRFNfTMfOmxZvFtGRFhZb8qNLBX+jcw53/uLf3GIey 2p9O2O/1VahEPHQ1BRx9sUTaz+L5v3ZQXfeti+HNBW+XGWHemCwtwbEAIfluFb7VdYiN D4uv1MY/XPmmttAFHSCLK6aUz71773UkmC3YJKRsQ8N8thJJXnJawAOeYluotRikzklq 96qlkoTCR99k1bXy6MekPbbC8U17YKo+RrmNyu3IJGfQivnp8O63kh1zYb8OrC0pVsAG 1ezWelYKi9/Frnj5xTvxB6REpY5WjHb/uuLwNQpoKlpji9+u71hPTLwtC0Q4KM2egpzy ebJg== 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 f13-v6si1630547plm.188.2018.02.28.09.08.29; Wed, 28 Feb 2018 09:08:44 -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; 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 S933661AbeB1PuO (ORCPT + 99 others); Wed, 28 Feb 2018 10:50:14 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:34307 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933643AbeB1PuL (ORCPT ); Wed, 28 Feb 2018 10:50:11 -0500 Received: from [2a02:8011:400e:2:6f00:88c8:c921:d332] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1er3Yi-0006Xf-Hf; Wed, 28 Feb 2018 15:22:20 +0000 Received: from ben by deadeye with local (Exim 4.90_1) (envelope-from ) id 1er3Yh-00008D-B0; Wed, 28 Feb 2018 15:22:19 +0000 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Moshe Shemesh" , "Saeed Mahameed" Date: Wed, 28 Feb 2018 15:20:18 +0000 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 134/254] net/mlx5: Cleanup IRQs in case of unload failure In-Reply-To: X-SA-Exim-Connect-IP: 2a02:8011:400e:2:6f00:88c8:c921:d332 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.55-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Moshe Shemesh commit d6b2785cd55ee72e9608762650b3ef299f801b1b upstream. 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 [bwh: Backported to 3.16: there's no pfault_eq] Signed-off-by: Ben Hutchings --- --- a/drivers/net/ethernet/mellanox/mlx5/core/eq.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/eq.c @@ -485,23 +485,28 @@ err1: return err; } -int mlx5_stop_eqs(struct mlx5_core_dev *dev) +void mlx5_stop_eqs(struct mlx5_core_dev *dev) { struct mlx5_eq_table *table = &dev->priv.eq_table; int err; err = 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); - mlx5_destroy_unmap_eq(dev, &table->async_eq); + err = 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); err = 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; + } } int mlx5_core_eq_query(struct mlx5_core_dev *dev, struct mlx5_eq *eq, --- a/include/linux/mlx5/driver.h +++ b/include/linux/mlx5/driver.h @@ -759,7 +759,7 @@ int mlx5_create_map_eq(struct mlx5_core_ int nent, u64 mask, const char *name, struct mlx5_uar *uar); 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_core_attach_mcg(struct mlx5_core_dev *dev, union ib_gid *mgid, u32 qpn); int mlx5_core_detach_mcg(struct mlx5_core_dev *dev, union ib_gid *mgid, u32 qpn);