Received: by 2002:a05:622a:251a:b0:39a:b4a2:e86 with SMTP id cm26csp316907qtb; Wed, 19 Oct 2022 02:44:37 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4aHpaodQg5a5vVs8BIfIF6vB9f+0Dul0AFDopEkeKbaJeh9w21JqpLNt6xZp+Zv/2rPRFF X-Received: by 2002:a17:907:7fa4:b0:791:9307:9d6a with SMTP id qk36-20020a1709077fa400b0079193079d6amr5985249ejc.464.1666172677653; Wed, 19 Oct 2022 02:44:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666172677; cv=none; d=google.com; s=arc-20160816; b=DT33NvBLvg20WTwD8Xza6fC5zQN0bTvWEoCsUg4EQGGrIdx7fGCzWAPo8TgKBo8OLK mNXffZzTvIrtpv5tdpcwRQYRgMqsq/pz5z93IMzleO2yzDBb8TYjJEpWWWq7Sf0fW7+/ jx0aAsGvxRyzerl88JglIH5ZmYDz2Sz8wf8lPYL/Bu+e9yG039amuhYOhyHw8jxoRYMh cXLp6A3TIaJesooI0MAkfsGpgShW6sIMxnAfpI9bg8dNLPJw0tGPbDJURoMsnXcB2GJ8 xbnLZBcKO0C7GkQ9Ml1eln8UB56Rd5HRcs2mCIDRh2CnE1CrqxYvG+0rWlFpqBQ86HhP FR0Q== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=YpXg8/w1vmZARK6nmwtXr1AHLKukkApciuM0pi3pCjE=; b=L0tM38vney9YJwLDqWJoAyuPXsZTx97fl+0tW8v/f9ayJV/yYsoP2lJfkh+i00i/dU mMxXBD8S3lPKm8zOgG6p0RfbmMWAzVfhc32K0ddYxGEX2IaAPUSlB92/by1M04ghD+PE XgZPONXlmYDm09r7Ce95uWLaaxO8p8WibMChy4rzO2C9ToEtojPfIuvYzDE5l09Q8XS1 f76dYOSfs/pkYQ61QWhRc8U3yRYA4ZJaVQ2e9HSLqK8cfsz++z/shS9GC5Rk7CQbIFIR gE+la8FfuCLdPtqpYjOFET01eMCx2C2ZZfUbfT607R9jlUYO4oievVI3SD+uZLO8+99j 9Stw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=AkkoVOIe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qf22-20020a1709077f1600b0073fc8e72882si13540939ejc.28.2022.10.19.02.44.00; Wed, 19 Oct 2022 02:44:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=AkkoVOIe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230064AbiJSJfE (ORCPT + 99 others); Wed, 19 Oct 2022 05:35:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47870 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233843AbiJSJ3i (ORCPT ); Wed, 19 Oct 2022 05:29:38 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 246C0BBF26; Wed, 19 Oct 2022 02:13:12 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 009D9617B0; Wed, 19 Oct 2022 08:49:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 15C93C433D6; Wed, 19 Oct 2022 08:49:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666169397; bh=ofERgBikDVQ+ar+COdBWG8wzBxL4NHGfWH2UTVp+d7Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AkkoVOIeJYzvZCRT1cQ97KZrI4AYsyObrrRV1RPDDu4qsg9HsdKqM/3txwmaOtZOe Km0uJTUBE59zmaxweMaTVELuwi0aC5suQfBNs9eRJ4syBCyJoJJhy7cMbSv49mGwK0 M5YrNpxm83GO8cP/eVKCCrrxBAwxg6sbfzGdRA8k= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ping-Ke Shih , Kalle Valo , Sasha Levin Subject: [PATCH 6.0 260/862] wifi: rtw89: pci: fix interrupt stuck after leaving low power mode Date: Wed, 19 Oct 2022 10:25:47 +0200 Message-Id: <20221019083301.537271863@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ping-Ke Shih [ Upstream commit b7e715d3dcd2e9fa3a689ba0dd7ab85f8aaf6e9a ] We turn off interrupt in ISR, and re-enable interrupt in threadfn or napi_poll according to the mode it stays. If we are turning off interrupt, rtwpci->running flag is unset and interrupt handler stop processing even if it was called, so disallow to re-enable interrupt in this situation. Or, wifi chip doesn't trigger interrupt events anymore because interrupt status (ISR) isn't clear by interrupt handler anymore. Fixes: c83dcd0508e2 ("rtw89: pci: add a separate interrupt handler for low power mode") Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220824063312.15784-1-pkshih@realtek.com Signed-off-by: Sasha Levin --- drivers/net/wireless/realtek/rtw89/pci.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/realtek/rtw89/pci.c b/drivers/net/wireless/realtek/rtw89/pci.c index c68fec9eb5a6..8a093e1cb328 100644 --- a/drivers/net/wireless/realtek/rtw89/pci.c +++ b/drivers/net/wireless/realtek/rtw89/pci.c @@ -760,7 +760,8 @@ static irqreturn_t rtw89_pci_interrupt_threadfn(int irq, void *dev) enable_intr: spin_lock_irqsave(&rtwpci->irq_lock, flags); - rtw89_chip_enable_intr(rtwdev, rtwpci); + if (likely(rtwpci->running)) + rtw89_chip_enable_intr(rtwdev, rtwpci); spin_unlock_irqrestore(&rtwpci->irq_lock, flags); return IRQ_HANDLED; } -- 2.35.1