Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3512780pxf; Mon, 15 Mar 2021 11:11:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwnm/B1gsJJV92+hVRbZYQz1N/YDRaPvCkw+O2h19iuJpPsReKtZnkj0Pa1SKFXS67CoJ6K X-Received: by 2002:a17:906:1a16:: with SMTP id i22mr25295496ejf.522.1615831895765; Mon, 15 Mar 2021 11:11:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615831895; cv=none; d=google.com; s=arc-20160816; b=AzYSO7ah40hzJVDgJuUvNktNX2wJtpV/KbQ0GA2lW/Yz+VSAeQcduXpz0mJhFLkoDn h2NJ31Dp46Mwbdbg3XrycuYUu7fahJ9nXNQPWXiAnjQy6TprMchG08VIR8V2o7LZ8Y/W ChPT8kWah6jfB1q58jpfZJmV/Yode7XBjZvu33cMX8l5SP6ZUJYnayt67eaxgCOl+3gb N4sSUfGmAIYcNFQs+/lPAhc+JqNTCWAAipDJQCUujPx57Lq55kLnrNITjdVc/9DJmdia /DTBWSK51tQ6xn+0wLV23bf1payZwfqv+88JgvbnyAxMCuSUI9suJFdd8S2wo+PJy0Cm inAg== 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=zMTpLQEhTSwS9eCtZPv85bwETTqoGYN9cNR/gdlpj3E=; b=g/i2XeAd89qFcGwS1XOJFMY9N4iRCWcJdyO0gVI0TbxbcvXlOLmk89Z9dio3sUD062 RNmZVcj0VJ60gdyPzdi6tG2QXIfm38L2X4Lr8zVK/U4bbFQpH4lGyg4phuA3P7+/zBKn mSC/bNfj4GruzqLWR3oLl1ug2yRPZOhGNWSqbqCeLrN5VYWzrOsS2g6E6pivKN6zkTjl 7QpHMcNc1FWkwWhVAuWrMP5jQQ6/I9Ws+xhYMcLFbz5EVheS4jBqwkEecuigLMJeQTjA Gob4cYy/DLd+h4Xdgzf/fXKvU5SobphCpROy+LFEuwromezJstQ31Ot0ofkFbs8aGH6j YFig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=k55v7vSQ; 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 bf1si12347471edb.359.2021.03.15.11.11.07; Mon, 15 Mar 2021 11:11:35 -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=k55v7vSQ; 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 S231237AbhCOOLb (ORCPT + 99 others); Mon, 15 Mar 2021 10:11:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:36594 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232312AbhCON6X (ORCPT ); Mon, 15 Mar 2021 09:58:23 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9095C64F34; Mon, 15 Mar 2021 13:58:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816702; bh=FYEib7Qc+zd8XyDPJDqStoS8FTLRRMIFWhsDCCF4Tas=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=k55v7vSQGyc8oRYahDCJxa4zAmHmjaVMFSIdsQVUWolx+Wnjfwak2WHXcQr289uK5 9ZhBclTQNNvyMi+ENJ7NnIJL9pEiXcMdlV2T69Q++csVxlZ3iRvNAbw7B0xsudc6lY NkKMABdlBRKkaRMCL57m9FLmS9dqZmHyyXlIYwIU= 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 074/306] s390/qeth: schedule TX NAPI on QAOB completion Date: Mon, 15 Mar 2021 14:52:17 +0100 Message-Id: <20210315135510.147889280@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 3e83d467a08e25b27c44c885f511624a71c84f7c upstream. When a QAOB notifies us that a pending TX buffer has been delivered, the actual TX completion processing by qeth_tx_complete_pending_bufs() is done within the context of a TX NAPI instance. We shouldn't rely on this instance being scheduled by some other TX event, but just do it ourselves. qeth_qdio_handle_aob() is called from qeth_poll(), ie. our main NAPI instance. To avoid touching the TX queue's NAPI instance before/after it is (un-)registered, reorder the code in qeth_open() and qeth_stop() accordingly. Fixes: 0da9581ddb0f ("qeth: exploit asynchronous delivery of storage blocks") Signed-off-by: Julian Wiedmann Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/s390/net/qeth_core_main.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) --- a/drivers/s390/net/qeth_core_main.c +++ b/drivers/s390/net/qeth_core_main.c @@ -470,6 +470,7 @@ static void qeth_qdio_handle_aob(struct struct qaob *aob; struct qeth_qdio_out_buffer *buffer; enum iucv_tx_notify notification; + struct qeth_qdio_out_q *queue; unsigned int i; aob = (struct qaob *) phys_to_virt(phys_aob_addr); @@ -512,7 +513,9 @@ static void qeth_qdio_handle_aob(struct buffer->is_header[i] = 0; } + queue = buffer->q; atomic_set(&buffer->state, QETH_QDIO_BUF_EMPTY); + napi_schedule(&queue->napi); break; default: WARN_ON_ONCE(1); @@ -7225,9 +7228,7 @@ int qeth_open(struct net_device *dev) card->data.state = CH_STATE_UP; netif_tx_start_all_queues(dev); - napi_enable(&card->napi); local_bh_disable(); - napi_schedule(&card->napi); if (IS_IQD(card)) { struct qeth_qdio_out_q *queue; unsigned int i; @@ -7239,8 +7240,12 @@ int qeth_open(struct net_device *dev) napi_schedule(&queue->napi); } } + + napi_enable(&card->napi); + napi_schedule(&card->napi); /* kick-start the NAPI softirq: */ local_bh_enable(); + return 0; } EXPORT_SYMBOL_GPL(qeth_open); @@ -7250,6 +7255,11 @@ int qeth_stop(struct net_device *dev) struct qeth_card *card = dev->ml_priv; QETH_CARD_TEXT(card, 4, "qethstop"); + + napi_disable(&card->napi); + cancel_delayed_work_sync(&card->buffer_reclaim_work); + qdio_stop_irq(CARD_DDEV(card)); + if (IS_IQD(card)) { struct qeth_qdio_out_q *queue; unsigned int i; @@ -7270,10 +7280,6 @@ int qeth_stop(struct net_device *dev) netif_tx_disable(dev); } - napi_disable(&card->napi); - cancel_delayed_work_sync(&card->buffer_reclaim_work); - qdio_stop_irq(CARD_DDEV(card)); - return 0; } EXPORT_SYMBOL_GPL(qeth_stop);