From patchwork Wed Jan 20 22:03:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 367110 Delivered-To: patch@linaro.org Received: by 2002:a02:a60d:0:0:0:0:0 with SMTP id c13csp6789jam; Wed, 20 Jan 2021 14:31:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJz4Mquk/OUCYpp6QHQMCL37FnVZzjL/zR7sQstrBmMI3dX/u7eyAmpmlfz/tmtDBWJv+3OY X-Received: by 2002:aa7:c3d9:: with SMTP id l25mr9342323edr.188.1611181860652; Wed, 20 Jan 2021 14:31:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611181860; cv=none; d=google.com; s=arc-20160816; b=qctb4fC5qWxBvZjOb/M1+SlCWv7QAjm7+qIcUvc+37YF37AeRf7xVLs0Xqzh++7KIK 1QAIy/Tz/UhETakeWmxQE3ZXVENAx5fe6hB67Xj+MFSIxifdwoFQIflNTotdxUx80WIM JTazPImCkUKHTQsAoJ+uB8z47eQ9n21Grbl8WTA1JLM4Ko331LizgNRFcoSea08qhOYG dFobG49uCZB15eqOVclMF/idz7WlBU5WG8mgy5Mbwe11nYDqU7o3ZfezUcQ2tztUJlgg eUCf3HS7sGiLV2cAGlgVlN8iMNPzLO7j2q2sJGHLQ6b8i9nQojZEBdV5B+sX/FoWUZBm mjLw== 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=G8bjLZpoNIzOiv6PkD0iZ3h3ctPEFqZsMrd34LvNS2U=; b=jVjTPIttCLhHIMDSI9RZlmUQ76jPgiHism/4zfYpdDYTRo139Jewy3h5zqqsJ22hb2 UO29xl4JR1CURf1TEMwn79RAzKI1Ac/L3kmUksnutcb6kjgXenIrPHb+aS/FLadZjc9m nPwhapPOp4vxQ+HVsnbngphlnUtTtnmGEsyE6tWTKkAkBMVeGijl/hJAZbn3M5rHKg7e lSyRtUIk85HFdD9NUyluD55ocmoeMbaHDGF2cfTZ9yx+4jcdcZTaBE7i9zwEBvZuuTEq 0iZ84+VHkQ1Pm8DeL4trgSa2eAvHOE9qVFUW6VgkpXPwKhOXvU99nowEHERovPKyEzrV zX1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UvCG+u3b; 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 cs9si1063897ejc.113.2021.01.20.14.31.00; Wed, 20 Jan 2021 14:31:00 -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=UvCG+u3b; 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 S2391366AbhATWUC (ORCPT + 7 others); Wed, 20 Jan 2021 17:20:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732380AbhATWEr (ORCPT ); Wed, 20 Jan 2021 17:04:47 -0500 Received: from mail-io1-xd29.google.com (mail-io1-xd29.google.com [IPv6:2607:f8b0:4864:20::d29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 493EAC0613C1 for ; Wed, 20 Jan 2021 14:04:06 -0800 (PST) Received: by mail-io1-xd29.google.com with SMTP id q2so48408555iow.13 for ; Wed, 20 Jan 2021 14:04:06 -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=G8bjLZpoNIzOiv6PkD0iZ3h3ctPEFqZsMrd34LvNS2U=; b=UvCG+u3bGXVwyyD6UipJdy59reXyhCEho2eMjnMo5G8z6oh4dgT2/G1U944jKepyab z8zdrAJF1cSdiHNvJZIDAqxrVa+aRomeBSidiQBmTfeh6ctFMyhWhGFl+IYk+JBvnKsi AM1gvKgz+XlHhczG3CoFQn3b1Nr5no2eWuCUkuGVqoCZNegWtLCBu7Cwo1QGWqZ/oAIN UvZ8WxUU6+6SR0fs/351LMBz3woLCx2zytckX4jSdvbzAwXR6SIJRmDTExdHF1sAp4c6 M2hGO9yFXevkrI8NajRnBcTrak2KiyV3GiXQq7qbaTDaUAOaDfJ6PHlxMwL8/LbCkUxD noww== 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=G8bjLZpoNIzOiv6PkD0iZ3h3ctPEFqZsMrd34LvNS2U=; b=V+BX/pnUKCVnciJpRD8Zoy8FyXkT0x/GbEBjhZHZ0E/FXzi6+AS7cECpZM/WJWVaob PErZEqGyHNUhN+sEqzNN8b1V2SrNAfYFIZ5csCoQqYTIJq7EYh+vpKuxAV3GcByUDkFs qmSjhITlbUYC40YzAxwQ+riHAjl4b/QzKt3f3X5lRq8RmsXwKpM0VLjEUrzCCb00L0Dm Wy4Ibb4eORUju2S/F9MQFRC6dYVKi/8z+yCvFnX1dDtrBSZjn1QI1RYrH09Ordzfg9IQ JPhU1NDVEa00PQLDfxrxuApt2hc6PkCaQftgJSF3gJi3pyYpFXbwOLG2JjNkBhaqEkzD pmDQ== X-Gm-Message-State: AOAM531v0NJo57TUzT6UusjYEc+tJpDkA4JcGNH5uFX0rPkOb1SRLzMm s++aLlIOVg37tkidgMuCvkFDmA== X-Received: by 2002:a05:6638:204b:: with SMTP id t11mr9300584jaj.87.1611180245665; Wed, 20 Jan 2021 14:04:05 -0800 (PST) Received: from beast.localdomain (c-73-185-129-58.hsd1.mn.comcast.net. [73.185.129.58]) by smtp.gmail.com with ESMTPSA id e5sm1651712ilu.27.2021.01.20.14.04.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Jan 2021 14:04:05 -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 1/5] net: ipa: count actual work done in gsi_channel_poll() Date: Wed, 20 Jan 2021 16:03:57 -0600 Message-Id: <20210120220401.10713-2-elder@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210120220401.10713-1-elder@linaro.org> References: <20210120220401.10713-1-elder@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org There is an off-by-one problem in gsi_channel_poll(). The count of transactions completed is incremented each time through the loop *before* determining whether there is any more work to do. As a result, if we exit the loop early the counter its value is one more than the number of transactions actually processed. Instead, increment the count after processing, to ensure it reflects the number of processed transactions. The result is more naturally described as a for loop rather than a while loop, so change that. Signed-off-by: Alex Elder --- drivers/net/ipa/gsi.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) -- 2.20.1 diff --git a/drivers/net/ipa/gsi.c b/drivers/net/ipa/gsi.c index 5b29f7d9d6ac1..56a5eb61b20c4 100644 --- a/drivers/net/ipa/gsi.c +++ b/drivers/net/ipa/gsi.c @@ -1543,13 +1543,12 @@ static struct gsi_trans *gsi_channel_poll_one(struct gsi_channel *channel) static int gsi_channel_poll(struct napi_struct *napi, int budget) { struct gsi_channel *channel; - int count = 0; + int count; channel = container_of(napi, struct gsi_channel, napi); - while (count < budget) { + for (count = 0; count < budget; count++) { struct gsi_trans *trans; - count++; trans = gsi_channel_poll_one(channel); if (!trans) break; From patchwork Wed Jan 20 22:03:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 367108 Delivered-To: patch@linaro.org Received: by 2002:a02:a60d:0:0:0:0:0 with SMTP id c13csp4172jam; Wed, 20 Jan 2021 14:25:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJwSWJu3Xu/+FEPSuSvAXoC5W2EDBHBT4wTHIP3o1pvc7mkeDKmF/MYJzlJMkzy7X6Us5tYi X-Received: by 2002:a17:906:b0d2:: with SMTP id bk18mr6931444ejb.508.1611181553137; Wed, 20 Jan 2021 14:25:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611181553; cv=none; d=google.com; s=arc-20160816; b=DVTBnFKUHp66FHrMKe2hsQY9HjA7rImU5oToTeatCpMiicxvycd8AORtldJa56mJQp vL8PZsBxv01IULbfcbRzKRAdmkLVPkHZb17/nvLPp2ogyYeSkEzWNPk4XypTy8avZzaJ UBEXnqTfy8hoIojonBM6sJEKc8WE2uqc6JjFqeC6JL/cNh4Vpo2UbNseWbY9geG5pgdv CCr5QgFF6qEPGzmGyYZ9wqgsCsi97yzno5vJM/w084t9qoENQkadxK+w7hPMentpojUY /pqPKPM3DwfWlpP9KRXPhblUl3FRIfayewx1w+0LvhKjenVc9ci7U5sBEEtzNbHb0Bwy 0eng== 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=m6e39kAfCJQxvEQdmc/oDMA8MTPHe7FkK1dKGoyuSSk=; b=xBQ12YlCSYQEY4zJFvOu2r499xtC+QYS8i4ye4V48cHeoRYxAnuzI6EIeHYlaH2eWk c5RwoPm1q76akbw3kc6bQSXpO8LdouhhH4iy3fLsqVJdguptSo7i4+ygL945lRTdCx2R dK8XlM0rtgukA84bV9Y4+3dGb0AaI1FqJVEfWw2r3ulUcYIH2GaiV+HAfNzYpHQROZJL +MbDTuaoYAU6fJJykcKvTx8yyV7uHN3W5gUNrBrxPSPNLpeTj5YEIKItbhW9Jiaw1HcD f1ZHVi+6Nr8Q0WKUoK7Ro+1RBDhyZjIeoR11pzvHXQ2g4rGHfU0AWsD9U1da3FC8O4+u Pk7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RuFJt40B; 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 cs9si1063897ejc.113.2021.01.20.14.25.52; Wed, 20 Jan 2021 14:25:53 -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=RuFJt40B; 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 S1731040AbhATWWe (ORCPT + 7 others); Wed, 20 Jan 2021 17:22:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38360 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732539AbhATWFw (ORCPT ); Wed, 20 Jan 2021 17:05:52 -0500 Received: from mail-io1-xd2e.google.com (mail-io1-xd2e.google.com [IPv6:2607:f8b0:4864:20::d2e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6AEDDC0613D6 for ; Wed, 20 Jan 2021 14:04:07 -0800 (PST) Received: by mail-io1-xd2e.google.com with SMTP id q2so48408784iow.13 for ; Wed, 20 Jan 2021 14:04:07 -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=m6e39kAfCJQxvEQdmc/oDMA8MTPHe7FkK1dKGoyuSSk=; b=RuFJt40Bsvi4BGgD5V5q75wwLL3L8641PLjoyA1Fp6sg7tYB3PzTkSBsMhAztSa998 meXPzBJ/77nnux+LN6kNpyY/PUhxQpwXC2PvL3w0aVOd50/2X7ro2rc5Bsj3zpa2Azv0 tzGxaNBNyoIXu3NkVs7sPrQy1NdkEAdiES17xTELjUT8j8sAin9rvtyEkAGpu5fjpyYr r5ZKEOYQF8w2E8ra2eKRFeD81MS1mcIgKMXR2enn2zWIFDDFIpxlytbVr4wvfIkUfSMV 1OHyCzINb8bpxn17IhFLOQNuMzA3ZWjGKoo2J1TSEzeUGZslrfA/O+/3IYjXhqWlWNum h1QA== 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=m6e39kAfCJQxvEQdmc/oDMA8MTPHe7FkK1dKGoyuSSk=; b=m+3Sr6mzDGVZmiSSlLjJWzv+wvSq6yZIo9XHsR5UgYlLEGVK5acduzhS11Me4oiUVO 47Edr5GpEBbDqmeqjVyKyC6tH9KkMSoueWAUyZlTdVb4/pBR2zB7h7tpgthZHcUciJSl Sen1+DLNKSv8KNTYanS3uVPTuJKXcTzKLRZDfDvdUBVGSl3ykn2PD9m6uli5yXSpF4jI n+NWYIpHlR6ENRrxwLf6vbQa2tzBQSH4xvi/HQtPS+C8pOoIdf6M1S+kCjDxi0cEqEez uLy8c2SptrP/0uHxbRP1CKpl6LGcGAfNQWNx1SQ+BZMJl4bLe/+z3n+XCyutXNDhFpq8 0Y/w== X-Gm-Message-State: AOAM532L/jSUMCjgGl/Olb7ZY1njsNtfKEoXvkCrWu3pJjrjaYvBg8Is sefZP6K0ZU5b8VBWc//aRzNFHg== X-Received: by 2002:a05:6e02:1110:: with SMTP id u16mr9987227ilk.73.1611180246798; Wed, 20 Jan 2021 14:04:06 -0800 (PST) Received: from beast.localdomain (c-73-185-129-58.hsd1.mn.comcast.net. [73.185.129.58]) by smtp.gmail.com with ESMTPSA id e5sm1651712ilu.27.2021.01.20.14.04.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Jan 2021 14:04:06 -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 2/5] net: ipa: heed napi_complete() return value Date: Wed, 20 Jan 2021 16:03:58 -0600 Message-Id: <20210120220401.10713-3-elder@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210120220401.10713-1-elder@linaro.org> References: <20210120220401.10713-1-elder@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Pay attention to the return value of napi_complete(), completing polling only if it returns true. Just use napi rather than &channel->napi as the argument passed to napi_complete(). Signed-off-by: Alex Elder --- drivers/net/ipa/gsi.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) -- 2.20.1 diff --git a/drivers/net/ipa/gsi.c b/drivers/net/ipa/gsi.c index 56a5eb61b20c4..634f514e861e7 100644 --- a/drivers/net/ipa/gsi.c +++ b/drivers/net/ipa/gsi.c @@ -1555,10 +1555,8 @@ static int gsi_channel_poll(struct napi_struct *napi, int budget) gsi_trans_complete(trans); } - if (count < budget) { - napi_complete(&channel->napi); + if (count < budget && napi_complete(napi)) gsi_irq_ieob_enable(channel->gsi, channel->evt_ring_id); - } return count; } From patchwork Wed Jan 20 22:03:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 367109 Delivered-To: patch@linaro.org Received: by 2002:a02:a60d:0:0:0:0:0 with SMTP id c13csp5832jam; Wed, 20 Jan 2021 14:29:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJwNhyAKeQlpl+R84XJqofMXNBUnWEK1IZS1ZRojLxNiXdevnp8ymswof0uRnCLAjytn+5nx X-Received: by 2002:a17:907:c23:: with SMTP id ga35mr7286342ejc.72.1611181754907; Wed, 20 Jan 2021 14:29:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611181754; cv=none; d=google.com; s=arc-20160816; b=xhFBMwpJyNo8p94KGOH+A6d5tkTuKpNi486l7dEw+dT7tM1aL8Rad9xltf60FZJW0A 1PH22we/tRXQrEjiYfMv7fQcN7zUV5N34y1gyMN03XnUOHtMaHzw3L2FfTxOcPHRFBVV 97dXXfR/wGqorvf0H3ts9pgJFTTtCv0HcUsd8FGt23ciARErM/6+z4zYL96dY8wGmi5e eXk4R0r1lvWd58s3SWuxCv7ahxeuuI8OFVXdr6D8f/YEuWyaUMWtnkLeDH36nFZpjsYp 9gfa8mfEGg5Kj66VOEBDWv8AD5E9K56UJgImeSvzuhNUrIqf7jwJV5UfOkv7I+CdGPZg WR6A== 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=WBNzWrwjXuW0OAZcNNJPMhiWPrYSOE7uMer+o1tBWxs=; b=0m9+4Z2ODLqMKk0ErAMvrEzmYtQIvk/GUHEH7m4rZQT0J1CZh1euzahuOSDVT46HVa TBwl2lQ7cSev2b6wkGC1YE6mgs2zSEKsyVrF5MkAwDoxcB0GiHICD7ouSLLzvm5k9PCZ qZhxozc9MB/a0Ofj+x+AZ5GPhVekZK4FVW5LCHjjHyJpPtVwO58XooqdHrfDPXfZFtkQ qjcr/dOZIkPSB4eCvv+V+NCTvIRFYgKoan49I2r8Z44VYt04rY/uVkweI9+8Qlaz7/kO wZt0D+9kH06Qu7HhIZjEXCRhVlf/9oJlxi0AuXXtitUH2GdjRbutfF4E7s0kLTTa1FgV x1aQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EopezSHS; 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 cs9si1063897ejc.113.2021.01.20.14.29.14; Wed, 20 Jan 2021 14:29:14 -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=EopezSHS; 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 S1731558AbhATWXW (ORCPT + 7 others); Wed, 20 Jan 2021 17:23:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38366 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732554AbhATWFx (ORCPT ); Wed, 20 Jan 2021 17:05:53 -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 A86EDC061786 for ; Wed, 20 Jan 2021 14:04:08 -0800 (PST) Received: by mail-io1-xd31.google.com with SMTP id q2so48408957iow.13 for ; Wed, 20 Jan 2021 14:04:08 -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=WBNzWrwjXuW0OAZcNNJPMhiWPrYSOE7uMer+o1tBWxs=; b=EopezSHSVJS84vNTnBHTbyonlclmvUvfJvafozzWmFDq8oERl7Rd97ZWIBpgxCUVaH FshlYUyQijgsnIG0dw7TV5JiBXErk4Nd4nhJzHix2Y7y+R+jawVu0DfUwZbNo1fBELzh I3ODwK7clViV6d2nW8Zgk5oLWMKOL02X6RPsWVipC1SLcsuWCrIPi6pZIsMU0x+4V6bs 5FgAFo8qdCdu5Wv1zM1H7ac9qNXz7aysQs0gfzZjBMXx2L9XE22BAGDCyCZ4bsX6kkDc N+MGkp9MajWZ3iH2jt7ui2xPHBOHq2W+GHgAdoPmSenGO9RJLEcBTUtDPd3wvtzENQKs K7Gw== 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=WBNzWrwjXuW0OAZcNNJPMhiWPrYSOE7uMer+o1tBWxs=; b=rgg0NTxln0Cqx0RHIaSCnVdf6DRFar6pmTzreRIFGY9mub+4lgg7n26SCeP9BRXnjO 3bAEIjvLX80hvAZfm8rlGHPuJ/JVF1IBEowk5B9+txMa9/bMAWxv1bwlRRvQDzUQpjUf dH4bXucnx4LUsazcO981Zl8od0nvOGk+XK/j6fur2j0pG9Q1xXc2VRoePtvj0a1p5h2J IRQnFTrWM+/s9RoJ50iK/px9QPEimJ3LGXMqlQWVn0nuOinLcgWc2sFIv3XT9YyoQj6c LepSO4WX6XUOC5sVDrRNA9zjKPZmZV3b6nI4Mo64D6di4jWbmwWWC0tdHWGiLKKKPdCI nFxA== X-Gm-Message-State: AOAM531Rhj+LBPZNUWHM4a9ZRGwc666gbdzRM7suE8zF5pCI53B8g8iM lo0gURbN/SpJv5bkD4q9hGo/aQ== X-Received: by 2002:a02:52c8:: with SMTP id d191mr9443168jab.59.1611180248061; Wed, 20 Jan 2021 14:04:08 -0800 (PST) Received: from beast.localdomain (c-73-185-129-58.hsd1.mn.comcast.net. [73.185.129.58]) by smtp.gmail.com with ESMTPSA id e5sm1651712ilu.27.2021.01.20.14.04.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Jan 2021 14:04:07 -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 3/5] net: ipa: have gsi_channel_update() return a value Date: Wed, 20 Jan 2021 16:03:59 -0600 Message-Id: <20210120220401.10713-4-elder@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210120220401.10713-1-elder@linaro.org> References: <20210120220401.10713-1-elder@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Have gsi_channel_update() return the first transaction in the updated completed transaction list, or NULL if no new transactions have been added. Signed-off-by: Alex Elder --- drivers/net/ipa/gsi.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) -- 2.20.1 diff --git a/drivers/net/ipa/gsi.c b/drivers/net/ipa/gsi.c index 634f514e861e7..5b98003263710 100644 --- a/drivers/net/ipa/gsi.c +++ b/drivers/net/ipa/gsi.c @@ -1452,7 +1452,7 @@ void gsi_channel_doorbell(struct gsi_channel *channel) } /* Consult hardware, move any newly completed transactions to completed list */ -static void gsi_channel_update(struct gsi_channel *channel) +struct gsi_trans *gsi_channel_update(struct gsi_channel *channel) { u32 evt_ring_id = channel->evt_ring_id; struct gsi *gsi = channel->gsi; @@ -1471,7 +1471,7 @@ static void gsi_channel_update(struct gsi_channel *channel) offset = GSI_EV_CH_E_CNTXT_4_OFFSET(evt_ring_id); index = gsi_ring_index(ring, ioread32(gsi->virt + offset)); if (index == ring->index % ring->count) - return; + return NULL; /* Get the transaction for the latest completed event. Take a * reference to keep it from completing before we give the events @@ -1496,6 +1496,8 @@ static void gsi_channel_update(struct gsi_channel *channel) gsi_evt_ring_doorbell(channel->gsi, channel->evt_ring_id, index); gsi_trans_free(trans); + + return gsi_channel_trans_complete(channel); } /** @@ -1516,11 +1518,8 @@ static struct gsi_trans *gsi_channel_poll_one(struct gsi_channel *channel) /* Get the first transaction from the completed list */ trans = gsi_channel_trans_complete(channel); - if (!trans) { - /* List is empty; see if there's more to do */ - gsi_channel_update(channel); - trans = gsi_channel_trans_complete(channel); - } + if (!trans) /* List is empty; see if there's more to do */ + trans = gsi_channel_update(channel); if (trans) gsi_trans_move_polled(trans); From patchwork Wed Jan 20 22:04:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 367111 Delivered-To: patch@linaro.org Received: by 2002:a02:a60d:0:0:0:0:0 with SMTP id c13csp6785jam; Wed, 20 Jan 2021 14:31:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJw/hDoiowSiY3eHVJtcbwttNO+wU3WAkeouzmH1LIWX+VPPDysMy5AHagRgAlqAqy2DdKwD X-Received: by 2002:a17:906:a042:: with SMTP id bg2mr7216090ejb.540.1611181860225; Wed, 20 Jan 2021 14:31:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611181860; cv=none; d=google.com; s=arc-20160816; b=U4VSZQIks9aL7IrhQAjR1SEVY6BMt+GoizCv9E5r12T+5ywODAtH2/oFBFxgAkiIxm f1E7F7qUbORBoZIj46u7IPTKW1+mFCK0GBvo/78qz+icfyleCwt9ODSIRxRglp7Zur5L kXsOSNQlGPAhvPCC4al57oxEOwRHafFe+zNn3+lCigMbcA3IdxZG7WJkLRScywBDjzAB pgcS48BTPPyEj9P4/wmM3Gx8I8VYQ+/9nBTKcj00d3rDobVu4A6w59QoxvQuTa6rfJNw Zr203TosGFphRgBVKRJ0LGCxX/r8Wybhng2rTPZZZrWrSDPFvX2SL7W8A4txTP7mGl3Y m7kg== 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=OTJ73KV2wfSd3Og0yq4LeI7FHZJzlHvLFa16f+6zrPU=; b=pzl0e+M8QETMkaSgF1aOW6+1H4+VxDeWvOhwEOed6wGTOwWaW1pKg4gO5wzqL8hPPq DNZz4ZPZTTYBiHBnYwOCjUTM1nBNoMck+ifnrnUp1f13r4NPplXmzVZIo02TYb3V2FC3 8XBEIbCD4QwWElLzBp51rNGgMdrrJgtWukDyRs5yipHbHMEpe53VWp0aGqaHEOt06037 Het5y3Rg4vNouHYeZk3kmfTBXLB6cZD2lHV0LXfabcHJmXSrsnil1Ts3EyC+INVFFk/4 1u8Il9fT8mG092biU2skaN8ezRsKEL8Eq2fR0M8QWbECqzPaRFvDbTJtgCJ9gSR8BvaD B0jw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qMmPeSXk; 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 cs9si1063897ejc.113.2021.01.20.14.31.00; Wed, 20 Jan 2021 14:31:00 -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=qMmPeSXk; 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 S1731757AbhATWUY (ORCPT + 7 others); Wed, 20 Jan 2021 17:20:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38364 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732540AbhATWFw (ORCPT ); Wed, 20 Jan 2021 17:05:52 -0500 Received: from mail-io1-xd2b.google.com (mail-io1-xd2b.google.com [IPv6:2607:f8b0:4864:20::d2b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CE8C2C061793 for ; Wed, 20 Jan 2021 14:04:09 -0800 (PST) Received: by mail-io1-xd2b.google.com with SMTP id x21so35860iog.10 for ; Wed, 20 Jan 2021 14:04:09 -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=OTJ73KV2wfSd3Og0yq4LeI7FHZJzlHvLFa16f+6zrPU=; b=qMmPeSXkukYNoqJkku67SA1G23I8JZCr4XuQKGicdZPP3Bpw03KreZYU7v+kEaYC1Q FOXTVdY80Er7i2a0NxrT2CC18D9zpSl/oCSlIZsyxtCFJ2ife/K864V4sYpvoRSafRno uY21kxj86WBbnum3bRih7g3pwQ2udxm3LApvt4ZzzL5GNnauK2BB3ZJN5cTdjaV9Ts1q Kwgfk8RIN+2ulgzBv7nHavFjq/EgRjbVi45JuUImaxNYGC7aEUtxiTm24r2RMGrLysZI hv6uKDCHDQTbgV2P50USutj0PdJY9j8nIp5dCptX9cEafdOgarzQCWgO8nqvCbZahZDO 27dw== 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=OTJ73KV2wfSd3Og0yq4LeI7FHZJzlHvLFa16f+6zrPU=; b=ehEX4ivsyKFDvOBoOC87vZ8GYxgL/skw4TiVorhA3NLaSEQJbQdyfSsrMSO8Q8VupO rArzxQ9Ivsx/GLM112VToLssaojGLas6XK+W0Fw0NBiYE1wlwlDaqExqBf3U59QGUQqh ZHMURI/DJ70y6jCExrRQODMxi1jm5yhsMoy9FuiU2Dj9Y36S9lu2eo00XUC/1zvTFdTk sUI8JKj+n33jg4KdywbVagAseOuhAJ+R31ZpsjMumQe22PgbSOmprW9TxR7qJH99GODa lZVKVYwO0Qy3pvkpMRfsBmOtDRb04zOkPPqYAJSrT31ib/z/fm99PUF8HMxyqZ4YZH39 0v0w== X-Gm-Message-State: AOAM5318woNShl0V6eg/fvclZjdC7WtAU4F+JYSvDq/NBFFRu33hXhEr pnoLHskC98EmCqnIancv4N4zeQ== X-Received: by 2002:a92:1e08:: with SMTP id e8mr9258420ile.16.1611180249244; Wed, 20 Jan 2021 14:04:09 -0800 (PST) Received: from beast.localdomain (c-73-185-129-58.hsd1.mn.comcast.net. [73.185.129.58]) by smtp.gmail.com with ESMTPSA id e5sm1651712ilu.27.2021.01.20.14.04.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Jan 2021 14:04:08 -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 4/5] net: ipa: repurpose gsi_irq_ieob_disable() Date: Wed, 20 Jan 2021 16:04:00 -0600 Message-Id: <20210120220401.10713-5-elder@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210120220401.10713-1-elder@linaro.org> References: <20210120220401.10713-1-elder@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Rename gsi_irq_ieob_disable() to be gsi_irq_ieob_disable_one(). Introduce a new function gsi_irq_ieob_disable() that takes a mask of events to disable rather than a single event id. This will be used in the next patch. Rename gsi_irq_ieob_enable() to be gsi_irq_ieob_enable_one() to be consistent. Signed-off-by: Alex Elder --- drivers/net/ipa/gsi.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) -- 2.20.1 diff --git a/drivers/net/ipa/gsi.c b/drivers/net/ipa/gsi.c index 5b98003263710..59fc22347a257 100644 --- a/drivers/net/ipa/gsi.c +++ b/drivers/net/ipa/gsi.c @@ -272,7 +272,7 @@ static void gsi_irq_ch_ctrl_disable(struct gsi *gsi) iowrite32(0, gsi->virt + GSI_CNTXT_SRC_CH_IRQ_MSK_OFFSET); } -static void gsi_irq_ieob_enable(struct gsi *gsi, u32 evt_ring_id) +static void gsi_irq_ieob_enable_one(struct gsi *gsi, u32 evt_ring_id) { bool enable_ieob = !gsi->ieob_enabled_bitmap; u32 val; @@ -286,11 +286,11 @@ static void gsi_irq_ieob_enable(struct gsi *gsi, u32 evt_ring_id) gsi_irq_type_enable(gsi, GSI_IEOB); } -static void gsi_irq_ieob_disable(struct gsi *gsi, u32 evt_ring_id) +static void gsi_irq_ieob_disable(struct gsi *gsi, u32 event_mask) { u32 val; - gsi->ieob_enabled_bitmap &= ~BIT(evt_ring_id); + gsi->ieob_enabled_bitmap &= ~event_mask; /* Disable the interrupt type if this was the last enabled channel */ if (!gsi->ieob_enabled_bitmap) @@ -300,6 +300,11 @@ static void gsi_irq_ieob_disable(struct gsi *gsi, u32 evt_ring_id) iowrite32(val, gsi->virt + GSI_CNTXT_SRC_IEOB_IRQ_MSK_OFFSET); } +static void gsi_irq_ieob_disable_one(struct gsi *gsi, u32 evt_ring_id) +{ + gsi_irq_ieob_disable(gsi, BIT(evt_ring_id)); +} + /* Enable all GSI_interrupt types */ static void gsi_irq_enable(struct gsi *gsi) { @@ -766,13 +771,13 @@ static void gsi_channel_freeze(struct gsi_channel *channel) napi_disable(&channel->napi); - gsi_irq_ieob_disable(channel->gsi, channel->evt_ring_id); + 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(channel->gsi, channel->evt_ring_id); + gsi_irq_ieob_enable_one(channel->gsi, channel->evt_ring_id); napi_enable(&channel->napi); } @@ -1207,7 +1212,7 @@ static void gsi_isr_ieob(struct gsi *gsi) event_mask ^= BIT(evt_ring_id); - gsi_irq_ieob_disable(gsi, evt_ring_id); + gsi_irq_ieob_disable_one(gsi, evt_ring_id); napi_schedule(&gsi->evt_ring[evt_ring_id].channel->napi); } } @@ -1555,7 +1560,7 @@ static int gsi_channel_poll(struct napi_struct *napi, int budget) } if (count < budget && napi_complete(napi)) - gsi_irq_ieob_enable(channel->gsi, channel->evt_ring_id); + gsi_irq_ieob_enable_one(channel->gsi, channel->evt_ring_id); return count; } From patchwork Wed Jan 20 22:04:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 367107 Delivered-To: patch@linaro.org Received: by 2002:a02:a60d:0:0:0:0:0 with SMTP id c13csp3464jam; Wed, 20 Jan 2021 14:24:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJyC3CYyBawFU7rOZB8sTVqiNj8L7YMUqXHPAcZxqMXFu61TDB4G21AdGmPbLuAFOYoFgkUY X-Received: by 2002:a17:906:c954:: with SMTP id fw20mr5196204ejb.342.1611181468424; Wed, 20 Jan 2021 14:24:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611181468; cv=none; d=google.com; s=arc-20160816; b=HE1f8ssHM0DhucX9hWPSYcoBxUDRBLE/06iKYeCvbq0Iq/haqIvUR8l0f/6KM+7i0H LOUUrdnf6jKMc0iFuFQyAKWVhPDZR8j87E9tttW/yxLpKSf3iLaekkwhECE1H4g1jbIj iRsriXFHS/YmjqRplghNlZjpGoO+1GKIK4VXLxnduj8yoNfY0PSrUznG5dR3QrF6QDQO Gr44CDhCQGb0qJ6tLLD4jnXK26maAAxdKOX33k0NoVhgPmAPI5JxeKardCJki7RX4I+7 z0b72C2zX6ZFbiVe+lfAD/wqyDEHluBa0UtnFTAhLOarn42dPnRV3O0a5m0Nq5tAm1pK aCdA== 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=GEkZShmIoWIOHRSj/dMYdcTQJIFBlR5LmZuBGxQqt0o=; b=Ud9s16xXIOSotvo2J6aldUNWUSmMdC+9PgU/6idfSAybOypZEf/FKDBjnRNbysLcGa GYgVahIdtsuD1tVaGdxPfIkFNH6ti3hhQHaaFlYzbtxXrOx4i4eoJjBGmFLTs8nV28j7 AkrsaLLtsnoqji/rYcDfQ9rgfV3zUT1/NKLwKeYfob5UucFku4pmmQSMr80SVwuDt3Zp Ys9lEE6XBWdlbQXGNlYwTW0AzERqO/403ph92PHbAwsqvvwro9g70DOQ6ocp2z/hkCtu Llfy6/92PTWso0HJEbqMLxVePCCnoogZ1OiWgFVL5exlig/zvjLfuUzZLLCXXVcfYSo+ Aa4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KGqxBRhW; 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 cs9si1063897ejc.113.2021.01.20.14.24.28; Wed, 20 Jan 2021 14:24:28 -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=KGqxBRhW; 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 S1729312AbhATWVl (ORCPT + 7 others); Wed, 20 Jan 2021 17:21:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38372 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732565AbhATWFw (ORCPT ); Wed, 20 Jan 2021 17:05:52 -0500 Received: from mail-io1-xd2f.google.com (mail-io1-xd2f.google.com [IPv6:2607:f8b0:4864:20::d2f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 08E5BC061796 for ; Wed, 20 Jan 2021 14:04:11 -0800 (PST) Received: by mail-io1-xd2f.google.com with SMTP id n2so70843iom.7 for ; Wed, 20 Jan 2021 14:04:11 -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=GEkZShmIoWIOHRSj/dMYdcTQJIFBlR5LmZuBGxQqt0o=; b=KGqxBRhWG0wQED0/oG28azKJHeU2ExraE2jLPSU6GHG05vMtlgk4Gmn2w8JmfNqATL gvmiDftAv2x5Si3uR/G9iHV7tXuEfPzG5EJEg8T9S5Iu4MJlUk0VfXCcmt4/V+bSMeGI NG3IAmA67S5jo3tKSp43Hf5+hsp4uyZ42jLQSR4x7wSECOXHqE78ZwOVUydn/BT/g0YS QJplMcQrQjW4Q1r1+A2r5D3KLeqZlpUriBZGJE3jAZbm0g3OQwR1HMg6ZTl32cjIpuwn 28sdghpNDr1JpHHybKBPBwgm2ka36SPFxXA5xA0dYfSpA5snWcaY0yOPIvV7XvX92p/7 6YtQ== 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=GEkZShmIoWIOHRSj/dMYdcTQJIFBlR5LmZuBGxQqt0o=; b=RRJudVeBjfKf+zBfA+uAENAQeGc0Z7bqL0Ngj79zXQyOYAMZ9ywPg7OaoKUupiF1b3 ocfwmejVR5lpT9vGeR9vxWn348zu+nllFcwelfPi9anFVIYqkgnnWYTkxInoqQ/dwilV 2EVcpCGX4t5+IKHfewoOc1+/V8YForAyVuOuA3gMeOF7+JKww2v1v2CLxOqLl7K/ULCw nNFnxsnRPiiswSmqq/wmS4xLsxLFyLmTEjWyhVoarjGixDoWvz9BCs5Ruf0EIM3FefCS qjDP9b7swSZFgXxRGNInYaR80mucRe8JDMPA2Nh9DlLaOoemk6X76cpYnvhzXNMeO4bz PEKg== X-Gm-Message-State: AOAM531bGc+acK9aGr9bZoYxfd2BqQfI9oPNBMF4+egtQDQOAXI81l9Z 4B/czRg873rlhTfI6xmriN9Vcg== X-Received: by 2002:a05:6638:164c:: with SMTP id a12mr9475468jat.128.1611180250424; Wed, 20 Jan 2021 14:04:10 -0800 (PST) Received: from beast.localdomain (c-73-185-129-58.hsd1.mn.comcast.net. [73.185.129.58]) by smtp.gmail.com with ESMTPSA id e5sm1651712ilu.27.2021.01.20.14.04.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Jan 2021 14:04:09 -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 5/5] net: ipa: disable IEOB interrupts before clearing Date: Wed, 20 Jan 2021 16:04:01 -0600 Message-Id: <20210120220401.10713-6-elder@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210120220401.10713-1-elder@linaro.org> References: <20210120220401.10713-1-elder@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Currently in gsi_isr_ieob(), event ring IEOB interrupts are disabled one at a time. The loop disables the IEOB interrupt for all event rings represented in the event mask. Instead, just disable them all at once. Disable them all *before* clearing the interrupt condition. This guarantees we'll schedule NAPI for each event once, before another IEOB interrupt could be signaled. Signed-off-by: Alex Elder --- drivers/net/ipa/gsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.20.1 diff --git a/drivers/net/ipa/gsi.c b/drivers/net/ipa/gsi.c index 59fc22347a257..8498326c43f40 100644 --- a/drivers/net/ipa/gsi.c +++ b/drivers/net/ipa/gsi.c @@ -1205,6 +1205,7 @@ static void gsi_isr_ieob(struct gsi *gsi) u32 event_mask; event_mask = ioread32(gsi->virt + GSI_CNTXT_SRC_IEOB_IRQ_OFFSET); + gsi_irq_ieob_disable(gsi, event_mask); iowrite32(event_mask, gsi->virt + GSI_CNTXT_SRC_IEOB_IRQ_CLR_OFFSET); while (event_mask) { @@ -1212,7 +1213,6 @@ static void gsi_isr_ieob(struct gsi *gsi) event_mask ^= BIT(evt_ring_id); - gsi_irq_ieob_disable_one(gsi, evt_ring_id); napi_schedule(&gsi->evt_ring[evt_ring_id].channel->napi); } }