> Looks like there is problem with rtsx driver!
Oh, I forgot to add: disabling SD Card Reader in BIOS solves problem!
And console on these crashes is totally dead, and disks are not detected yet, so I can not look at structures in memory and/or dump core.
>> Looks like there is problem with rtsx driver!
> Oh, I forgot to add: disabling SD Card Reader in BIOS solves problem!
>
> And console on these crashes is totally dead, and disks are not detected yet, so I can not look at structures in memory and/or dump core.
13.0-RELEASE installation media crashes in same way if SD reader is enabled in BIOS.
>>>> Looks like there is problem with rtsx driver!
>>> Oh, I forgot to add: disabling SD Card Reader in BIOS solves problem!
>>>
>>> And console on these crashes is totally dead, and disks are not
>>> detected yet, so I can not look at structures in memory and/or
>>> dump core.
>>
>> 13.0-RELEASE installation media crashes in same way if SD reader is
>> enabled in BIOS.
>>
>
> I see that rtsx was added to GENERIC. Might have been premature.
>
> The only thing I can recommend is to install with the SD card reader
> disabled in the BIOS.
Yep, it works. Not only install, but booting of installed system too — any GENERIC kernel panics, even new, built by hands from latest sources.
> It may be the case that rtsx still works even if the card reader is
> disabled in the BIOS. That's the first thing I would try out.
Nope, it doesn't work (and I don't need it on this Laptop, to be honest). If SD reader is disabled in BIOS, it isn't detected at all.
> If that fails then generate a kernel with rtsx as a module rather than
> it being hard coded into the kernel.
>
> You could then re-enable the SD card reader in the BIOS and load the
> module to check whether the SD card reader works or causes a panic
> when the moduke is loaded. This approach might make it possible to
> get a crash dump if a problem occurs.
Ok, I'll try this, good idea.
BTW, I've got hints that it it rtsx-related only after ~40 crashes, as most of stack traces don't have rtsx in them and are very generic. Looks like rtsx mangle kernel memory and it crashes in other places/kernel threads.
--
// Lev Serebryakov
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=255130
Do you happen to have an empty adapter (sd->micro sd) inserted in the
slot. That causes a card-inserted interrupt, on all the realtek sd-card
readers I have touched.
Regards
> Have you try
>
> dev.rtsx.0.inversion=1
>
> in /boot/loader.conf with the device enabled on BIOS?
Not yet :-) I'll try.
> If not yet, it would be worth trying.
>
> In rtsx(4) manpage,
>
>> 〓 RTS522A on Lenovo P50s and Lenovo T470p, card detection and read-only
>> switch are reversed. This is sovled by adding in loader.conf(5):
>>
>> dev.rtsx.0.inversion=1
>
> If it works for you, possibly no one had tested on T540p yet.
> And there can be much, much more PCs/chips which need it, but no one has
> tested yet.
>
> My rtsx driver on ThinkPad P52 works fine without it, but IIRC,
> paniced with it (I did it just a test purpose when it landed).
>
> And one more.
> If you insert write-protected card and then mount it as writable,
> it SHOULD certainly crash the system.
> It's not a rtsx driver issue, but promised to happen.
> I've encountered the problem on USB card readers, too.
My slot is empty, no card, no adapters, no plastic pseudo-card, nothing.
> It would be fine if you can test the driver with dev.rtsx.0.inversion=1 in loader.conf and see it it solve the problem.
> the output of
> sysctl dev.rtsx and
> kenv | grep smbios.system
> would be useful
>
> BTW is a dummy card inserted in the SD slot?
>
> Thank for your time
My T540p:
(1) rtsx in the kernel, enabled in BIOS, no settings in loader.conf, EMPTY SLOT — panic on boot, typically WITHOUT rtsx in stack trace.
(2) rtsx in the kernel, enabled in BIOS, no settings in loader.conf, SD CARD IN THE SLOT — no panic on boot, but WiFi card detected
too late for startup scripts to run wpa_supplicant properly.
(3) rtsx in the kernel, enabled in BIOS, "dev.rtsx.0.inversion=1", SD CARD IN THE SLOT — no panic on boot, but WiFi card detected
too late for startup scripts to run wpa_supplicant properly. And card reporting is inverted related to real deal: rtsx0
reports "Card present" when I remove card and vice versa.
(4) rtsx in the kernel, disabled in BIOS — device not found, everything (but SD reader) boots & works (as expected!)
(5) rtsx in the kernel, enabled in BIOS, "dev.rtsx.0.inversion=1", EMPTY SLOT — boots, but prints out "timeout for CMD8/55/1" for very long time and *console*is*not*accessible* till "no compatible cards found on bus".
ALSO (!) wifi card is found only AFTER all these timeouts, when startup scripts are FAILED to attach to wireless network (!!!).
ALSO (!) it says "Card Absent" when I *INSERT* card after boot, and "Card present" (+ a lot of timeouts again) when I *REMOVE* card, looks like this "inversion" is wrong for my hardware.
So, it boots, but practically unusable.
(6) rtsx in the kernel, enabled in BIOS, "dev.rtsx.0.inversion=1", SD CARD IN THE SLOT
(7) rtsx is loaded as module after boot (manually, from console), enabled in BIOS, no setting in loader.conf — looks to work properly.
Card could be mounted, read/write, it works.
(9) rtsx is loaded as module after boot (manually, from console), enabled in BIOS, "dev.rtsx.0.inversion=1" — don't panic, but thinks wrong about card state (Card Present/Absent is inverted, as instructed).
My theory: rtsx detect/attach code has some race conditions / incompatibilities for multi-core boot when card is not present, and it thrash kernel memory and/or block something on boot. "inversion" removes this bad behavior due to waiting for card commands (as with "inversion" it thinks card is here and try to access it).
See (2), (3) and (4) — when rtsx doesn't cause panic on boot, it still mangle other devices detection & initialization.
I could provide any additional information. Unfortunately, memory dump of panic-on-boot is impossible :-(
--
// Lev Serebryakov
I’ve put my diagnostics in this thread, with the SVN revision in which it seems to have broken.
https://docs.freebsd.org/cgi/getmsg.cgi?fetch=327822+0+archive/2020/freebsd-current/20201227.freebsd-current
I’m willing to help debug the issue if someone can give me some pointers.
Best regards,
Marc Veldman
Indeed. But boot panics is not 100%, it is about 95%, and I've tested each case only one time...
>
>>
>> See (2), (3) and (4) — when rtsx doesn't cause panic on boot, it still mangle other devices detection & initialization.
>
> booting in case (2) can you show the output of
>
> pciconf -lvbc
hostb0@pci0:0:0:0: class=0x060000 rev=0x06 hdr=0x00 vendor=0x8086 device=0x0c04 subvendor=0x17aa subdevice=0x2210
vendor = 'Intel Corporation'
device = 'Xeon E3-1200 v3/4th Gen Core Processor DRAM Controller'
class = bridge
subclass = HOST-PCI
cap 09[e0] = vendor (length 12) Intel cap 0 version 1
pcib1@pci0:0:1:0: class=0x060400 rev=0x06 hdr=0x01 vendor=0x8086 device=0x0c01 subvendor=0x17aa subdevice=0x2210
vendor = 'Intel Corporation'
device = 'Xeon E3-1200 v3/4th Gen Core Processor PCI Express x16 Controller'
class = bridge
subclass = PCI-PCI
cap 0d[88] = PCI Bridge subvendor=0x17aa subdevice=0x2210
cap 01[80] = powerspec 3 supports D0 D3 current D0
cap 05[90] = MSI supports 1 message
cap 10[a0] = PCI-Express 2 root port max data 256(256)
max read 128
link x8(x8) speed 2.5(8.0) ASPM L0s/L1(L0s/L1)
slot 1 power limit 75000 mW
ecap 0002[100] = VC 1 max VC0
ecap 0005[140] = Root Complex Link Declaration 1
ecap 0019[d94] = PCIe Sec 1 lane errors 0xfe
vgapci1@pci0:0:2:0: class=0x030000 rev=0x06 hdr=0x00 vendor=0x8086 device=0x0416 subvendor=0x17aa subdevice=0x221e
vendor = 'Intel Corporation'
device = '4th Gen Core Processor Integrated Graphics Controller'
class = display
subclass = VGA
bar [10] = type Memory, range 64, base 0xf3000000, size 4194304, enabled
bar [18] = type Prefetchable Memory, range 64, base 0xc0000000, size 536870912, enabled
bar [20] = type I/O Port, range 32, base 0x5000, size 64, enabled
cap 05[90] = MSI supports 1 message enabled with 1 message
cap 01[d0] = powerspec 2 supports D0 D3 current D0
cap 13[a4] = PCI Advanced Features: FLR TP
hdac0@pci0:0:3:0: class=0x040300 rev=0x06 hdr=0x00 vendor=0x8086 device=0x0c0c subvendor=0x17aa subdevice=0x2210
vendor = 'Intel Corporation'
device = 'Xeon E3-1200 v3/4th Gen Core Processor HD Audio Controller'
class = multimedia
subclass = HDA
bar [10] = type Memory, range 64, base 0xf4630000, size 16384, enabled
cap 01[50] = powerspec 2 supports D0 D3 current D0
cap 05[60] = MSI supports 1 message enabled with 1 message
cap 10[70] = PCI-Express 1 root endpoint max data 128(128) FLR NS
max read 128
xhci0@pci0:0:20:0: class=0x0c0330 rev=0x04 hdr=0x00 vendor=0x8086 device=0x8c31 subvendor=0x17aa subdevice=0x2210
vendor = 'Intel Corporation'
device = '8 Series/C220 Series Chipset Family USB xHCI'
class = serial bus
subclass = USB
bar [10] = type Memory, range 64, base 0xf4620000, size 65536, enabled
cap 01[70] = powerspec 2 supports D0 D3 current D0
cap 05[80] = MSI supports 8 messages, 64 bit enabled with 1 message
none0@pci0:0:22:0: class=0x078000 rev=0x04 hdr=0x00 vendor=0x8086 device=0x8c3a subvendor=0x17aa subdevice=0x2210
vendor = 'Intel Corporation'
device = '8 Series/C220 Series Chipset Family MEI Controller'
class = simple comms
bar [10] = type Memory, range 64, base 0xf4639000, size 16, enabled
cap 01[50] = powerspec 3 supports D0 D3 current D0
cap 05[8c] = MSI supports 1 message, 64 bit
em0@pci0:0:25:0: class=0x020000 rev=0x04 hdr=0x00 vendor=0x8086 device=0x153a subvendor=0x17aa subdevice=0x2210
vendor = 'Intel Corporation'
device = 'Ethernet Connection I217-LM'
class = network
subclass = ethernet
bar [10] = type Memory, range 32, base 0xf4600000, size 131072, enabled
bar [14] = type Memory, range 32, base 0xf463f000, size 4096, enabled
bar [18] = type I/O Port, range 32, base 0x5080, size 32, enabled
cap 01[c8] = powerspec 2 supports D0 D3 current D0
cap 05[d0] = MSI supports 1 message, 64 bit enabled with 1 message
cap 13[e0] = PCI Advanced Features: FLR TP
ehci0@pci0:0:26:0: class=0x0c0320 rev=0x04 hdr=0x00 vendor=0x8086 device=0x8c2d subvendor=0x17aa subdevice=0x2210
vendor = 'Intel Corporation'
device = '8 Series/C220 Series Chipset Family USB EHCI'
class = serial bus
subclass = USB
bar [10] = type Memory, range 32, base 0xf463e000, size 1024, enabled
cap 01[50] = powerspec 2 supports D0 D3 current D0
cap 0a[58] = EHCI Debug Port at offset 0xa0 in map 0x14
cap 13[98] = PCI Advanced Features: FLR TP
hdac1@pci0:0:27:0: class=0x040300 rev=0x04 hdr=0x00 vendor=0x8086 device=0x8c20 subvendor=0x17aa subdevice=0x2210
vendor = 'Intel Corporation'
device = '8 Series/C220 Series Chipset High Definition Audio Controller'
class = multimedia
subclass = HDA
bar [10] = type Memory, range 64, base 0xf4634000, size 16384, enabled
cap 01[50] = powerspec 2 supports D0 D3 current D0
cap 05[60] = MSI supports 1 message, 64 bit enabled with 1 message
cap 10[70] = PCI-Express 1 root endpoint max data 128(128) FLR
max read 128
ecap 0002[100] = VC 1 max VC1
pcib2@pci0:0:28:0: class=0x060400 rev=0xd4 hdr=0x01 vendor=0x8086 device=0x8c10 subvendor=0x17aa subdevice=0x2210
vendor = 'Intel Corporation'
device = '8 Series/C220 Series Chipset Family PCI Express Root Port'
class = bridge
subclass = PCI-PCI
cap 10[40] = PCI-Express 2 root port max data 128(128)
max read 128
link x1(x1) speed 2.5(5.0) ASPM L0s/L1(L0s/L1)
slot 0 power limit 100 mW
cap 05[80] = MSI supports 1 message
cap 0d[90] = PCI Bridge subvendor=0x17aa subdevice=0x2210
cap 01[a0] = powerspec 3 supports D0 D3 current D0
pcib3@pci0:0:28:1: class=0x060400 rev=0xd4 hdr=0x01 vendor=0x8086 device=0x8c12 subvendor=0x17aa subdevice=0x2210
vendor = 'Intel Corporation'
device = '8 Series/C220 Series Chipset Family PCI Express Root Port'
class = bridge
subclass = PCI-PCI
cap 10[40] = PCI-Express 2 root port max data 128(128)
max read 128
link x1(x1) speed 2.5(5.0) ASPM L1(L0s/L1)
slot 1 power limit 100 mW
cap 05[80] = MSI supports 1 message
cap 0d[90] = PCI Bridge subvendor=0x17aa subdevice=0x2210
cap 01[a0] = powerspec 3 supports D0 D3 current D0
pcib4@pci0:0:28:2: class=0x060400 rev=0xd4 hdr=0x01 vendor=0x8086 device=0x8c14 subvendor=0x17aa subdevice=0x2210
vendor = 'Intel Corporation'
device = '8 Series/C220 Series Chipset Family PCI Express Root Port'
class = bridge
subclass = PCI-PCI
cap 10[40] = PCI-Express 2 root port max data 128(128)
max read 128
link x0(x1) speed 0.0(5.0) ASPM L0s/L1(L0s/L1)
slot 2 power limit 100 mW HotPlug(empty) surprise
cap 05[80] = MSI supports 1 message enabled with 1 message
cap 0d[90] = PCI Bridge subvendor=0x17aa subdevice=0x2210
cap 01[a0] = powerspec 3 supports D0 D3 current D0
ehci1@pci0:0:29:0: class=0x0c0320 rev=0x04 hdr=0x00 vendor=0x8086 device=0x8c26 subvendor=0x17aa subdevice=0x2210
vendor = 'Intel Corporation'
device = '8 Series/C220 Series Chipset Family USB EHCI'
class = serial bus
subclass = USB
bar [10] = type Memory, range 32, base 0xf463d000, size 1024, enabled
cap 01[50] = powerspec 2 supports D0 D3 current D0
cap 0a[58] = EHCI Debug Port at offset 0xa0 in map 0x14
cap 13[98] = PCI Advanced Features: FLR TP
isab0@pci0:0:31:0: class=0x060100 rev=0x04 hdr=0x00 vendor=0x8086 device=0x8c4f subvendor=0x17aa subdevice=0x2210
vendor = 'Intel Corporation'
device = 'QM87 Express LPC Controller'
class = bridge
subclass = PCI-ISA
cap 09[e0] = vendor (length 12) Intel cap 1 version 0
features: AMT, 4 PCI-e x1 slots
ahci0@pci0:0:31:2: class=0x010601 rev=0x04 hdr=0x00 vendor=0x8086 device=0x8c03 subvendor=0x17aa subdevice=0x2210
vendor = 'Intel Corporation'
device = '8 Series/C220 Series Chipset Family 6-port SATA Controller 1 [AHCI mode]'
class = mass storage
subclass = SATA
bar [10] = type I/O Port, range 32, base 0x50a8, size 8, enabled
bar [14] = type I/O Port, range 32, base 0x50b4, size 4, enabled
bar [18] = type I/O Port, range 32, base 0x50a0, size 8, enabled
bar [1c] = type I/O Port, range 32, base 0x50b0, size 4, enabled
bar [20] = type I/O Port, range 32, base 0x5060, size 32, enabled
bar [24] = type Memory, range 32, base 0xf463c000, size 2048, enabled
cap 05[80] = MSI supports 1 message enabled with 1 message
cap 01[70] = powerspec 3 supports D0 D3 current D0
cap 12[a8] = SATA Index-Data Pair
ichsmb0@pci0:0:31:3: class=0x0c0500 rev=0x04 hdr=0x00 vendor=0x8086 device=0x8c22 subvendor=0x17aa subdevice=0x2210
vendor = 'Intel Corporation'
device = '8 Series/C220 Series Chipset Family SMBus Controller'
class = serial bus
subclass = SMBus
bar [10] = type Memory, range 64, base 0xf4638000, size 256, enabled
bar [20] = type I/O Port, range 32, base 0xefa0, size 32, enabled
vgapci0@pci0:1:0:0: class=0x030000 rev=0xa1 hdr=0x00 vendor=0x10de device=0x1290 subvendor=0x17aa subdevice=0x221e
vendor = 'NVIDIA Corporation'
device = 'GK208M [GeForce GT 730M]'
class = display
subclass = VGA
bar [10] = type Memory, range 32, base 0xf2000000, size 16777216, enabled
bar [14] = type Prefetchable Memory, range 64, base 0xe0000000, size 268435456, enabled
bar [1c] = type Prefetchable Memory, range 64, base 0xf0000000, size 33554432, enabled
bar [24] = type I/O Port, range 32, base 0x4000, size 128, enabled
cap 01[60] = powerspec 3 supports D0 D3 current D0
cap 05[68] = MSI supports 1 message, 64 bit
cap 10[78] = PCI-Express 2 endpoint max data 256(256) RO NS
max read 512
link x8(x8) speed 2.5(8.0) ASPM L0s/L1(L0s/L1) ClockPM disabled
ecap 0002[100] = VC 1 max VC0
ecap 0004[128] = Power Budgeting 1
ecap 000b[600] = Vendor [1] ID 0001 Rev 1 Length 36
ecap 0019[900] = PCIe Sec 1 lane errors 0
rtsx0@pci0:3:0:0: class=0xff0000 rev=0x01 hdr=0x00 vendor=0x10ec device=0x5227 subvendor=0x17aa subdevice=0x2210
vendor = 'Realtek Semiconductor Co., Ltd.'
device = 'RTS5227 PCI Express Card Reader'
bar [10] = type Memory, range 32, base 0xf4500000, size 4096, enabled
cap 01[40] = powerspec 3 supports D0 D1 D2 D3 current D0
cap 05[50] = MSI supports 1 message, 64 bit enabled with 1 message
cap 10[70] = PCI-Express 2 endpoint max data 128(128) RO
max read 512
link x1(x1) speed 2.5(2.5) ASPM disabled(L0s/L1) ClockPM enabled
ecap 0001[100] = AER 2 0 fatal 0 non-fatal 1 corrected
ecap 0003[140] = Serial 1 00000001004ce000
ecap 0018[150] = LTR 1
ecap 001e[158] = L1 PM Substates 1
iwm0@pci0:4:0:0: class=0x028000 rev=0x6b hdr=0x00 vendor=0x8086 device=0x08b2 subvendor=0x8086 subdevice=0xc262
vendor = 'Intel Corporation'
device = 'Wireless 7260'
class = network
bar [10] = type Memory, range 64, base 0xf4400000, size 8192, enabled
cap 01[c8] = powerspec 3 supports D0 D3 current D0
cap 05[d0] = MSI supports 1 message, 64 bit enabled with 1 message
cap 10[40] = PCI-Express 2 endpoint max data 128(128) FLR RO NS
max read 128
link x1(x1) speed 2.5(2.5) ASPM L1(L0s/L1) ClockPM enabled
ecap 0001[100] = AER 1 0 fatal 0 non-fatal 0 corrected
ecap 0003[140] = Serial 1 7c7a91ffff988046
ecap 0018[14c] = LTR 1
ecap 000b[154] = Vendor [1] ID cafe Rev 1 Length 20
> and
>
> vmstat -i
interrupt total rate
irq1: atkbd0 278 3
irq9: acpi0 232 3
irq16: ehci0 171 2
irq23: ehci1 226 3
cpu0:timer 3636 43
cpu1:timer 2033 24
cpu2:timer 1839 22
cpu3:timer 1610 19
cpu4:timer 2363 28
cpu5:timer 3004 36
cpu6:timer 2990 36
cpu7:timer 2894 34
irq32: hdac0 6 0
irq33: xhci0 109175 1299
irq35: hdac1 45 1
irq36: rtsx0 359 4
irq38: ahci0 3098 37
irq39: iwm0 550 7
irq40: vgapci1 82 1
Total 134591 1602
--
// Lev Serebryakov
> On 12 May 2021, at 17:46, Henri Hennebert <h...@restart.be> wrote:
>
> On 5/12/21 5:04 PM, Marc Veldman wrote:
>> Unfortunately I can only say “me too”, but on a different Lenovo laptop.
>> I’ve put my diagnostics in this thread, with the SVN revision in which it seems to have broken.
>> https://docs.freebsd.org/cgi/getmsg.cgi?fetch=327822+0+archive/2020/freebsd-current/20201227.freebsd-current
>> I’m willing to help debug the issue if someone can give me some pointers.
>
> Just to try something:
>
> Does disabling the WIFI in the BIOS (if possible at all) allow a clean boot with rtsx in the kernel config?
>
Yes. With wifi disabled in the BIOS, the laptop boots both with and without a card inserted.
Booting a recent GENERIC with the following /boot/loader.conf
#dev.rtsx.0.inversion="1"
kern.geom.label.disk_ident.enable="0"
kern.geom.label.gptid.enable="0"
kern.geom.label.disk_ident.enable="0"
kern.geom.label.gptid.enable="0"
cryptodev_load="YES"
zfs_load=“YES"
uname -a:
FreeBSD supernovo 14.0-CURRENT FreeBSD 14.0-CURRENT #0 main-n246598-30659d1dcbc:
Wed May 12 10:53:48 CEST 2021 marc@devnovo:/usr/obj/usr/src/amd64.amd64/sys/GENERIC amd64
> can you also try a boot with a card inserted as in case (2) of Lev tests.
Booting with card inserted, wifi enabled in BIOS succeeds.
Booting with no card inserted wifi enabled in BIOS fails.
Booting with a card insert wifi enabled in BIOS succeeds.
Booting with no card inserted with wifi disabled in BIOS succeeds
The dev.rtsx.0.inversion flag inverts the behaviour: With wifi enabled
booting fails with the card inserted and succeeds with no card inserted.
> On 12 May 2021, at 18:06, Henri Hennebert <h...@restart.be> wrote:
>
> On 5/12/21 5:04 PM, Marc Veldman wrote:
>> Unfortunately I can only say “me too”, but on a different Lenovo laptop.
>> I’ve put my diagnostics in this thread, with the SVN revision in which it seems to have broken.
>> https://docs.freebsd.org/cgi/getmsg.cgi?fetch=327822+0+archive/2020/freebsd-current/20201227.freebsd-current
>
> I your first message on the thread I see
>
> "mmc0: detached"
>
> do you have the previous lines of the dmesg?
>
This is what I can see on the display:
(Copied by hand, so there might be some typos)
pcib2: <ACPI PCI-PCI bridge> at device 28.2 on pci0
pci2: <ACPI PCI bus> on pcib2
pci2: <network> at device 0.0 (no driver attached)
pcib3: <ACPI PCI-PCI bridge> at device 29.0 on pci0
pci3: <ACPI PCI bus> on pcib3
vgapci1: <VGA-compatible display> port 0xd000-0xd07f mem 0xf3000000-0xf3ffffff,0xe0000000-0xefffffff,0xf0000000-0xf1ffffff at device 0.0 on pci3
isab0: <PCI-ISA bridge> at device 31.0 on pci0
isa0: <ISA bus> on isab0
pci0: <memory> at device 31.2 (no driver attached)
hdac0: <Intel Sunrise Point-LP HDA Controller> mem 0xf4240000-0xf4243fff,0xf4230000-0xf423ffff at device 31.3 on pci0
em0: <Intel(R) I219-V SPT> mem 0xf4200000-0xf421ffff at device 31.6 on pci0
em0: Using 1024 TX descriptors and 1024 RX descriptors
em0: Using an MSI interrupt
em0: Ethernet address: 54:ee:75:cb:0d:e3
em0: netmap queues/slots: TX 1/1024, RX 1/1024
acpi_tz0: <Thermal Zone> on acpi0
atkbdc0: <Keyboard controller (i8042)> port 0x60,0x64 irq 1 on acpi0
atkbd0: <AT Keyboard> irq 1 on atkbdc0
kbd0 at atkbd0
atkbd0: [GIANT-LOCKED]
psm0: <PS/2 Mouse> irq 12 on atkbdc0
psm0: [GIANT-LOCKED]
WARNING: Device "psm" is Giant locked and may be deleted before FreeBSD 14.0.
psm0: model Synaptics Touchpad, device ID 0
battery0: <ACPI Control Method Battery> on acpi0
battery1: <ACPI Control Method Battery> on acpi0
acpi_acad0: <AC Adapter> on acpi0
orm0: <ISA Option ROM> at iomem 0xc0000-0xcffff pnpid ORM0000 on isa0
hwpstate_intel0: <Intel Speed Shift> on cpu0
hwpstate_intel1: <Intel Speed Shift> on cpu1
hwpstate_intel2: <Intel Speed Shift> on cpu2
hwpstate_intel3: <Intel Speed Shift> on cpu3
Timecounters tick every 1.000 msec
ZFS filesystem version: 5
ZFS storage pool version: features support (5000)
mmc0: detached
ugen0.1: <0x8086 XHCI root HUB> at usbus0
Fatal trap 9: general protection fault while in kernel mode
cupid = 3; apic id = 03
….
….
I’m not sure if this is an interesting data point or not,
but a warm boot without the card inserted succeeds after
a cold boot with the card inserted.
Yes.
rtsx0: <2.0c Realtek RT5522A PCI MMC/SD Card reader mem 0xf4100000-0xf4100fff at device 0.0 on pci1>
rtsx0: Card present
mmc0: <MMC/SD bus> on rtsx0
rtsx0: Interrupt card inserted/removed
rtsx0: Card absent
pcib2: <ACPI PCI-PCI bridge> ad device 28.2 on pci0
… (continue as above, with panic)
Note: The card is not inserted.
> I’m not sure if this is an interesting data point or not,
> but a warm boot without the card inserted succeeds after
> a cold boot with the card inserted.
It could explain, why my tests with "same code path" gave different results!
--
// Lev Serebryakov
>>> I’m not sure if this is an interesting data point or not,
>>> but a warm boot without the card inserted succeeds after
>>> a cold boot with the card inserted.
>>
>> It could explain, why my tests with "same code path" gave different results!
>>
> With a "cold" boot and without a card inserted did you see something like:
>
> rtsx0: <2.0c Realtek ...
> rtsx0: Card present
> mmc0: <MMC/SD bus> on rtsx0
> rtsx0: Interrupt card inserted/removed
> rtsx0: Card absent
When it panics, it panics before rtsx0 prints something in my case.
--
// Lev Serebryakov
>>>>> I’m not sure if this is an interesting data point or not,
>>>>> but a warm boot without the card inserted succeeds after
>>>>> a cold boot with the card inserted.
>>>>
>>>> It could explain, why my tests with "same code path" gave different results!
>>>>
>>> With a "cold" boot and without a card inserted did you see something like:
>>>
>>> rtsx0: <2.0c Realtek ...
>>> rtsx0: Card present
>>> mmc0: <MMC/SD bus> on rtsx0
>>> rtsx0: Interrupt card inserted/removed
>>> rtsx0: Card absent
>> When it panics, it panics before rtsx0 prints something in my case.
>>
> Does iwm0 / mmc0 is shown during boot?
>
> can you try a verbose boot (boot -s)
do you mean "boot -v"? :) It runs very fast, and there are not so much lines on the screen (is it possible to change screen reoslution before loading i915kms?)
Ok, now I've recorded cold boot without SD, without verbose, with my phone (yes, screenshots by photocamera, I fell so low!) and I was wrong, there is rtsx0:
rtsx0: <2.0c .....>
rtsx0: Card present
mmc0: <MMC/SD bus> on rtsx0
rtsx0: Interrupt card inserted/removed
rtsx0: Card absent
...
PANIC! (without rtsx0 in stacktrace, again it is run_interrupt_driven_config_hooks()).
> if you can't see the verbose output which is too fast on the display:
> try a boot -p
Oooops, keyboard is unresponsive after first pause and I can not unpause output :-(
Looks like another bug of early boot — EFI boot can not access keywboard before it is detected as `atkbd` (keyboard in loader works!)
--
// Lev Serebryakov
>> rtsx0: <2.0c .....>
>> rtsx0: Card present
>> mmc0: <MMC/SD bus> on rtsx0
>> rtsx0: Interrupt card inserted/removed
>> rtsx0: Card absent
>> ...
>
> This must be the culprit this change from present/absent
>
>> PANIC! (without rtsx0 in stacktrace, again it is run_interrupt_driven_config_hooks()).
>>
>>> if you can't see the verbose output which is too fast on the display:
>>> try a boot -p
>> Oooops, keyboard is unresponsive after first pause and I can not unpause output :-(
>>
>> Looks like another bug of early boot — EFI boot can not access keywboard before it is detected as `atkbd` (keyboard in loader works!)
>>
>
> try to rebuild your kernel with the attached patch.
Nope, same panic after cold (power-cycle) boot.
>>> try to rebuild your kernel with the attached patch.
>> Nope, same panic after cold (power-cycle) boot.
>
> Can you try with "DELAY(500000);"
>
> to see if this is a path to dig further.
It helps with panic!
--
// Lev Serebryakov
>>>>> try to rebuild your kernel with the attached patch.
>>>> Nope, same panic after cold (power-cycle) boot.
>>>
>>> Can you try with "DELAY(500000);"
>>>
>>> to see if this is a path to dig further.
>>
>> It helps with panic!
>
> What do you mean? Does it display "card present" before the interrupt ?
It doesn't panic, boots and works more than 500 seconds :-)
Output is like this:
pcib2: <ACPI PCI-PCI bridge> at device 28.0 on pci0
pci2: <ACPI PCI bus> on pcib2
rtsx0: <2.0c Realtek RTS5227 PCI MMC/SD Card Reader> mem 0xf4500000-0xf4500fff at device 0.0 on pci2
rtsx0: Interrupt card inserted/removed
rtsx0: Card absent
rtsx0: Card absent
pcib3: <ACPI PCI-PCI bridge> at device 28.1 on pci0
pci3: <ACPI PCI bus> on pcib3
(no visible pause between two "Card absent" lines).
--
// Lev Serebryakov
Just thought I'd throw that out.
--Chris
On my laptop (Lenovo P50s) the laptop now boots fine with and without the
card inserted, but it panics immediately on insertion or removal of the card,
unfortunately.
1)
#dev.rtsx.0.inversion=“1"
commented out in boot/loader.conf.
1.a)
Booting with the card works.
When I remove the card a few minutes after boot I get a panic:
Unread portion of the kernel message buffer:
rtsx0: Interrupt card inserted/removed
rtsx0: Card present
panic: mutex Giant not owned at /usr/src/sys/kern/subr_bus.c:2944
cpuid = 3
time = 1620924849
KDB: stack backtrace:
db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe00c6780910
vpanic() at vpanic+0x181/frame 0xfffffe00c6780960
panic() at panic+0x43/frame 0xfffffe00c67809c0
__mtx_assert() at __mtx_assert+0xb0/frame 0xfffffe00c67809d0
device_probe_and_attach() at device_probe_and_attach+0x2a/frame 0xfffffe00c6780a00
taskqueue_run_locked() at taskqueue_run_locked+0xaa/frame 0xfffffe00c6780a80
taskqueue_thread_loop() at taskqueue_thread_loop+0x94/frame 0xfffffe00c6780ab0
fork_exit() at fork_exit+0x80/frame 0xfffffe00c6780af0
fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe00c6780af0
--- trap 0, rip = 0, rsp = 0, rbp = 0 —
1.b)
Booting without the card works, when I insert the card I get the same panic.
2)
With ndev.rtsx.0.inversion="1"
Now enabled in /boot/loader.conf
2a)
Booting with the card inserted works, but when I remove the card I get the above panic.
2b)
Booting without the card inserted works, but when Insert the card I get the above panic.
> I will push this new version to current, but it will take some time because I am not a committer.
>
A minor thing about the patch/change.
I suspect the delay is a quarter of a second, not half as stated in the comments.
Again, thank you very much for your work on this!
Best regards,
Marc Veldman
The Power To Serve