From patchwork Wed Oct 19 08:25:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 4900 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp225567wrs; Wed, 19 Oct 2022 02:43:26 -0700 (PDT) X-Google-Smtp-Source: AMsMyM53rww+Qxm//pid7GfvgxmtCzNXOl+BWjl3lkdePM7xhdV8Ydsxcsq4t2bhhwUXjRQNGsIq X-Received: by 2002:a17:907:3181:b0:787:d81c:a6ad with SMTP id xe1-20020a170907318100b00787d81ca6admr5941499ejb.769.1666172606038; Wed, 19 Oct 2022 02:43:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666172606; cv=none; d=google.com; s=arc-20160816; b=ZW39d505Zui/o1IlKNPj7nRTD/arvWAnlqq4ex+BRRSycD3wEQlC8IBzRwEvqD2Wr5 HTMnEqv9855sUsdb10KkOY9WDGx2Sy0PSE5YwQ7bzWDshDqCzyPuigDjG/D25Vv141JC JfkEin6bUkZRkr4joBJvDdxwt4qA+8XDQqa++yjL9UMcW5wXA5EMCcckZYTJZTW2Tbnh YNVF6D7NTMmMlFc6kRLRCfWsicJeGJJzHTfhwDmoDXDNrOKC11ro2HA/TGW8yhZXHztG T9RH73BbpVkX4l3A4FzY1W2l4c+YSrhFdaqjMzaghNLYKmmYM4SbmL8AKUs8NLAny56A 7SuQ== 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 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.42.58; Wed, 19 Oct 2022 02:43:26 -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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747108606930833659?= X-GMAIL-MSGID: =?utf-8?q?1747108606930833659?= 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; }