* Lenovo LOQ rtw_8852be
[not found] <1700948088-16140-mlmmj-666d2532@vger.kernel.org>
@ 2023-11-25 21:35 ` Ali Ghandour
2023-11-27 1:42 ` Ping-Ke Shih
0 siblings, 1 reply; 15+ messages in thread
From: Ali Ghandour @ 2023-11-25 21:35 UTC (permalink / raw)
To: linux-wireless
Hi,
Following below thread, rtw_8852be driver fails for Lenovo LOQ:
https://github.com/lwfinger/rtw89/issues/235
rtw89_8852be 0000:09:00.0: loaded firmware rtw89/rtw8852b_fw-1.bin
rtw89_8852be 0000:09:00.0: Firmware version 0.29.29.5 (da87cccd), cmd
version 0, type 5
rtw89_8852be 0000:09:00.0: Firmware version 0.29.29.5 (da87cccd), cmd
version 0, type 3
rtw89_8852be 0000:09:00.0: MAC has already powered on
rtw89_8852be 0000:09:00.0: [ERR]pci config read 719
rtw89_8852be 0000:09:00.0: [ERR] pcie autok fail -22
rtw89_8852be 0000:09:00.0: failed to setup chip information
tw89_8852be: probe of 0000:09:00.0 failed with error -22
I am running Ubuntu 22.04.3 and kernel 6.2.0-37-generic.
Please advise.
Ali
^ permalink raw reply [flat|nested] 15+ messages in thread
* RE: Lenovo LOQ rtw_8852be
2023-11-25 21:35 ` Lenovo LOQ rtw_8852be Ali Ghandour
@ 2023-11-27 1:42 ` Ping-Ke Shih
2023-11-27 6:01 ` Ali Ghandour
0 siblings, 1 reply; 15+ messages in thread
From: Ping-Ke Shih @ 2023-11-27 1:42 UTC (permalink / raw)
To: Ali Ghandour, linux-wireless@vger.kernel.org
> -----Original Message-----
> From: Ali Ghandour <gandour.ali@gmail.com>
> Sent: Sunday, November 26, 2023 5:36 AM
> To: linux-wireless@vger.kernel.org
> Subject: Lenovo LOQ rtw_8852be
>
> Hi,
>
> Following below thread, rtw_8852be driver fails for Lenovo LOQ:
> https://github.com/lwfinger/rtw89/issues/235
>
> rtw89_8852be 0000:09:00.0: loaded firmware rtw89/rtw8852b_fw-1.bin
> rtw89_8852be 0000:09:00.0: Firmware version 0.29.29.5 (da87cccd), cmd
> version 0, type 5
> rtw89_8852be 0000:09:00.0: Firmware version 0.29.29.5 (da87cccd), cmd
> version 0, type 3
> rtw89_8852be 0000:09:00.0: MAC has already powered on
> rtw89_8852be 0000:09:00.0: [ERR]pci config read 719
> rtw89_8852be 0000:09:00.0: [ERR] pcie autok fail -22
> rtw89_8852be 0000:09:00.0: failed to setup chip information
> tw89_8852be: probe of 0000:09:00.0 failed with error -22
>
> I am running Ubuntu 22.04.3 and kernel 6.2.0-37-generic.
>
Not very sure why your host can't read PCI configuration space 0x719.
Please provide your PCI host controller by 'lspci -tv'.
And, I wonder if user space tool 'lspci' can dump whole PCI configuration
space on your platform, so please provide full dump by
'sudo lspci -s xx:yy.zz -xxxx'
(you can get the device number followed '-s' by 'lspci', and copy the number, like)
03:00.0 Network controller: Realtek Semiconductor Co., Ltd. Device b852
After kernel 5.18, we change to use standard pci API to read/write configuration
space, so if possible please downgrade to 5.17 to see if that version works to you.
Ping-Ke
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Lenovo LOQ rtw_8852be
2023-11-27 1:42 ` Ping-Ke Shih
@ 2023-11-27 6:01 ` Ali Ghandour
2023-11-27 6:19 ` Ali Ghandour
0 siblings, 1 reply; 15+ messages in thread
From: Ali Ghandour @ 2023-11-27 6:01 UTC (permalink / raw)
To: Ping-Ke Shih; +Cc: linux-wireless@vger.kernel.org
$ lspci -tv
-[0000:00]-+-00.0 Intel Corporation Device a715
+-01.0-[01-05]--+-00.0 NVIDIA Corporation Device 28e0
| \-00.1 NVIDIA Corporation Device 22be
+-02.0 Intel Corporation Device a7a8
+-04.0 Intel Corporation Device a71d
+-06.0-[06]----00.0 Micron Technology Inc Device 5411
+-06.2-[07]----00.0 MAXIO Technology (Hangzhou) Ltd. NVMe
SSD Controller MAP1202
+-0a.0 Intel Corporation Device a77d
+-14.0 Intel Corporation Alder Lake PCH USB 3.2 xHCI Host Controller
+-14.2 Intel Corporation Alder Lake PCH Shared SRAM
+-15.0 Intel Corporation Alder Lake PCH Serial IO I2C Controller #0
+-16.0 Intel Corporation Alder Lake PCH HECI Controller
+-19.0 Intel Corporation Alder Lake-P Serial IO I2C Controller #0
+-1c.0-[08]----00.0 Realtek Semiconductor Co., Ltd.
RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
+-1c.5-[09]----00.0 Realtek Semiconductor Co., Ltd. Device b852
+-1f.0 Intel Corporation Device 519d
+-1f.3 Intel Corporation Device 51ca
+-1f.4 Intel Corporation Alder Lake PCH-P SMBus Host Controller
\-1f.5 Intel Corporation Alder Lake-P PCH SPI Controller
$ sudo lspci -s 09:00.0 -xxxx
09:00.0 Network controller: Realtek Semiconductor Co., Ltd. Device b852
00: ec 10 52 b8 03 00 10 00 00 00 80 02 10 00 00 00
10: 01 30 00 00 00 00 00 00 04 00 10 52 00 00 00 00
20: 00 00 00 00 00 00 00 00 00 00 00 00 aa 17 53 48
30: 00 00 00 00 40 00 00 00 00 00 00 00 ff 01 00 00
40: 01 50 c3 c9 08 00 00 00 00 00 00 00 00 00 00 00
50: 05 70 80 00 00 00 00 00 00 00 00 00 00 00 00 00
60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
70: 10 00 02 00 81 8d 90 15 30 20 10 00 11 6c 47 00
80: 43 01 11 10 00 00 00 00 00 00 00 00 00 00 00 00
90: 00 00 00 00 10 08 0c 00 00 04 00 00 02 00 00 00
a0: 02 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00
b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=============================================
Dr. Ali J. Ghandour
Associate Researcher, GEOspatial Artificial Intelligence (GEOAI) group
National Remote Sensing Center – CNRS
Beirut, Lebanon
Phone: +961 (4)409845
Email: aghandour@cnrs.edu.lb - LinkedIn - GoogleScholar
On Mon, Nov 27, 2023 at 3:43 AM Ping-Ke Shih <pkshih@realtek.com> wrote:
>
>
>
> > -----Original Message-----
> > From: Ali Ghandour <gandour.ali@gmail.com>
> > Sent: Sunday, November 26, 2023 5:36 AM
> > To: linux-wireless@vger.kernel.org
> > Subject: Lenovo LOQ rtw_8852be
> >
> > Hi,
> >
> > Following below thread, rtw_8852be driver fails for Lenovo LOQ:
> > https://github.com/lwfinger/rtw89/issues/235
> >
> > rtw89_8852be 0000:09:00.0: loaded firmware rtw89/rtw8852b_fw-1.bin
> > rtw89_8852be 0000:09:00.0: Firmware version 0.29.29.5 (da87cccd), cmd
> > version 0, type 5
> > rtw89_8852be 0000:09:00.0: Firmware version 0.29.29.5 (da87cccd), cmd
> > version 0, type 3
> > rtw89_8852be 0000:09:00.0: MAC has already powered on
> > rtw89_8852be 0000:09:00.0: [ERR]pci config read 719
> > rtw89_8852be 0000:09:00.0: [ERR] pcie autok fail -22
> > rtw89_8852be 0000:09:00.0: failed to setup chip information
> > tw89_8852be: probe of 0000:09:00.0 failed with error -22
> >
> > I am running Ubuntu 22.04.3 and kernel 6.2.0-37-generic.
> >
>
> Not very sure why your host can't read PCI configuration space 0x719.
> Please provide your PCI host controller by 'lspci -tv'.
>
> And, I wonder if user space tool 'lspci' can dump whole PCI configuration
> space on your platform, so please provide full dump by
> 'sudo lspci -s xx:yy.zz -xxxx'
>
> (you can get the device number followed '-s' by 'lspci', and copy the number, like)
> 03:00.0 Network controller: Realtek Semiconductor Co., Ltd. Device b852
>
>
> After kernel 5.18, we change to use standard pci API to read/write configuration
> space, so if possible please downgrade to 5.17 to see if that version works to you.
>
> Ping-Ke
>
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Lenovo LOQ rtw_8852be
2023-11-27 6:01 ` Ali Ghandour
@ 2023-11-27 6:19 ` Ali Ghandour
2023-11-28 1:21 ` Ping-Ke Shih
0 siblings, 1 reply; 15+ messages in thread
From: Ali Ghandour @ 2023-11-27 6:19 UTC (permalink / raw)
To: Ping-Ke Shih; +Cc: linux-wireless@vger.kernel.org
seems like the same error persists after downgrading:
$ uname -r
5.17.0-1035-oem
$ sudo dmesg | grep rtw
[ 4.859848] rtw89_8852be 0000:09:00.0: loaded firmware
rtw89/rtw8852b_fw-1.bin
[ 4.860214] rtw89_8852be 0000:09:00.0: enabling device (0000 -> 0003)
[ 4.861546] rtw89_8852be 0000:09:00.0: Firmware version 0.29.29.5
(da87cccd), cmd version 0, type 5
[ 4.861550] rtw89_8852be 0000:09:00.0: Firmware version 0.29.29.5
(da87cccd), cmd version 0, type 3
[ 4.861556] rtw89_8852be 0000:09:00.0: MAC has already powered on
[ 4.867246] rtw89_8852be 0000:09:00.0: [ERR]pci config read 719
[ 4.867251] rtw89_8852be 0000:09:00.0: [ERR] pcie autok fail -22
[ 4.867254] rtw89_8852be 0000:09:00.0: failed to setup chip information
[ 4.867703] rtw89_8852be: probe of 0000:09:00.0 failed with error -22
[ 5.305458] Modules linked in: fjes(-) rtw_8852be(OE)
x86_pkg_temp_thermal intel_powerclamp rtw_8852b(OE) rtw89pci(OE)
rtw89core(OE) mac80211 libarc4 coretemp binfmt_misc wl(POE) mei_pxp
mei_hdcp intel_rapl_msr snd_hda_codec_hdmi nls_iso8859_1 kvm_intel
snd_hda_intel snd_intel_dspcfg snd_intel_sdw_acpi snd_hda_codec kvm
btusb snd_hda_core snd_hwdep btrtl btbcm snd_pcm btintel uvcvideo
btmtk crct10dif_pclmul ghash_clmulni_intel bluetooth snd_seq_midi
videobuf2_vmalloc snd_seq_midi_event videobuf2_memops aesni_intel
videobuf2_v4l2 snd_rawmidi videobuf2_common crypto_simd videodev
snd_seq cryptd ecdh_generic snd_seq_device joydev input_leds
intel_cstate mc ecc serio_raw wmi_bmof cfg80211
nvidia_wmi_ec_backlight snd_timer processor_thermal_device_pci mei_me
processor_thermal_device snd hid_multitouch processor_thermal_rfim mei
processor_thermal_mbox processor_thermal_rapl soundcore
intel_rapl_common ideapad_laptop sparse_keymap platform_profile
int3400_thermal int3403_thermal
[ 5.308233] Modules linked in: fjes(-) rtw_8852be(OE)
x86_pkg_temp_thermal intel_powerclamp rtw_8852b(OE) rtw89pci(OE)
rtw89core(OE) mac80211 libarc4 coretemp binfmt_misc wl(POE) mei_pxp
mei_hdcp intel_rapl_msr snd_hda_codec_hdmi nls_iso8859_1 kvm_intel
snd_hda_intel snd_intel_dspcfg snd_intel_sdw_acpi snd_hda_codec kvm
btusb snd_hda_core snd_hwdep btrtl btbcm snd_pcm btintel uvcvideo
btmtk crct10dif_pclmul ghash_clmulni_intel bluetooth snd_seq_midi
videobuf2_vmalloc snd_seq_midi_event videobuf2_memops aesni_intel
videobuf2_v4l2 snd_rawmidi videobuf2_common crypto_simd videodev
snd_seq cryptd ecdh_generic snd_seq_device joydev input_leds
intel_cstate mc ecc serio_raw wmi_bmof cfg80211
nvidia_wmi_ec_backlight snd_timer processor_thermal_device_pci mei_me
processor_thermal_device snd hid_multitouch processor_thermal_rfim mei
processor_thermal_mbox processor_thermal_rapl soundcore
intel_rapl_common ideapad_laptop sparse_keymap platform_profile
int3400_thermal int3403_thermal
[ 5.310330] Modules linked in: rtw_8852be(OE) x86_pkg_temp_thermal
intel_powerclamp rtw_8852b(OE) rtw89pci(OE) rtw89core(OE) mac80211
libarc4 coretemp binfmt_misc wl(POE) mei_pxp mei_hdcp intel_rapl_msr
snd_hda_codec_hdmi nls_iso8859_1 kvm_intel snd_hda_intel
snd_intel_dspcfg snd_intel_sdw_acpi snd_hda_codec kvm btusb
snd_hda_core snd_hwdep btrtl btbcm snd_pcm btintel uvcvideo btmtk
crct10dif_pclmul ghash_clmulni_intel bluetooth snd_seq_midi
videobuf2_vmalloc snd_seq_midi_event videobuf2_memops aesni_intel
videobuf2_v4l2 snd_rawmidi videobuf2_common crypto_simd videodev
snd_seq cryptd ecdh_generic snd_seq_device joydev input_leds
intel_cstate mc ecc serio_raw wmi_bmof cfg80211
nvidia_wmi_ec_backlight snd_timer processor_thermal_device_pci mei_me
processor_thermal_device snd hid_multitouch processor_thermal_rfim mei
processor_thermal_mbox processor_thermal_rapl soundcore
intel_rapl_common ideapad_laptop sparse_keymap platform_profile
int3400_thermal int3403_thermal acpi_thermal_rel
[ 5.312399] Modules linked in: rtw_8852be(OE) x86_pkg_temp_thermal
intel_powerclamp rtw_8852b(OE) rtw89pci(OE) rtw89core(OE) mac80211
libarc4 coretemp binfmt_misc wl(POE) mei_pxp mei_hdcp intel_rapl_msr
snd_hda_codec_hdmi nls_iso8859_1 kvm_intel snd_hda_intel
snd_intel_dspcfg snd_intel_sdw_acpi snd_hda_codec kvm btusb
snd_hda_core snd_hwdep btrtl btbcm snd_pcm btintel uvcvideo btmtk
crct10dif_pclmul ghash_clmulni_intel bluetooth snd_seq_midi
videobuf2_vmalloc snd_seq_midi_event videobuf2_memops aesni_intel
videobuf2_v4l2 snd_rawmidi videobuf2_common crypto_simd videodev
snd_seq cryptd ecdh_generic snd_seq_device joydev input_leds
intel_cstate mc ecc serio_raw wmi_bmof cfg80211
nvidia_wmi_ec_backlight snd_timer processor_thermal_device_pci mei_me
processor_thermal_device snd hid_multitouch processor_thermal_rfim mei
processor_thermal_mbox processor_thermal_rapl soundcore
intel_rapl_common ideapad_laptop sparse_keymap platform_profile
int3400_thermal int3403_thermal acpi_thermal_rel
[ 5.507904] Modules linked in: rtw_8852be(OE) x86_pkg_temp_thermal
intel_powerclamp rtw_8852b(OE) rtw89pci(OE) rtw89core(OE) mac80211
libarc4 coretemp binfmt_misc wl(POE) mei_pxp mei_hdcp intel_rapl_msr
snd_hda_codec_hdmi nls_iso8859_1 kvm_intel snd_hda_intel
snd_intel_dspcfg snd_intel_sdw_acpi snd_hda_codec kvm btusb
snd_hda_core snd_hwdep btrtl btbcm snd_pcm btintel uvcvideo btmtk
crct10dif_pclmul ghash_clmulni_intel bluetooth snd_seq_midi
videobuf2_vmalloc snd_seq_midi_event videobuf2_memops aesni_intel
videobuf2_v4l2 snd_rawmidi videobuf2_common crypto_simd videodev
snd_seq cryptd ecdh_generic snd_seq_device joydev input_leds
intel_cstate mc ecc serio_raw wmi_bmof cfg80211
nvidia_wmi_ec_backlight snd_timer processor_thermal_device_pci mei_me
processor_thermal_device snd hid_multitouch processor_thermal_rfim mei
processor_thermal_mbox processor_thermal_rapl soundcore
intel_rapl_common ideapad_laptop sparse_keymap platform_profile
int3400_thermal int3403_thermal acpi_thermal_rel
=============================================
Dr. Ali J. Ghandour
Associate Researcher, GEOspatial Artificial Intelligence (GEOAI) group
National Remote Sensing Center – CNRS
Beirut, Lebanon
Phone: +961 (4)409845
Email: aghandour@cnrs.edu.lb - LinkedIn - GoogleScholar
On Mon, Nov 27, 2023 at 8:01 AM Ali Ghandour <gandour.ali@gmail.com> wrote:
>
> $ lspci -tv
> -[0000:00]-+-00.0 Intel Corporation Device a715
> +-01.0-[01-05]--+-00.0 NVIDIA Corporation Device 28e0
> | \-00.1 NVIDIA Corporation Device 22be
> +-02.0 Intel Corporation Device a7a8
> +-04.0 Intel Corporation Device a71d
> +-06.0-[06]----00.0 Micron Technology Inc Device 5411
> +-06.2-[07]----00.0 MAXIO Technology (Hangzhou) Ltd. NVMe
> SSD Controller MAP1202
> +-0a.0 Intel Corporation Device a77d
> +-14.0 Intel Corporation Alder Lake PCH USB 3.2 xHCI Host Controller
> +-14.2 Intel Corporation Alder Lake PCH Shared SRAM
> +-15.0 Intel Corporation Alder Lake PCH Serial IO I2C Controller #0
> +-16.0 Intel Corporation Alder Lake PCH HECI Controller
> +-19.0 Intel Corporation Alder Lake-P Serial IO I2C Controller #0
> +-1c.0-[08]----00.0 Realtek Semiconductor Co., Ltd.
> RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
> +-1c.5-[09]----00.0 Realtek Semiconductor Co., Ltd. Device b852
> +-1f.0 Intel Corporation Device 519d
> +-1f.3 Intel Corporation Device 51ca
> +-1f.4 Intel Corporation Alder Lake PCH-P SMBus Host Controller
> \-1f.5 Intel Corporation Alder Lake-P PCH SPI Controller
>
>
> $ sudo lspci -s 09:00.0 -xxxx
> 09:00.0 Network controller: Realtek Semiconductor Co., Ltd. Device b852
> 00: ec 10 52 b8 03 00 10 00 00 00 80 02 10 00 00 00
> 10: 01 30 00 00 00 00 00 00 04 00 10 52 00 00 00 00
> 20: 00 00 00 00 00 00 00 00 00 00 00 00 aa 17 53 48
> 30: 00 00 00 00 40 00 00 00 00 00 00 00 ff 01 00 00
> 40: 01 50 c3 c9 08 00 00 00 00 00 00 00 00 00 00 00
> 50: 05 70 80 00 00 00 00 00 00 00 00 00 00 00 00 00
> 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> 70: 10 00 02 00 81 8d 90 15 30 20 10 00 11 6c 47 00
> 80: 43 01 11 10 00 00 00 00 00 00 00 00 00 00 00 00
> 90: 00 00 00 00 10 08 0c 00 00 04 00 00 02 00 00 00
> a0: 02 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00
> b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>
>
>
> =============================================
>
> Dr. Ali J. Ghandour
> Associate Researcher, GEOspatial Artificial Intelligence (GEOAI) group
> National Remote Sensing Center – CNRS
> Beirut, Lebanon
>
>
>
> Phone: +961 (4)409845
> Email: aghandour@cnrs.edu.lb - LinkedIn - GoogleScholar
>
>
> On Mon, Nov 27, 2023 at 3:43 AM Ping-Ke Shih <pkshih@realtek.com> wrote:
> >
> >
> >
> > > -----Original Message-----
> > > From: Ali Ghandour <gandour.ali@gmail.com>
> > > Sent: Sunday, November 26, 2023 5:36 AM
> > > To: linux-wireless@vger.kernel.org
> > > Subject: Lenovo LOQ rtw_8852be
> > >
> > > Hi,
> > >
> > > Following below thread, rtw_8852be driver fails for Lenovo LOQ:
> > > https://github.com/lwfinger/rtw89/issues/235
> > >
> > > rtw89_8852be 0000:09:00.0: loaded firmware rtw89/rtw8852b_fw-1.bin
> > > rtw89_8852be 0000:09:00.0: Firmware version 0.29.29.5 (da87cccd), cmd
> > > version 0, type 5
> > > rtw89_8852be 0000:09:00.0: Firmware version 0.29.29.5 (da87cccd), cmd
> > > version 0, type 3
> > > rtw89_8852be 0000:09:00.0: MAC has already powered on
> > > rtw89_8852be 0000:09:00.0: [ERR]pci config read 719
> > > rtw89_8852be 0000:09:00.0: [ERR] pcie autok fail -22
> > > rtw89_8852be 0000:09:00.0: failed to setup chip information
> > > tw89_8852be: probe of 0000:09:00.0 failed with error -22
> > >
> > > I am running Ubuntu 22.04.3 and kernel 6.2.0-37-generic.
> > >
> >
> > Not very sure why your host can't read PCI configuration space 0x719.
> > Please provide your PCI host controller by 'lspci -tv'.
> >
> > And, I wonder if user space tool 'lspci' can dump whole PCI configuration
> > space on your platform, so please provide full dump by
> > 'sudo lspci -s xx:yy.zz -xxxx'
> >
> > (you can get the device number followed '-s' by 'lspci', and copy the number, like)
> > 03:00.0 Network controller: Realtek Semiconductor Co., Ltd. Device b852
> >
> >
> > After kernel 5.18, we change to use standard pci API to read/write configuration
> > space, so if possible please downgrade to 5.17 to see if that version works to you.
> >
> > Ping-Ke
> >
^ permalink raw reply [flat|nested] 15+ messages in thread
* RE: Lenovo LOQ rtw_8852be
2023-11-27 6:19 ` Ali Ghandour
@ 2023-11-28 1:21 ` Ping-Ke Shih
2023-12-02 9:23 ` Ali Ghandour
0 siblings, 1 reply; 15+ messages in thread
From: Ping-Ke Shih @ 2023-11-28 1:21 UTC (permalink / raw)
To: Ali Ghandour; +Cc: linux-wireless@vger.kernel.org
> -----Original Message-----
> From: Ali Ghandour <gandour.ali@gmail.com>
> Sent: Monday, November 27, 2023 2:19 PM
> To: Ping-Ke Shih <pkshih@realtek.com>
> Cc: linux-wireless@vger.kernel.org
> Subject: Re: Lenovo LOQ rtw_8852be
>
> seems like the same error persists after downgrading:
>
> $ uname -r
> 5.17.0-1035-oem
>
> $ sudo dmesg | grep rtw
> [ 4.859848] rtw89_8852be 0000:09:00.0: loaded firmware
> rtw89/rtw8852b_fw-1.bin
> [ 4.860214] rtw89_8852be 0000:09:00.0: enabling device (0000 -> 0003)
> [ 4.861546] rtw89_8852be 0000:09:00.0: Firmware version 0.29.29.5
> (da87cccd), cmd version 0, type 5
> [ 4.861550] rtw89_8852be 0000:09:00.0: Firmware version 0.29.29.5
> (da87cccd), cmd version 0, type 3
> [ 4.861556] rtw89_8852be 0000:09:00.0: MAC has already powered on
> [ 4.867246] rtw89_8852be 0000:09:00.0: [ERR]pci config read 719
We did changes after 5.18, but your 5.17 print out error with
"pci config read" instead of "dbi_r8_pcie".
- ret = rtw89_dbi_read8(rtwdev, RTW89_PCIE_L1_CTRL, &bdr_ori);
+ ret = rtw89_pci_read_config_byte(rtwdev, RTW89_PCIE_L1_CTRL, &bdr_ori);
if (ret) {
- rtw89_err(rtwdev, "[ERR]dbi_r8_pcie %X\n", RTW89_PCIE_L1_CTRL); // 5.17
+ rtw89_err(rtwdev, "[ERR]pci config read %X\n", RTW89_PCIE_L1_CTRL); // 5.18
return ret;
}
Uh. I know the reason why you see the new one, because 8852be is supported
by kernel 6.2, and distro backport the driver to old kernel.
If you can build driver yourself, please revert below patch and try again.
Fixes: db38d9cd26c9 ("rtw89: use pci_read/write_config instead of dbi read/write")
> >
> > $ lspci -tv
> > -[0000:00]-+-00.0 Intel Corporation Device a715
I will try to Google to see if I can find some information about this PCI host controller.
Can I know the type of your platoform Lenovo LOQ? Is it a regular notebook computer?
> >
> > $ sudo lspci -s 09:00.0 -xxxx
> > 09:00.0 Network controller: Realtek Semiconductor Co., Ltd. Device b852
[...]
> > f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
In my side, lspci with '-xxxx', it can display PCI configuration space 0 ~ ff0.
In your side, lspci has the same behavior as driver that can't read 0x719.
The PCI EXT capabilities locate from 100h. Not sure if host controller driver
limits to display them?
Ping-Ke
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Lenovo LOQ rtw_8852be
2023-11-28 1:21 ` Ping-Ke Shih
@ 2023-12-02 9:23 ` Ali Ghandour
2023-12-05 0:39 ` Ping-Ke Shih
0 siblings, 1 reply; 15+ messages in thread
From: Ali Ghandour @ 2023-12-02 9:23 UTC (permalink / raw)
To: Ping-Ke Shih; +Cc: linux-wireless@vger.kernel.org
>> Can I know the type of your platoform Lenovo LOQ? Is it a regular notebook computer?
LOQ 15IRH8 - Type 82XV
I am using a dual boot with Windows and Ubuntu 22.04
>> The PCI EXT capabilities locate from 100h. Not sure if host controller driver limits to display them?
I did not get your question. Can you say it again please?
Ali
On Tue, Nov 28, 2023 at 3:21 AM Ping-Ke Shih <pkshih@realtek.com> wrote:
>
>
>
> > -----Original Message-----
> > From: Ali Ghandour <gandour.ali@gmail.com>
> > Sent: Monday, November 27, 2023 2:19 PM
> > To: Ping-Ke Shih <pkshih@realtek.com>
> > Cc: linux-wireless@vger.kernel.org
> > Subject: Re: Lenovo LOQ rtw_8852be
> >
> > seems like the same error persists after downgrading:
> >
> > $ uname -r
> > 5.17.0-1035-oem
> >
> > $ sudo dmesg | grep rtw
> > [ 4.859848] rtw89_8852be 0000:09:00.0: loaded firmware
> > rtw89/rtw8852b_fw-1.bin
> > [ 4.860214] rtw89_8852be 0000:09:00.0: enabling device (0000 -> 0003)
> > [ 4.861546] rtw89_8852be 0000:09:00.0: Firmware version 0.29.29.5
> > (da87cccd), cmd version 0, type 5
> > [ 4.861550] rtw89_8852be 0000:09:00.0: Firmware version 0.29.29.5
> > (da87cccd), cmd version 0, type 3
> > [ 4.861556] rtw89_8852be 0000:09:00.0: MAC has already powered on
> > [ 4.867246] rtw89_8852be 0000:09:00.0: [ERR]pci config read 719
>
> We did changes after 5.18, but your 5.17 print out error with
> "pci config read" instead of "dbi_r8_pcie".
>
> - ret = rtw89_dbi_read8(rtwdev, RTW89_PCIE_L1_CTRL, &bdr_ori);
> + ret = rtw89_pci_read_config_byte(rtwdev, RTW89_PCIE_L1_CTRL, &bdr_ori);
> if (ret) {
> - rtw89_err(rtwdev, "[ERR]dbi_r8_pcie %X\n", RTW89_PCIE_L1_CTRL); // 5.17
> + rtw89_err(rtwdev, "[ERR]pci config read %X\n", RTW89_PCIE_L1_CTRL); // 5.18
> return ret;
> }
>
> Uh. I know the reason why you see the new one, because 8852be is supported
> by kernel 6.2, and distro backport the driver to old kernel.
>
>
> If you can build driver yourself, please revert below patch and try again.
> Fixes: db38d9cd26c9 ("rtw89: use pci_read/write_config instead of dbi read/write")
>
> > >
> > > $ lspci -tv
> > > -[0000:00]-+-00.0 Intel Corporation Device a715
>
> I will try to Google to see if I can find some information about this PCI host controller.
>
> Can I know the type of your platoform Lenovo LOQ? Is it a regular notebook computer?
>
> > >
> > > $ sudo lspci -s 09:00.0 -xxxx
> > > 09:00.0 Network controller: Realtek Semiconductor Co., Ltd. Device b852
>
> [...]
>
> > > f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>
> In my side, lspci with '-xxxx', it can display PCI configuration space 0 ~ ff0.
> In your side, lspci has the same behavior as driver that can't read 0x719.
>
> The PCI EXT capabilities locate from 100h. Not sure if host controller driver
> limits to display them?
>
> Ping-Ke
>
^ permalink raw reply [flat|nested] 15+ messages in thread
* RE: Lenovo LOQ rtw_8852be
2023-12-02 9:23 ` Ali Ghandour
@ 2023-12-05 0:39 ` Ping-Ke Shih
2023-12-05 6:12 ` Ali Ghandour
0 siblings, 1 reply; 15+ messages in thread
From: Ping-Ke Shih @ 2023-12-05 0:39 UTC (permalink / raw)
To: Ali Ghandour; +Cc: linux-wireless@vger.kernel.org
> -----Original Message-----
> From: Ali Ghandour <gandour.ali@gmail.com>
> Sent: Saturday, December 2, 2023 5:24 PM
> To: Ping-Ke Shih <pkshih@realtek.com>
> Cc: linux-wireless@vger.kernel.org
> Subject: Re: Lenovo LOQ rtw_8852be
>
> > > > $ lspci -tv
> > > > -[0000:00]-+-00.0 Intel Corporation Device a715
> >> Can I know the type of your platoform Lenovo LOQ? Is it a regular notebook computer?
>
> LOQ 15IRH8 - Type 82XV
> I am using a dual boot with Windows and Ubuntu 22.04
I still can't find information about the device a715 that I also can't find
this ID in kernel source code. I will dig kernel further when I have free time.
>
> >> The PCI EXT capabilities locate from 100h. Not sure if host controller driver limits to display them?
> I did not get your question. Can you say it again please?
I meant offset 100h of PCI configuration space is a standard area [1].
"PCI Express extends the Configuration Space to 4096 bytes per Function as compared to 256 bytes
allowed by PCI Local Bus Specification. PCI Express Configuration Space is divided into a PCI 3.0
compatible region, which consists of the first 256 bytes of a Function’s Configuration Space, and a
PCI Express Extended Configuration Space which consists of the remaining Configuration Space
5 (see Figure 7-3)."
I don't know why the PCI controller in your platform doesn't recognize the region,
and then _possibly_ cause driver failed to access 719h.
[1] https://blog.csdn.net/huangkangying/article/details/50570612
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Lenovo LOQ rtw_8852be
2023-12-05 0:39 ` Ping-Ke Shih
@ 2023-12-05 6:12 ` Ali Ghandour
2023-12-06 2:41 ` Ping-Ke Shih
0 siblings, 1 reply; 15+ messages in thread
From: Ali Ghandour @ 2023-12-05 6:12 UTC (permalink / raw)
To: Ping-Ke Shih; +Cc: linux-wireless@vger.kernel.org
> > > > > $ lspci -tv
> > > > > -[0000:00]-+-00.0 Intel Corporation Device a715
> > >> Can I know the type of your platoform Lenovo LOQ? Is it a regular notebook computer?
> >
> > LOQ 15IRH8 - Type 82XV
> > I am using a dual boot with Windows and Ubuntu 22.04
>
> I still can't find information about the device a715 that I also can't find
> this ID in kernel source code. I will dig kernel further when I have free time.
According to the specs:
1x 13th Generation Intel Core i7-13620H Processor(Core i7-13620H)
>
> >
> > >> The PCI EXT capabilities locate from 100h. Not sure if host controller driver limits to display them?
> > I did not get your question. Can you say it again please?
>
> I meant offset 100h of PCI configuration space is a standard area [1].
>
> "PCI Express extends the Configuration Space to 4096 bytes per Function as compared to 256 bytes
> allowed by PCI Local Bus Specification. PCI Express Configuration Space is divided into a PCI 3.0
> compatible region, which consists of the first 256 bytes of a Function’s Configuration Space, and a
> PCI Express Extended Configuration Space which consists of the remaining Configuration Space
> 5 (see Figure 7-3)."
>
> I don't know why the PCI controller in your platform doesn't recognize the region,
> and then _possibly_ cause driver failed to access 719h.
>
>
> [1] https://blog.csdn.net/huangkangying/article/details/50570612
According to the specs:
2 x M.2 (PCI Express 4.0 x4) (1 free)
512 GB SSD M.2 2242 PCIe 4.0 x4 - NVM Express (NVMe)
and I have actually inserted a second SSD myself
Is the driver compatible with PCI 4.0?
^ permalink raw reply [flat|nested] 15+ messages in thread
* RE: Lenovo LOQ rtw_8852be
2023-12-05 6:12 ` Ali Ghandour
@ 2023-12-06 2:41 ` Ping-Ke Shih
2023-12-10 6:24 ` Ali Ghandour
0 siblings, 1 reply; 15+ messages in thread
From: Ping-Ke Shih @ 2023-12-06 2:41 UTC (permalink / raw)
To: Ali Ghandour; +Cc: linux-wireless@vger.kernel.org
> -----Original Message-----
> From: Ali Ghandour <gandour.ali@gmail.com>
> Sent: Tuesday, December 5, 2023 2:13 PM
> To: Ping-Ke Shih <pkshih@realtek.com>
> Cc: linux-wireless@vger.kernel.org
> Subject: Re: Lenovo LOQ rtw_8852be
>
>
> > > > > > $ lspci -tv
> > > > > > -[0000:00]-+-00.0 Intel Corporation Device a715
> > > >> Can I know the type of your platoform Lenovo LOQ? Is it a regular notebook computer?
> > >
> > > LOQ 15IRH8 - Type 82XV
> > > I am using a dual boot with Windows and Ubuntu 22.04
> >
> > I still can't find information about the device a715 that I also can't find
> > this ID in kernel source code. I will dig kernel further when I have free time.
>
>
> According to the specs:
> 1x 13th Generation Intel Core i7-13620H Processor(Core i7-13620H)
>
I have found the ID in kernel:
arch/x86/events/intel/uncore_snb.c:101:#define PCI_DEVICE_ID_INTEL_RPL_15_IMC 0xA715
But honestly I'm not familiar with PCI. I'll continue to dig to see if I can
find something...
>
>
> >
> > >
> > > >> The PCI EXT capabilities locate from 100h. Not sure if host controller driver limits to display them?
> > > I did not get your question. Can you say it again please?
> >
> > I meant offset 100h of PCI configuration space is a standard area [1].
> >
> > "PCI Express extends the Configuration Space to 4096 bytes per Function as compared to 256 bytes
> > allowed by PCI Local Bus Specification. PCI Express Configuration Space is divided into a PCI 3.0
> > compatible region, which consists of the first 256 bytes of a Function’s Configuration Space, and a
> > PCI Express Extended Configuration Space which consists of the remaining Configuration Space
> > 5 (see Figure 7-3)."
> >
> > I don't know why the PCI controller in your platform doesn't recognize the region,
> > and then _possibly_ cause driver failed to access 719h.
> >
> >
> > [1] https://blog.csdn.net/huangkangying/article/details/50570612
>
> According to the specs:
> 2 x M.2 (PCI Express 4.0 x4) (1 free)
> 512 GB SSD M.2 2242 PCIe 4.0 x4 - NVM Express (NVMe)
> and I have actually inserted a second SSD myself
>
> Is the driver compatible with PCI 4.0?
I think PCI should be backward compatible to older devices.
I did trace PCI code and found pci_dev->cfg_size limit the access, so please try
below hack patch in driver and see pci_dev->cfg_size in your platform.
@@ -2111,6 +2111,11 @@ static int rtw89_pci_auto_refclk_cal(struct rtw89_dev *rtwdev, bool autook_en)
u8 val8, bdr_ori;
bool l1_flag = false;
int ret = 0;
+ struct rtw89_pci *rtwpci = (struct rtw89_pci *)rtwdev->priv;
+ struct pci_dev *pdev = rtwpci->pdev;
+
+ printk("pdev->cfg_size=%d\n", pdev->cfg_size); // in my computer, this is 4096 already
+ pdev->cfg_size = PCI_CFG_SPACE_EXP_SIZE; // 4096
if (chip_id != RTL8852B && chip_id != RTL8851B)
return 0;
Ping-Ke
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Lenovo LOQ rtw_8852be
2023-12-06 2:41 ` Ping-Ke Shih
@ 2023-12-10 6:24 ` Ali Ghandour
2023-12-11 1:53 ` Ping-Ke Shih
0 siblings, 1 reply; 15+ messages in thread
From: Ali Ghandour @ 2023-12-10 6:24 UTC (permalink / raw)
To: Ping-Ke Shih; +Cc: linux-wireless@vger.kernel.org
> I did trace PCI code and found pci_dev->cfg_size limit the access, so please try
> below hack patch in driver and see pci_dev->cfg_size in your platform.
>
> @@ -2111,6 +2111,11 @@ static int rtw89_pci_auto_refclk_cal(struct rtw89_dev *rtwdev, bool autook_en)
> u8 val8, bdr_ori;
> bool l1_flag = false;
> int ret = 0;
> + struct rtw89_pci *rtwpci = (struct rtw89_pci *)rtwdev->priv;
> + struct pci_dev *pdev = rtwpci->pdev;
> +
> + printk("pdev->cfg_size=%d\n", pdev->cfg_size); // in my computer, this is 4096 already
> + pdev->cfg_size = PCI_CFG_SPACE_EXP_SIZE; // 4096
>
> if (chip_id != RTL8852B && chip_id != RTL8851B)
> return 0;
>
It ended up showing 4096.
ali@loq:~$ sudo dmesg | grep rtw
[ 3.153827] rtw89_8852be 0000:09:00.0: loaded firmware
rtw89/rtw8852b_fw-1.bin
[ 3.154264] rtw89_8852be 0000:09:00.0: enabling device (0000 -> 0003)
[ 3.155976] rtw89_8852be 0000:09:00.0: Firmware version 0.29.29.5
(da87cccd), cmd version 0, type 5
[ 3.155980] rtw89_8852be 0000:09:00.0: Firmware version 0.29.29.5
(da87cccd), cmd version 0, type 3
[ 3.160040] rtw89_8852be 0000:09:00.0: [ERR]pci config read 719
[ 3.160044] rtw89_8852be 0000:09:00.0: [ERR] pcie autok fail -22
[ 3.160046] rtw89_8852be 0000:09:00.0: failed to setup chip information
[ 3.161040] rtw89_8852be: probe of 0000:09:00.0 failed with error -22
[ 760.432807] rtw89_8852be 0000:09:00.0: loaded firmware
rtw89/rtw8852b_fw-1.bin
[ 760.434865] rtw89_8852be 0000:09:00.0: Firmware version 0.29.29.5
(da87cccd), cmd version 0, type 5
[ 760.434868] rtw89_8852be 0000:09:00.0: Firmware version 0.29.29.5
(da87cccd), cmd version 0, type 3
[ 760.434874] rtw89_8852be 0000:09:00.0: MAC has already powered on
[ 760.440601] rtw89_8852be 0000:09:00.0: [ERR]pci config read 719
[ 760.440602] rtw89_8852be 0000:09:00.0: [ERR] pcie autok fail -22
[ 760.440603] rtw89_8852be 0000:09:00.0: failed to setup chip information
[ 760.441448] rtw89_8852be: probe of 0000:09:00.0 failed with error -22
[ 1765.595921] rtw89_8852be 0000:09:00.0: loaded firmware
rtw89/rtw8852b_fw-1.bin
[ 1765.599918] rtw89_8852be 0000:09:00.0: Firmware version 0.29.29.5
(da87cccd), cmd version 0, type 5
[ 1765.599929] rtw89_8852be 0000:09:00.0: Firmware version 0.29.29.5
(da87cccd), cmd version 0, type 3
[ 1765.599940] rtw89_8852be 0000:09:00.0: MAC has already powered on
[ 1765.605861] rtw89_8852be 0000:09:00.0: [ERR]pci config read 719
[ 1765.605869] rtw89_8852be 0000:09:00.0: [ERR] pcie autok fail -22
[ 1765.605874] rtw89_8852be 0000:09:00.0: failed to setup chip information
[ 1765.609552] rtw89_8852be: probe of 0000:09:00.0 failed with error -22
ali@loq:~$ sudo dmesg | grep pdev
[ 2.508247] ppdev: user-space parallel port driver
[ 760.440595] pdev->cfg_size=256
[ 1765.605839] pdev->cfg_size=4096
On Wed, Dec 6, 2023 at 4:41 AM Ping-Ke Shih <pkshih@realtek.com> wrote:
>
>
>
> > -----Original Message-----
> > From: Ali Ghandour <gandour.ali@gmail.com>
> > Sent: Tuesday, December 5, 2023 2:13 PM
> > To: Ping-Ke Shih <pkshih@realtek.com>
> > Cc: linux-wireless@vger.kernel.org
> > Subject: Re: Lenovo LOQ rtw_8852be
> >
> >
> > > > > > > $ lspci -tv
> > > > > > > -[0000:00]-+-00.0 Intel Corporation Device a715
> > > > >> Can I know the type of your platoform Lenovo LOQ? Is it a regular notebook computer?
> > > >
> > > > LOQ 15IRH8 - Type 82XV
> > > > I am using a dual boot with Windows and Ubuntu 22.04
> > >
> > > I still can't find information about the device a715 that I also can't find
> > > this ID in kernel source code. I will dig kernel further when I have free time.
> >
> >
> > According to the specs:
> > 1x 13th Generation Intel Core i7-13620H Processor(Core i7-13620H)
> >
>
> I have found the ID in kernel:
> arch/x86/events/intel/uncore_snb.c:101:#define PCI_DEVICE_ID_INTEL_RPL_15_IMC 0xA715
>
> But honestly I'm not familiar with PCI. I'll continue to dig to see if I can
> find something...
>
> >
> >
> > >
> > > >
> > > > >> The PCI EXT capabilities locate from 100h. Not sure if host controller driver limits to display them?
> > > > I did not get your question. Can you say it again please?
> > >
> > > I meant offset 100h of PCI configuration space is a standard area [1].
> > >
> > > "PCI Express extends the Configuration Space to 4096 bytes per Function as compared to 256 bytes
> > > allowed by PCI Local Bus Specification. PCI Express Configuration Space is divided into a PCI 3.0
> > > compatible region, which consists of the first 256 bytes of a Function’s Configuration Space, and a
> > > PCI Express Extended Configuration Space which consists of the remaining Configuration Space
> > > 5 (see Figure 7-3)."
> > >
> > > I don't know why the PCI controller in your platform doesn't recognize the region,
> > > and then _possibly_ cause driver failed to access 719h.
> > >
> > >
> > > [1] https://blog.csdn.net/huangkangying/article/details/50570612
> >
> > According to the specs:
> > 2 x M.2 (PCI Express 4.0 x4) (1 free)
> > 512 GB SSD M.2 2242 PCIe 4.0 x4 - NVM Express (NVMe)
> > and I have actually inserted a second SSD myself
> >
> > Is the driver compatible with PCI 4.0?
>
> I think PCI should be backward compatible to older devices.
>
>
> I did trace PCI code and found pci_dev->cfg_size limit the access, so please try
> below hack patch in driver and see pci_dev->cfg_size in your platform.
>
> @@ -2111,6 +2111,11 @@ static int rtw89_pci_auto_refclk_cal(struct rtw89_dev *rtwdev, bool autook_en)
> u8 val8, bdr_ori;
> bool l1_flag = false;
> int ret = 0;
> + struct rtw89_pci *rtwpci = (struct rtw89_pci *)rtwdev->priv;
> + struct pci_dev *pdev = rtwpci->pdev;
> +
> + printk("pdev->cfg_size=%d\n", pdev->cfg_size); // in my computer, this is 4096 already
> + pdev->cfg_size = PCI_CFG_SPACE_EXP_SIZE; // 4096
>
> if (chip_id != RTL8852B && chip_id != RTL8851B)
> return 0;
>
> Ping-Ke
>
^ permalink raw reply [flat|nested] 15+ messages in thread
* RE: Lenovo LOQ rtw_8852be
2023-12-10 6:24 ` Ali Ghandour
@ 2023-12-11 1:53 ` Ping-Ke Shih
2023-12-12 5:36 ` Ali Ghandour
0 siblings, 1 reply; 15+ messages in thread
From: Ping-Ke Shih @ 2023-12-11 1:53 UTC (permalink / raw)
To: Ali Ghandour; +Cc: linux-wireless@vger.kernel.org
> -----Original Message-----
> From: Ali Ghandour <gandour.ali@gmail.com>
> Sent: Sunday, December 10, 2023 2:24 PM
> To: Ping-Ke Shih <pkshih@realtek.com>
> Cc: linux-wireless@vger.kernel.org
> Subject: Re: Lenovo LOQ rtw_8852be
>
> It ended up showing 4096.
But still not work. PCI code is hard to me.
Please try below workaround patch to ignore the setting. I have tried that, and
in my side it still works without obvious problem. I will check internally to
check how much this can affect. If not, I would ignore this if certain platform
like yours can't access PCI space over 0x100.
@@ -2061,6 +2061,9 @@ static int rtw89_pci_auto_refclk_cal(struct rtw89_dev *rtwdev, bool autook_en)
if (chip_id != RTL8852B && chip_id != RTL8851B)
return 0;
+ printk("no auto_refclk_cal\n");
+ return 0;
+
ret = rtw89_pci_read_config_byte(rtwdev, RTW89_PCIE_PHY_RATE, &val8);
if (ret) {
rtw89_err(rtwdev, "[ERR]pci config read %X\n",
Ping-Ke
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Lenovo LOQ rtw_8852be
2023-12-11 1:53 ` Ping-Ke Shih
@ 2023-12-12 5:36 ` Ali Ghandour
2023-12-12 6:01 ` Ping-Ke Shih
2023-12-26 3:42 ` Ping-Ke Shih
0 siblings, 2 replies; 15+ messages in thread
From: Ali Ghandour @ 2023-12-12 5:36 UTC (permalink / raw)
To: Ping-Ke Shih; +Cc: linux-wireless@vger.kernel.org
> Please try below workaround patch to ignore the setting. I have tried that, and
> in my side it still works without obvious problem. I will check internally to
> check how much this can affect. If not, I would ignore this if certain platform
> like yours can't access PCI space over 0x100.
I was able to connect. Thanks a lot Ping-Ke!
[ 609.484727] rtw89_8852be 0000:09:00.0: loaded firmware
rtw89/rtw8852b_fw-1.bin
[ 609.484998] rtw89_8852be 0000:09:00.0: enabling device (0000 -> 0003)
[ 609.486812] rtw89_8852be 0000:09:00.0: Firmware version 0.29.29.5
(da87cccd), cmd version 0, type 5
[ 609.486815] rtw89_8852be 0000:09:00.0: Firmware version 0.29.29.5
(da87cccd), cmd version 0, type 3
[ 609.767891] rtw89_8852be 0000:09:00.0: chip rfe_type is 1
[ 609.796171] rtw89_8852be 0000:09:00.0: failed to set CLKREQ Delay
[ 609.796175] rtw89_8852be 0000:09:00.0: failed to set CLKREQ_L1, ret=-22
[ 609.796177] rtw89_8852be 0000:09:00.0: failed to read ASPM Delay
[ 609.796177] rtw89_8852be 0000:09:00.0: failed to read ASPM Delay
[ 609.796178] rtw89_8852be 0000:09:00.0: failed to set ASPM L1, ret=-22
[ 609.803786] rtw89_8852be 0000:09:00.0 wlp9s0: renamed from wlan0
On Mon, Dec 11, 2023 at 3:53 AM Ping-Ke Shih <pkshih@realtek.com> wrote:
>
>
>
> > -----Original Message-----
> > From: Ali Ghandour <gandour.ali@gmail.com>
> > Sent: Sunday, December 10, 2023 2:24 PM
> > To: Ping-Ke Shih <pkshih@realtek.com>
> > Cc: linux-wireless@vger.kernel.org
> > Subject: Re: Lenovo LOQ rtw_8852be
> >
> > It ended up showing 4096.
>
> But still not work. PCI code is hard to me.
>
> Please try below workaround patch to ignore the setting. I have tried that, and
> in my side it still works without obvious problem. I will check internally to
> check how much this can affect. If not, I would ignore this if certain platform
> like yours can't access PCI space over 0x100.
>
>
> @@ -2061,6 +2061,9 @@ static int rtw89_pci_auto_refclk_cal(struct rtw89_dev *rtwdev, bool autook_en)
> if (chip_id != RTL8852B && chip_id != RTL8851B)
> return 0;
>
> + printk("no auto_refclk_cal\n");
> + return 0;
> +
> ret = rtw89_pci_read_config_byte(rtwdev, RTW89_PCIE_PHY_RATE, &val8);
> if (ret) {
> rtw89_err(rtwdev, "[ERR]pci config read %X\n",
>
>
> Ping-Ke
>
^ permalink raw reply [flat|nested] 15+ messages in thread
* RE: Lenovo LOQ rtw_8852be
2023-12-12 5:36 ` Ali Ghandour
@ 2023-12-12 6:01 ` Ping-Ke Shih
2023-12-26 3:42 ` Ping-Ke Shih
1 sibling, 0 replies; 15+ messages in thread
From: Ping-Ke Shih @ 2023-12-12 6:01 UTC (permalink / raw)
To: Ali Ghandour; +Cc: linux-wireless@vger.kernel.org
> -----Original Message-----
> From: Ali Ghandour <gandour.ali@gmail.com>
> Sent: Tuesday, December 12, 2023 1:36 PM
> To: Ping-Ke Shih <pkshih@realtek.com>
> Cc: linux-wireless@vger.kernel.org
> Subject: Re: Lenovo LOQ rtw_8852be
>
> > Please try below workaround patch to ignore the setting. I have tried that, and
> > in my side it still works without obvious problem. I will check internally to
> > check how much this can affect. If not, I would ignore this if certain platform
> > like yours can't access PCI space over 0x100.
>
> I was able to connect. Thanks a lot Ping-Ke!
>
Good. Please use it as usual and monitor if it works stable. I would like
take your results as reference to decide how I can modify the driver.
> [ 609.796171] rtw89_8852be 0000:09:00.0: failed to set CLKREQ Delay
> [ 609.796175] rtw89_8852be 0000:09:00.0: failed to set CLKREQ_L1, ret=-22
> [ 609.796177] rtw89_8852be 0000:09:00.0: failed to read ASPM Delay
> [ 609.796177] rtw89_8852be 0000:09:00.0: failed to read ASPM Delay
> [ 609.796178] rtw89_8852be 0000:09:00.0: failed to set ASPM L1, ret=-22
These mean we fail to access more PCI config space over 0x100. I will
consider these cases as well.
Ping-Ke
^ permalink raw reply [flat|nested] 15+ messages in thread
* RE: Lenovo LOQ rtw_8852be
2023-12-12 5:36 ` Ali Ghandour
2023-12-12 6:01 ` Ping-Ke Shih
@ 2023-12-26 3:42 ` Ping-Ke Shih
[not found] ` <CAOE0c95hkCdoKksAO5KhfVPuH1r8bpWXyM4Q_B+R2N-mJFz4yA@mail.gmail.com>
1 sibling, 1 reply; 15+ messages in thread
From: Ping-Ke Shih @ 2023-12-26 3:42 UTC (permalink / raw)
To: Ali Ghandour; +Cc: linux-wireless@vger.kernel.org
[-- Attachment #1: Type: text/plain, Size: 1248 bytes --]
Hi Ali,
> -----Original Message-----
> From: Ping-Ke Shih
> Sent: Tuesday, December 12, 2023 2:02 PM
> To: 'Ali Ghandour' <gandour.ali@gmail.com>
> Cc: linux-wireless@vger.kernel.org
> Subject: RE: Lenovo LOQ rtw_8852be
>
> > -----Original Message-----
> > From: Ali Ghandour <gandour.ali@gmail.com>
> > Sent: Tuesday, December 12, 2023 1:36 PM
> > To: Ping-Ke Shih <pkshih@realtek.com>
> > Cc: linux-wireless@vger.kernel.org
> > Subject: Re: Lenovo LOQ rtw_8852be
> >
> > > Please try below workaround patch to ignore the setting. I have tried that, and
> > > in my side it still works without obvious problem. I will check internally to
> > > check how much this can affect. If not, I would ignore this if certain platform
> > > like yours can't access PCI space over 0x100.
> >
> > I was able to connect. Thanks a lot Ping-Ke!
> >
>
> Good. Please use it as usual and monitor if it works stable. I would like
> take your results as reference to decide how I can modify the driver.
>
After internal discussion, people suggest to implement DBI to access PCI config
space as attached patch. Please help to revert workaround and apply this one,
and give us kernel log to see if it works as expected.
Ping-Ke
[-- Attachment #2: 0001-wifi-rtw89-pci-use-DBI-function-for-8852AE-8852BE-88.patch --]
[-- Type: application/octet-stream, Size: 3824 bytes --]
From 0974cd95c6cf3e6096035ee639354b69bd6ca954 Mon Sep 17 00:00:00 2001
From: Chin-Yen Lee <timlee@realtek.com>
Date: Fri, 15 Dec 2023 18:55:28 +0800
Subject: [PATCH] wifi: rtw89: pci: use DBI function for 8852AE/8852BE/8851BE
Sometimes driver can't use kernel api pci_read/write_config_byte
to access the pci config space of above address 0x100 due to
the negotiated pci setting. 8852AE/8852BE/8851BE provide another
way called dbi function, which belongs to wifi mac and could
access all pci config space for this case.
Change-Id: I34f4b70accfab24aec8ff33ddfdc9ee3a31e8e6a
Signed-off-by: Chin-Yen Lee <timlee@realtek.com>
---
pci.c | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
pci.h | 1 +
2 files changed, 68 insertions(+), 2 deletions(-)
diff --git a/pci.c b/pci.c
index e66396dfecb7..c48cb9183c68 100644
--- a/pci.c
+++ b/pci.c
@@ -1907,22 +1907,87 @@ static int rtw89_write16_mdio_clr(struct rtw89_dev *rtwdev, u8 addr, u16 mask, u
return 0;
}
+static int rtw89_dbi_write8(struct rtw89_dev *rtwdev, u16 addr, u8 data)
+{
+ u16 addr_2lsb = addr & B_AX_DBI_2LSB;
+ u16 write_addr;
+ u8 flag;
+ int ret;
+
+ write_addr = addr & B_AX_DBI_ADDR_MSK;
+ write_addr |= u16_encode_bits(BIT(addr_2lsb), B_AX_DBI_WREN_MSK);
+ rtw89_write8(rtwdev, R_AX_DBI_WDATA + addr_2lsb, data);
+ rtw89_write16(rtwdev, R_AX_DBI_FLAG, write_addr);
+ rtw89_write8(rtwdev, R_AX_DBI_FLAG + 2, B_AX_DBI_WFLAG >> 16);
+
+ ret = read_poll_timeout_atomic(rtw89_read8, flag, !flag, 10,
+ 10 * RTW89_PCI_WR_RETRY_CNT, false,
+ rtwdev, R_AX_DBI_FLAG + 2);
+ if (ret)
+ rtw89_err(rtwdev, "failed to write DBI register, addr=0x%X\n",
+ addr);
+
+ return ret;
+}
+
+static int rtw89_dbi_read8(struct rtw89_dev *rtwdev, u16 addr, u8 *value)
+{
+ u16 read_addr = addr & B_AX_DBI_ADDR_MSK;
+ u8 flag;
+ int ret;
+
+ rtw89_write16(rtwdev, R_AX_DBI_FLAG, read_addr);
+ rtw89_write8(rtwdev, R_AX_DBI_FLAG + 2, B_AX_DBI_RFLAG >> 16);
+
+ ret = read_poll_timeout_atomic(rtw89_read8, flag, !flag, 10,
+ 10 * RTW89_PCI_WR_RETRY_CNT, false,
+ rtwdev, R_AX_DBI_FLAG + 2);
+ if (ret) {
+ rtw89_err(rtwdev, "failed to read DBI register, addr=0x%X\n",
+ addr);
+ return ret;
+ }
+
+ read_addr = R_AX_DBI_RDATA + (addr & 3);
+ *value = rtw89_read8(rtwdev, read_addr);
+
+ return 0;
+}
+
static int rtw89_pci_write_config_byte(struct rtw89_dev *rtwdev, u16 addr,
u8 data)
{
struct rtw89_pci *rtwpci = (struct rtw89_pci *)rtwdev->priv;
+ enum rtw89_core_chip_id chip_id = rtwdev->chip->chip_id;
struct pci_dev *pdev = rtwpci->pdev;
+ int ret;
+
+ ret = pci_write_config_byte(pdev, addr, data);
+ if (!ret)
+ return 0;
- return pci_write_config_byte(pdev, addr, data);
+ if (chip_id == RTL8852A || chip_id == RTL8852B || chip_id == RTL8851B)
+ ret = rtw89_dbi_write8(rtwdev, addr, data);
+
+ return ret;
}
static int rtw89_pci_read_config_byte(struct rtw89_dev *rtwdev, u16 addr,
u8 *value)
{
struct rtw89_pci *rtwpci = (struct rtw89_pci *)rtwdev->priv;
+ enum rtw89_core_chip_id chip_id = rtwdev->chip->chip_id;
struct pci_dev *pdev = rtwpci->pdev;
+ int ret;
- return pci_read_config_byte(pdev, addr, value);
+ ret = pci_read_config_byte(pdev, addr, value);
+ if (!ret)
+ return 0;
+
+ if (chip_id == RTL8852A || chip_id == RTL8852B || chip_id == RTL8851B)
+ ret = rtw89_dbi_read8(rtwdev, addr, value);
+
+ return ret;
}
static int rtw89_pci_config_byte_set(struct rtw89_dev *rtwdev, u16 addr,
diff --git a/pci.h b/pci.h
index ca5de77fee90..1fb7c209fa0d 100644
--- a/pci.h
+++ b/pci.h
@@ -42,6 +42,7 @@
#define B_AX_DBI_WFLAG BIT(16)
#define B_AX_DBI_WREN_MSK GENMASK(15, 12)
#define B_AX_DBI_ADDR_MSK GENMASK(11, 2)
+#define B_AX_DBI_2LSB GENMASK(1, 0)
#define R_AX_DBI_WDATA 0x1094
#define R_AX_DBI_RDATA 0x1098
--
2.25.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* RE: Lenovo LOQ rtw_8852be
[not found] ` <CAOE0c95hkCdoKksAO5KhfVPuH1r8bpWXyM4Q_B+R2N-mJFz4yA@mail.gmail.com>
@ 2024-01-03 0:13 ` Ping-Ke Shih
0 siblings, 0 replies; 15+ messages in thread
From: Ping-Ke Shih @ 2024-01-03 0:13 UTC (permalink / raw)
To: Ali Ghandour; +Cc: linux-wireless@vger.kernel.org
> -----Original Message-----
> From: Ali Ghandour <gandour.ali@gmail.com>
> Sent: Wednesday, January 3, 2024 2:09 AM
> To: Ping-Ke Shih <pkshih@realtek.com>
> Subject: Re: Lenovo LOQ rtw_8852be
>
> Hello Ping-Ke,
>
> > After internal discussion, people suggest to implement DBI to access PCI config
> > space as attached patch. Please help to revert workaround and apply this one,
> > and give us kernel log to see if it works as expected.
>
> 1. I tried first to patch using below commands but it failed:
> $ patch -p 2 -o pci.c pci.h <
> ../0001-wifi-rtw89-pci-use-DBI-function-for-8852AE-8852BE-88.patch
> What should I use instead?
Normally, I use below command
$ patch -p 1 -m -d path_to_rtw89 < xxx.patch
>
> 2. So I manually applied the changes and load the kernel:
> [ 2428.566026] rtw89_8852be 0000:09:00.0: loaded firmware
> rtw89/rtw8852b_fw-1.bin
> [ 2428.568023] rtw89_8852be 0000:09:00.0: Firmware version 0.29.29.5
> (da87cccd), cmd version 0, type 5
> [ 2428.568027] rtw89_8852be 0000:09:00.0: Firmware version 0.29.29.5
> (da87cccd), cmd version 0, type 3
> [ 2428.847820] rtw89_8852be 0000:09:00.0: chip rfe_type is 1
> [ 2428.878840] rtw89_8852be 0000:09:00.0 wlp9s0: renamed from wlan0
>
> rebooted and checked again and still working fine:
> [ 3.227606] rtw89_8852be 0000:09:00.0: loaded firmware
> rtw89/rtw8852b_fw-1.bin
> [ 3.227870] rtw89_8852be 0000:09:00.0: enabling device (0000 -> 0003)
> [ 3.229682] rtw89_8852be 0000:09:00.0: Firmware version 0.29.29.5
> (da87cccd), cmd version 0, type 5
> [ 3.229684] rtw89_8852be 0000:09:00.0: Firmware version 0.29.29.5
> (da87cccd), cmd version 0, type 3
> [ 3.542579] rtw89_8852be 0000:09:00.0: chip rfe_type is 1
> [ 3.574406] rtw89_8852be 0000:09:00.0 wlp9s0: renamed from wlan0
>
Thanks for the help. I will submit this patch to upstream.
Ping-Ke
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2024-01-03 0:13 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1700948088-16140-mlmmj-666d2532@vger.kernel.org>
2023-11-25 21:35 ` Lenovo LOQ rtw_8852be Ali Ghandour
2023-11-27 1:42 ` Ping-Ke Shih
2023-11-27 6:01 ` Ali Ghandour
2023-11-27 6:19 ` Ali Ghandour
2023-11-28 1:21 ` Ping-Ke Shih
2023-12-02 9:23 ` Ali Ghandour
2023-12-05 0:39 ` Ping-Ke Shih
2023-12-05 6:12 ` Ali Ghandour
2023-12-06 2:41 ` Ping-Ke Shih
2023-12-10 6:24 ` Ali Ghandour
2023-12-11 1:53 ` Ping-Ke Shih
2023-12-12 5:36 ` Ali Ghandour
2023-12-12 6:01 ` Ping-Ke Shih
2023-12-26 3:42 ` Ping-Ke Shih
[not found] ` <CAOE0c95hkCdoKksAO5KhfVPuH1r8bpWXyM4Q_B+R2N-mJFz4yA@mail.gmail.com>
2024-01-03 0:13 ` Ping-Ke Shih
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).