Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3521624pxf; Mon, 15 Mar 2021 11:24:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy20O7kpdj47XlryB0+I+vF8X52ZGVKni+o0bcYSN3kYpHxogf8SHVVxFdatdx9Km/vaHsr X-Received: by 2002:a17:906:f1c8:: with SMTP id gx8mr25713073ejb.385.1615832684556; Mon, 15 Mar 2021 11:24:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615832684; cv=none; d=google.com; s=arc-20160816; b=dFAJNVCY4jpb+o8iCn6dgdJBlPaNe4iAEEkvXSPODI4GN047R45gfqvTloQxljFiz/ X88u7P5lzeUyOm7enUBfnUzLDRLZrbXK4WyCpc4nnDfolkkPmduIFWYjmP3TFgL+GKvD csFXIX3jEG3BV1HfA6UcOJPNJiqyN41kSAxypA9AbbVkSRiLGzuN2c5ONSuv0uq82rPs Zol9xleHUwZpzsSc9OiisibPj/hkaQX0eRJZumYUqkLipFdcWc03kAng1w8OBjYCPDyO ae12lM2g/bmCBiSYnYRAMKTBidTvPpaHjCyf3DuXnaQeaGpQzlt5+/9sAuyiNO1Hy+1Z Z0EA== 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=Qhh2xUqI4kSj868btjIz8y3HbjwdDMGD8tcy2Ap0YIw=; b=RjIpd70xFLGZdrid9UDXaEIQeK7ct02vF71a2t4FeI5qaRLhbHGzjq2aeZbOh7Jbxt RJw4uJ4T3xy6uS0GzoL7PJ9T1lPclW+kZ89Gl5slamTrrqNebmBdGKsxHMmAwnRovMoa 6rjSQQoqCfMAHrxqRfYTNCIg3hkChC8mP0+Qk42O6TRRCYlVLDro7xv2t4hg9Y0pDjRn n5D0CiSnKo7G/U5vPHHELWRIChAPmwU4oSu53/3dZHqDSFhMCo7ElptCJosCjcDCz/UO UV07Hs4KqvXCitzLQBPl8Rd55Fu7V4il/GYwanIlx6LN0ywlUGhoiazmmVN13sn/7/pr ItmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=DC1sh0+L; 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 b21si11126360eju.469.2021.03.15.11.24.22; Mon, 15 Mar 2021 11:24:44 -0700 (PDT) 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=DC1sh0+L; 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 S232846AbhCOOYI (ORCPT + 99 others); Mon, 15 Mar 2021 10:24:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:37670 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232835AbhCOOAB (ORCPT ); Mon, 15 Mar 2021 10:00:01 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C472664E89; Mon, 15 Mar 2021 13:59:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816783; bh=8unQdc5hnTANnRYGxog1e+/Pq9XJgyVVhYZCPVHgm/A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DC1sh0+LNLWvhhljiXSIL2wsDfJqMua8AkTbovLEIU5DBfq2uYFPEXe5iOmyJODgh ydS0FDjpRwIxwDGMlmQu1Njv0PzrwUo6td5MxyuCsX3TY0QhqDOOs8hV+FFIfj8VVH 9DfwFsk/WkpKd8oKj4vSXKHzttnWU2p+cNm3M+J8= From: gregkh@linuxfoundation.org To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Julian Wiedmann , "David S. Miller" , Sasha Levin Subject: [PATCH 5.10 112/290] s390/qeth: fix notification for pending buffers during teardown Date: Mon, 15 Mar 2021 14:53:25 +0100 Message-Id: <20210315135545.698316170@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135541.921894249@linuxfoundation.org> References: <20210315135541.921894249@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: Greg Kroah-Hartman From: Julian Wiedmann [ Upstream commit 7eefda7f353ef86ad82a2dc8329e8a3538c08ab6 ] The cited commit reworked the state machine for pending TX buffers. In qeth_iqd_tx_complete() it turned PENDING into a transient state, and uses NEED_QAOB for buffers that get parked while waiting for their QAOB completion. But it missed to adjust the check in qeth_tx_complete_buf(). So if qeth_tx_complete_pending_bufs() is called during teardown to drain the parked TX buffers, we no longer raise a notification for af_iucv. Instead of updating the checked state, just move this code into qeth_tx_complete_pending_bufs() itself. This also gets rid of the special-case in the common TX completion path. Fixes: 8908f36d20d8 ("s390/qeth: fix af_iucv notification race") Signed-off-by: Julian Wiedmann Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/s390/net/qeth_core_main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c index db785030293b..03f96177e58e 100644 --- a/drivers/s390/net/qeth_core_main.c +++ b/drivers/s390/net/qeth_core_main.c @@ -1383,9 +1383,6 @@ static void qeth_tx_complete_buf(struct qeth_qdio_out_buffer *buf, bool error, struct qeth_qdio_out_q *queue = buf->q; struct sk_buff *skb; - if (atomic_read(&buf->state) == QETH_QDIO_BUF_PENDING) - qeth_notify_skbs(queue, buf, TX_NOTIFY_GENERALERROR); - /* Empty buffer? */ if (buf->next_element_to_fill == 0) return; @@ -1458,6 +1455,9 @@ static void qeth_tx_complete_pending_bufs(struct qeth_card *card, QETH_CARD_TEXT(card, 5, "fp"); QETH_CARD_TEXT_(card, 5, "%lx", (long) buf); + if (drain) + qeth_notify_skbs(queue, buf, + TX_NOTIFY_GENERALERROR); qeth_tx_complete_buf(buf, drain, 0); list_del(&buf->list_entry); -- 2.30.1