From patchwork Tue May 26 18:52:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 225299 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 53B2BC433E0 for ; Tue, 26 May 2020 19:21:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2923320776 for ; Tue, 26 May 2020 19:21:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590520870; bh=DJ+RkNvt0Js/EBh4v/QVhJIKEDFFoh4tGKhMbLz5ypE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Nm8MszUxExsuHGHsDWgEL1oH2Je3+6icdZni6PLjblQ+g9lbFGECe8Yxt1YlSy7dT N031roRERtHHAj/S0qyvVkAWKjzKCeJtpQU8uzRzHy+HCUJM9sY42lJrqGgJSjSVpB Z3Rvlo94inxDkD58R08czru1dQKB6Zm2AYFwxUKE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391551AbgEZTU6 (ORCPT ); Tue, 26 May 2020 15:20:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:41706 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404116AbgEZTMM (ORCPT ); Tue, 26 May 2020 15:12: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 01ED220776; Tue, 26 May 2020 19:12:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590520331; bh=DJ+RkNvt0Js/EBh4v/QVhJIKEDFFoh4tGKhMbLz5ypE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dmt2imCFXPZ/v0Iovelx0rSvD1AKzCi812BSUAAJaYhcbDJMtfctd7y+Fuykgr3oF hC3j2MLyy+m3rxN868W6C/pgpi4gpP0YpGI0DCsns9hRdCGDTN1iBE90NeOs2jTkeh rIpj9i6azh9cQMtjPR39lhfeqCXt3mWjAy00Psa4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Juliet Kim , "David S. Miller" , Sasha Levin Subject: [PATCH 5.6 038/126] ibmvnic: Skip fatal error reset after passive init Date: Tue, 26 May 2020 20:52:55 +0200 Message-Id: <20200526183941.130962874@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200526183937.471379031@linuxfoundation.org> References: <20200526183937.471379031@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Juliet Kim [ Upstream commit f9c6cea0b38518741c8dcf26ac056d26ee2fd61d ] During MTU change, the following events may happen. Client-driven CRQ initialization fails due to partner’s CRQ closed, causing client to enqueue a reset task for FATAL_ERROR. Then passive (server-driven) CRQ initialization succeeds, causing client to release CRQ and enqueue a reset task for failover. If the passive CRQ initialization occurs before the FATAL reset task is processed, the FATAL error reset task would try to access a CRQ message queue that was freed, causing an oops. The problem may be most likely to occur during DLPAR add vNIC with a non-default MTU, because the DLPAR process will automatically issue a change MTU request. Fix this by not processing fatal error reset if CRQ is passively initialized after client-driven CRQ initialization fails. Signed-off-by: Juliet Kim Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/ibm/ibmvnic.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c index 4bd33245bad6..3de549c6c693 100644 --- a/drivers/net/ethernet/ibm/ibmvnic.c +++ b/drivers/net/ethernet/ibm/ibmvnic.c @@ -2189,7 +2189,8 @@ static void __ibmvnic_reset(struct work_struct *work) rc = do_hard_reset(adapter, rwi, reset_state); rtnl_unlock(); } - } else { + } else if (!(rwi->reset_reason == VNIC_RESET_FATAL && + adapter->from_passive_init)) { rc = do_reset(adapter, rwi, reset_state); } kfree(rwi);