Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2200162imm; Mon, 28 May 2018 03:48:41 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqkMUBW/YfcG1C5JHqVsk9Gx8uQboIXMk/elOKZucl451jHve24jV9WSUMkoy0mKRsvPiuB X-Received: by 2002:a63:91c8:: with SMTP id l191-v6mr10218208pge.53.1527504521184; Mon, 28 May 2018 03:48:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527504521; cv=none; d=google.com; s=arc-20160816; b=MCYsxE7zjfd5gL9P6yL6y6YZyPjfFQaaE/kVsjjcTJ0x5iqtrpNkiwnOWCC8vHy9Yf 6s44QRmq2nttlhpk5UezBr0VZzSHmfUflV2EYtUrJwrdFj4IIIm3xbLfwHi2hTawGC60 As80bujG4/5vuOwcs5JlkB9t0C7nTm6dpB/XrIubmmb6ih0Hai/6ef9MQ5XFjQc8HWZ5 jUnlkj3ZK1gabZoF0vf47xtFabKUoim0J3m66zSfr3NFqXRxyehJYScU7zHvpsz1Zyn4 RZ7+ylbG9JbSemM/l4NPR5BORl3diUr+qSjZ7ob6mby3RfXoON+cG9T+d04sjdW+kypE RwiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=YQ0gngnjblumPRP/r1UlQ7nPx9UtPPGRpqIlMgVFK/Y=; b=KBADOyCsWW4r2+X4dq9x2LFDh0abtMK1J/YHAdt3MBke+w4Oaxvl9xesxLy/aQapq4 AZU+UpTyQudApHveCys/S5dfvR/8mjINKyTebGqvuk+Si43lrn7PvgvjkdiRh2CeXw7j JvRen2UfiglWVOmkzBENr3yBLEopkRdgpNydpJzabgBGlkFp1oMzjF5wvfM/g7ilontn 4jLaM6foYoQjUYDgiWnDuQ/JiOOnuvz4hk7+JR1MjDhWYWJmO124dWRaGkNKzLKVIyCx 762+1t04fTq+SWuphog/H53CuvurPxixG6E1WXajCyL1b0p6uiHT/giP0wDlkVdXKPFa fm9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=2mFmoDjk; 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 y3-v6si30308688pfa.181.2018.05.28.03.48.26; Mon, 28 May 2018 03:48:41 -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=2mFmoDjk; 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 S1034229AbeE1KrO (ORCPT + 99 others); Mon, 28 May 2018 06:47:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:37280 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1163203AbeE1KrH (ORCPT ); Mon, 28 May 2018 06:47:07 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (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 0068B20899; Mon, 28 May 2018 10:47:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527504426; bh=EnBy62aAzcPYYk3MSi1DipkbK+s4yR4THfcOcSId1yw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2mFmoDjk2W35QjNm3WZqH8Bilfk2rJBUBhZPUQC0wRMLXwEkIz6tk+Vv2cH6ALkxR OVL0W01KGNs+APYlFWw/TR4znkL0+FMeLTjd2+tK6z+vUyw+38XSLGrjGr+7TFFwbc /1genjM0yEYMmVkfOVSgFYchSSBzBWKreUfJoGJI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Selvin Xavier , Doug Ledford , Sasha Levin Subject: [PATCH 4.14 106/496] RDMA/bnxt_re: Fix system crash during load/unload Date: Mon, 28 May 2018 11:58:11 +0200 Message-Id: <20180528100324.356460166@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180528100319.498712256@linuxfoundation.org> References: <20180528100319.498712256@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Selvin Xavier [ Upstream commit dcdaba08062b4726500b9456f8664bfda896c664 ] During driver unload, the driver proceeds with cleanup without waiting for the scheduled events. So the device pointers get freed up and driver crashes when the events are scheduled later. Flush the bnxt_re_task work queue before starting device removal. Signed-off-by: Selvin Xavier Signed-off-by: Doug Ledford Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/infiniband/hw/bnxt_re/main.c | 5 +++++ 1 file changed, 5 insertions(+) --- a/drivers/infiniband/hw/bnxt_re/main.c +++ b/drivers/infiniband/hw/bnxt_re/main.c @@ -1398,6 +1398,11 @@ static void __exit bnxt_re_mod_exit(void list_for_each_entry(rdev, &to_be_deleted, list) { dev_info(rdev_to_dev(rdev), "Unregistering Device"); + /* + * Flush out any scheduled tasks before destroying the + * resources + */ + flush_workqueue(bnxt_re_wq); bnxt_re_dev_stop(rdev); bnxt_re_ib_unreg(rdev, true); bnxt_re_remove_one(rdev);