Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3610113pxb; Mon, 24 Jan 2022 13:28:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJzlSdYmLm0foNJfQLs7ByYvMMgoCwX1VnP6iBMrG+s2Ur7lIoNGHRs6uIiw47QMsaRzvNfX X-Received: by 2002:a17:90b:4c4a:: with SMTP id np10mr128418pjb.164.1643059694795; Mon, 24 Jan 2022 13:28:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643059694; cv=none; d=google.com; s=arc-20160816; b=kt0YJ6T9hX1UCvIX5g1s5BjvPW9XCVW+mRXCqLphplynCoqDQchu9yWGiBOvW+crnk FS3lF0LSfJ/zp4WLPtjfSV8nttmuRV2e0Dcmd+6kJoFwShfQszArjRFes5un42bNtCrE BjAy9SMlG/+SV9IqRm7/PsJ45pKKalmVDWWE1yvY0vb+2AWJwNJ/nvV+U9b//Za9xUog 6wZZrhUwvKklReCAuA/qMYr95Upw01Tys7v6KmKHLaZifzzFHHKPz0/JR6MRUobB3rCm eruMFFN7ihmO0AU4AOgnuyxcIjtajkNrzVyQrFnQPETKeLi2f4NYzYKdca6T0L2Kyeh+ 4aGQ== 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=7ovbVdrj9ZH7fC54X313g8TCRha+5dHUoql2FXPAQdM=; b=j80lhJo9NJvvcrxg0YosJk23U1IF8Yqe6Db0LDbx6pFs3c+ZgsuUb10IxcM2ocrP2C 2DJBxkAdBmpJKw0gPrlHjMRUdVZ11psdrvYp1L08uOLv0ZTSddBjHPA29p88pu3Fv+dx dfiOv3Y2fw7Y0nbL4xUHmLZzemWhbbng6fuMPpaJv6s2BovqrS4wg/xpl6acHU+U6+mt 9hEYfVrXhTpoyvQfS5JYpDDrZe+cX5AC/jjOfDcoshqNwd2l7Mxwmqfvv1Msudcyaugu JU2rzEKvHWQVv/ZnCs9r5UGycpnRc/j8sWf/Cq4J4x+vCyWc/Q3ipII9t9ZMMjPpV4a8 lsSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=HowtncY5; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v14si13194480pgk.382.2022.01.24.13.28.02; Mon, 24 Jan 2022 13:28:14 -0800 (PST) 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=@linuxfoundation.org header.s=korg header.b=HowtncY5; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353466AbiAXVDI (ORCPT + 99 others); Mon, 24 Jan 2022 16:03:08 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:35354 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1389010AbiAXUkW (ORCPT ); Mon, 24 Jan 2022 15:40:22 -0500 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 C771961372; Mon, 24 Jan 2022 20:40:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 87A91C340E5; Mon, 24 Jan 2022 20:40:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643056821; bh=+2CGRR58hyrC+e0/rwMd7vvHpmue7xOZCLaTjHMreKA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HowtncY5Wvn2XYoLYcUTR93HuOQXzuxp4HmNpYnkxAyjlr9sA9w7wEPkNgTRZSe1Q PSFVLH3Szc1Vv+WivTgPQ8JpoEjABKqHmcgdzZNxt8e5D0XfaQ3U6VWiczKKZuD6Xn vypnePK1SX1v3o14ne2zdalEoqDjhW9B0MgLq3HM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Luca Coelho , Sasha Levin Subject: [PATCH 5.15 579/846] iwlwifi: pcie: make sure prph_info is set when treating wakeup IRQ Date: Mon, 24 Jan 2022 19:41:36 +0100 Message-Id: <20220124184121.016112149@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184100.867127425@linuxfoundation.org> References: <20220124184100.867127425@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Luca Coelho [ Upstream commit 459fc0f2c6b0f6e280bfa0f230c100c9dfe3a199 ] In some rare cases when the HW is in a bad state, we may get this interrupt when prph_info is not set yet. Then we will try to dereference it to check the sleep_notif element, which will cause an oops. Fix that by ignoring the interrupt if prph_info is not set yet. Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211219132536.0537aa562313.I183bb336345b9b3da196ba9e596a6f189fbcbd09@changeid Signed-off-by: Luca Coelho Signed-off-by: Sasha Levin --- drivers/net/wireless/intel/iwlwifi/pcie/rx.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/rx.c b/drivers/net/wireless/intel/iwlwifi/pcie/rx.c index 8e45eb38304b2..fea89330f692c 100644 --- a/drivers/net/wireless/intel/iwlwifi/pcie/rx.c +++ b/drivers/net/wireless/intel/iwlwifi/pcie/rx.c @@ -2261,7 +2261,12 @@ irqreturn_t iwl_pcie_irq_msix_handler(int irq, void *dev_id) } } - if (inta_hw & MSIX_HW_INT_CAUSES_REG_WAKEUP) { + /* + * In some rare cases when the HW is in a bad state, we may + * get this interrupt too early, when prph_info is still NULL. + * So make sure that it's not NULL to prevent crashing. + */ + if (inta_hw & MSIX_HW_INT_CAUSES_REG_WAKEUP && trans_pcie->prph_info) { u32 sleep_notif = le32_to_cpu(trans_pcie->prph_info->sleep_notif); if (sleep_notif == IWL_D3_SLEEP_STATUS_SUSPEND || -- 2.34.1