Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp5068636pxb; Mon, 15 Feb 2021 08:41:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJwTlUzfjAGNlDwOf+cORsbxDAVn0wUKkQKaBSxYwg2z7oV42tdHcIhSgLGOud7eVFJjNM8w X-Received: by 2002:a50:f693:: with SMTP id d19mr7197088edn.298.1613407263851; Mon, 15 Feb 2021 08:41:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613407263; cv=none; d=google.com; s=arc-20160816; b=ukMaLibfVHM+f83E5vbBws4Y5mxp8nnk3LmOPhktCXpWDU5d8P81gFM1xkmaZjDAOT 7EZt9guzDwH1TwGaW8ByM1/w35GuXfLaFvrzQBVpNwzk6jhYlyau9UTtIVOjpHpBwV8V L5h4zeGnY728SZTiSDlPpetKi6z0XgQxRrP6zaZb/VKzpWeLBQQPpCW2iqJuLcHN5J+c Irf28iwS8FG9BvWy3lF1XqyEHC9B2ddGl8uOxMlcxqsHUs2DxvB0f5P2bWg4+KhL3HQj b8jq5UoWXOXNNshzSCNgw5Iub3rGMfznzz7kYWsbxV657lLexxZvWHptzfrz+Frr1pIX Kywg== 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=sMbzYkhjgUYe0MYp1I32K7bsI39chmeOkcFHChpy3Rg=; b=sQpW61iT7EKaOnOkcsy3ajwf0Oa/C6HyVI6LsUf6Z6Wtc2/2Zh1FWYc4YbwxM06W60 Kkyyh3tnO6ITaF/7cW0jWmN80xkb9I2jV6ayLHgc2xt+p7k16JTTDJKXPqTs+wO1QzAw RsXS7wnppZu/UQKUlMPLnUOa93vFVIJ31IQFUofAeoBNwnCIFvs93tJbK5OravmBqLPl 2z16d1I9MwJg0c7FY2Z7XONqw/waj0vxjV+I8y7s6blonGTLWXQTq/J7AmagMq5yCakd je0ZyZeU92gJpnfpP/KuIN9weYodkBjaxUd1DdaNwpZaUQs5HKdM/MmcA4lZ0IXKxfS7 nLyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jSeUol0D; 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 j1si12437978eja.96.2021.02.15.08.40.40; Mon, 15 Feb 2021 08:41:03 -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=jSeUol0D; 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 S230142AbhBOQjO (ORCPT + 99 others); Mon, 15 Feb 2021 11:39:14 -0500 Received: from mail.kernel.org ([198.145.29.99]:50214 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231503AbhBOPhy (ORCPT ); Mon, 15 Feb 2021 10:37:54 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 85AA964EE6; Mon, 15 Feb 2021 15:33:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1613403210; bh=YRSsPjhU5NSqReLOkiilngwVizIj9OU4Bj324PZBaew=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jSeUol0Dt+wVO1+ffYIk2ijxxybURwzX0r/5oNVj6uSL39rZDO7ESUZPTn9XlZ2Ms Udb7Cp8PT18Ll4gVwkoXpL1bYSiI9iUrW53yfkXtiVFLnIkLX/fT9mDBuc8ydsbNx6 GpcdiuKJyB+o8MyydnQJT2bKZQaBP4lr25SaAue0= 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.10 068/104] ibmvnic: Clear failover_pending if unable to schedule Date: Mon, 15 Feb 2021 16:27:21 +0100 Message-Id: <20210215152721.661356833@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210215152719.459796636@linuxfoundation.org> References: <20210215152719.459796636@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 2f281d0f98070..ee16e0e4fa5fc 100644 --- a/drivers/net/ethernet/ibm/ibmvnic.c +++ b/drivers/net/ethernet/ibm/ibmvnic.c @@ -4813,7 +4813,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