From patchwork Thu Jan 21 11:48:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 367826 Delivered-To: patch@linaro.org Received: by 2002:a02:a60d:0:0:0:0:0 with SMTP id c13csp497295jam; Thu, 21 Jan 2021 03:56:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJyBHtjS77BqD+qtiR66D9cZcuNPGfbTtY15e7KchZgHpx28J8ZMfG/Pt8CNZ7pscg4oidyf X-Received: by 2002:a50:cdc8:: with SMTP id h8mr1681587edj.293.1611230175448; Thu, 21 Jan 2021 03:56:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611230175; cv=none; d=google.com; s=arc-20160816; b=ZrvuUZCKcafVcrZxftEjOWTIyajYxXnM0s9o6tQpc7iG/EgBUvinwbBQ8uJVM4wRi8 +iYCgj5gCAiPQSSPNDKx0gChRpxB2pPaiaqVglrQWYx7SZUf4VYyS+JxZhHdzOJsUZUt EcKltaw1IHSMmJoV2YMf1AOYTRg798MI1st66GIcLfanFha1VFh5PlQi/Ydbt2cP11v8 oL1frl5vrsXVXSDf7kCCOS8tjOFZv/W3wG3UWBMyXFXJM5UY7NOLWUy6NhRvYY/F+Zpk vwlHMyJswFCSIQUL7Uq4Y8RzPCdiZma2whQibep04QRH4gRpLEBYwlnpoIzES8HGgalE RyQQ== 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=z0T1INxt1+7UX+TxEoGvbN0Y8sGk+wozqJym9eGuvZCbbR39Ph0uR2MJvFfnB3XeCQ U4oOds7/Zdd/wVTY1hqiI2inSsDwqEq7Eq8rRwPecGeTTWCr8QmGHjVu6DlZef5C5Pil WUa0+Bibkb4s+wbCYIiVI1B9t/E7rcYogm/BeBHP2OkMPzhGmj3w5+WTZAreCbix1XIx i2F+DeBEp6CA9rvaJA2Poo1jTfqtpdYfX6cq1iDNwGIfPoPj24ChL/WrOxCH0QUoX6Pa pB5/aENbk70qC8xpNF77Hkyo+5DfdI35ZeYrz4GP9rVMj/pc5pUurETsU+2YOXJB6xBA fJHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JAFtsJX4; 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 js1si1693967ejc.88.2021.01.21.03.56.15; Thu, 21 Jan 2021 03:56:15 -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=JAFtsJX4; 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 S1730706AbhAULzP (ORCPT + 7 others); Thu, 21 Jan 2021 06:55:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45832 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730789AbhAULtI (ORCPT ); Thu, 21 Jan 2021 06:49:08 -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 8A092C0613CF for ; Thu, 21 Jan 2021 03:48:26 -0800 (PST) Received: by mail-io1-xd29.google.com with SMTP id d81so3378448iof.3 for ; Thu, 21 Jan 2021 03:48:26 -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=JAFtsJX4NG1ehyjtn4swO/HcsgonIYApimTOBD7fbZ9tIigJYaY/JUxrpOotUR/PzP jDeiPwxedRzEvUGtRCjQZMWVX73vHZO3kctNZcWeLjrRh2P8IOeaX/jGkEhFCh3tW0lL MI2HeR8e6xBFvtT5R+H4lqjqD5h6BqzhNc9X2deLpWCopIZSPSAFWfcXvGPGXLKDCrRp 0DtMV50E2Qfh5WSvjZF7QsCpOsQyFJBheLSAhNAP45XB1eblAqhxjNhHof2kc6ghBDL3 F5c4jIy4QNdQ89ps3HFOVHCPF4nKOUarcUFgxOlb3lIMFLzPF4n4YQ0hchwQ2jZoFZbs Km2A== 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=BeUaN1Tf5WsmJe+H9nIrxnFXPB4UahibRv8S7OOgy6tZOm4kIAokj9H+jRuBo88lMP gHUFz+pf7uqyvu+Mn8Jao+SJxCqceRgiHQrVj3GF+C4OQBsMNXd86sS9q2J0TOQkJHuG CL/7TnbEfi8pthyLGu46387/IH6Vw072YfPSi4KVFXB+h8TQKk9dRlHns2Gt8Xa8jPDL 1nSQ3F3gM+ga9WwbbDqI0G0oLEdU6opGnIOVjEEndYT0dcU+shQk7s96mIzWgwL4r5VH Uj5vPRLcRCBIifrY1ZIpdM6kYE9d0NxSqt3iXlcQa/ctfbafqGuQshPL/SGupwDDwys3 lg+A== X-Gm-Message-State: AOAM532XRAtLtq3nxh4qL8EEgPiJArsdWT/93T0eKyR/aeme1Ao1SlNG 8ZinOY3X756RuQINgnNQChmdO4Ce2ELkfw== X-Received: by 2002:a92:8587:: with SMTP id f129mr11964455ilh.119.1611229705925; Thu, 21 Jan 2021 03:48:25 -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 p5sm2762766ilm.80.2021.01.21.03.48.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Jan 2021 03:48:25 -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 v2 1/5] net: ipa: count actual work done in gsi_channel_poll() Date: Thu, 21 Jan 2021 05:48:17 -0600 Message-Id: <20210121114821.26495-2-elder@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210121114821.26495-1-elder@linaro.org> References: <20210121114821.26495-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 Thu Jan 21 11:48:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 367821 Delivered-To: patch@linaro.org Received: by 2002:a02:a60d:0:0:0:0:0 with SMTP id c13csp493584jam; Thu, 21 Jan 2021 03:50:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJyNF7uSwg7HoLgC32L7U8JtHZ6HAqs5DUO7iXszbicOxEXxyCEAq8u7niS3yMURppTptHzj X-Received: by 2002:aa7:c9c9:: with SMTP id i9mr10759366edt.160.1611229846522; Thu, 21 Jan 2021 03:50:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611229846; cv=none; d=google.com; s=arc-20160816; b=z+dlYMLjptkRj3o1R7xQ8QE6JOnnT6QT88FF8JiuLJd2Uwm1edXScKkaKTegi4u+xh c9buMembOIbbvtPuCoySE8CSKT5+x1YYOXn/c/BLIpzqHXRz9Z04NQSZ4IiO2RednjJB T/w6J6Wz9hc1A9GXySJm4D5yzEeY8ooW5wANiFBuKzRWA0DQrSsaD6JgHwcKO4iOYIYv 6lyPAvM51MvM1Dz/swAXeqXjvO0YMa//3SCenJ3Yv4HH2X3Uf5xJKL5ITgoaXCl2HXNJ 1px6AUSDudcnPner5RWfJwlz+pIpbEkGNqC/azoVMZV9MI8EDXCIhSw6d9nytKq7Bpsx BMMQ== 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=GBXrYjA+yN6zrJi/PBAmIiTfRx34CYJiBQq33JhMxKPW+unbECq/j5NKyXOl27D+1Y 4FdQxnUybraLQ6ZlPK5lfL7EGZdXnVXbt5N6Dd8FupK2RdvDuU4aZOtG44abGHcWy06P JU0e+t8ZAJSeXBEtq8CZJTXLLgiHvwRk+j5e98e9fDx2zZ0KbyyaKhFO+of4Fg1pwLVP XgC66FVLn9T6YYaDaENEeg3LoEeabFwXqaIgBz34MzZqcNn7Glux98BQH+jPAxxrGVDa la8es34fohtocIV9u4hnCIYusxOS0xNs2D+n6KNmU7vS3N0faio+Y+M26ML19TU36piJ 04dw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MjUzmMnM; 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 a59si2205348edf.278.2021.01.21.03.50.45; Thu, 21 Jan 2021 03:50:46 -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=MjUzmMnM; 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 S1730830AbhAULtv (ORCPT + 7 others); Thu, 21 Jan 2021 06:49:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45834 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730787AbhAULtI (ORCPT ); Thu, 21 Jan 2021 06:49:08 -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 814D0C0613D3 for ; Thu, 21 Jan 2021 03:48:27 -0800 (PST) Received: by mail-io1-xd2e.google.com with SMTP id d81so3378547iof.3 for ; Thu, 21 Jan 2021 03:48:27 -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=MjUzmMnMtHugryAIUP4qnuXUMxstLxIJX3Q+4cRAvZpPbzivp4cKamS40MFmnssASk X243ad1D3Mckag/zUAt/PRurHnU22NTJsGnWe/gXJ9Hc3Fzaoy7UGu/KX83gEv2GxerW ocmhpFeDtvN1ZGWZWYgNsGLW8+f1N7UjY+LZ8kVqVfLNQRjgvPeP6CfQea3YTQa0KueB BikLPLzmiIEkDg4dbXxPFFHPcAvfdTl0wnM3tr0mRpjUG5UEu+5F2gNk8vb6iCNjXkw/ eK0XigvItjIV89cY6zUqQkROjEvkhyFbRiKtwSO7ulm/Wu0RJsbqjlJxsn6Hovd24xjq 28kw== 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=mtWiwdnCH/ahfftXQMohKBFwpN8BbTLytZSB2qFN6f1mstYMDVmEhRLJw9jOre/iYf nmjQzIf8t+n9n7bMp0pJm10vczFaDwa6ifkI11XnFtDam/2GwqFMuwrZrAkrwMQtpYOp x1hZrHZpvz1FkmDUqXIAzTmyFFMRDefmxNi28onkyetM6QhfWMGpBzH8Jq87GpLdsQHg ZBn1RPF6rBPhWQhay0XBTkDSAAjhBjyPdteGRVXlSY5XPl33gFUXM1EeyYrs8sY10hNZ 4qZfCPTugEhY2upb14jbCUstNfNoABRFxxYW6CLrUrqLOwIhzf3+IzSlC6vPpbnJuqoT IzNQ== X-Gm-Message-State: AOAM532uiWHDOOjqlQ3RFMWg7JZ8FUOvIP6GiRg0CcPgshYTkCb6TC04 fP2w72lIqFAbg+VRfHRc9jxQeA== X-Received: by 2002:a5e:8812:: with SMTP id l18mr10088840ioj.149.1611229706989; Thu, 21 Jan 2021 03:48:26 -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 p5sm2762766ilm.80.2021.01.21.03.48.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Jan 2021 03:48:26 -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 v2 2/5] net: ipa: heed napi_complete() return value Date: Thu, 21 Jan 2021 05:48:18 -0600 Message-Id: <20210121114821.26495-3-elder@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210121114821.26495-1-elder@linaro.org> References: <20210121114821.26495-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 Thu Jan 21 11:48:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 367827 Delivered-To: patch@linaro.org Received: by 2002:a02:a60d:0:0:0:0:0 with SMTP id c13csp497299jam; Thu, 21 Jan 2021 03:56:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJxe/QqtAjBK3iHrz/pQUHx+k2DCFhLjonYJUR6nQihaySzz5Or64drLHPdPfs4JDNoBSTEZ X-Received: by 2002:aa7:c308:: with SMTP id l8mr11190255edq.246.1611230175822; Thu, 21 Jan 2021 03:56:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611230175; cv=none; d=google.com; s=arc-20160816; b=YFgO9mCFpSLSkUcjWhYybvSo2ULrSoFDBmS1YLh3WmhGHJKUvaN3gooMGq3CH2Mx4E uoy6pfH+LsaTag9FKCB/m+MXL8LDTzj9pmRGKUuVqR5COJXzRmYjjIbsedHif9id4xJD 1O/UdT/zIrIP2tTWsX6OmeJ7QlrrvcdH0sl/OZIXzTzswiusF5IUO6REOKbZlHLjWeTR f15s3ZETq+aldwk3n7r36GpONCyuw1XC2urQv7jjsYL5UpsCAJU1/G9zL4RCeFrec5Zk V+RXFTcYyLvEHsZQQ7Kl8Y5Ci7J4IqcirfNIcDtTmZ4KgDojw8Rm8bL6z40rIJu+FGVV hHvQ== 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=lB7a5cRodpbpGb/+6TS9nogIS/hSgl+bcWuo7lSLV6I=; b=taB66k1UStrfDkMU6xYg7dIsVBQBHv/s/BB6iDBHe3esD2TFrJTVyo8xfbQ9+KjkEn j/RKw2H7azZpdInglxNl4As69iQqzbapzSI/wmY0f9UeK216s/Zc4fQCWc6+z0m1+p9O xVyof4USryYDb96fqu2dEz6/igk5+JQiqOvaw5NsM/so3kCswJIg5z5t8hOKNm86q1GV dOGUuA/2YKQpsAewGdS2zcRklljUTGicqtK2M8Olvc7eDawHXq9x64dV2fjcsCeV3nWn O40baib/QfXpI0ldIxBr7R1mlwvRBRbe3WQws3L8cqFJQPs6ZPQe96bxJg+4O26S2BeF O3/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TZOGTIjV; 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 js1si1693967ejc.88.2021.01.21.03.56.15; Thu, 21 Jan 2021 03:56:15 -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=TZOGTIjV; 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 S1730801AbhAULz1 (ORCPT + 7 others); Thu, 21 Jan 2021 06:55:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46014 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730849AbhAULt4 (ORCPT ); Thu, 21 Jan 2021 06:49:56 -0500 Received: from mail-io1-xd2a.google.com (mail-io1-xd2a.google.com [IPv6:2607:f8b0:4864:20::d2a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8EB57C061786 for ; Thu, 21 Jan 2021 03:48:28 -0800 (PST) Received: by mail-io1-xd2a.google.com with SMTP id e22so3368643iom.5 for ; Thu, 21 Jan 2021 03:48:28 -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=lB7a5cRodpbpGb/+6TS9nogIS/hSgl+bcWuo7lSLV6I=; b=TZOGTIjV+H03KgIz69zU7KTj3IXoyXgRRTOVe++ketr0sARbl8xJe3yneNmzr+VKT0 RIATGg9tYV+y3+3o3LOe8XVizpY+jv0GiDTmUXZdxIamIVlEXzv38Ro4OJhjiWXv8x2C FQ2k9I/gWte1WsL0an9l5lqIyXoNmIL6dsvGVJRlQBOV4haNZaNH50K+aG8sopmtgpLo 8nhEsgjC/mlb1XNunkblS/8d8nOGVakFsDnPDXVgqMjOxKmOsFs9izi1wVdAVvJVJhGb NLHv/vT81WPx2tby6Yx0bAXj32YDzGrDkQAwbibIC4hwGAr1TP93/GQqK+ftbTng7bIl K81g== 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=lB7a5cRodpbpGb/+6TS9nogIS/hSgl+bcWuo7lSLV6I=; b=SX3KoFzlP4d871HOYGgL+6MAXc1PLzD45ye1RRFySTS8x7O85fiHw9PjQoS7Suj/Dj f0bykhKS5GLeMU4M9tVr/C2R7C7qc/2yZZOANycI21LKoufGr4d37h0GK1Q1KbpT84OV uqrmN/sGfT1XpbuIeblMnPCGNR+RSkGr7CwtEPmjBZ4ses7Cw5Vq0TulTC+o6NS3+BD0 ut/9PbBBhDWfMDZqnYpLMH7SpTb9bcdJ6hb8LTAvXcQ2K2ag4lwNT/DlM4bATMusWkk+ 5A8M7L8s3Mxe6lonzsPM7tl4OYnFleNrGMb9Lzt6ERKmkvunQpSdypOFHivgWVV4YL/X FxTg== X-Gm-Message-State: AOAM531IJxOf2k+5PnAKf9NQJYafNFyJM7RyiKWDtU9cb61xl0ZVLzre c6Lm8/4bjvqszKN9EkycjnsKeScWexHOZw== X-Received: by 2002:a92:cccd:: with SMTP id u13mr11747369ilq.273.1611229707990; Thu, 21 Jan 2021 03:48:27 -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 p5sm2762766ilm.80.2021.01.21.03.48.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Jan 2021 03:48:27 -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 v2 3/5] net: ipa: have gsi_channel_update() return a value Date: Thu, 21 Jan 2021 05:48:19 -0600 Message-Id: <20210121114821.26495-4-elder@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210121114821.26495-1-elder@linaro.org> References: <20210121114821.26495-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 --- v2: Do not drop the static keyword that limits the function scope. 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..6e5817e16c0f6 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) +static 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 Thu Jan 21 11:48:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 367823 Delivered-To: patch@linaro.org Received: by 2002:a02:a60d:0:0:0:0:0 with SMTP id c13csp494726jam; Thu, 21 Jan 2021 03:52:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJw3AXM4QRghQA/WE7okF34r7lOHB473mlWhsSKLXWlSotGLo3u1JVLTSjM8Lw4HcoK1Kd6W X-Received: by 2002:aa7:db85:: with SMTP id u5mr10188510edt.107.1611229944650; Thu, 21 Jan 2021 03:52:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611229944; cv=none; d=google.com; s=arc-20160816; b=gIRn5Bb3RtuZfFBv2cFRKfYGrYF4mCtXjJusg6MQRnYPDM/n5BIY62nwO8yYhbGxBE g0zR5+p5XQ2SqAFUaU4PZ9hxeYJqOGXh4YXvhbxVvSs3E3b4envdwk8YqzG+uObejQps aBM5LDRa2h5RDixJAp3uwUtleFXVizlQyXu5QE+0+XqbIXga5V6IyfLMjvzqTZxO3cjj y+T1DVjE7KPgF0VlQGJ+VppxD+tliPCTKoBUOatvvNVHn15KhFVhARBqw03IUjOzytPq Ekb+TAjd4bNF7Ev98QB+AqDKMgDsXlrbiQQ6rVTNglfRbBtQQS/utum87i2YkbUTXktf 4NTg== 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=za0GhtZfftGjQIdCUc6UBpGtSoxmgmTkf3cBAKgV72E=; b=gRzGe9NDmAynX+vJPTWkJdwCf2xJBPlEISzlfRJnnWTJ9y7Aiz3Bbw4FJIoXFOAgJz ghIhLGkzib3YWfjn+ZfRJWRSTZVkLHZ4UjVMmw1byX7zjsOTiAeUWvnNF3BKeBYp1HKN 4z785Frb+GriRO69W2Ln2FB3lDdJ4wMwoGFubfl3yuH52YRVEFkOHjf/mmt4khl6cmQ+ Ec434q8uzljRvP8DPXJpzovcqdwJ/ahETjBqdVPbdVnpen9Gez1+0+1eIhohxdqdRZHL im47Kh8sWcDMCy2K4Eb5FIklhs+JgAwGkYw4BQl2ERpeRyt4d4VDaniIf2a4zO7HigC0 fhiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FeACznIV; 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 qp1si1671123ejb.183.2021.01.21.03.52.24; Thu, 21 Jan 2021 03:52:24 -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=FeACznIV; 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 S1730569AbhAULvn (ORCPT + 7 others); Thu, 21 Jan 2021 06:51:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730787AbhAULt4 (ORCPT ); Thu, 21 Jan 2021 06:49:56 -0500 Received: from mail-io1-xd2d.google.com (mail-io1-xd2d.google.com [IPv6:2607:f8b0:4864:20::d2d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F3DDC061793 for ; Thu, 21 Jan 2021 03:48:29 -0800 (PST) Received: by mail-io1-xd2d.google.com with SMTP id p72so3278421iod.12 for ; Thu, 21 Jan 2021 03:48:29 -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=za0GhtZfftGjQIdCUc6UBpGtSoxmgmTkf3cBAKgV72E=; b=FeACznIVgzKKWzoON26G1ss3btkUAs3Rz2YF5t+/ESI9h24h6SJbOT8CVVcFbyOFag nH4YeSUG/hI8spQlAJL8vBea6eaqArrG8HW8T2vOXIlOB0mC+xlAZ+1STmi7IFN0ba29 obpBbb7pX80S2cziWFrRyplE+5nQc9MI2Fu+w1WWZwvFeLqkN4UxTWbXZgZKhMAP836z X0VwY8bcOo5SlKu/LMgrGdgGG1T/XP/1YAYeBrKtc+qc1cnw4ZK61P3h6RG9IZZ4qERz n6si1iuvvOEy/zo6pJYGPFXkA5snEjZrk+PMPbReTFSDuInf56BrynrHm8G93SxP7aLv LVmA== 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=za0GhtZfftGjQIdCUc6UBpGtSoxmgmTkf3cBAKgV72E=; b=awn+u1MT9xhk0Ar1+iq/HhAInFNCX+hvsQ69h+PKn44UiCQv7jwC5HlK7yAxa7zgvZ bPUJReA5BvG7WoAG4V7fHkrxWN3e5kFP/FHhDWanZrHlGWdr+ujH6OtmnkWDLFB1fcwh 4AyTW8THZlBa69ytAWW/2TZbSvnm8l4iBiLKoB2TWa3Cn/xZmCqy9LJlZf8Er4yPFfjP n/MBdcDqpnFx216J3thLNjprBFLuHAUT983IOvljjQdedZ0OyB9LdFrZ22aRCxgl8LBv iT4Fwav9AJulWaFS4/WRD8q4FcEmZyggmY0YTAvAXHmEwQEWno1d7iP1HshNXsZH2S0m epxg== X-Gm-Message-State: AOAM533vKE2ly1DK5HQfTmyFsFv4s19tbe9PH8TAWwHOw1KpjNQsMnwE murZvaOmnZtl43LFkBZsy8ohpA== X-Received: by 2002:a92:7b07:: with SMTP id w7mr11084031ilc.78.1611229709015; Thu, 21 Jan 2021 03:48:29 -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 p5sm2762766ilm.80.2021.01.21.03.48.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Jan 2021 03:48:28 -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 v2 4/5] net: ipa: repurpose gsi_irq_ieob_disable() Date: Thu, 21 Jan 2021 05:48:20 -0600 Message-Id: <20210121114821.26495-5-elder@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210121114821.26495-1-elder@linaro.org> References: <20210121114821.26495-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 6e5817e16c0f6..0391f5a207c9f 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 Thu Jan 21 11:48:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 367822 Delivered-To: patch@linaro.org Received: by 2002:a02:a60d:0:0:0:0:0 with SMTP id c13csp493598jam; Thu, 21 Jan 2021 03:50:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJx4H4UsnKZRAx/4yQTDpL2/rZGnB7DupsRpXEK2z0HAbTMm7cXfTQJAT9dShmj4hnLoM2j/ X-Received: by 2002:a17:906:758:: with SMTP id z24mr8708968ejb.3.1611229847888; Thu, 21 Jan 2021 03:50:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611229847; cv=none; d=google.com; s=arc-20160816; b=tvWO6l6pK8JWxtTpHtwWQ+8Ru54Wm/ljVCBdchcz52VKr2V/K7kK1xUEaSUDsTs1NC 89rVZcvw1yB7+KxwwCI2EP+0ZyPbUU9tl4Mw2WbcILvRcBFoN6hfT05002HuZWMzRyAF WgHJCdN+YeBxug57rXtpLJK+0C6VJE99950luoxg5DHu5/DK13Ll+Jb+zqT8Q5CzWYKT 2lSX9yDl5f2X1vSckc+ZksS3TfP82zDbFiJ7UGIxB1EN7jIvo//GR922xyzyw/hxi2Ru arbBzEork9lNIRV2whDuG2She32M5jEzBPJSWeIKDxMIIVxRHuZJEMjlVgzRiOe2tvI1 Etxg== 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=kygNnWwNHZcFAU/IIMmhkkxZa/aeNIwUlXt4TwJxOxI=; b=ZdvZCyAaguQQpBNSCMB70l4MEOBlQJjFYPJSne+REbRAvqu44CxhgUG7YV7zAzDGTr Zpr16rQS6OYNw9R9pPwhY1lQcQh+xS5pHRgUIvFfkcyhCJ3wR2+2APTwmBtb2rQ5oPmf 92z/Ri2xCTk7NxA7UIPvO2u5GnKkAXSh7TclCyATA7b3GL/Em15pSPaRpkrfj4mhbB9E NeOodLxEjIFPIfvxhRKhuUyMrhiIZ9lRbO9+mlf9xd3SEr7+YIgkJME7wXBeo74Jq2W9 9mAuRA+DGRxVWjo6v2prtL7ntxNCnRYtFsgoS1rEYfSTo2r5S8B5WmGw3U+4IpW2hBO9 SjrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iBqbR3UU; 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 a59si2205348edf.278.2021.01.21.03.50.47; Thu, 21 Jan 2021 03:50:47 -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=iBqbR3UU; 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 S1730910AbhAULuT (ORCPT + 7 others); Thu, 21 Jan 2021 06:50:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730853AbhAULt4 (ORCPT ); Thu, 21 Jan 2021 06:49:56 -0500 Received: from mail-io1-xd32.google.com (mail-io1-xd32.google.com [IPv6:2607:f8b0:4864:20::d32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE8A1C061795 for ; Thu, 21 Jan 2021 03:48:30 -0800 (PST) Received: by mail-io1-xd32.google.com with SMTP id e22so3353815iog.6 for ; Thu, 21 Jan 2021 03:48:30 -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=kygNnWwNHZcFAU/IIMmhkkxZa/aeNIwUlXt4TwJxOxI=; b=iBqbR3UUymSgU0tbCuyTM6KqEaC8KTyTxtL74a2ptRCBtg2p8l7KAc2emVSeiRVlzn Ol6xudYj6Xfx6Mvqe9L9bTv+hrhVwqFUvejUoPORXwkxlYxilNIh2evsIsme0A4y+pbH o2XXRpFMBcNA4vpBbue/O37Fu62mlx+gbtT7lXd6X0pn2Sz//LfS8O17tmJ4fDHBxlDC Ran//KgAXyokLzjX9TWG/swnrmFE21Bw+UR78g+nYXlLy8pJllBKM2bq+iU9Vz8JpR/a b+HL5//a/7Azc77jZv3t04WfD8wlb2UEiSNaZXhv/NuWCSiMwxv9Hgs/yBBYUnHN4su5 +Bbg== 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=kygNnWwNHZcFAU/IIMmhkkxZa/aeNIwUlXt4TwJxOxI=; b=kTKX/BEmIbsU53j6WqeYMSekKz5UeKi94ZqUA0wmN/TnDTdoqy6h0Md/28oM7+pErv 5zCK84nSY/p8aMj3Wh8cjdLcBSjr6iQSyNwMuOvMb+YqPgYdLWrNcsAqKYI01mAL0iKW NBMlGxPDGc+6FsIiUtFxdYfDpWoUoMm5KCyox2Y2HSWajeAI7YfsST6P9yafvAnXb9xT v2RznnMIM3qaZ2ThMsPreg/3JbVaHoYtTbZRoUl7pWPXrXODulbIiSWmmEJ9USw/sqc2 9zMIHYsuMXCio0x8ICdgrgpjMSJ/AbNjV4lHrcyTSDhCdnu/IHcdZnrYDaG4uQ1KD/9f 6myw== X-Gm-Message-State: AOAM531wQXjxI9aMD7xE59/QNt7LwfxbiqiwldNUj8qPTqLJcG02fe6v qxtx0aUe3k3Mf7y5FbteKNq+IQ== X-Received: by 2002:a05:6e02:1b88:: with SMTP id h8mr4380146ili.39.1611229710111; Thu, 21 Jan 2021 03:48:30 -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 p5sm2762766ilm.80.2021.01.21.03.48.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Jan 2021 03:48:29 -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 v2 5/5] net: ipa: disable IEOB interrupts before clearing Date: Thu, 21 Jan 2021 05:48:21 -0600 Message-Id: <20210121114821.26495-6-elder@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210121114821.26495-1-elder@linaro.org> References: <20210121114821.26495-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 0391f5a207c9f..f79cf3c327c1c 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); } }