From patchwork Mon Feb 1 17:28:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 374285 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp1498371jah; Mon, 1 Feb 2021 09:34:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJz8rjz67EaYOGyg2I3Z4aEZOdalqBlF7eNp5T+RxklWtFPYZ0fqgrfE4oex7131eRFVvfTh X-Received: by 2002:aa7:dc0d:: with SMTP id b13mr20144068edu.170.1612200856746; Mon, 01 Feb 2021 09:34:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612200856; cv=none; d=google.com; s=arc-20160816; b=S14DYTim/1e/AoPhEEQwAvYyAj73LdeTXG5onzqm/JwleMmBuFRvCrSgBywgR7BZNW QCeMrMyqFF1IaAZE8yqG8vRHwOp42DUsx4A3UvKXdzsTA50gEwo5bX1/BiQTSZTVlI5m qddE9w7lSrm1t1BRuphzWqpaiiOctFYo+/ZgIZ3AOJUL0NU7XRue+sdqVWoU16Bu6CM3 5GOdAojup/7ZMH65uxWtmPywHMk+aKJJQDI1ofNin5udSzRS5RFWaLvN910hcAjOs3Db MBoZrKKLMJxvUhiChhPFSyK7uKKtayERoCqc96Pg8vqQYBnixmPIbEg9tw28Ol43IkG0 kOzA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=AD7sJiqeRNIVKYtmxnmsyabUetsvJJmTXIczDFUxnes=; b=kdBXR6gEOi49e0Y5LkfA0+fL88vrDohtkQQ2/8giNtSfm+u+y1Ak/RgE5Ezngn4XFq 2VT49TfXEjtaYhYzesr56v2ANRJ1KD0HzXrKsui0MVjOdrZh8N/wnPUsAXh4Hq9acR02 QNBitECRogVgBaE1oNgVLPPxew0zSBv1GeXN3DYn89+6/hIdQ19mEujgeirsMbiTapR6 nlcGozz76TI92QUQDjbO1xpa82A6xm3IdnGN3HuimhylPUjw90csbRyrCOkp0wZglCcE rk6NNiD779L1f3z8qwHVoToCmhi2OUzE4o0OUjoSEQ36nXZiuyCNnyIUqCHLRIaVQmcT oM1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=j0ZNpjxF; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id de4si4526973edb.200.2021.02.01.09.34.16; Mon, 01 Feb 2021 09:34:16 -0800 (PST) Received-SPF: pass (google.com: domain of netdev-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=@linaro.org header.s=google header.b=j0ZNpjxF; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231907AbhBARd6 (ORCPT + 7 others); Mon, 1 Feb 2021 12:33:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39440 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231872AbhBARaV (ORCPT ); Mon, 1 Feb 2021 12:30:21 -0500 Received: from mail-il1-x12a.google.com (mail-il1-x12a.google.com [IPv6:2607:f8b0:4864:20::12a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BFC10C061793 for ; Mon, 1 Feb 2021 09:29:01 -0800 (PST) Received: by mail-il1-x12a.google.com with SMTP id d6so16367633ilo.6 for ; Mon, 01 Feb 2021 09:29:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=AD7sJiqeRNIVKYtmxnmsyabUetsvJJmTXIczDFUxnes=; b=j0ZNpjxFBP2YppUXpqlylkEtM0G6AwPuOwVc962pTU0wtZ0pfH+rl/2UiD5RinVsk2 9BKOVNgo3UoAEy2lKvayX3xIsUDH5n2AFvTXoEUd8RhvHK1w2K8mNp0CN1kUFx70feSP 9BTvoZpyU95S99+jEEuOarwPkJGC78QnCaoDFtIXMiRKfdylC9e39ICQBh/yNusj3beq FtnNFtqMnyiquX7EKXfXBDX0rHiwEBynmzuXGTDCeeVC02XCHbsoJGZQujh2wvL9sfOq 3mwRhjrGJCN2uSJ3fvA1peL0QkScFRrBBS8sVEsADr9C2LNkR7TpGpkAK4nA66/dM2xT 89Ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=AD7sJiqeRNIVKYtmxnmsyabUetsvJJmTXIczDFUxnes=; b=OteNUV1J9VHW2wDcKnD21Fbxcb20Kp9EBlM1SCvF/ozJM38ndnOD3I5uxEOkqPvr9I P1k+ltgREPgtwh+v8LDyPTNg9kviQwsPOHxYiATntgt4VIHHmTHZn99TNRvnm4ToBJop bkvltc62I2uWWRRzCNVds4PZwY+d6gdpVwKh5By97xZDw+1z+TmohORx8AELwv72m2+H xxZpwnCCONp8RsLhNwO30PwI3usasm5Ly9iSf3IyXHX9TMqBq1Yc6WBXnh76QlpGf3tH kgWyKVq3zkoTrAGYqt7oEplzqS3zuTSZP35t7PPREdHPxJBpfEauJHv2x2qja2t1Ge84 R/hw== X-Gm-Message-State: AOAM5327GJWDkOzNL+Qz9BNZW+aSSeIRn85Khg13yegW40ygNLfU2mwN nUysdJubOk6/5IKMphD//EM0OHXxRkrksw== X-Received: by 2002:a05:6e02:1b84:: with SMTP id h4mr5304965ili.196.1612200541274; Mon, 01 Feb 2021 09:29:01 -0800 (PST) Received: from presto.localdomain (c-73-185-129-58.hsd1.mn.comcast.net. [73.185.129.58]) by smtp.gmail.com with ESMTPSA id v2sm9529856ilj.19.2021.02.01.09.28.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Feb 2021 09:29:00 -0800 (PST) From: Alex Elder To: davem@davemloft.net, kuba@kernel.org Cc: willemdebruijn.kernel@gmail.com, elder@kernel.org, evgreen@chromium.org, bjorn.andersson@linaro.org, cpratapa@codeaurora.org, subashab@codeaurora.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next v2 5/7] net: ipa: disable interrupt and NAPI after channel stop Date: Mon, 1 Feb 2021 11:28:48 -0600 Message-Id: <20210201172850.2221624-6-elder@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210201172850.2221624-1-elder@linaro.org> References: <20210201172850.2221624-1-elder@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Disable both the I/O completion interrupt and NAPI polling on a channel *after* we successfully stop it rather than before. This ensures a completion occurring just before the channel is stopped gets processed. Enable NAPI polling and the interrupt *before* starting a channel rather than after, to be symmetric. A stopped channel won't generate any completion interrupts anyway. Enable NAPI before the interrupt and disable it afterward. Signed-off-by: Alex Elder --- v2: Update code for *both* NAPI and the completion interrupt. drivers/net/ipa/gsi.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) -- 2.27.0 diff --git a/drivers/net/ipa/gsi.c b/drivers/net/ipa/gsi.c index 565c785e33a25..93e1d29b28385 100644 --- a/drivers/net/ipa/gsi.c +++ b/drivers/net/ipa/gsi.c @@ -860,15 +860,18 @@ static int __gsi_channel_start(struct gsi_channel *channel, bool start) struct gsi *gsi = channel->gsi; int ret; + napi_enable(&channel->napi); + gsi_irq_ieob_enable_one(gsi, channel->evt_ring_id); + mutex_lock(&gsi->mutex); ret = start ? gsi_channel_start_command(channel) : 0; mutex_unlock(&gsi->mutex); - if (!ret) { - gsi_irq_ieob_enable_one(gsi, channel->evt_ring_id); - napi_enable(&channel->napi); + if (ret) { + gsi_irq_ieob_disable_one(gsi, channel->evt_ring_id); + napi_disable(&channel->napi); } return ret; @@ -908,14 +911,11 @@ static int __gsi_channel_stop(struct gsi_channel *channel, bool stop) int ret; gsi_channel_trans_quiesce(channel); - napi_disable(&channel->napi); - gsi_irq_ieob_disable_one(gsi, channel->evt_ring_id); ret = stop ? gsi_channel_stop_retry(channel) : 0; - - if (ret) { - gsi_irq_ieob_enable_one(gsi, channel->evt_ring_id); - napi_enable(&channel->napi); + if (!ret) { + gsi_irq_ieob_disable_one(gsi, channel->evt_ring_id); + napi_disable(&channel->napi); } return ret;