From patchwork Fri May 15 20:07:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 1291620 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=Tv+lROKB; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 49Nzwr01nBz9sTS for ; Sat, 16 May 2020 06:07:55 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726278AbgEOUHn (ORCPT ); Fri, 15 May 2020 16:07:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726183AbgEOUHm (ORCPT ); Fri, 15 May 2020 16:07:42 -0400 Received: from mail-qv1-xf43.google.com (mail-qv1-xf43.google.com [IPv6:2607:f8b0:4864:20::f43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 30D2FC05BD0B for ; Fri, 15 May 2020 13:07:42 -0700 (PDT) Received: by mail-qv1-xf43.google.com with SMTP id g20so1718166qvb.9 for ; Fri, 15 May 2020 13:07:42 -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=VnxRWHDXHhnTZy+gwKWC5VS3DYI6cRqhNhPWiq4rZmg=; b=Tv+lROKByW/LBPC0MoPALLkGwSNyeqW0JW97X019XsYzrTpHJ1jejK1GDUnGz2qpW4 Eklk4GhajSlShVGuB/rxGAQ4l5ohbG31MBGzav8b2hgh9lnHhDt+Btva8nEY3epA2JhO AGFPo36fVH0LmUwzlsJ1UbuQsS0bEtoKt9GaFjhInArgcGibLC/oa5IFYTmO9G65GLUi ul9WcXUzWkcFjX/fTDC96YmaQ8P56slnE8SA0Mxkdbx8WXHPpS6G303UxjkRd1mrlocl aefrDa2CmQ0BDhjSGMakOygFLbkDm3nutDEuA0Ihvg2QMA6EIAevt8ETDiQXibZk9s7T 0BVw== 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=VnxRWHDXHhnTZy+gwKWC5VS3DYI6cRqhNhPWiq4rZmg=; b=KyHeNogq37vadSSphiiLUvhcIO2IyfhA914GKzQQAdtosnAtT0V2s3VPnioxxTc7ok dWm6QpTm5pGeu7KXlqB8v2nk3ZgF2Uq8J5acUhpUzQDn5ffz/Pk8E6SO9qg3QDL4mPhh MjYA1nY4V9t84T6q9exP/SbOFeYNU6RNRHwW4veJR8EGtYnOhk1wUXRdavLuVV31x1Sa TswCpqLocke38SXUL/QjXlcsrBLZNAXjjTc/XRfBULtLeMIDl1TX4zPpTs54Y7pxDEyT /vzJOAMxJ0Di1HIM3GYLXEqo4dhK4njMnjFZdqtagl+57rZNcTWpkjoiACJ0td33Lbke LyFw== X-Gm-Message-State: AOAM5316w18xuc+DaLStY9giT0SVTnJZFykEmkELvk7kRI6DsTaTdLtq RuSBC8TJVALsNGIXRBAyIqT2zA== X-Google-Smtp-Source: ABdhPJzDnLFI//uXsW8EBqoqzHLUpXo1v2yfY/OVy6VaSEXRw3Oh6dIVhIfzxprXD6TWafpO8bjl4g== X-Received: by 2002:a0c:f485:: with SMTP id i5mr5365095qvm.144.1589573261453; Fri, 15 May 2020 13:07:41 -0700 (PDT) Received: from beast.localdomain (c-73-185-129-58.hsd1.mn.comcast.net. [73.185.129.58]) by smtp.gmail.com with ESMTPSA id 132sm2328246qkj.117.2020.05.15.13.07.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 May 2020 13:07:41 -0700 (PDT) From: Alex Elder To: davem@davemloft.net Cc: evgreen@chromium.org.net, subashab@codeaurora.org, cpratapa@codeaurora.org, bjorn.andersson@linaro.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next 1/2] net: ipa: don't use noirq suspend/resume callbacks Date: Fri, 15 May 2020 15:07:30 -0500 Message-Id: <20200515200731.2931-2-elder@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200515200731.2931-1-elder@linaro.org> References: <20200515200731.2931-1-elder@linaro.org> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Use the suspend and resume callbacks rather than suspend_noirq and resume_noirq. With IPA v4.2, we use the CHANNEL_STOP command to implement a suspend, and without interrupts enabled, that command won't complete. Signed-off-by: Alex Elder --- drivers/net/ipa/ipa_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ipa/ipa_main.c b/drivers/net/ipa/ipa_main.c index e0b1fe3c34f9..76d5108b8403 100644 --- a/drivers/net/ipa/ipa_main.c +++ b/drivers/net/ipa/ipa_main.c @@ -933,8 +933,8 @@ static int ipa_resume(struct device *dev) } static const struct dev_pm_ops ipa_pm_ops = { - .suspend_noirq = ipa_suspend, - .resume_noirq = ipa_resume, + .suspend = ipa_suspend, + .resume = ipa_resume, }; static struct platform_driver ipa_driver = { From patchwork Fri May 15 20:07:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 1291619 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=BRtgwGCc; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 49Nzwh5gcGz9sTN for ; Sat, 16 May 2020 06:07:48 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726693AbgEOUHs (ORCPT ); Fri, 15 May 2020 16:07:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726632AbgEOUHo (ORCPT ); Fri, 15 May 2020 16:07:44 -0400 Received: from mail-qt1-x841.google.com (mail-qt1-x841.google.com [IPv6:2607:f8b0:4864:20::841]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D3E6C05BD09 for ; Fri, 15 May 2020 13:07:43 -0700 (PDT) Received: by mail-qt1-x841.google.com with SMTP id i68so3086155qtb.5 for ; Fri, 15 May 2020 13:07:43 -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=3r8s7zaQa/KQl7hgw/M/WA+lgPX3mns2yHevK22z30k=; b=BRtgwGCcFo61RZsb2/I16jAiD4ENgLTywxJXh2NnUISr13acvjJOUE5nvgRKZkmM90 wPV5jZALMt7CP2iveEOhtfs9XLAXOEPv2kijmh70T3xT/vcJ2//ofZVVy+PoCIH6l2OS E8j1OoCnwnuzIMqxwYf1ojxbGe5Wu74wMojaB0xOvgzMvmT5Xq+fvwXbkXg7f73FoyO6 3mDSEY11pCdeQ4ZTBVjlgLFBTB3xtPmbsx8Ww7y6u6HbxKNQGbok/SOT06yTQDAW7Y3v /5//7Xd92KriSkL0nhQXTlbbgFjB2iC1CAjD37fekwyOeBe8lt2OoVX4ULr/8U1YklFh P9Gg== 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=3r8s7zaQa/KQl7hgw/M/WA+lgPX3mns2yHevK22z30k=; b=nntWl3Iq7Y1pA2PA3x3ca3d/DBTiCJI3+O24LCHQCNrdtuSF46IDp2GSLSAOnFBhC3 2WHQ7GsJz+R92naIGo/Y1WZ9HVxxk+itE9hBhZ8+7s6K489e6YY2GBl7nyr2geN3ay1n tKTZ4mqcd7P683iIXq9g5wBsNrga3SRLm0QrbhliRWEcbH5GtuKByriVaRyIIvWr1b37 Zm6oSuFWjg0z6JCm3XZW5D+yCIxBnCw7wteZ6R0VZK6JsPKjIzlQI+UVkTSZkYwed2Uf k2RELZbH4mdlQkYKgTlPCsj2C/cO4tqDoglY/QZqHUdUIfMGonOHNNmYaq3/lfeHvJN3 CfCw== X-Gm-Message-State: AOAM531eiaHzXwPt7hPXjRDuLkISFw1MculS1Rv/5Sw8MmlDSPEd4MUG CV9qMxdiAtg6CY6mG00Bg2gykVEQoAI= X-Google-Smtp-Source: ABdhPJz+54fAQNJEeoaeaQPLvewzy1S/LrjWypbertBQ0Kd9eVZQrPTcNc5266QmcNbbuxxQ/rpHEQ== X-Received: by 2002:ac8:e8f:: with SMTP id v15mr5246054qti.391.1589573262634; Fri, 15 May 2020 13:07:42 -0700 (PDT) Received: from beast.localdomain (c-73-185-129-58.hsd1.mn.comcast.net. [73.185.129.58]) by smtp.gmail.com with ESMTPSA id 132sm2328246qkj.117.2020.05.15.13.07.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 May 2020 13:07:42 -0700 (PDT) From: Alex Elder To: davem@davemloft.net Cc: evgreen@chromium.org.net, subashab@codeaurora.org, cpratapa@codeaurora.org, bjorn.andersson@linaro.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next 2/2] net: ipa: do not clear interrupt in gsi_channel_start() Date: Fri, 15 May 2020 15:07:31 -0500 Message-Id: <20200515200731.2931-3-elder@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200515200731.2931-1-elder@linaro.org> References: <20200515200731.2931-1-elder@linaro.org> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org In gsi_channel_start() there is harmless-looking comment "Clear the channel's event ring interrupt in case it's pending". The intent was to avoid getting spurious interrupts when first bringing up a channel. However we now use channel stop/start to implement suspend and resume, and an interrupt pending at the time we resume is actually something we don't want to ignore. The very first time we bring up the channel we do not expect an interrupt to be pending, and even if it were, the effect would simply be to schedule NAPI on that channel, which would find nothing to do, which is not a problem. Stop clearing any pending IEOB interrupt in gsi_channel_start(). That leaves one caller of the trivial function gsi_isr_ieob_clear(). Get rid of that function and just open-code it in gsi_isr_ieob() instead. This fixes a problem where suspend/resume IPA v4.2 would get stuck when resuming after a suspend. Signed-off-by: Alex Elder --- drivers/net/ipa/gsi.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/drivers/net/ipa/gsi.c b/drivers/net/ipa/gsi.c index 66570609c845..d343dc94cb48 100644 --- a/drivers/net/ipa/gsi.c +++ b/drivers/net/ipa/gsi.c @@ -238,11 +238,6 @@ static void gsi_irq_ieob_enable(struct gsi *gsi, u32 evt_ring_id) iowrite32(val, gsi->virt + GSI_CNTXT_SRC_IEOB_IRQ_MSK_OFFSET); } -static void gsi_isr_ieob_clear(struct gsi *gsi, u32 mask) -{ - iowrite32(mask, gsi->virt + GSI_CNTXT_SRC_IEOB_IRQ_CLR_OFFSET); -} - static void gsi_irq_ieob_disable(struct gsi *gsi, u32 evt_ring_id) { u32 val; @@ -777,7 +772,6 @@ static void gsi_channel_deprogram(struct gsi_channel *channel) int gsi_channel_start(struct gsi *gsi, u32 channel_id) { struct gsi_channel *channel = &gsi->channel[channel_id]; - u32 evt_ring_id = channel->evt_ring_id; int ret; mutex_lock(&gsi->mutex); @@ -786,9 +780,6 @@ int gsi_channel_start(struct gsi *gsi, u32 channel_id) mutex_unlock(&gsi->mutex); - /* Clear the channel's event ring interrupt in case it's pending */ - gsi_isr_ieob_clear(gsi, BIT(evt_ring_id)); - gsi_channel_thaw(channel); return ret; @@ -1093,7 +1084,7 @@ static void gsi_isr_ieob(struct gsi *gsi) u32 event_mask; event_mask = ioread32(gsi->virt + GSI_CNTXT_SRC_IEOB_IRQ_OFFSET); - gsi_isr_ieob_clear(gsi, event_mask); + iowrite32(event_mask, gsi->virt + GSI_CNTXT_SRC_IEOB_IRQ_CLR_OFFSET); while (event_mask) { u32 evt_ring_id = __ffs(event_mask);