From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2E19A3C198D for ; Mon, 8 Jun 2026 13:54:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780926865; cv=none; b=VhFXOkXAfLN2xf6Tl25wig0wSD1D/t+sVjAj7BJ7ISe/CetBD1rehxOCO6w/HxNuIV6o64re3fvovpXv0NxAzbxR/81sh86KoMi5N/cYJ8yPfNXzK1XnCzMP2H6USAV9fNTBmGpFh4bSv+Xni4Wf3DJ5AFvb8Dssl4nDoJ9WUrY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780926865; c=relaxed/simple; bh=WRM6rnm0YRU9zIEhu6olPs9K+uYsva+VYcdLLXprDfY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=MzF1Arhxttb1mGaRyskvy69KXIHMxq+vraEBD1B1hPIcnZFdgU4Hk9AHO2hfb7R6q8/MSJe0BQGLM5GfcknfQG9MzXMEFfTB0c30tarNhMUW5bIR+2eAlYGiO88NrHnuH6aYZMY8aeUosQ3X2AEfscURuwBjsAyodnPAhIEFxDQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=CowFtsuX; arc=none smtp.client-ip=209.85.128.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="CowFtsuX" Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-490b1bbcf3aso35674695e9.1 for ; Mon, 08 Jun 2026 06:54:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1780926862; x=1781531662; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=PXD1hmtAJBOKntNEa4d1CS66NTtiC54GCzkhUezAbnA=; b=CowFtsuXsI2n5yX/XQwBvBEItN5OFYanMsi2nzoBkX/uyhX4LY4kfib9VggDhmI2hz VWLPvvuDGzTU2X0+d8heiBo+GJ2zCHrzYF8x5eULcE2JuQlNKcnyb7rhOX78Nv7wfpU6 zULJMY6lr5pDojO32920HWruEqTCrlmJIE64kZBvTl93lxi/dM7+7k46UfwzkkAT2KNy +c06Qc8W5xZNZwDKG2bpdJ/34LPizgojrW3Qpfw8P1HexY8eBeTWkawECMPxicm994Ea PRAoGM4oYI2rAIJcqHBgi4Ukh2r1fzu693caZYuWICYBrLx/yNQEuOAMz9flH7EzVKYo /0UA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780926862; x=1781531662; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=PXD1hmtAJBOKntNEa4d1CS66NTtiC54GCzkhUezAbnA=; b=USh7pWXp6pxaEljiZ8KPsSeSzQhStp0yJh7YFF/DnrFWYojaB2tEDd3YWouwv9s/8n u5hMOZFBP4+fOFaOWwerbctB2YvrI0XwPntF5VsERrqDxn2N0OtsTxk+dnlrEI28Qzka wLKBIhrWYHc96nUdN4JseiYChEPsHQaSANT7R+z0N0KhKa++0q8kui8s0Shf1vPvyLb8 NsiDUExJLwkLYbpL2HMpj6W+3kqiJJRiDunquKm2NfMnC8aVjzpPK5KU9cO30k+L0GOV yPGeiLKogue9+6Wzr6KG9HWyFcrxZwH4AuaVf/QWENla7V6VHYFAbX+mhq8Gfh5FgXd8 5KRg== X-Forwarded-Encrypted: i=1; AFNElJ+Q4ZedynNh59XuFtabQANkJFkwSxLKZrb1auxoKUF/4o08r/aV43v+LEYuPN1fl+9rmdtathPdGbrJrjk=@vger.kernel.org X-Gm-Message-State: AOJu0YxnW6LcvpdPq0YpXeOLjT/bkwRT9idl3vNWv8Nd8lAqPlmrEDMA k8gjulv+TYEKiSoxuHRqWfQetN6mTVqACYIcJPR5zWk6RYGno3FgXTA0 X-Gm-Gg: Acq92OHUbyd6bHNYuWuoPowmiTj1SSbSMJtI7KVw/QBhtlOsnvXihYseieD9q34bFOl n7P2b7cJy5kEFoTZsvh6iZlF76xZFf0Ea8kuzEs4Xj0Da5p1M63LvY8Qwc8IUGwXn5tu+qmgtGG C7FNNdHnIBI0/C0hBFJyT1e5kVAdcOrpKKpVVVXGmpNVghjSr6eOicQEn1XpDgWg/9/f5Ag9L+V BWF19LRWRTkLKUy4FffWvwweY4NyYJOrlITXYNO6sSTOmIt4yvULw8GIOUhvrN42c5NCthvbHUj D/AjGTmBTm6KbdakphfBBEBXSBFnhNyUH9lQbtu6pwkQIlqUUhkbv4+WEtAsa6sJ37OQ2sGg7Rp MfK8VDGpZ854EnKSfR+s2gXVPVMYOZMt4cmLQSUQknsETAgbXHE8XvRQJ+fcEgHe2kJ8vVOSjCZ i9v5Lg1u0h84QkGeaTJiMK7n3uGhQay8UrWlnuFHA3d6Vp X-Received: by 2002:a05:600c:8216:b0:490:688b:f9f8 with SMTP id 5b1f17b1804b1-490c261ad21mr253671525e9.27.1780926862225; Mon, 08 Jun 2026 06:54:22 -0700 (PDT) Received: from localhost ([80.208.66.169]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4602cda3651sm41066099f8f.32.2026.06.08.06.54.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jun 2026 06:54:21 -0700 (PDT) From: William Hansen-Baird X-Google-Original-From: William Hansen-Baird To: pkshih@realtek.com Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, William Hansen-Baird Subject: [PATCH] wifi: rtlwifi: rtl8723be: Remove unnecessary irq save/restore in hw_init() Date: Mon, 8 Jun 2026 15:53:47 +0200 Message-ID: <20260608135345.2526325-3-williamhb+k@fastmail.com> X-Mailer: git-send-email 2.54.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit rtl8723be hw_init() calls local_save_flags(flags) followed by local_irq_enable(). Later, local_irq_restore(flags) is called. This causes warnings from Lockdep on boot and modprobe, as local_irq_restore(flags) should only be called while irqs are disabled. With testing I found that all paths which call hw_init() have irqs already enabled for rtl8723be. Furthermore, the calls were originally added for the rtl8192ce in commit f78bccd79ba3 ("rtlwifi: rtl8192ce: Fix too long disable of IRQs") before later being added to most other rtlwifi drivers. Commit d3feae41a347 ("rtlwifi: Update power-save routines for 062814 driver") then replaces the call to spin_lock_irqsave() before hw_init(), and thus the codepath which caused irqs to be disabled in hw_init and prompted the original commit has been removed. The same irq save/restore pattern is also present in the hw_init() of rtl8192ce, rtl8723ae, rtl8188ee, rtl8192se and rtl8192cu, however I don't have the hardware to test them, so I did not include them in my changes. Tested on a Razer Blade 14 2017. Example of output from Lockdep prior to fix: [ 2305.476471] raw_local_irq_restore() called with IRQs enabled ... [ 2305.478709] Call Trace: [ 2305.478731] [ 2305.478753] rtl8723be_hw_init+0x5992/0x7220 [rtl8723be] [ 2305.478798] ? static_obj+0x61/0xa0 [ 2305.478848] rtl_pci_start+0x222/0x5c0 [rtl_pci] [ 2305.478891] rtl_op_start+0x128/0x1a0 [rtlwifi] [ 2305.478940] ? __kasan_check_read+0x11/0x20 [ 2305.480082] drv_start+0x16c/0x550 [mac80211] ... [ 2305.570855] irq event stamp: 887679 [ 2305.571569] hardirqs last enabled at (887689): [] __up_console_sem+0x90/0xa0 [ 2305.572347] hardirqs last disabled at (887698): [] __up_console_sem+0x75/0xa0 [ 2305.573076] softirqs last enabled at (887670): [] __irq_exit_rcu+0x175/0x2f0 [ 2305.573817] softirqs last disabled at (887649): [] __irq_exit_rcu+0x175/0x2f0 [ 2305.574636] ---[ end trace 0000000000000000 ]--- Link: https://lore.kernel.org/all/20210111153707.10071-1-mark.rutland@arm.com/ Signed-off-by: William Hansen-Baird --- drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c index e1f811218894..bf7b5a32adaa 100644 --- a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c @@ -1333,11 +1333,6 @@ int rtl8723be_hw_init(struct ieee80211_hw *hw) bool rtstatus = true; int err; u8 tmp_u1b; - unsigned long flags; - - /* reenable interrupts to not interfere with other devices */ - local_save_flags(flags); - local_irq_enable(); rtlhal->fw_ready = false; rtlpriv->rtlhal.being_init_adapter = true; @@ -1443,7 +1438,6 @@ int rtl8723be_hw_init(struct ieee80211_hw *hw) rtl8723be_dm_init(hw); exit: - local_irq_restore(flags); rtlpriv->rtlhal.being_init_adapter = false; return err; } -- 2.54.0