Received: by 2002:ac0:b08d:0:0:0:0:0 with SMTP id l13csp3477349imc; Sun, 24 Feb 2019 06:06:13 -0800 (PST) X-Google-Smtp-Source: AHgI3Ib4mc4o7x4y8gAoEVcprw0jIgztRpJQyv2OaS2f/ylmAipuHzIsFcYUIpWNJR5X5xpO6XWr X-Received: by 2002:aa7:8205:: with SMTP id k5mr5727486pfi.86.1551017173321; Sun, 24 Feb 2019 06:06:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551017173; cv=none; d=google.com; s=arc-20160816; b=oz6L05TS9GBGlrWex11KYwXQ5HJeysMlBPsKB3zD0Ns4l4Gvj+lkVGGb8zGolJCbjb NQ/9HbSl+tL5hJ6EzAmzp2+CyItFVvwNsFIeCUfCgRx7wCumGcAI+Vl+KMjtqeQ/aQWc wnMRNCxZrS10ZrVquc8WzIGC/pPxo7am3GdMIhukbFp1QOdb1+KmEpEWUObjnLacJwtR 6EyNkiUmPLD/o5n8yJezWNhg8CEN9lY+/LL9YHWVtM7cOBzLsGYLTExnoROTcdzCyMjX WK3QaCYsL3iJ7tuT7rzfGVwnKUQhUXOH2u9paUPD7jpxujlo6E8bmv0aR85siQaOWQc5 CkNQ== 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; bh=5ieaUABENjnbcJS3FtTeNKMI+MYmOiB7Bb8PzKgfrYo=; b=WXHJq9gYYy7X0Yx3+WWLz6E/xqW9pt6ObpkrsEiEWYs8dm5Ltz0hCLQww+IiDI0DNl cfEMUL/LME8pIccEUVlpghDMHilq0Hit45fuEQrwOoi/XtgtuJNw+Q2wCTo+8mjZUlNm DkvFzXjoqrMh2iwlpfZR0j+oIMrEb6jbVu8y9rm3pVORK9EpabwsMYf0mKG9hYTJ42Tr 9JG0p47+By8cSFqez6Ujn4h0hr90wDQLivaJ0KrUeRFlxKlzeKhVImqe45mLVv14MI6Y GzQduZqyRSB8cPuWyghO4+mYU2ELdYGoFO8LIsDWIej8UWwYtkMXOZ8qEoj8ujklCY6R rSxQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y8si6208248pfm.31.2019.02.24.06.05.53; Sun, 24 Feb 2019 06:06:13 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728465AbfBXOFV (ORCPT + 99 others); Sun, 24 Feb 2019 09:05:21 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:52520 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728409AbfBXOFT (ORCPT ); Sun, 24 Feb 2019 09:05:19 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3950E16A3; Sun, 24 Feb 2019 06:05:19 -0800 (PST) Received: from why.lan (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1AF9E3F690; Sun, 24 Feb 2019 06:05:15 -0800 (PST) From: Marc Zyngier To: Amitkumar Karwar , Enric Balletbo i Serra , Ganapathi Bhat , Heiko Stuebner , Kalle Valo , Nishant Sarmukadam , Rob Herring , Xinming Hu Cc: "David S. Miller" , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH 3/4] mwifiex: Flag wake-up interrupt as IRQ_NOAUTOEN rather than disabling it too late Date: Sun, 24 Feb 2019 14:04:25 +0000 Message-Id: <20190224140426.3267-4-marc.zyngier@arm.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190224140426.3267-1-marc.zyngier@arm.com> References: <20190224140426.3267-1-marc.zyngier@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The mwifiex driver makes unsafe assumptions about the state of the wake-up interrupt. It requests it and only then disable it. Of course, the interrupt may be screaming for whatever reason at that time, and the handler will then be called without the interrupt having been registered with the PM/wakeup subsystem. Oops. The right way to handle this kind of situation is to flag the interrupt with IRQ_NOAUTOEN before requesting it. It will then stay disabled until someone (the wake-up subsystem) enables it. Signed-off-by: Marc Zyngier --- drivers/net/wireless/marvell/mwifiex/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/marvell/mwifiex/main.c b/drivers/net/wireless/marvell/mwifiex/main.c index 2105c2b7c627..82cf35e50579 100644 --- a/drivers/net/wireless/marvell/mwifiex/main.c +++ b/drivers/net/wireless/marvell/mwifiex/main.c @@ -1610,6 +1610,7 @@ static void mwifiex_probe_of(struct mwifiex_adapter *adapter) "wake-up interrupt outside 'wake-up' subnode of %pOF\n", adapter->dt_node); + irq_set_status_flags(adapter->irq_wakeup, IRQ_NOAUTOEN); ret = devm_request_irq(dev, adapter->irq_wakeup, mwifiex_irq_wakeup_handler, IRQF_TRIGGER_LOW, "wifi_wake", adapter); @@ -1619,7 +1620,6 @@ static void mwifiex_probe_of(struct mwifiex_adapter *adapter) goto err_exit; } - disable_irq(adapter->irq_wakeup); if (device_init_wakeup(dev, true)) { dev_err(dev, "fail to init wakeup for mwifiex\n"); goto err_exit; -- 2.20.1