From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 680E0C433E6 for ; Fri, 29 Jan 2021 20:21:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2A66C64DE7 for ; Fri, 29 Jan 2021 20:21:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233259AbhA2UV3 (ORCPT ); Fri, 29 Jan 2021 15:21:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59850 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232776AbhA2UVE (ORCPT ); Fri, 29 Jan 2021 15:21:04 -0500 Received: from mail-io1-xd31.google.com (mail-io1-xd31.google.com [IPv6:2607:f8b0:4864:20::d31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C37C8C061756 for ; Fri, 29 Jan 2021 12:20:23 -0800 (PST) Received: by mail-io1-xd31.google.com with SMTP id y19so10663452iov.2 for ; Fri, 29 Jan 2021 12:20:23 -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:mime-version :content-transfer-encoding; bh=nhvF9PGHPykZ//tfBqMwf6Wd6smJWeypfZ3nnpPqJhQ=; b=fY48G4XUV5nA1Y+/YfKCAmxGTbIzY1eBq12gOKgmMX/TRRTlJOCPTEJP7mxrHXjMcC 1g7mLeHtbLVN+YfBn2toqKqmuaU6gJ2jHMBhA+x98K7IZEQ24rdSywuQHXJMklO8jksr SCWzTKUOZXBSe2NRNakaEnaCoT8GHraA09/WsU1LZiiN3c2ThRGBWNxEdb2pWDDlkVHS o+Yeq8nY3KfR0/uNGHuWjPqrS2cZt+0LWTPPMKXDzlKS8AEI0LdI5TAes/dzccS+Jfgu /EppfHBb16FgcebKuQslOEZkzaJ4acp5sYygRhvkq9/MR5gxrDjbPfDYbre8aXH/1xYo HS3w== 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:mime-version :content-transfer-encoding; bh=nhvF9PGHPykZ//tfBqMwf6Wd6smJWeypfZ3nnpPqJhQ=; b=gefOm3ONenzGDPWHlPIShdzeft9pldr2CM1YHOdQ7/AMsMt5ZjQaqzUDn84si4m5/Y NqsjncNJd8WpetiIilILSt7nlH1FRLtkTqw1F5+zefiOkcu2AgiQdpf2wRJNXchsPtbV uRHTi71rpYsMklRW4IU2N3E+w9ULEMe/nSYC2xCL5v0OvlG1Z8QZaGRbaAZJE7YiRJYn lthpMEqyj6GpWP2eIhByTj9SzJNB4lFSbkG8yTR7J8p/FQXkJbAt550rsCSVvayYrsX6 wmZ6Zsyb0Wz/wRG8G+1UXTAJDLrSJT/fdGObm9v4WgWjD2qctKahz1SaL1zIV0uHoG0m l6JA== X-Gm-Message-State: AOAM530OFJv/WzkoS4nsYOwAmBhN+vXtobSwxaJJri3mBN6aGYmzueKA Hvjv0708zQf+sQsz/VZ6ukw/IQ== X-Google-Smtp-Source: ABdhPJzR5J6clkSLXEEUxoyqtq+nvIyEMtlFthb1yRWt35BJi+/1J56LUugLYWAVBRAg6ZniitoWsw== X-Received: by 2002:a02:3844:: with SMTP id v4mr5042759jae.1.1611951623187; Fri, 29 Jan 2021 12:20:23 -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 h23sm4645738ila.15.2021.01.29.12.20.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Jan 2021 12:20:22 -0800 (PST) From: Alex Elder To: davem@davemloft.net, kuba@kernel.org Cc: 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 0/9] net: ipa: don't disable NAPI in suspend Date: Fri, 29 Jan 2021 14:20:10 -0600 Message-Id: <20210129202019.2099259-1-elder@linaro.org> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org A few weeks ago I suggested a change that added a flag to determine whether NAPI should be re-enabled on a channel when we're done polling. That change was questioned, and upon further investigation I realized the IPA suspend path was "doing it wrong." Currently (for newer hardware) the IPA driver suspends channels by issuing a STOP command. Part of the stop processing includes a "freeze" operation, which quiesces activity, disables the I/O completion interrupt, and disables NAPI. But disabling NAPI is only meant to be done when shutting down the channel; there is no need to disable it when a channel is being stopped for suspend. This series reworks the way channels are stopped, with the end result being that neither NAPI nor the I/O completion interrupt is disabled when a channel is suspended. The first patch fixes an error handling bug in the channel starting path. The second patch creates a helper function to encpasulate retrying channel stop commands. The third also creates helper functions, but in doing so it makes channel stop and start handling be consistent for both "regular" stop and suspend. The fourth patch open-codes the freeze and thaw functions as a first step toward reworking what they do (reordering and eliminating steps). The fifth patch makes the I/O completion interrupt get disabled *after* a channel is stopped. This eliminates a small race in which the interrupt condition could occur between disabling the interrupt and stopping the channel. Once stopped, the channel will generate no more I/O completion interrupts. The sixth and seventh patches arrange for the completion interrupt to be disabled only stopping a channel "for good", not when suspending. (The sixth patch just makes a small step to facilitate review; these two could be squashed together.) The 8th patch ensures a TX request--if initiated just before stopping the TX queue--is included when determining whether a a channel is quiesced for stop or suspend. And finally the last patch implements the ultimate objective, disabling NAPI *only* when "really" stopping a channel (not for suspend). Instead of disabling NAPI, a call to napi_synchronize() ensures everything's done before we suspend. -Alex Alex Elder (9): net: ipa: don't thaw channel if error starting net: ipa: introduce gsi_channel_stop_retry() net: ipa: introduce __gsi_channel_start() net: ipa: kill gsi_channel_freeze() and gsi_channel_thaw() net: ipa: disable IEOB interrupt after channel stop net: ipa: move completion interrupt enable/disable net: ipa: don't disable IEOB interrupt during suspend net: ipa: expand last transaction check net: ipa: don't disable NAPI in suspend drivers/net/ipa/gsi.c | 137 ++++++++++++++++++++++++++---------------- 1 file changed, 85 insertions(+), 52 deletions(-) -- 2.27.0