From patchwork Sat Oct 22 07:21:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7269 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1091891wrr; Sat, 22 Oct 2022 00:52:10 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6UN0MvJVOLy+OWjuNN0YDIotea3S7PFQZ2+8sGp+iaZIxwiVJluz/+p/ntMwclutVxbM7t X-Received: by 2002:a63:1e21:0:b0:43a:b17f:cd13 with SMTP id e33-20020a631e21000000b0043ab17fcd13mr19631868pge.553.1666425130420; Sat, 22 Oct 2022 00:52:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666425130; cv=none; d=google.com; s=arc-20160816; b=TpBCWUDrS0tkfEj0+BhIueYIjRTEHCQA1v8IfFjkChYtGFh/aQCu9NTFudn/sUsC2P vtmC7QFEDt9ivO48FRl5F/IlExW2ZOMQ4fmsQKtLw13Kk463saW8mVj63x5JRCuCXQ5n paD2ktIwxxR6xPA8wPcSMqrOJT2wl7Ns6uAzwcb/W049ihqH1fD1y4274ZUdnOtIdBhs Qxb04xpmS0p7jqHzRSRzC/twl86mYC3F4274VuLZ/8Vkq+gU7YdfOF8vNXIIBfNgfXR+ dF8Jj6ouX1/19Z8vW7ifhjbHeHr4judj8PlaS54rmC+a849ImnXp06NgQ48hM/eqVtit Ii6w== 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=puHrylIcUQXyy+9n3X4N9ZP60S4cYHXsswaoYmVReJc=; b=dDYQq+l8pnMVpFMRB7B2cm54YbsQOiG3edYJbNuAFZ9Bm/1jFDc1OsxdjfTxUnwyWJ 9S2Iwb2Oa+9h5KabM4YaCUKyKQjbJUkUz8/Pw+3Na6yty1dMh3vV2QBo46Z0JZDl6hxN fnh2RN0wXsoCzv4mQbKlO2pTchi8vO8pk66/Ab2L5L0DH1mQ/XuEMc1a5n5UBMbUvicD fkwz3ZrNUT4ojTQnjD7lNEryoGVKq7gnMd7mXBrTVhDRi4f9+9vHEsc7lgrQShqpMFIj G1H4w5oNHqMD00GRzr3dEyI+26u3MWaSISy94zP1xNsjb4yBbu/KcvXI42pQ1tKbnz2V 7wcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Y0ZO2wB6; 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 j10-20020a056a00130a00b00564874e14e9si27957266pfu.280.2022.10.22.00.51.58; Sat, 22 Oct 2022 00:52:10 -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=Y0ZO2wB6; 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 S231928AbiJVHvi (ORCPT + 99 others); Sat, 22 Oct 2022 03:51:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231601AbiJVHsp (ORCPT ); Sat, 22 Oct 2022 03:48:45 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A3E817F9A5; Sat, 22 Oct 2022 00:45:26 -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 ams.source.kernel.org (Postfix) with ESMTPS id C5ED1B82E19; Sat, 22 Oct 2022 07:44:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1968CC433D6; Sat, 22 Oct 2022 07:44:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666424649; bh=ERDI38QKblPmR1f8XYJ2sDWZUWQpi0wgXYYc/TKJcSY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Y0ZO2wB6Z+ZbnzJfGbCReBmMYssYQTmTSb7xBZXW8PC1v0gCBChoZuLBqhiyTT/Ww BUQ+55sxg1nds0f09crFgkb51tlbbZHeYJVHlhmQFyy3GkCdcccCDhWx6qHDyCVNjv +JKCCNXZjX/CFPYffjlhYowpxqSpv7QS4MF4ROkg= 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 5.19 224/717] wifi: rtw89: pci: fix interrupt stuck after leaving low power mode Date: Sat, 22 Oct 2022 09:21:43 +0200 Message-Id: <20221022072454.761173516@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 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?1747373397123770486?= X-GMAIL-MSGID: =?utf-8?q?1747373397123770486?= 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 0ef7821b2e0f..622f95bc3ffc 100644 --- a/drivers/net/wireless/realtek/rtw89/pci.c +++ b/drivers/net/wireless/realtek/rtw89/pci.c @@ -756,7 +756,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; }