Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2807052pxu; Mon, 14 Dec 2020 11:19:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJzg3ep6UDk2qk8f/hhxtIniBqGKsBW+mjPqRY2Mt/IEEN85AxZmv1jSKzmkZv8pXr1lJurn X-Received: by 2002:a50:f40e:: with SMTP id r14mr25669599edm.5.1607973547505; Mon, 14 Dec 2020 11:19:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607973547; cv=none; d=google.com; s=arc-20160816; b=E68nr4Gl6jDRuOoUbqIrvXHWQBfJl7zIdgZcH2vUslpOMUKuk4C+bLgzpZroyWb6ty 0hADSR6Xd6tWfQTNBXRQl1VdfCAn3KUcuKx/pxRysLH6LgbK2Hbk0XmNUNN1U3ZvroJ2 CYWjUyToAO9trAvzH2fbp0wYEPEWy88EtbkVZyWZtz1IxptdLkFYPN+uk1/E0RVMlHof hRG32gDGhV+fGn4dVj/TdsIT3jSzH/GQUjPfRiE9P/wHUCP0235lOvl2X7iIQiM+EMzw CV9XHbs7j1YA5eXDIIXSOrieYyU3lUDrHQ8bTS8qR2toe475o5RhP1W3SexIqkyQu3sV VXxw== 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; bh=eINwiIQozi4xEP3q4ctGBCo/WY/8hVfMK4k46rmdek8=; b=WZ9f5TnOfoe96WbH1MmE6xoXduod2vE+qIA3XBV6CXN1nIlGoJF8LXdBgMMmumNnIO OVr8qBlq3R0nnGYiN3uFS+8c8VrdaCQrFqsKQX1wPrbppVTlu119H4nPG0wMiE4dGXrD /PHEUFtr6re7zEj3QPIn7Bw2eA/97VW4mAXG6CmsQmEytrxuQVniHpqZQ7JwbAyoa73H +yGYD7egDp3vlhOgffC71fTkdcU7gZRTrDgkF6SaJE9yEC6rtnjUoaB0yXT8O6GUdYy6 JGeQw2Dg3aOLC/WHvSWTJaLw7O2OeypuXxRQgIw3B/U+0DkkDDiAucwhJYxO/9L2iw7J Q7pw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (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 dq8si10527064ejc.750.2020.12.14.11.18.44; Mon, 14 Dec 2020 11:19:07 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2440923AbgLNTKk (ORCPT + 99 others); Mon, 14 Dec 2020 14:10:40 -0500 Received: from mail.kernel.org ([198.145.29.99]:46226 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2408541AbgLNRgz (ORCPT ); Mon, 14 Dec 2020 12:36:55 -0500 From: Greg Kroah-Hartman Authentication-Results: mail.kernel.org; dkim=permerror (bad message/signature format) To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dany Madden , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.9 016/105] ibmvnic: stop free_all_rwi on failed reset Date: Mon, 14 Dec 2020 18:27:50 +0100 Message-Id: <20201214172556.052856619@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201214172555.280929671@linuxfoundation.org> References: <20201214172555.280929671@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: Dany Madden [ Upstream commit 18f141bf97d42f65abfdf17fd93fb3a0dac100e7 ] When ibmvnic fails to reset, it breaks out of the reset loop and frees all of the remaining resets from the workqueue. Doing so prevents the adapter from recovering if no reset is scheduled after that. Instead, have the driver continue to process resets on the workqueue. Remove the no longer need free_all_rwi(). Fixes: ed651a10875f1 ("ibmvnic: Updated reset handling") Signed-off-by: Dany Madden Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/ethernet/ibm/ibmvnic.c | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c index 85c54c061ed91..32fc0266d99b1 100644 --- a/drivers/net/ethernet/ibm/ibmvnic.c +++ b/drivers/net/ethernet/ibm/ibmvnic.c @@ -2186,17 +2186,6 @@ static struct ibmvnic_rwi *get_next_rwi(struct ibmvnic_adapter *adapter) return rwi; } -static void free_all_rwi(struct ibmvnic_adapter *adapter) -{ - struct ibmvnic_rwi *rwi; - - rwi = get_next_rwi(adapter); - while (rwi) { - kfree(rwi); - rwi = get_next_rwi(adapter); - } -} - static void __ibmvnic_reset(struct work_struct *work) { struct ibmvnic_rwi *rwi; @@ -2265,9 +2254,9 @@ static void __ibmvnic_reset(struct work_struct *work) else adapter->state = reset_state; rc = 0; - } else if (rc && rc != IBMVNIC_INIT_FAILED && - !adapter->force_reset_recovery) - break; + } + if (rc) + netdev_dbg(adapter->netdev, "Reset failed, rc=%d\n", rc); rwi = get_next_rwi(adapter); @@ -2281,11 +2270,6 @@ static void __ibmvnic_reset(struct work_struct *work) complete(&adapter->reset_done); } - if (rc) { - netdev_dbg(adapter->netdev, "Reset failed\n"); - free_all_rwi(adapter); - } - clear_bit_unlock(0, &adapter->resetting); } -- 2.27.0