Skip to contentSkip to conversation

wifi: rtl8xxxu: 8188f: no need to initialize interrupts

PATCH In review Kevin Lo 3 participants 5 messages Apr 28, 2023 – May 5, 2023 RTL8XXXU wireless driver (rtl8xxxu)

lore
Share & tools
lore

Kevin Lo

author
#0 lore raw

PATCH v2 1/1 wifi: rtl8xxxu: 8188f: no need to initialize interrupts

There's no need to initialize interrupts for RTL8188FTV like the vendor driver.

---
v2:
- Fix my email address.
---

drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c +1 -4
index 620a5cc2bfdd..7f620dc47ee0 100644
@@ -4023,9 +4023,6 @@ static int rtl8xxxu_init_device(struct ieee80211_hw *hw)
 	if (priv->rtl_chip == RTL8192E) {
 		rtl8xxxu_write32(priv, REG_HIMR0, 0x00);
 		rtl8xxxu_write32(priv, REG_HIMR1, 0x00);
-	} else if (priv->rtl_chip == RTL8188F) {
-		rtl8xxxu_write32(priv, REG_HISR0, 0xffffffff);
-		rtl8xxxu_write32(priv, REG_HISR1, 0xffffffff);
 	} else if (priv->rtl_chip == RTL8188E) {
 		rtl8xxxu_write32(priv, REG_HISR0, 0xffffffff);
 		val32 = IMR0_PSTIMEOUT | IMR0_TBDER | IMR0_CPWM | IMR0_CPWM2;
@@ -4035,7 +4032,7 @@ static int rtl8xxxu_init_device(struct ieee80211_hw *hw)
 		val8 = rtl8xxxu_read8(priv, REG_USB_SPECIAL_OPTION);
 		val8 |= USB_SPEC_INT_BULK_SELECT;
 		rtl8xxxu_write8(priv, REG_USB_SPECIAL_OPTION, val8);
-	} else {
+	} else if (priv->rtl_chip != RTL8188F) {
 		/*
 		 * Enable all interrupts - not obvious USB needs to do this
 		 */
#1 lore raw
Quoted 3 lines · Kevin Lo

There's no need to initialize interrupts for RTL8188FTV like the vendor driver.

Why do this, what's the benefit? Or is this just a theoretical fix. The commit log should explain this.

Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
author
#2 lore raw
Quoted 9 lines · Kalle Valo
Quoted 3 lines · Kevin Lo

There's no need to initialize interrupts for RTL8188FTV like the vendor driver.

Why do this, what's the benefit? Or is this just a theoretical fix. The commit log should explain this.

If I understand correctly, just like rtw88 usb devices, rtl8xxxu has no hardware interrupt.

#3 lore raw
Quoted 16 lines

-----Original Message-----
From: Kevin Lo <[email protected]>
Sent: Friday, April 28, 2023 2:35 PM
To: Kalle Valo <[email protected]>
Cc: [email protected]; Bitterblue Smith <[email protected]>; Jes Sorensen <[email protected]>; Ping-Ke Shih <[email protected]>
Subject: Re: [PATCH v2] wifi: rtl8xxxu: 8188f: no need to initialize interrupts

Quoted 5 lines · Kalle Valo
Quoted 2 lines · Kevin Lo

There's no need to initialize interrupts for RTL8188FTV like the vendor driver.

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

Why do this, what's the benefit? Or is this just a theoretical fix. The commit log should explain this.

If I understand correctly, just like rtw88 usb devices, rtl8xxxu has no hardware interrupt.

With/without hardware interrupt, it depends on IMR (interrupt mask register) setting. If it is enabled, driver can receive C2H, PS indicators, and beacon TBTT events via certain USB endpoint. But, normally vendor driver doesn't use them neither.

Why it initializes interrupt in this patch is to reset ISR (interrupt status register) to avoid unexpected interrupts are received. So, if it doesn't really enable interrupt by IMR, I suppose it should work well even without this patch.

Kevin, could I know the real problem you met?

Ping-Ke

author
#4 lore raw
Quoted 31 lines · Ping-Ke Shih
Quoted 17 lines

-----Original Message-----
From: Kevin Lo <[email protected]>
Sent: Friday, April 28, 2023 2:35 PM
To: Kalle Valo <[email protected]>
Cc: [email protected]; Bitterblue Smith <[email protected]>; Jes Sorensen <[email protected]>; Ping-Ke Shih <[email protected]>
Subject: Re: [PATCH v2] wifi: rtl8xxxu: 8188f: no need to initialize interrupts

Quoted 5 lines · Kalle Valo
Quoted 2 lines · Kevin Lo

There's no need to initialize interrupts for RTL8188FTV like the vendor driver.

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

Why do this, what's the benefit? Or is this just a theoretical fix. The commit log should explain this.

If I understand correctly, just like rtw88 usb devices, rtl8xxxu has no hardware interrupt.

With/without hardware interrupt, it depends on IMR (interrupt mask register) setting. If it is enabled, driver can receive C2H, PS indicators, and beacon TBTT events via certain USB endpoint. But, normally vendor driver doesn't use them neither.

Quoted 6 lines

Why it initializes interrupt in this patch is to reset ISR (interrupt status register) to avoid unexpected interrupts are received. So, if it doesn't really enable interrupt by IMR, I suppose it should work well even without this patch.

Kevin, could I know the real problem you met?

Ping-Ke, many thanks for the clear explanation.

I didn't encounter any problems. As you mentioned, while the vendor driver doesn't have IMR settings, there is no harm in initializing interrupts. Please drop this patch, thanks.

Quoted 1 line

Ping-Ke

Regards,
Kevin