Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp402024pxu; Tue, 1 Dec 2020 14:20:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJz2EkwgNlikMMLBIykwlOkPpF5Ae9Jm35qMhjJ/9O6wlSrVAVgGosGz31tHc2pNlWBxDrE/ X-Received: by 2002:a50:8741:: with SMTP id 1mr5342357edv.349.1606861239918; Tue, 01 Dec 2020 14:20:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606861239; cv=none; d=google.com; s=arc-20160816; b=kWwgyrCbaQ9LHPoy0lJIbh1cUUP595Jq1UvrizvUJLu9nthbVx9fjjYsKSu6Pb9VNM tiXw+nEO1lruLbry9uB58Pf11zOGj9S86g/l9lDi637W8Mw722MOSTjBeqtOxpYwFv3m 6B1NP5l26tfKkhufEPipzqjN5WVVTdtAYq0aMaWwekJfAJAThqg20s2Qprxm90kMtZZU ZlvKGII/IX4uBKNqlmZzL83b9n86pY8PHYrtoSS9f668/Vw+FFjeJ/nNahClFq1+MexY ZbNSAad3SR4HVutcARvDCvxUk7Cs1h9qDPtWnrTJsQcN+4sSGyyO4msZfjLh35y1BlX+ 12fw== 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=FDNDF8PJoPjNvJTIXPsw2HsHEkePqddbFsTc+B3RH8I=; b=ufvhCva2KBIA3liAYKl09q33+4J1ZVNViZxIP1iLcRz4xVp6WX3k5wE9ZlUcRscInh y4uyTX7vcblorWZRiUvqsNIorzjvt9xw15hc6cQCv6mu9f+jWc2A5uzB+MbNrYI5ofAH 1DodRrT4vV48B7cveURMAHxOHCwVhcRngl4AEmrm3+kIU5wuEuZV/BI6Oo0BUr0vyPOz 4YyQ1qcQOsrIah4zfFP2v7SzVXUC+jkQIfvw8z+img4hAa8kuHShzB+brLusRWkpb3Pi mMjfNem07qhugLp9vjSUtg3yBT74pI6s416j8JlqxaIHlGFIJcBNqcZ9mNR6Iefa+uks j5HA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=YyboLJNs; 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 d7si816424ejb.73.2020.12.01.14.20.17; Tue, 01 Dec 2020 14:20:39 -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=YyboLJNs; 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 S2388534AbgLAJBV (ORCPT + 99 others); Tue, 1 Dec 2020 04:01:21 -0500 Received: from mail.kernel.org ([198.145.29.99]:36796 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388512AbgLAJBQ (ORCPT ); Tue, 1 Dec 2020 04:01:16 -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 1C9EB20809; Tue, 1 Dec 2020 09:00:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1606813260; bh=z98ZFUmV7c7WULsRxEoh75Bn7YbFJN6IbAySPvC58Z0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YyboLJNsSeazRfCS0os4Jnr2NQGP4c/4mxCGjG+/Zj9wIyozqFnSsrQcUMs9ENEPD 0LDR+J/1vEOR0ZcFB4U1h57Yh6aq4UHGhjBdrqc0/BLPU2ljIdymivp2oAMDHwkcmt xx37qDM2UnMS533SuidqiP+YU0lTLFrgCypmdNTY= 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 4.19 37/57] s390/qeth: fix tear down of async TX buffers Date: Tue, 1 Dec 2020 09:53:42 +0100 Message-Id: <20201201084650.935855282@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201201084647.751612010@linuxfoundation.org> References: <20201201084647.751612010@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 5f59e2dfc7db9..d0aaef937b0fe 100644 --- a/drivers/s390/net/qeth_core_main.c +++ b/drivers/s390/net/qeth_core_main.c @@ -470,12 +470,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