Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3513546pxf; Mon, 15 Mar 2021 11:12:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwJPpSGaVQQIWhrjCa/I8dUsCmGlYwZJ/f8eWqOlq2a6VWPQFnwLev2BpHxvgwn4sWgDg6r X-Received: by 2002:a05:6402:3495:: with SMTP id v21mr31186041edc.117.1615831966592; Mon, 15 Mar 2021 11:12:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615831966; cv=none; d=google.com; s=arc-20160816; b=aW73929skBhTh2rXUzxqsxbT7EmD05LIA1WegcGrDV7hvPSOl1FezmXAqP5MjFcP3n Yd/aNS7kRSE1lAzyuYZU5v/9d5pglIDFoAjXhFIhRtkzNMVFB6KkMDitvXMoS7WJ0Ks2 UzJ/fCtzTa5aEX+5hWQ3J2PXerNkUXh+8Lye46ZANDRv+zWFkb2WMZsmEtB9Z1I6yNC/ 3onaZvNJyj6CbhEjdtI7BRnHrcd6yRAemTlqSy1LV2TQ1WvbGLuqfwGqLD/zVWMWjYX6 jH8TgXewJ2pia84td1EqrRrG91TpuwuONyKTh+qq/bbdRKVg1pZzePQq9hMwW7eA5jpq WCYQ== 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=6ms5sKVj6uOXwzESvLcDwzLXI8xO46YEJEBk++VQbsQ=; b=Xuy0TUmQbUrw4uI4vB+nRkTM8feIKCkt0Ysxa6Ipf4uGS60HSJqUIhQyOXUiK/gmxh raocyp22riUWZnat8Zoe+lrS2zDrJa+wvrC9YG6ZqABsG7+lJmC+gMeQBFhldWDT1Vcr fDFUCQqs1JbY6Q1dQ+HSgFG7g1W1+VpmN2irktg3KHKE2CSgX09WNvRdlMs87fvCIBws vQMSdYKX0FiIXER818kY26kYp4xLCSyJ5tKJLhhVyZ/WulHx52j4mGGj7KEsVB1eCX4D ANLNurvb9lb6hzL0QJl4lKenaCnHOGfBToF3CCzbMIGJNtJ6clBytIufi0leClR+ojEj uHXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=tilEB6ki; 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 y18si11965768ejp.482.2021.03.15.11.12.24; Mon, 15 Mar 2021 11:12:46 -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=tilEB6ki; 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 S236012AbhCOOML (ORCPT + 99 others); Mon, 15 Mar 2021 10:12:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:34900 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232330AbhCON6Y (ORCPT ); Mon, 15 Mar 2021 09:58:24 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8027164F16; Mon, 15 Mar 2021 13:58:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816704; bh=lYI+fxC0x0wtugthTFEwxqBaDX2lnENLz29pCkVtjPY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tilEB6kimJEU3SyDUv+MaQe5tpcZMyq6aKtieC53iEFVNzJdtdw0dlb43bHXxUg5f zhMXDNiCgvXrwqiryq+h2KXSrGbSMuUgru8bTPnbD/b0VnaleG0tMdbdIGDa705n9W X487l5v26OF6WWgClaKqF2qQHv59F6SKUFvz73cc= From: gregkh@linuxfoundation.org To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Julian Wiedmann , "David S. Miller" Subject: [PATCH 5.11 075/306] s390/qeth: fix notification for pending buffers during teardown Date: Mon, 15 Mar 2021 14:52:18 +0100 Message-Id: <20210315135510.180474061@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135507.611436477@linuxfoundation.org> References: <20210315135507.611436477@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 commit 7eefda7f353ef86ad82a2dc8329e8a3538c08ab6 upstream. 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: Greg Kroah-Hartman --- drivers/s390/net/qeth_core_main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/drivers/s390/net/qeth_core_main.c +++ b/drivers/s390/net/qeth_core_main.c @@ -1386,9 +1386,6 @@ static void qeth_tx_complete_buf(struct 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; @@ -1461,6 +1458,9 @@ static void qeth_tx_complete_pending_buf 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);