Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp109476ybg; Mon, 8 Jun 2020 17:52:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxacbJc0Kn/hCh7HmwJ9IOyPlIm/jEXYzUSYNVXJizEwCiBcM9paGHtCW8LqNFhSBo1/Nau X-Received: by 2002:a17:906:9254:: with SMTP id c20mr24243441ejx.540.1591663922669; Mon, 08 Jun 2020 17:52:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591663922; cv=none; d=google.com; s=arc-20160816; b=HQgx0v1h9qu0XBbRdnD01GBROXhyRAZ7L1VGgPdL8vqd2JrfxWeVu3B6RVJISMG9ip KlznlSQCoOo9ThMSCxzl5Og7nJ/ngd0Axvjx80fl3kpwt57RU3fD5QrXCc9Tv9EFJZ5l bPb3C0LLmA1Gu7A9+b4xdb1TXthL23q8x1WvnE+PLQZJ2Ehi7LMh8pn/KoO+fku2EiFa 64oUtfee9YTcj4s97vhn+zZ7efu4Baemogh8yTd8KnCOb1rNaZQ7yeFrJ9aSoVCRjBTi 4uVzdgEcLK6OoOt9tgsy+KdkOGv+e3FynTnENDg2jP8mocjCKAjYQdJjZutbZzPHCrOW mj5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=aXE7EgtAhgD24anDXLe1P6u9oF1DF/EWe2R7gGYzwcg=; b=LZ8v+p8/n4LoLUUZ/046U5pePmgYxOxpSrBiKJxDEptrnVzGsHALEvSywx1eGRr3UN oINZo/iDLbgIQ25DVbfbBhl0LPQyommncR6o5/GbTUg3OObDApniCEoYXwbgTU5PujsB KUX98hAh6vkmdGMbBNpk5cQAzCJ/t9Nzmbw41alFMn0Y7wrwwYIPkV5ngv54mi3H0jYo PU17JZNLNwuiVz3vQ2lTafODHS2RqByaV/Xbsu1BrmGHL0fRiaX/j+mFPwTDDlll8+Uy 6+596cWBOAeEkf7Kb6+EQ/WlniCTtQlnKlk1w4iFuEQJllfDSVm0kk/01KnnFsocTVA1 G1gg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=snqut+Tl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 6si10141502edp.594.2020.06.08.17.51.36; Mon, 08 Jun 2020 17:52:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@kernel.org header.s=default header.b=snqut+Tl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732660AbgFIAtp (ORCPT + 99 others); Mon, 8 Jun 2020 20:49:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:56910 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728740AbgFHXKl (ORCPT ); Mon, 8 Jun 2020 19:10:41 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1DDF8208FE; Mon, 8 Jun 2020 23:10:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591657841; bh=/WXHUUPc1w97z44Y0YVUkz4p30wFHJ30MGCDQ+SgazA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=snqut+Tl/I+yd/9hD/fbPvVLEMVTIXg20kbpJsJfHLdMNak9uUFjDcs1/CdKm982P axEI+dM5VUtgpqtQ1Uw7Sp6Smw49Uha+cUUb/ms3pkaXXLbIprktRWumWPjWwNqYdr Q7TRwqhmGqNBN8jzkjeFUR01c5AnoVb9kEMcZC/k= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Alex Elder , "David S . Miller" , Sasha Levin , netdev@vger.kernel.org Subject: [PATCH AUTOSEL 5.7 209/274] net: ipa: do not clear interrupt in gsi_channel_start() Date: Mon, 8 Jun 2020 19:05:02 -0400 Message-Id: <20200608230607.3361041-209-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200608230607.3361041-1-sashal@kernel.org> References: <20200608230607.3361041-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alex Elder [ Upstream commit 195ef57f870070cb02f2f3b99a63d69e8e8f798e ] 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 Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- 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 8d9ca1c335e8..043a675e1be1 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; @@ -756,7 +751,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); @@ -765,9 +759,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; @@ -1071,7 +1062,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); -- 2.25.1