Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp837260ybi; Fri, 12 Jul 2019 05:28:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqzCQLdlqTpo8/GoewKsFVS04/JSWyqnKrt/zWtqEP58Sk1WHMJQCcN4KrNrYvTxe0wDajs3 X-Received: by 2002:a63:bf01:: with SMTP id v1mr10383177pgf.278.1562934530923; Fri, 12 Jul 2019 05:28:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562934530; cv=none; d=google.com; s=arc-20160816; b=aBsetm/KS3VborGmA0ZVrxUmhLhoNdaP0v8ZFgLSXo5OHW+O6bXKUSiQmHolifYkaf Rnt5DpaWst4r7p2N5bE8rGc60bPnpxXhGwzWxZl0zzzzc6bq752dmdXnJqztWmkNzcd7 WNvZNcJ1A6tnfv1JoPRqpxVIXNYT54QbCTHui/d0t1mWZYo6PdCPppue1Gp82YESXYEb vPQNRfbkmcBcM9s+9UtZQf869yKSbU/n6d50R1kvqhTEbH83S8Sk8mMOcDDV4mZugDyA X4uKsB/fGbM++2hZBgJvFtofteVUFfCB7D1SuQJ5E7KsPnlqU3dK+RWRhNfYvup12N9w jfNA== 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=zNzEU9AS/3rgEsrwL9Fe5N7p6vyGGBQ/Usz2YJ1opkA=; b=VQeDIRhRtGALPD/FA1Tw/VJOxSfYTjKcdMXeJ7P3gGlFcJdjJ6MgrKv/+dFGyXRI17 WkMYc1jvmzVfQz1tDSGVHqerCVpNlfmmLw77gS5bci8OJ4e6U9uwBvZeV9MJfuqSEeIZ R2W2KspeV51g2Yogz6+J4ixIvt4o6J6JLo4Z0sjx41GzM058EKIb0IjZflY+NFETpdz+ 7Hgqta/zqYbU6JzIuUGbjvO2y+QcAxBd52RLnttU7t8F5Z0KVkNjhnonHWB6C51aNX1B /5hMO3tL/2Z+jobSwQ2PH3RmkGt9NDRgn0FGnSqRjKdwHAl5/+/D/duscsf1IDaIKy4t j5og== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Nq5BPMrb; 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 g9si7792993plm.207.2019.07.12.05.28.35; Fri, 12 Jul 2019 05:28:50 -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=Nq5BPMrb; 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 S1728127AbfGLM0b (ORCPT + 99 others); Fri, 12 Jul 2019 08:26:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:37732 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727561AbfGLM03 (ORCPT ); Fri, 12 Jul 2019 08:26:29 -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 2E1BD2084B; Fri, 12 Jul 2019 12:26:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1562934388; bh=jnfapKDAJb2wo6tU6rPlft0yXV1aRdTj1hfyQPk7CqE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Nq5BPMrbWw/pTsbGFhXg43jktsWGbgbMduSQRkpefTWraGJHSThhwSDbPf7wAOBsD cFdy0USIR7UUPatNG5MGbJzZTioaDCm4sFfXpa1IhAdFjMABicv/Hz3Onl03r/pfQG InkhWv11DyCp2yYwSD7g78PW+MjR2n8x3nDCQFYU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Thomas Falcon , "David S. Miller" , Sasha Levin Subject: [PATCH 5.1 040/138] ibmvnic: Do not close unopened driver during reset Date: Fri, 12 Jul 2019 14:18:24 +0200 Message-Id: <20190712121630.214132491@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190712121628.731888964@linuxfoundation.org> References: <20190712121628.731888964@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 [ Upstream commit 1f94608b0ce141be5286dde31270590bdf35b86a ] Check driver state before halting it during a reset. If the driver is not running, do nothing. Otherwise, a request to deactivate a down link can cause an error and the reset will fail. Signed-off-by: Thomas Falcon 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 3dfb2d131eb7..71bf895409a1 100644 --- a/drivers/net/ethernet/ibm/ibmvnic.c +++ b/drivers/net/ethernet/ibm/ibmvnic.c @@ -1751,7 +1751,8 @@ static int do_reset(struct ibmvnic_adapter *adapter, ibmvnic_cleanup(netdev); - if (adapter->reset_reason != VNIC_RESET_MOBILITY && + if (reset_state == VNIC_OPEN && + adapter->reset_reason != VNIC_RESET_MOBILITY && adapter->reset_reason != VNIC_RESET_FAILOVER) { rc = __ibmvnic_close(netdev); if (rc) -- 2.20.1