From patchwork Tue Jul 27 19:46:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 486746 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:1185:0:0:0:0 with SMTP id f5csp527502jas; Tue, 27 Jul 2021 12:46:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwYJhAbeNi2f9Sx29mpoyWAn3BamyFSg4I9acHQWjoc/U4Lq4yJ1Dzhsy7C5+JEjDbHp345 X-Received: by 2002:a05:6638:204c:: with SMTP id t12mr22792316jaj.129.1627415198565; Tue, 27 Jul 2021 12:46:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627415198; cv=none; d=google.com; s=arc-20160816; b=FKX6C2jgsv+3es89Pr7RIKVoYa/oIVLJUAPnectFkrtOA9onCcrhvt8vmiDHnQT4El u0Zjmkny85jdU1DjZnNa+FCLAcPgb2Vk3Co94YQxqbl0kRxn+07gYxyMQG0PvzOg5sga MQbtVD55Op7CcWKwvZbNnZaTz12CpOEceksOEcsNH3aTFE8Qp+ORDWS1F+Uyynaz0Tni +gG/Rc/Avd085bGUfMxgtN2lHpR65VaUTxxnOW30XBM/MsVsDInUWao0M5czTJxab6dJ WXuxYdu+o/d9m45W18IMrQRzKOsOG+aU7AObwJr/Y2K5e1PW5chMdRm0a88mVKIGkk0i kBJw== 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=2G5lQvEnI5L7BAUDwmuhfg8oZzrhcwdOUc0mzF2aRsc=; b=Q0xtKOZ8dm4+WnR3UrOohXGTTRMn5xC41DMsyj66hQ/8Na1ePRsTWhmJMZDZMblEqT LlgWo90kGFq5bkujOxU0IOvb0fE+5Ja2veV57ouNBy1ISSU2UI+bynId6iGI0Yr8YuSQ OCa+PDNZw+uUm/fzzNT15dRKvuVnc18l8cjcO11pLukVSx8Ve/lx5RzhXG5hCgj0uh/x di5++ouHzAUkhvqQ/X+hfHGPshx0tnoOic4ewlHpx3ifBPD6Rn+U8+NReNM0De4rQZzf 1MyQjaAkmB0Z5How9lcmABCVYkKcFYoMNnsdqYgfSSWFDzAeB8XvdHuk56padUvRHpkB i+Qw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Mp7tC8vO; 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 b16si4499074ile.135.2021.07.27.12.46.38; Tue, 27 Jul 2021 12:46:38 -0700 (PDT) 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=Mp7tC8vO; 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 S232140AbhG0Tqh (ORCPT + 8 others); Tue, 27 Jul 2021 15:46:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230387AbhG0Tqf (ORCPT ); Tue, 27 Jul 2021 15:46:35 -0400 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 D8EC2C061764 for ; Tue, 27 Jul 2021 12:46:33 -0700 (PDT) Received: by mail-io1-xd2e.google.com with SMTP id m13so107865iol.7 for ; Tue, 27 Jul 2021 12:46:33 -0700 (PDT) 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=2G5lQvEnI5L7BAUDwmuhfg8oZzrhcwdOUc0mzF2aRsc=; b=Mp7tC8vOl5C2a2JYxESAytRd5Qb1AzB9ZFF+kS2kCRs+HYCJr3feYT/2YfjZzGi5GB TKbfT4o3YNzt8k8I0cqukBSAo5X6gF5yANonz3all/ow1ejcGzsHmXMlctma9kf6Zmr/ rczoiOvhnM/oD6JW4G91cSSwgtNjrQqkNtB2A4u3rtZhKmbUFIgfJx7cxYhW15pkU3He zROXvWjDpAQ37+29PBD7uziK4shBu11cgPlljL5sgOKUys2OqQdpTiGZUL/0Cq0+tNtr jP3JxQiVdep4aTZ8aqYEU+iJnENvLFatpK/Np4fQpj+ZVEViT0BqapbKiGv0xg34svVw 74pQ== 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=2G5lQvEnI5L7BAUDwmuhfg8oZzrhcwdOUc0mzF2aRsc=; b=hF4+XhAw39X7c8TRFluKHXqkubj+0mw2zkMOM+B5FwuQ3wTvO0bUkT2Yp3yy+g61Yl yOir2OX47hDaPM2B2OtPszeyQyNY9IBFKlLLSi2S66N5QE56ijXb/F27ujAG8NOKcVVw Am3JjBuM2bTFGJUpLUVs6JxGlOxO4HKR+al6WjxZjT6p/pIbUadAVbY6qMDsy18TeA2K qpqKMVIH9eVqIOmzjXZvDhzMB5slzDBFpnDRKwTkQ/UGDO+J7+zBkRxYLT5Wp7UJ8Cla d7xK62zxlV21O5FSq6mQkr8ZaqPRGufsH5knkZJ/CUAoRtpK5pGWhL0QQp3h8iJSt+SP 6niQ== X-Gm-Message-State: AOAM531Oihf1w1gO55j2hmxuvjN3oQBDtCNoKYQx0oATmuoLQEyPSl8v esScTb6tcQo58/YV2ZseofykjA== X-Received: by 2002:a6b:ec0d:: with SMTP id c13mr20756506ioh.108.1627415193209; Tue, 27 Jul 2021 12:46:33 -0700 (PDT) Received: from presto.localdomain (c-73-185-129-58.hsd1.mn.comcast.net. [73.185.129.58]) by smtp.gmail.com with ESMTPSA id c1sm2443014ils.21.2021.07.27.12.46.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Jul 2021 12:46:32 -0700 (PDT) From: Alex Elder To: davem@davemloft.net, kuba@kernel.org Cc: bjorn.andersson@linaro.org, evgreen@chromium.org, cpratapa@codeaurora.org, subashab@codeaurora.org, elder@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next 1/4] net: ipa: make IPA interrupt handler threaded only Date: Tue, 27 Jul 2021 14:46:26 -0500 Message-Id: <20210727194629.841131-2-elder@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210727194629.841131-1-elder@linaro.org> References: <20210727194629.841131-1-elder@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org When the IPA interrupt handler runs, the IPA core clock must already be operational, and the interconnect providing access by the AP to IPA config space must be enabled too. Currently we ensure this by taking a top-level "stay awake" IPA clock reference, but that will soon go away. In preparation for that, move all handling for the IPA IRQ into the thread function. Signed-off-by: Alex Elder --- drivers/net/ipa/ipa_interrupt.c | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) -- 2.27.0 diff --git a/drivers/net/ipa/ipa_interrupt.c b/drivers/net/ipa/ipa_interrupt.c index 9fd158dd90473..7dee4ebaf5a95 100644 --- a/drivers/net/ipa/ipa_interrupt.c +++ b/drivers/net/ipa/ipa_interrupt.c @@ -100,32 +100,22 @@ static void ipa_interrupt_process_all(struct ipa_interrupt *interrupt) } } -/* Threaded part of the IPA IRQ handler */ +/* IPA IRQ handler is threaded */ static irqreturn_t ipa_isr_thread(int irq, void *dev_id) -{ - struct ipa_interrupt *interrupt = dev_id; - - ipa_clock_get(interrupt->ipa); - - ipa_interrupt_process_all(interrupt); - - ipa_clock_put(interrupt->ipa); - - return IRQ_HANDLED; -} - -/* Hard part (i.e., "real" IRQ handler) of the IRQ handler */ -static irqreturn_t ipa_isr(int irq, void *dev_id) { struct ipa_interrupt *interrupt = dev_id; struct ipa *ipa = interrupt->ipa; u32 offset; u32 mask; + ipa_clock_get(ipa); + offset = ipa_reg_irq_stts_offset(ipa->version); mask = ioread32(ipa->reg_virt + offset); - if (mask & interrupt->enabled) - return IRQ_WAKE_THREAD; + if (mask & interrupt->enabled) { + ipa_interrupt_process_all(interrupt); + goto out_clock_put; + } /* Nothing in the mask was supposed to cause an interrupt */ offset = ipa_reg_irq_clr_offset(ipa->version); @@ -134,6 +124,9 @@ static irqreturn_t ipa_isr(int irq, void *dev_id) dev_err(&ipa->pdev->dev, "%s: unexpected interrupt, mask 0x%08x\n", __func__, mask); +out_clock_put: + ipa_clock_put(ipa); + return IRQ_HANDLED; } @@ -260,7 +253,7 @@ struct ipa_interrupt *ipa_interrupt_config(struct ipa *ipa) offset = ipa_reg_irq_en_offset(ipa->version); iowrite32(0, ipa->reg_virt + offset); - ret = request_threaded_irq(irq, ipa_isr, ipa_isr_thread, IRQF_ONESHOT, + ret = request_threaded_irq(irq, NULL, ipa_isr_thread, IRQF_ONESHOT, "ipa", interrupt); if (ret) { dev_err(dev, "error %d requesting \"ipa\" IRQ\n", ret); From patchwork Tue Jul 27 19:46:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 486750 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:1185:0:0:0:0 with SMTP id f5csp527629jas; Tue, 27 Jul 2021 12:46:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxcAiloNcb8UsX76c6sI9NfcfJS9kI4W7QmAgNz7AXG9Q0wcX0rn2FZ635esXIdEzAmtTYd X-Received: by 2002:a5d:9ccb:: with SMTP id w11mr20346951iow.174.1627415207126; Tue, 27 Jul 2021 12:46:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627415207; cv=none; d=google.com; s=arc-20160816; b=UeuPgaRzhE8FgRPJMo+ZWb6wzYQ3rtJ/ZSVda0l6BHAhNJZB7LUCAFcOAl8Nljimkf eV+w39LjrwOgWcqsbzDyaHyfPhMKEFNzI7PC1JKV/IDjATd5MOmimYlt4aXTG3/IWX+i a3AawCSjgqKJitUHFzBXXeD2FhwCtWcWU8oktenHgh+lrilo6hsfEbW02raGm0AKjp2u 9jGYEbzeCxsyHS9kfw6Y05ab5KxtlXrP5MssUkFHEN761VrUvwauXOioOaNbmvB1yE+4 Z0o+Esxue69VBaFnIAtOQxY2gbKciMkQsJ2HvbUERzaW8wxqvs3J0bAVh1j1WyJc8Gnx g0/A== 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=JpKATF26Oehqbj9lTGQY7PBo/hOLLmivLGfbP+CflK4=; b=vhMwucLZ8abqbNG9NYSNYb8HjindS//vz874CtplxobakpNbDAnnjPfvw2RiuHPINK JTIdtiuGA6Yo/se2TH69iNoSpbXHRPL+lqJhdXLjVULvNhKv8PTXnpcydQwY2/k5TLoQ 04VKdqnTslB/r6nTFKkT31Vczr0plW880qt+Pfv5oF0XmsK3IzC/Sa+ucy+Qs7+P0UuD XaadCT3y8DB0t0P9CPH5uMsLtZONUuP2Ij2jcCrqNNMnVVXAgX3RBqI8yYN3dExpsYpD d3X38KONTYTch8yoEVLoy9AI18FrhD+yXTEjSCJxHjjYWTFgbkcPTrB4fTbFjrOLPFK8 OOMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QmVNUSY3; 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 i42si4150090jav.32.2021.07.27.12.46.46; Tue, 27 Jul 2021 12:46:47 -0700 (PDT) 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=QmVNUSY3; 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 S232359AbhG0Tqp (ORCPT + 8 others); Tue, 27 Jul 2021 15:46:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37344 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232123AbhG0Tqh (ORCPT ); Tue, 27 Jul 2021 15:46:37 -0400 Received: from mail-io1-xd36.google.com (mail-io1-xd36.google.com [IPv6:2607:f8b0:4864:20::d36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E0DEC0613CF for ; Tue, 27 Jul 2021 12:46:34 -0700 (PDT) Received: by mail-io1-xd36.google.com with SMTP id r6so101054ioj.8 for ; Tue, 27 Jul 2021 12:46:34 -0700 (PDT) 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=JpKATF26Oehqbj9lTGQY7PBo/hOLLmivLGfbP+CflK4=; b=QmVNUSY3LsuSyY6FD99L5WcKmSWbBwUxw6irXRHPTSYqTUUxh8K2ntp8JTi4EQV8vO fVxRMGX9WI5xhMjAcXW1QuPEJJFyHgjAGD8rTI4MgG2mbj/ZFW59IPZ1gtA0t6b62JrA 9jQZO2ByxKZR+hmLY+I3cTDUWxExHVKIhw8kpN2xD8z5QGko0GwwPANN3yVZvb44U7/T zzJHl2U9mPlYcsoAgzVjgyREm2f0IsYPdQfVXCsmeBmwt9qNuif5la5Stxog9cl9/TEL DH3i8/XMy7j2KB1Yhb7+zXK0CihxPNubhAf5Z1c5XbKF/bBLFCAlSMwT74jJwafW2RWY 8YOw== 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=JpKATF26Oehqbj9lTGQY7PBo/hOLLmivLGfbP+CflK4=; b=A4ElBudWytij3Swr/X9cL7/Z5v9jWFkuf6lSgXv3p/SQ736JA70GAvnk4aqetI54ar Yd4SDTlXUekLg7F2REusfRamfyhYaUfYh1Teryaqd+wndmutj02SXKfgpc/nfuLn9EDq IFOUBVcrMJe9SKLnEfU0zl3+BJxkdjJi3RDXPveIDepXZAOd+FayKuJOCEbEvKVf1e2/ M+Gz0jTCtoJ0krjdX8qvcole5aUUL4FAXK/wEHeascK8SVidZMSqNXTIGd704tvziPcv zEkQjz8uru/3Z0VM9L07vfVPChVzoF6OY8znMif6khscNla4mF3LmTzt0JQeGrO+lv/A 4eww== X-Gm-Message-State: AOAM533peX3egyijtklaw3Fb/31mNfDVFhBldQ64HM7dd748hFGsmhBL 0p2B74HvCYWt3wqc2DEY5hHHayI0lk7auA== X-Received: by 2002:a02:90cb:: with SMTP id c11mr23365375jag.53.1627415194152; Tue, 27 Jul 2021 12:46:34 -0700 (PDT) Received: from presto.localdomain (c-73-185-129-58.hsd1.mn.comcast.net. [73.185.129.58]) by smtp.gmail.com with ESMTPSA id c1sm2443014ils.21.2021.07.27.12.46.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Jul 2021 12:46:33 -0700 (PDT) From: Alex Elder To: davem@davemloft.net, kuba@kernel.org Cc: bjorn.andersson@linaro.org, evgreen@chromium.org, cpratapa@codeaurora.org, subashab@codeaurora.org, elder@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next 2/4] net: ipa: clear disabled IPA interrupt conditions Date: Tue, 27 Jul 2021 14:46:27 -0500 Message-Id: <20210727194629.841131-3-elder@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210727194629.841131-1-elder@linaro.org> References: <20210727194629.841131-1-elder@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org We ignore any IPA interrupt that has no handler. If any interrupt conditions without a handler exist when an IPA interrupt occurs, clear those conditions. Add a debug message to report which ones are being cleared. Signed-off-by: Alex Elder --- drivers/net/ipa/ipa_interrupt.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) -- 2.27.0 diff --git a/drivers/net/ipa/ipa_interrupt.c b/drivers/net/ipa/ipa_interrupt.c index 7dee4ebaf5a95..c12d0c33557cd 100644 --- a/drivers/net/ipa/ipa_interrupt.c +++ b/drivers/net/ipa/ipa_interrupt.c @@ -79,6 +79,7 @@ static void ipa_interrupt_process_all(struct ipa_interrupt *interrupt) { struct ipa *ipa = interrupt->ipa; u32 enabled = interrupt->enabled; + u32 pending; u32 offset; u32 mask; @@ -87,8 +88,8 @@ static void ipa_interrupt_process_all(struct ipa_interrupt *interrupt) * only the enabled ones. */ offset = ipa_reg_irq_stts_offset(ipa->version); - mask = ioread32(ipa->reg_virt + offset); - while ((mask &= enabled)) { + pending = ioread32(ipa->reg_virt + offset); + while ((mask = pending & enabled)) { do { u32 irq_id = __ffs(mask); @@ -96,7 +97,17 @@ static void ipa_interrupt_process_all(struct ipa_interrupt *interrupt) ipa_interrupt_process(interrupt, irq_id); } while (mask); - mask = ioread32(ipa->reg_virt + offset); + pending = ioread32(ipa->reg_virt + offset); + } + + /* If any disabled interrupts are pending, clear them */ + if (pending) { + struct device *dev = &ipa->pdev->dev; + + dev_dbg(dev, "clearing disabled IPA interrupts 0x%08x\n", + pending); + offset = ipa_reg_irq_clr_offset(ipa->version); + iowrite32(pending, ipa->reg_virt + offset); } } From patchwork Tue Jul 27 19:46:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 486749 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:1185:0:0:0:0 with SMTP id f5csp527624jas; Tue, 27 Jul 2021 12:46:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzx8a/2JbADmpqhdMpDRmj+trnyBrDjAVWoYk9MVbUBwW+y2khEA1u2Z6U/eNzh5IoEWXOQ X-Received: by 2002:a05:6602:21d6:: with SMTP id c22mr9073948ioc.69.1627415206853; Tue, 27 Jul 2021 12:46:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627415206; cv=none; d=google.com; s=arc-20160816; b=MKIhd4fkHhC28RmIPeWPw5vpR0N/MannNQX65VMeNKtohbkhBMrOhM66BrRXaT6T8h LG6AXTxn7qFGRzDCHRZzK/khnHT2T4yzL9AReybs5mPr2MsBoCXz/rMK1h6SOYH8Z04K LShg0yUJwKk43hFGxPA9O6NSQuNsxjgVsK7oGEEisdutqjDbxoCTbQQXAqW4sh38chOh vNxb9qnyAFI6ib1Co8hqiRgdhjkBpCghUe8ZUNV+nIOwBIAztZB9Jcq6VbCth9FewCVE zIL0C5iK8xXC9lojqP4X/1AMsuAxrk/8Wl3Hi2VxzLdiq4Dxho1iL7xBWzst9j3jTlGz ZE0Q== 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=NLz2frAd3QKDDMnRP6OXGsrEzL53XboKZfJ8zI0IXQU=; b=qbCMVQYaONJ28/zKaf9Pj3U36PCp3FPRkLSW3oBcanVYThvLZaPIBL3zLnJYe8uiBk mDzOtRmOJZJuTPlapLbklNDFP0hrjnqRtUBAQ03iyqkOf3w4sSKLV3Bola8ASugfnESG NYZIA4DPxIbaLRfe5D1OOXecgX82swmL1VemVRm4JHnAWlfiCjtfG2gds0UU+Gnuhkip kzZ+mfxeTZK+ZvIu55Wi7Ib1Zc+MROwRj7EbbCQ3PemwzyuwBCspwn7PVRIuypDJQ0GU x4PGG6gvi35lKvfHG3rB21zOfMXdFHVAdXXYo1aZLmijK6bDVA6QEsTTlZ0fpOR4npyA nNxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rBzZlHEk; 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 i42si4150090jav.32.2021.07.27.12.46.46; Tue, 27 Jul 2021 12:46:46 -0700 (PDT) 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=rBzZlHEk; 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 S232296AbhG0Tqn (ORCPT + 8 others); Tue, 27 Jul 2021 15:46:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232110AbhG0Tqg (ORCPT ); Tue, 27 Jul 2021 15:46:36 -0400 Received: from mail-il1-x131.google.com (mail-il1-x131.google.com [IPv6:2607:f8b0:4864:20::131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9DFC4C0613C1 for ; Tue, 27 Jul 2021 12:46:35 -0700 (PDT) Received: by mail-il1-x131.google.com with SMTP id r5so374282ilc.13 for ; Tue, 27 Jul 2021 12:46:35 -0700 (PDT) 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=NLz2frAd3QKDDMnRP6OXGsrEzL53XboKZfJ8zI0IXQU=; b=rBzZlHEkQej+rUd/GCmCW8HOR6qggFZa6keLtFb0bUxK3OfBXp0NsBaKM1xag4NxH4 Eki/Ji18uJTBG7/wuuHOyRBlZXvKgM0nIHNlI6+SbwnJiE0YxWtVFrNav3V02RNwuAMm aZmVKhaMMRYxRySSNW7bAc6A1ICLphUted4QmL/L1IN/M92cYBGsi1UH/xeQup+s+L/y V/DcAMvyoPECxofUraxiOZRvTqwPVK8u+4OX2pLgUh7Hd1nDQE7G50F41CS6SCSrzIhs 11VKHfZKb+BfO7N9koDQaVZuHpv2LK4FAQ9o/hI4WZj9kTU/4f4axqn2JbUfpOc+l3Ni OVgg== 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=NLz2frAd3QKDDMnRP6OXGsrEzL53XboKZfJ8zI0IXQU=; b=W4mFM6GS/hqKh+W+5hLs4CQ7rF0lY+Cyj7UyhMPaoXvlqBmZEf24dg5fBMvpwVLp8Q /zLWgYfX0ue9SIG4hupeK6z4g3sAs2qXU72ZQb5e9mPJkaYAyn8rlq7SHhvvuliQD6TE XBAA0ALk0Rr1ijuVYU+ZPQ1a76CalLJzkC2099jiI3Hl9m5JJI3fjIz1GXoiczZ82YL9 DBDzgdaIyM3eVmvlsNQi1rLkZ9pLwIkx6AngQgyW+ZEEVRLINKjj2t5qHHxivyJpZkQI 97bPTeg1hSccKxQNUFNtwtfMPbOANUu+zEHVtojbKzeXaObbdqEZhOZxCQMswtyKcQdV TEsw== X-Gm-Message-State: AOAM532V5q6B8O8GplXZCpFBjfnidbRTl5HGvJoG5Cw827wRX/RJHgVJ r9KZ0j3T2ZF6hPnUUldJ/CyiZQ== X-Received: by 2002:a05:6e02:1a05:: with SMTP id s5mr1029683ild.232.1627415194959; Tue, 27 Jul 2021 12:46:34 -0700 (PDT) Received: from presto.localdomain (c-73-185-129-58.hsd1.mn.comcast.net. [73.185.129.58]) by smtp.gmail.com with ESMTPSA id c1sm2443014ils.21.2021.07.27.12.46.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Jul 2021 12:46:34 -0700 (PDT) From: Alex Elder To: davem@davemloft.net, kuba@kernel.org Cc: bjorn.andersson@linaro.org, evgreen@chromium.org, cpratapa@codeaurora.org, subashab@codeaurora.org, elder@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next 3/4] net: ipa: get rid of some unneeded IPA interrupt code Date: Tue, 27 Jul 2021 14:46:28 -0500 Message-Id: <20210727194629.841131-4-elder@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210727194629.841131-1-elder@linaro.org> References: <20210727194629.841131-1-elder@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The pending IPA interrupts are checked by ipa_isr_thread(), and interrupts are processed only if an enabled interrupt has a condition pending. But ipa_interrupt_process_all() now makes the same check, so the one in ipa_isr_thread() can just be skipped. Also in ipa_isr_thread(), any interrupt conditions pending which are not enabled are cleared. Here too, ipa_interrupt_process_all() now clears such excess interrupt conditions, so ipa_isr_thread() doesn't have to. Signed-off-by: Alex Elder --- drivers/net/ipa/ipa_interrupt.c | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) -- 2.27.0 diff --git a/drivers/net/ipa/ipa_interrupt.c b/drivers/net/ipa/ipa_interrupt.c index c12d0c33557cd..d149e496ffa72 100644 --- a/drivers/net/ipa/ipa_interrupt.c +++ b/drivers/net/ipa/ipa_interrupt.c @@ -116,26 +116,11 @@ static irqreturn_t ipa_isr_thread(int irq, void *dev_id) { struct ipa_interrupt *interrupt = dev_id; struct ipa *ipa = interrupt->ipa; - u32 offset; - u32 mask; ipa_clock_get(ipa); - offset = ipa_reg_irq_stts_offset(ipa->version); - mask = ioread32(ipa->reg_virt + offset); - if (mask & interrupt->enabled) { - ipa_interrupt_process_all(interrupt); - goto out_clock_put; - } + ipa_interrupt_process_all(interrupt); - /* Nothing in the mask was supposed to cause an interrupt */ - offset = ipa_reg_irq_clr_offset(ipa->version); - iowrite32(mask, ipa->reg_virt + offset); - - dev_err(&ipa->pdev->dev, "%s: unexpected interrupt, mask 0x%08x\n", - __func__, mask); - -out_clock_put: ipa_clock_put(ipa); return IRQ_HANDLED; From patchwork Tue Jul 27 19:46:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 486748 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:1185:0:0:0:0 with SMTP id f5csp527582jas; Tue, 27 Jul 2021 12:46:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwxiynoiAZ1xwLzTR2wJCY6hIhUcsxEXS8NlWFm2BGEGUB0QWxCXbzGGWxnHFOhuijQLL32 X-Received: by 2002:a05:6602:2057:: with SMTP id z23mr19797977iod.29.1627415204037; Tue, 27 Jul 2021 12:46:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627415204; cv=none; d=google.com; s=arc-20160816; b=NLqXtxcMj20xQ8RoO0vFTuJna2p3Z8AVG8aFMB5hLyVifgCrKHvvcVu6rRFj+ftOPZ gTmlm0AawoeuVnkdHiVXWnmOe61J/FPqiupf+2fLIlapienazym43z0cJppZf2e+Pi02 r35Itqy4L2wU09I0bqlyPjuV1oOmlLtpi4HwVDiWzuhWnLbimD5XMZ7SqXkhc0xF5Mub 6zSjQ5TK6cGdMOd/36jnxId1XdttjF2ahaNGqcoJWbak0GyVCmH9snfcfg4TOShbOl5/ WXC71a6T/Y1HnvMOImq6Xt+AUbF5oSOWrJK6G81L+22s9ez1Vy+eAKu+6s/Nz0zS4Oaw 46WQ== 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=eH4S8FNsAoKRYvFR0Ki+05n7mxmZZlMccibOdhfBxlg=; b=UYMEyyvnFF/fEveBEnopUMm/dxdlknI4EsCBFmhzsAjqK1v8ix4v/i7AdsaKdIx/Gm Mhuo11KJmZtUlNWl/HSym19hDLLslnAdGaAqTkHRw56NKLKzYxmRePp6eBnBtHj8W9Wg YGqpR1M9sag20KzhtSh5QXXtxP95eLaf1g7RWrMGjBwNwdmsknlgD1ZxoBkLbGnysvC3 j6xErkiZni8sLgZZd72cYBg3YS7hdphFmsJreUQIRnT9nJoTUhPUn5qrYSAPwJ94kcRp r49rS1ErmJ6x2cnYUjYdzcnJY6Y9ffZnK8ZWCM9sjy4nLzj2R6zQhxGWWYck87h6yAxH eLTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MgJnPNwG; 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 v25si4315487jan.107.2021.07.27.12.46.42; Tue, 27 Jul 2021 12:46:44 -0700 (PDT) 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=MgJnPNwG; 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 S232200AbhG0Tqj (ORCPT + 8 others); Tue, 27 Jul 2021 15:46:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232078AbhG0Tqg (ORCPT ); Tue, 27 Jul 2021 15:46:36 -0400 Received: from mail-io1-xd34.google.com (mail-io1-xd34.google.com [IPv6:2607:f8b0:4864:20::d34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5FC87C061764 for ; Tue, 27 Jul 2021 12:46:36 -0700 (PDT) Received: by mail-io1-xd34.google.com with SMTP id y9so140597iox.2 for ; Tue, 27 Jul 2021 12:46:36 -0700 (PDT) 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=eH4S8FNsAoKRYvFR0Ki+05n7mxmZZlMccibOdhfBxlg=; b=MgJnPNwGGGC8USKl7KNWBI56pzqNdFS7mvjfVzTn1v7II1LQF8+IxuJOUhUgNNAiNN 7osh0jaO1pZXNA42jKDLWA8P9ywA4SFxlRncmLYOnjrUtxjUoJzA44vcnrqNJaJtNlpI Ym1ehl4GYYUG6sR1YjCAf8oKL8nmEbOw4IntTbvO7qGkKgmh+bv291pxio8tjuuCF5qX 47BkgFa/booLy4dfisVIolTlOOuJXGVZXAIxijz63awCZwabMQI1XRW7RCF3gHTOC38J 4wYue0xhxaSeWRaI2kVB/bBqG0iTOr1kDBKOerzdplFVkExUV+0nnd12GjRUfOGzSN+4 VSOQ== 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=eH4S8FNsAoKRYvFR0Ki+05n7mxmZZlMccibOdhfBxlg=; b=csjRJ44GP/Zd9RzSuZ/UQUkh9HqQh8OcbO+ZmOzljzjY+WyAn0Nl0JJHh+BaWczvba Y6arD8Dj4L8zCNxMdEJJ0+k8pgbgLcF0482VrgWN21YQFkazljtwKc1p6ET910peFkZH 8WWTHDgHTRXDrbCyIwQaN/f5OpwKS31NwMzF3bmakZei0wjFKRcFEcI+ZuHNdlpgeRgf +r2jjQmkkqo6a9s9NM7f4FqybVWiDSewDN+mzMkKdvLKzgnAvxZDSk6sdbhzcLaLc7LT HpH2UlbmjyITY75ahE1hBDwzc8Xj3u5V3Yejmp2Yiz4kWD/Ylsqhxvk8EVNwnyXO0ryJ /XbQ== X-Gm-Message-State: AOAM530ryCCCpYkN5zxxJ6eCxgRTP+8mAiUV2HBSoJ/PlAhL7pvsZEJu MOwkxdwsVvUkrxSPvJ2RSQtHeg== X-Received: by 2002:a05:6638:538:: with SMTP id j24mr22703457jar.59.1627415195809; Tue, 27 Jul 2021 12:46:35 -0700 (PDT) Received: from presto.localdomain (c-73-185-129-58.hsd1.mn.comcast.net. [73.185.129.58]) by smtp.gmail.com with ESMTPSA id c1sm2443014ils.21.2021.07.27.12.46.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Jul 2021 12:46:35 -0700 (PDT) From: Alex Elder To: davem@davemloft.net, kuba@kernel.org Cc: bjorn.andersson@linaro.org, evgreen@chromium.org, cpratapa@codeaurora.org, subashab@codeaurora.org, elder@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next 4/4] net: ipa: kill ipa_interrupt_process_all() Date: Tue, 27 Jul 2021 14:46:29 -0500 Message-Id: <20210727194629.841131-5-elder@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210727194629.841131-1-elder@linaro.org> References: <20210727194629.841131-1-elder@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Now that ipa_isr_thread() is a simple wrapper that gets a clock reference around ipa_interrupt_process_all(), get rid of the called function and just open-code it in ipa_isr_thread(). Signed-off-by: Alex Elder --- drivers/net/ipa/ipa_interrupt.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) -- 2.27.0 diff --git a/drivers/net/ipa/ipa_interrupt.c b/drivers/net/ipa/ipa_interrupt.c index d149e496ffa72..aa37f03f4557f 100644 --- a/drivers/net/ipa/ipa_interrupt.c +++ b/drivers/net/ipa/ipa_interrupt.c @@ -74,15 +74,18 @@ static void ipa_interrupt_process(struct ipa_interrupt *interrupt, u32 irq_id) iowrite32(mask, ipa->reg_virt + offset); } -/* Process all IPA interrupt types that have been signaled */ -static void ipa_interrupt_process_all(struct ipa_interrupt *interrupt) +/* IPA IRQ handler is threaded */ +static irqreturn_t ipa_isr_thread(int irq, void *dev_id) { + struct ipa_interrupt *interrupt = dev_id; struct ipa *ipa = interrupt->ipa; u32 enabled = interrupt->enabled; u32 pending; u32 offset; u32 mask; + ipa_clock_get(ipa); + /* The status register indicates which conditions are present, * including conditions whose interrupt is not enabled. Handle * only the enabled ones. @@ -109,17 +112,6 @@ static void ipa_interrupt_process_all(struct ipa_interrupt *interrupt) offset = ipa_reg_irq_clr_offset(ipa->version); iowrite32(pending, ipa->reg_virt + offset); } -} - -/* IPA IRQ handler is threaded */ -static irqreturn_t ipa_isr_thread(int irq, void *dev_id) -{ - struct ipa_interrupt *interrupt = dev_id; - struct ipa *ipa = interrupt->ipa; - - ipa_clock_get(ipa); - - ipa_interrupt_process_all(interrupt); ipa_clock_put(ipa);