Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp405853pxu; Tue, 1 Dec 2020 14:27:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJxqMCo7dDR4KhC+xrOrGoFEEPDYiQtG5uBFejF23N69aFkUNlF9S6sYtM5t7uQUT2+CeYOa X-Received: by 2002:a17:906:c096:: with SMTP id f22mr5007740ejz.488.1606861623507; Tue, 01 Dec 2020 14:27:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606861623; cv=none; d=google.com; s=arc-20160816; b=tkb1d0jYtjrfUNN07Y1xgTpWMaQ0zr5mVHp9BpMAR2Ul2nrud+M0zsIZPAKzW3okUf XtUmZQiFFjm51yTelWpifJgihhMl1XPUAX3EGwbEXcbH779JTohItO+DlGzs/COdX1YX ou0Uy7YwJ1PkCU93y1qFQFy+0oYROknDAc0m+msDlPGB1Wv3uXOAUJPIxWPF3huPwdi1 uIy6wMLf+5VSUpeBMpJYGeKx6rDXfG0+cj1MnZRwNYy7CV5O+eYoEV2qJmN/Hp4LhOOe YxwS/KcGl5O8CyuQKtU6ujia8suiFyKeNIUrBi0AFVvZW4BsI8GIQuvBJJjHjx2kyKM1 tfxA== 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=DT2piciG1/OlqKrYC6FbeZk00K05RY4x/7ttc3i2bDs=; b=p/9MhUWzy+6IukjBftTUKgYyy7SiEP8Nb/jTcxVO68F8Drg9g0lJACLi1Xfmz9ESop bCD4uS+Aunbhf+QEsscdWRA6HIu2oXBhcwyrD8dKXnBHzrI8hH/FPinJIlCPm1/B32qm yBC+XjKzRXeZplh0ia08Iqba1aU0482tjHZLn6yBLmQAI2W58V5/0GDYjk6akjsEL8uz n9fXq5bUlM2Q0MXEYRiPL/BtYpSPy3VLFBL4yvH+0eWdD9BQvQ8jt8UD4oOlIKt7STj8 ScS9Vvyr6dfDV0YVqXahu1bWWogCwY9F89FpcFuNqouOb82cwNb4woAmse2/Y2DO9s8c IDGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=bth9T5Jg; 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 rk17si819359ejb.509.2020.12.01.14.26.41; Tue, 01 Dec 2020 14:27: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=bth9T5Jg; 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 S2389955AbgLAJMX (ORCPT + 99 others); Tue, 1 Dec 2020 04:12:23 -0500 Received: from mail.kernel.org ([198.145.29.99]:50514 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388872AbgLAJMU (ORCPT ); Tue, 1 Dec 2020 04:12:20 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 CBACC2067D; Tue, 1 Dec 2020 09:11:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1606813899; bh=GiIcpuIEXT7xJ0orfc9XiiPQIwDzxmqy4Ut5oxb2zXU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bth9T5JgigG9VVF2vTMD3MPNFOo6MJXwY0DQo7Q7sL/KEynBLtIsg67hsdikob2Dm Yiui1//rb6RafThs2uRSQHdXZIMhDNu7Bmjs/4LS7yY5Eq37r0jfmzFyUanlNdbRk5 xg7ngDGa1cQKK+C/hMPcjfUO3XR+CuSxkTPjxSRU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Julian Wiedmann , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.9 097/152] s390/qeth: fix tear down of async TX buffers Date: Tue, 1 Dec 2020 09:53:32 +0100 Message-Id: <20201201084724.571225847@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201201084711.707195422@linuxfoundation.org> References: <20201201084711.707195422@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: Julian Wiedmann [ Upstream commit 7ed10e16e50daf74460f54bc922e27c6863c8d61 ] When qeth_iqd_tx_complete() detects that a TX buffer requires additional async completion via QAOB, it might fail to replace the queue entry's metadata (and ends up triggering recovery). Assume now that the device gets torn down, overruling the recovery. If the QAOB notification then arrives before the tear down has sufficiently progressed, the buffer state is changed to QETH_QDIO_BUF_HANDLED_DELAYED by qeth_qdio_handle_aob(). The tear down code calls qeth_drain_output_queue(), where qeth_cleanup_handled_pending() will then attempt to replace such a buffer _again_. If it succeeds this time, the buffer ends up dangling in its replacement's ->next_pending list ... where it will never be freed, since there's no further call to qeth_cleanup_handled_pending(). But the second attempt isn't actually needed, we can simply leave the buffer on the queue and re-use it after a potential recovery has completed. The qeth_clear_output_buffer() in qeth_drain_output_queue() will ensure that it's in a clean state again. Fixes: 72861ae792c2 ("qeth: recovery through asynchronous delivery") Signed-off-by: Julian Wiedmann Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/s390/net/qeth_core_main.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c index 54a7eefe73d19..e3666232a19a8 100644 --- a/drivers/s390/net/qeth_core_main.c +++ b/drivers/s390/net/qeth_core_main.c @@ -501,12 +501,6 @@ static void qeth_cleanup_handled_pending(struct qeth_qdio_out_q *q, int bidx, } } - if (forced_cleanup && (atomic_read(&(q->bufs[bidx]->state)) == - QETH_QDIO_BUF_HANDLED_DELAYED)) { - /* for recovery situations */ - qeth_init_qdio_out_buf(q, bidx); - QETH_CARD_TEXT(q->card, 2, "clprecov"); - } } -- 2.27.0