Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3284891ybb; Tue, 31 Mar 2020 02:05:36 -0700 (PDT) X-Google-Smtp-Source: ADFU+vs6BD7Fl30Q2Nx2qMSgaGxoOikjGr2Y1IrphluajkGXRLHbXFi6bhTp7PJziNXUCSEzujZA X-Received: by 2002:a05:6830:22d1:: with SMTP id q17mr12687127otc.194.1585645536445; Tue, 31 Mar 2020 02:05:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585645536; cv=none; d=google.com; s=arc-20160816; b=ktdgo2ikCzg7Im/ahskR+8Sh8cHYxkZ5kdVlADdUy4GqqHbphQBk8YRWfBpobXi5Nj K42YHg0/GCnMfDZtbfoKy1fBbgXTJxrX+l/JT1Z06RvRaLjkigpWKNLNet324rBHfmJP aHHNHcFzOmo4YUCUW7yWHw8DpW9D7vN1ptA3MRtTY5Qm9S1G4o719188jyl43yIuvSge NwHpiP0PIADLQmCpgK/kIvf8+cJ/8HQyG8l9t9Mo8pNXescPRYIvnumb7UYo2Cyywf0W dp//Bs+p/CWl3zP1XWmX+2FvHhtrxTBpipHMJRGda3ovD/FO3vzgbA4IpoIz+/DRs4Xn p5PQ== 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=n8hnDI+8mNEKE2V85vNhFZhcQijXPNW/DNrvGAmcwm0=; b=ARZ8yFbkIBQgc+94VipZh0+uSkva8XBFobdYFxFQ4uxKtLtBtJoSvMbADiP+Yfn4UM Pn6Kg7MFQUFAdMY1a4YtyJpxW0jBVt9h3snpfBeM18AJZXYi2iAn2zRuoWT0YW2ptMa7 eRqAlnWak8Xp595x8E8EB0HbkYE61FtqfpHeH4Y4QsIyfcne764vbU8MrFVRWeUJbQkX IWXJ6hJ+Z6qpoRx4T04Wgq51vbEEaS07eX8weh4r4FOjVmfgIjVsXSaXJ/8OmvZ2hqPX gbmgYiGmm5A3JRpp/UlZzji46vusbNvgFj2LPxPoXwM23HZyvpKTvjfMCD7UjtRZUEfd dHkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=OoQrO7+V; 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 f77si7770049oob.89.2020.03.31.02.05.24; Tue, 31 Mar 2020 02:05:36 -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; dkim=pass header.i=@kernel.org header.s=default header.b=OoQrO7+V; 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 S1730834AbgCaJDg (ORCPT + 99 others); Tue, 31 Mar 2020 05:03:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:43326 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730567AbgCaJDf (ORCPT ); Tue, 31 Mar 2020 05:03:35 -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 988A7208E0; Tue, 31 Mar 2020 09:03:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585645415; bh=mcXDqjTxnjRA1lBbrZNJiG7HSQjwELrJEtMA0Nod9s4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OoQrO7+Vhhxexu9wFauAMrRun8PYm9h6PtJv9LjtQuMGwaP+jzQvaxcaYXQYO7G88 V17ZIJYBVCSf41hV/ZFBh3hWTiLfJS8gb7c7gLEqppyii2njx5GVo0NRg0q09OH27r Z+c7fTYVBnd4TLuRT3OxnwxkWo8CwmrDW/NCcGng= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vasundhara Volam , Michael Chan , "David S. Miller" Subject: [PATCH 5.5 046/170] bnxt_en: Reset rings if ring reservation fails during open() Date: Tue, 31 Mar 2020 10:57:40 +0200 Message-Id: <20200331085429.342764632@linuxfoundation.org> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200331085423.990189598@linuxfoundation.org> References: <20200331085423.990189598@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: Vasundhara Volam [ Upstream commit 5d765a5e4bd7c368e564e11402bba74cf7f03ac1 ] If ring counts are not reset when ring reservation fails, bnxt_init_dflt_ring_mode() will not be called again to reinitialise IRQs when open() is called and results in system crash as napi will also be not initialised. This patch fixes it by resetting the ring counts. Fixes: 47558acd56a7 ("bnxt_en: Reserve rings at driver open if none was reserved at probe time.") Signed-off-by: Vasundhara Volam Signed-off-by: Michael Chan Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -11666,6 +11666,10 @@ static int bnxt_set_dflt_rings(struct bn bp->rx_nr_rings++; bp->cp_nr_rings++; } + if (rc) { + bp->tx_nr_rings = 0; + bp->rx_nr_rings = 0; + } return rc; }