From patchwork Mon Feb 1 17:28:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 374284 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp1498354jah; Mon, 1 Feb 2021 09:34:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJzC1gC057cPJhYY/nTdvIva5YBu7vW8yaFpRiymyhDApqR+fzSV/QZZKD6fiPijMVhbldre X-Received: by 2002:a17:906:b7c4:: with SMTP id fy4mr4043679ejb.84.1612200856067; 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=bLJCjvQhhZNaDlmEdP8KNYTW7BNHw2NJv+0fot13PtBi2MzYc+at09annto+y7Ro7s vgedY1uaE2hE8ADwzmU4T/U6+og+jya+D5+HedDGUZ51s08xcy3MUtXWh31tZDIfWj4j t2tpqV4bwZ9wJewIKz1wKRPc0j12wfyZ/vcnLuE6/4RBivDvrEMa8FjlNS2smCSqSFuv bnOZlpztx73guRN+kWMy08oI3ht66HgFpkQsnm7tYlH++S/RYLJWK8VKuIO6zqg0aSlV pw9LuntgF5ZYslGNHoZxPyCD8y45wBinhC8wNHSMV3UkQFJwawKXL6j46sh+t3CMExHz Uq5g== 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=DlCW8F0szf7ZcEm2ZEhTbHkqGMJz2nWWOYmbZKt8Dqw=; b=L+hKOMogYoSAEzQS9I7hCg0ngLNbc+2JyWXdWXG68gP1Cj7HxRjG4PVVhpBB8T5Bfm gVLd+P+JSaY4yY+iQK6+MONf5NGXJATdo7//lGG9wgDnv6IGqWlCX7ZQHwooQhr1xsAj 2X7TkhgKCZ+Cv3ncUNrqmF3ScH72XnrkI8Qn4OmPoQESl520gL3HDA8OX3HDLzwzGITR le+C4oJ9n0X8xLa+0FokvWbZJTF7OYNNYWyayDKsJ8xjA21IqVnDwwSxlW1t7QkoiDmG N52IDOkLduJJkPeejkW9knHRFM2NQgjhlXKhTf31Yxlc85IHA9e3e6cBR3yJx79jjZ+Y ZMIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ghtetcHI; 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.15; 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=ghtetcHI; 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 S231664AbhBARds (ORCPT + 7 others); Mon, 1 Feb 2021 12:33:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39438 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231873AbhBARaV (ORCPT ); Mon, 1 Feb 2021 12:30:21 -0500 Received: from mail-il1-x135.google.com (mail-il1-x135.google.com [IPv6:2607:f8b0:4864:20::135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43555C06178C for ; Mon, 1 Feb 2021 09:29:00 -0800 (PST) Received: by mail-il1-x135.google.com with SMTP id p8so16372472ilg.3 for ; Mon, 01 Feb 2021 09:29:00 -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=DlCW8F0szf7ZcEm2ZEhTbHkqGMJz2nWWOYmbZKt8Dqw=; b=ghtetcHIUsxWLmMhZWewAvClfll7oHvu1j/xc8IPS0HcJyNq5OlSTlf67LdNXRauda rNnjFHJcIuCDYtdPZ/gCFKOQHko+47Fkmr6cxdHdlBRzwbIkywsrOR8jFFstxS0EmcQC Q99eaHWvJpIS0ymTMSIolQow6bbw838FLl9poUvhcN6Ot/EKcb0IjT9KenChGx7/T5TJ +RvGoXRc1NDH+xqfvAI6PEgwyG6L3W0uUyOoRSaeI+Ux8VhVqNz55KmzZUh9TEzZo1Hp GAN+UNGYDvWyR5VtEjG7I1CsqpSJpQmXpPvhIC5YfpQUw9+LTbbwrDDwNXf2WwU5WVj9 3IJg== 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=DlCW8F0szf7ZcEm2ZEhTbHkqGMJz2nWWOYmbZKt8Dqw=; b=VPVbx02e5M6Mj01z40hFUMQyM2EDx59WGk5nXA3gAC4qaut4ZKrul+bVsNQjD4Hn46 W+Rh4BdCdkxb2dsV+ti98GuagPk6QoeLaN3LgPUSI5dUtfvM0ozzYN5t9e7+jRr9pviG P9Mur272wdedutfm0TgRuFsjLOxsktmdGkCHxY6okD6sdtZ9oQs8VJGXDxOTtlPgfpIw rRriycSqsODyA6X7sJQISlZNW9wxbHl6cUG17LYO9ulI+RdPoce7BUmXx6YyS+OWtEGy aZKppbbWAou1PyPEmntIz8tOVJPnUMN0Hs2QoOiBQhEs7z1ATZhR+6n0BgiXhS9hiJtf snxQ== X-Gm-Message-State: AOAM530cy88C8SrDAqYCmWDraFGEz40T9jT+77XCb1EbLYUNOv8992LZ mXQnKy5Eeob6oTA5MIWzGJ3Zfw== X-Received: by 2002:a92:d0d:: with SMTP id 13mr13492710iln.36.1612200539712; Mon, 01 Feb 2021 09:28:59 -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.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Feb 2021 09:28:59 -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 4/7] net: ipa: kill gsi_channel_freeze() and gsi_channel_thaw() Date: Mon, 1 Feb 2021 11:28:47 -0600 Message-Id: <20210201172850.2221624-5-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 Open-code gsi_channel_freeze() and gsi_channel_thaw() in all callers and get rid of these two functions. This is part of reworking the sequence of things done during channel suspend/resume and start/stop. Signed-off-by: Alex Elder --- drivers/net/ipa/gsi.c | 37 ++++++++++++------------------------- 1 file changed, 12 insertions(+), 25 deletions(-) -- 2.27.0 diff --git a/drivers/net/ipa/gsi.c b/drivers/net/ipa/gsi.c index bba64887fe969..565c785e33a25 100644 --- a/drivers/net/ipa/gsi.c +++ b/drivers/net/ipa/gsi.c @@ -764,24 +764,6 @@ static void gsi_channel_trans_quiesce(struct gsi_channel *channel) } } -/* Stop channel activity. Transactions may not be allocated until thawed. */ -static void gsi_channel_freeze(struct gsi_channel *channel) -{ - gsi_channel_trans_quiesce(channel); - - napi_disable(&channel->napi); - - gsi_irq_ieob_disable_one(channel->gsi, channel->evt_ring_id); -} - -/* Allow transactions to be used on the channel again. */ -static void gsi_channel_thaw(struct gsi_channel *channel) -{ - gsi_irq_ieob_enable_one(channel->gsi, channel->evt_ring_id); - - napi_enable(&channel->napi); -} - /* Program a channel for use */ static void gsi_channel_program(struct gsi_channel *channel, bool doorbell) { @@ -884,9 +866,10 @@ static int __gsi_channel_start(struct gsi_channel *channel, bool start) mutex_unlock(&gsi->mutex); - /* Thaw the channel if successful */ - if (!ret) - gsi_channel_thaw(channel); + if (!ret) { + gsi_irq_ieob_enable_one(gsi, channel->evt_ring_id); + napi_enable(&channel->napi); + } return ret; } @@ -921,15 +904,19 @@ static int gsi_channel_stop_retry(struct gsi_channel *channel) static int __gsi_channel_stop(struct gsi_channel *channel, bool stop) { + struct gsi *gsi = channel->gsi; int ret; - gsi_channel_freeze(channel); + 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; - /* Re-thaw the channel if an error occurred while stopping */ - if (ret) - gsi_channel_thaw(channel); + if (ret) { + gsi_irq_ieob_enable_one(gsi, channel->evt_ring_id); + napi_enable(&channel->napi); + } return ret; }