Subject: Is RTL8822CE with Kernel 6.1 for imx6



Dear linux wireless team:
This is Danny, a embedded software engineer


I have successfully run the 8822CE module in Linux kernel 5.4 with imx6 hardware platform.
But it doesnt work in Kernel 6.1 though i have put many efforts to this issue.
So, we'd like to check with you whether the RTL8822CE chip is compatible with Linux Kernel 6.1.

My usage is as below:
imx6 boardbuild RTL8822CE as M in kernel 6.1 menuconfigEach time after the board startup, i run four commands insmod rtw88_core.ko
insmod rtw88_pci.ko
insmod rtw88_8822c.ko
insmod rtw88_8822ce.ko


4. When run insmod rtw88_8822ce.ko, in most cases, the error will show as below. (few times can work)
Detail error log is attached.

Same step (1) -(4) works very well with kernel 5.4 in same hadrware platform.

================
root@imx6solosabresd:~/8822CE# ./insmod.sh
[ 60.541840] rtw_8822ce 0000:01:00.0: enabling device (0000 -> 0003)
[ 60.558145] rtw_8822ce 0000:01:00.0: Firmware version 9.9.4, H2C version 15
[ 60.567135] rtw_8822ce 0000:01:00.0: Firmware version 9.9.15, H2C version 15
[ 60.706697] 8<--- cut here ---
[ 60.709775] Unhandled fault: imprecise external abort (0x1406) at 0x01b77740
[ 60.716832] [01b77740] *pgd=00000000
[ 60.720421] Internal error: : 1406 [#1] PREEMPT SMP ARM
[ 60.725653] Modules linked in: rtw88_8822ce(+) rtw88_8822c rtw88_pci rtw88_core
[ 60.732991] CPU: 0 PID: 796 Comm: insmod Not tainted 6.1.22-g9c59b15a9e72 #1
[ 60.740049] Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
[ 60.746580] PC is at rtw_pci_read32+0x14/0x18 [rtw88_pci]
[ 60.752015] LR is at rtw_chip_info_setup+0x48/0x588 [rtw88_core]
[ 60.758170] pc : [<7f026048>] lr : [<7f0001c0>] psr: 60010013
[ 60.764442] sp : c1d0dd28 ip : 00000201 fp : 89344040
[ 60.769670] r10: 88b397a0 r9 : 88b3f890 r8 : 00000200
[ 60.774897] r7 : 000003da r6 : 000003d9 r5 : 7f03a2c8 r4 : 88b397a0
[ 60.781428] r3 : c09200f0 r2 : 00000000 r1 : 000000f0 r0 : 00000000
[ 60.787959] Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment none
[ 60.795100] Control: 10c5387d Table: 15d10059 DAC: 00000051
[ 60.800848] Register r0 information: NULL pointer
[ 60.805564] Register r1 information: non-paged memory
[ 60.810620] Register r2 information: NULL pointer




Thanks &Regards
Danny










Attachments:
RTL8822CEerrorlog.txt (12.20 kB)

2024-03-21 17:08:43

by Larry Finger

[permalink] [raw]
Subject: Re: Is RTL8822CE with Kernel 6.1 for imx6

On 3/21/24 08:13, 施小丰(医用制品产业集团-医用制品集团本部) wrote:
>
> Dear linux wireless team:
>    This is Danny, a embedded software engineer
>
>    I have successfully run the 8822CE module in Linux kernel 5.4 with imx6
> hardware platform.
>    But it doesnt work in Kernel 6.1 though i have put many efforts to this issue.
>   So, we'd like to check with you whether the RTL8822CE chip is compatible with
> Linux Kernel 6.1.
>    My usage is as below:
>
> 1. imx6 board
> 2. build RTL8822CE as M in kernel 6.1 menuconfig
> 3. Each time after the board startup, i run four commands
>
>     insmod rtw88_core.ko
>     insmod rtw88_pci.ko
>     insmod rtw88_8822c.ko
>     insmod rtw88_8822ce.ko
> 4.  When run  insmod rtw88_8822ce.ko, in most cases, the error will show as
> below. (few times can work)
>  Detail error log is attached.
>   Same step (1) -(4) works very well with kernel 5.4 in same hadrware platform.
> ================
> root@imx6solosabresd:~/8822CE# ./insmod.sh
> [   60.541840] rtw_8822ce 0000:01:00.0: enabling device (0000 -> 0003)
> [   60.558145] rtw_8822ce 0000:01:00.0: Firmware version 9.9.4, H2C version 15
> [   60.567135] rtw_8822ce 0000:01:00.0: Firmware version 9.9.15, H2C version 15
> [   60.706697] 8<--- cut here ---
> [   60.709775] Unhandled fault: imprecise external abort (0x1406) at 0x01b77740
> [   60.716832] [01b77740] *pgd=00000000
> [   60.720421] Internal error: : 1406 [#1] PREEMPT SMP ARM
> [   60.725653] Modules linked in: rtw88_8822ce(+) rtw88_8822c rtw88_pci rtw88_core
> [   60.732991] CPU: 0 PID: 796 Comm: insmod Not tainted 6.1.22-g9c59b15a9e72 #1
> [   60.740049] Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
> [   60.746580] PC is at rtw_pci_read32+0x14/0x18 [rtw88_pci]
> [   60.752015] LR is at rtw_chip_info_setup+0x48/0x588 [rtw88_core]
> [   60.758170] pc : [<7f026048>]    lr : [<7f0001c0>]    psr: 60010013
> [   60.764442] sp : c1d0dd28  ip : 00000201  fp : 89344040
> [   60.769670] r10: 88b397a0  r9 : 88b3f890  r8 : 00000200
> [   60.774897] r7 : 000003da  r6 : 000003d9  r5 : 7f03a2c8  r4 : 88b397a0
> [   60.781428] r3 : c09200f0  r2 : 00000000  r1 : 000000f0  r0 : 00000000
> [   60.787959] Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment none
> [   60.795100] Control: 10c5387d  Table: 15d10059  DAC: 00000051
> [   60.800848] Register r0 information: NULL pointer
> [   60.805564] Register r1 information: non-paged memory
> [   60.810620] Register r2 information: NULL pointer

Danny,

The RTL8822CE certainly works with kernel 6.1 on X86_64 hardware. Routine
rtw_pci_read32() where the unhandled fault happens has not been changed since
kernel 5.2.


2024-03-21 17:42:08

by Larry Finger

[permalink] [raw]
Subject: Re: Is RTL8822CE with Kernel 6.1 for imx6

On 3/21/24 08:13, 施小丰(医用制品产业集团-医用制品集团本部) wrote:
>
> Dear linux wireless team:
>    This is Danny, a embedded software engineer
>
>    I have successfully run the 8822CE module in Linux kernel 5.4 with imx6
> hardware platform.
>    But it doesnt work in Kernel 6.1 though i have put many efforts to this issue.
>   So, we'd like to check with you whether the RTL8822CE chip is compatible with
> Linux Kernel 6.1.
>    My usage is as below:
>
> 1. imx6 board
> 2. build RTL8822CE as M in kernel 6.1 menuconfig
> 3. Each time after the board startup, i run four commands
>
>     insmod rtw88_core.ko
>     insmod rtw88_pci.ko
>     insmod rtw88_8822c.ko
>     insmod rtw88_8822ce.ko
> 4.  When run  insmod rtw88_8822ce.ko, in most cases, the error will show as
> below. (few times can work)
>  Detail error log is attached.
>   Same step (1) -(4) works very well with kernel 5.4 in same hadrware platform.
> ================
> root@imx6solosabresd:~/8822CE# ./insmod.sh
> [   60.541840] rtw_8822ce 0000:01:00.0: enabling device (0000 -> 0003)
> [   60.558145] rtw_8822ce 0000:01:00.0: Firmware version 9.9.4, H2C version 15
> [   60.567135] rtw_8822ce 0000:01:00.0: Firmware version 9.9.15, H2C version 15
> [   60.706697] 8<--- cut here ---
> [   60.709775] Unhandled fault: imprecise external abort (0x1406) at 0x01b77740
> [   60.716832] [01b77740] *pgd=00000000
> [   60.720421] Internal error: : 1406 [#1] PREEMPT SMP ARM
> [   60.725653] Modules linked in: rtw88_8822ce(+) rtw88_8822c rtw88_pci rtw88_core
> [   60.732991] CPU: 0 PID: 796 Comm: insmod Not tainted 6.1.22-g9c59b15a9e72 #1
> [   60.740049] Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
> [   60.746580] PC is at rtw_pci_read32+0x14/0x18 [rtw88_pci]
> [   60.752015] LR is at rtw_chip_info_setup+0x48/0x588 [rtw88_core]
> [   60.758170] pc : [<7f026048>]    lr : [<7f0001c0>]    psr: 60010013
> [   60.764442] sp : c1d0dd28  ip : 00000201  fp : 89344040
> [   60.769670] r10: 88b397a0  r9 : 88b3f890  r8 : 00000200
> [   60.774897] r7 : 000003da  r6 : 000003d9  r5 : 7f03a2c8  r4 : 88b397a0
> [   60.781428] r3 : c09200f0  r2 : 00000000  r1 : 000000f0  r0 : 00000000
> [   60.787959] Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment none
> [   60.795100] Control: 10c5387d  Table: 15d10059  DAC: 00000051
> [   60.800848] Register r0 information: NULL pointer
> [   60.805564] Register r1 information: non-paged memory
> [   60.810620] Register r2 information: NULL pointer

Danny,

Sorry, the previous message was sent too early and incomplete.

The RTL8822CE certainly works with kernel 6.1 on X86_64 hardware. Routine
rtw_pci_read32() where the unhandled fault happens has not been changed since
kernel 5.2.

That "imprecise external abort" is ARM specific. I have not yet found the reason
for it, nor what the value 0x1406 means.

The range of kernels (5.4 to 6.1) is pretty broad. Are there any intermediate
kernels for you to test?

Larry






2024-03-22 07:31:04

by Ping-Ke Shih

[permalink] [raw]
Subject: RE: Is RTL8822CE with Kernel 6.1 for imx6



From: 施小丰(医用制品产业集团-医用制品集团本部) <[email protected]>
Sent: Thursday, March 21, 2024 9:13 PM
To: linux-wireless <[email protected]>
Subject: Is RTL8822CE with Kernel 6.1 for imx6

> root@imx6solosabresd:~/8822CE# ./insmod.sh
> [ 60.541840] rtw_8822ce 0000:01:00.0: enabling device (0000 -> 0003)
> [ 60.558145] rtw_8822ce 0000:01:00.0: Firmware version 9.9.4, H2C version 15
> [ 60.567135] rtw_8822ce 0000:01:00.0: Firmware version 9.9.15, H2C version 15
> [ 60.706697] 8<--- cut here ---
> [ 60.709775] Unhandled fault: imprecise external abort (0x1406) at 0x01b77740
> [ 60.716832] [01b77740] *pgd=00000000
> [ 60.720421] Internal error: : 1406 [#1] PREEMPT SMP ARM
> [ 60.725653] Modules linked in: rtw88_8822ce(+) rtw88_8822c rtw88_pci rtw88_core
> [ 60.732991] CPU: 0 PID: 796 Comm: insmod Not tainted 6.1.22-g9c59b15a9e72 #1
> [ 60.740049] Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
> [ 60.746580] PC is at rtw_pci_read32+0x14/0x18 [rtw88_pci]
> [ 60.752015] LR is at rtw_chip_info_setup+0x48/0x588 [rtw88_core]
> [ 60.758170] pc : [<7f026048>] lr : [<7f0001c0>] psr: 60010013
> [ 60.764442] sp : c1d0dd28 ip : 00000201 fp : 89344040
> [ 60.769670] r10: 88b397a0 r9 : 88b3f890 r8 : 00000200
> [ 60.774897] r7 : 000003da r6 : 000003d9 r5 : 7f03a2c8 r4 : 88b397a0
> [ 60.781428] r3 : c09200f0 r2 : 00000000 r1 : 000000f0 r0 : 00000000
> [ 60.787959] Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment none
> [ 60.795100] Control: 10c5387d Table: 15d10059 DAC: 00000051
> [ 60.800848] Register r0 information: NULL pointer
> [ 60.805564] Register r1 information: non-paged memory
> [ 60.810620] Register r2 information: NULL pointer

The rtw_pci_read32() is very simple that just use 'rtwpci->mmap' as address,
so I wonder this exception is caused by NULL of rtwpci->mmap.

But, rtw_pci_io_mapping() has handled the NULL case:

static int rtw_pci_io_mapping(struct rtw_dev *rtwdev,
struct pci_dev *pdev)
{
...

rtwpci->mmap = pci_iomap(pdev, bar_id, len);
if (!rtwpci->mmap) {
pci_release_regions(pdev);
rtw_err(rtwdev, "failed to map pci memory\n");
return -ENOMEM;
}
...
}

So, did you change something for your board?

Ping-Ke

2024-03-28 21:29:09

by Larry Finger

[permalink] [raw]
Subject: Re: Is RTL8822CE with Kernel 6.1 for imx6

On 3/28/24 1:11 PM, 施小丰(医用制品产业集团-医用制品集团本部) wrote:
> Hi Larry:
> This week, I tried 5.4,  5.15 and 6.1
>
> Only 5.4 works for 8822CE module.

Without any error messages, there is little I can do to fix it.

Larry


>
>
>


2024-03-29 00:17:49

by Ping-Ke Shih

[permalink] [raw]
Subject: RE: Is RTL8822CE with Kernel 6.1 for imx6


(use plain text and no top posting for wireless mailing list)

>  With kernel 5.4, it works fine, but with kernel 6.1, it doesn't work.

If you suspect rtw88 of kernel 6.1 gets wrong, pick it back to kernel 5.4
to see if it works. Or oppositely put old driver to new kernel.


2024-03-29 00:30:59

by Ping-Ke Shih

[permalink] [raw]
Subject: RE: Is RTL8822CE with Kernel 6.1 for imx6


> Shall we try some other firmware for the 8822CE?
> Is it possible that some confliction between 8822CE driver and firmware? 

No. As your log, it has not yet tried to download firmware.

> [   55.184350] r10: 83c797a0  r9 : 83c7f890  r8 : 00000200
> [   55.189578] r7 : 000003da  r6 : 000003d9  r5 : 7f048418  r4 : 83c797a0
> [   55.196109] r3 : c09200f0  r2 : 00000000  r1 : 000000f0  r0 : 00000000

Since first rtw_pci_read32() from rtw_chip_info_setup() is
hal->chip_version = rtw_read32(rtwdev, REG_SYS_CFG1); // REG_SYS_CFG1 is 0xf0

So, I guess r1 is to store arg2 (REG_SYS_CFG1), and r3 is rtwpci->mmap + addr.

> [   55.230013] Register r3 information: 0-page vmalloc region starting at 0xc0920000 allocated at rtw_pci_probe+0x164/0xf1c [rtw88_pci]

But weird. It says that is a vmalloc region.

I'm not familiar with the trace. Just point out some suspicious points for
reference.


2024-03-29 05:52:22

by Ping-Ke Shih

[permalink] [raw]
Subject: RE: Is RTL8822CE with Kernel 6.1 for imx6


> So, i would like to check to you, is there any successful case that a 8822CE WIFI module works well with Kernel 6.1?

I suggest you install Ubuntu or other distro on your x86 PC, and update
(upgrade or downgrade) the kernel to 6.1. Have you tried that?


2024-03-29 05:53:50

by Ping-Ke Shih

[permalink] [raw]
Subject: RE: Is RTL8822CE with Kernel 6.1 for imx6



> > So, i would like to check to you, is there any successful case that a 8822CE WIFI module works well with
> Kernel 6.1?
>
> I suggest you install Ubuntu or other distro on your x86 PC, and update
> (upgrade or downgrade) the kernel to 6.1. Have you tried that?

By the way, please use plain text mode and no top posting, which is convention
of this mailing list.