Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp5031677pxb; Mon, 15 Feb 2021 07:48:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJz2xRjvA7Qs4KsXvQs5YPqWVyN7gRegTDMw3HUB7mFsr5mdYtkru0iwAzo+vAavYAuxvQ/r X-Received: by 2002:ac2:58f2:: with SMTP id v18mr9624299lfo.284.1613404114085; Mon, 15 Feb 2021 07:48:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613404114; cv=none; d=google.com; s=arc-20160816; b=g2eJJsLVq/Z1j30Dw4CKqdWdiYzVhhVoBS/PWxIDP0r2yG/hMK7zUgP8qAsqWJT0o1 U5PH4IUD79FNiIhrh5Ek0v2UkvrLlTQyb/133JANooqgxfHJR0R3oEGF4SyYdzV4+bc2 trTYCL/Wy4WY42bPsQG7d5+QMbBZZkMt7VeOD0jyunrj6b/FkM1gOOP/7PHCCixpLZfj J8FIezPcea1fnngj5mP6hFMb1B9OR4wHzD4T73AhlB9YrfUHjRdsgzJEtvKRMTZ5n3rk CyR1G5MT7t0uuiEQTqEUdEwt7u4YjTUXAR/fIo6Vt/yPg9C5cETOwwtEUjtvi3Zxbfug BgBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=HJTVYk0b+wWNQnxEz/r2fZd2hp5XBg0z1CCUrcgUJnw=; b=UiHQrTbTMidc0k7VWA3azqXyKYKvHVtHu0cMrIs6etxmvMKhfJKM8m2UtvS/uidD1D orfYrkPPVCdt1gCo19wpJJn0yaer4XYbdlYZOP+2smS6r4l3avkizlYbv+dg8KWHltbg WzYaldoWk1B7p1Nh9rP0t1fdcryE4eMVby6cXYMP9EqkOdEK+/6C/1tE2jWb1KfGTvsX 6mb81d/y1Qy0C+Fm4JK5uplPd4PvfcwgXQbpgCYsqt4KDyVMpEV69Bl34/Q28Vcjo3fU UG39rRW36YTwOa0sGHlHoYeEL7tfyTLon0txzWN06AWWcOCu1ALikjDeFs97Myp61V0p yjlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ADvOCKrQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w17si4991127edx.417.2021.02.15.07.48.10; Mon, 15 Feb 2021 07:48:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ADvOCKrQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230498AbhBOPp3 (ORCPT + 99 others); Mon, 15 Feb 2021 10:45:29 -0500 Received: from mail.kernel.org ([198.145.29.99]:45568 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231207AbhBOPbM (ORCPT ); Mon, 15 Feb 2021 10:31:12 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0C9AC64E93; Mon, 15 Feb 2021 15:29:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1613402964; bh=Os9Gvae+8O6XOG788aNLZtLpM/vJrIWunQYgZHZf+yM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ADvOCKrQ7NWyFMokjfN0thj5QMl4/HYu/7XrGFMqbvqKHvQAEugw8euCTtYNTcK5m oWiULRVgM/4Jfw6vyaYaI8NPpv118Zoum90FzVLTMotnAp5Nohzt8HAsq97sBuZf4S MVGVZH1xhhCkunMvPyUK1jwQIb5CL30ETIPutFGg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sukadev Bhattiprolu , Cristobal Forno , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.4 36/60] ibmvnic: Clear failover_pending if unable to schedule Date: Mon, 15 Feb 2021 16:27:24 +0100 Message-Id: <20210215152716.509673232@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210215152715.401453874@linuxfoundation.org> References: <20210215152715.401453874@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sukadev Bhattiprolu [ Upstream commit ef66a1eace968ff22a35f45e6e8ec36b668b6116 ] Normally we clear the failover_pending flag when processing the reset. But if we are unable to schedule a failover reset we must clear the flag ourselves. We could fail to schedule the reset if we are in PROBING state (eg: when booting via kexec) or because we could not allocate memory. Thanks to Cris Forno for helping isolate the problem and for testing. Fixes: 1d8504937478 ("powerpc/vnic: Extend "failover pending" window") Signed-off-by: Sukadev Bhattiprolu Tested-by: Cristobal Forno Link: https://lore.kernel.org/r/20210203050802.680772-1-sukadev@linux.ibm.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/ethernet/ibm/ibmvnic.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c index c3079f436f6d7..0f35eec967ae8 100644 --- a/drivers/net/ethernet/ibm/ibmvnic.c +++ b/drivers/net/ethernet/ibm/ibmvnic.c @@ -4595,7 +4595,22 @@ static void ibmvnic_handle_crq(union ibmvnic_crq *crq, complete(&adapter->init_done); adapter->init_done_rc = -EIO; } - ibmvnic_reset(adapter, VNIC_RESET_FAILOVER); + rc = ibmvnic_reset(adapter, VNIC_RESET_FAILOVER); + if (rc && rc != -EBUSY) { + /* We were unable to schedule the failover + * reset either because the adapter was still + * probing (eg: during kexec) or we could not + * allocate memory. Clear the failover_pending + * flag since no one else will. We ignore + * EBUSY because it means either FAILOVER reset + * is already scheduled or the adapter is + * being removed. + */ + netdev_err(netdev, + "Error %ld scheduling failover reset\n", + rc); + adapter->failover_pending = false; + } break; case IBMVNIC_CRQ_INIT_COMPLETE: dev_info(dev, "Partner initialization complete\n"); -- 2.27.0