Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 14 May 2021 10:17:29 +0200
From:      Henri Hennebert <hlh@restart.be>
To:        Marc Veldman <marc@bumblingdork.com>
Cc:        "lev@freebsd.org" <lev@FreeBSD.org>, freebsd-current@freebsd.org
Subject:   Re: CURRENT crashes at early boot on Lenovo T540p: rtsx to blame - 13.0-RELEASE crashes same way!
Message-ID:  <0e13f794-a691-ddd1-4122-339bbc9e06f8@restart.be>
In-Reply-To: <FB505789-D89C-4BA8-A3AE-8352CDBF0556@bumblingdork.com>
References:  <a7363387-c53f-d6c0-acc0-be9081590ea1@FreeBSD.org> <D9843F30-308D-4F9F-A229-05639346564A@bumblingdork.com> <9f0abf48-ed13-bff3-5687-fca0d57195d8@restart.be> <C4E25C70-25BA-4BEB-83F0-D77279B2B94A@bumblingdork.com> <8d4e076b-9ecd-aef2-0ee8-73519bb9d939@FreeBSD.org> <8d2be5f2-4144-082e-4237-0dac0c4b37e6@restart.be> <f084b1c8-5020-2db9-6cf3-47641066bb69@FreeBSD.org> <6798878a-c499-d78d-e96d-d744513cb80d@restart.be> <a630c8a3-a9d7-c6f5-111c-be0e64db1ec6@FreeBSD.org> <1de588e2-20cb-3206-3aea-f3f88f577675@restart.be> <c324501a-6a8e-f8aa-3ecd-e8d7d3485e2c@FreeBSD.org> <e20d2d7d-8584-bb6b-465d-83a5b63f8210@restart.be> <67f0874a-6a05-67f1-3f2b-c4b3dc67fa11@FreeBSD.org> <83b823bf-c6c2-2f6a-b5dd-2e91b4d1931e@restart.be> <2c208bbc-5adc-2327-4717-a5e7c8d64b4b@FreeBSD.org> <9a15daa7-2b17-e257-d4d1-850c632a9db8@restart.be> <417a97b9-2c40-310c-c445-b193c493b880@FreeBSD.org> <7eb763ce-0bbf-9baf-2ede-968ee25cff2e@restart.be> <FB505789-D89C-4BA8-A3AE-8352CDBF0556@bumblingdork.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 5/13/21 7:25 PM, Marc Veldman wrote:
> 
> 
>> On 13 May 2021, at 17:56, Henri Hennebert <hlh@restart.be> wrote:
>>
>> On 5/13/21 5:51 PM, Lev Serebryakov wrote:
>>> On 13.05.2021 18:38, Henri Hennebert via freebsd-current wrote:
>>>> This seems a good news.
>>>>
>>>> Can you replace sys/dev/rtsx.c by the latest version (2.0g) from
>>>> https://github.com/hlh-restart/rtsx
>>>>
>>>> I reduce the DELAY to 250000 and make some other updates waiting in the pipeline.
>>> I've replaced two files in /usr/src/sys/dev/rtsx, rebuilt GENERIC kernel and it boots!
>>>   Output WITHOUT card is like this:
>>> pci2: <ACPI PCI bus> on pcib2
>>> rtsx0: <2.0g Realtek RTS5227 PCI MMC/SD Card Reader> mem 0xf4500000-0xf4500fff at device 0.0 on pci2
>>> rtsx0: We are running with inversion: 0
>>> rtsx0: Interrupt card inserted/removed
>>> rtsx0: Card absent
>>> rtsx0: No card is detected
>>> pcib3: <ACPI PCI-PCI bridge> at device 28.1 on pci0
>>>   Output WITH card is like this:
>>> pci2: <ACPI PCI bus> on pcib2
>>> rtsx0: <2.0g Realtek RTS5227 PCI MMC/SD Card Reader> mem 0xf4500000-0xf4500fff at device 0.0 on pci2
>>> rtsx0: We are running with inversion: 0
>>> rtsx0: Interrupt card inserted/removed
>>> rtsx0: Card present
>>> rtsx0: A card is detected
>>> mmc0: <MMC/SD bus> on rtsx0
>>> pcib3: <ACPI PCI-PCI bridge> at device 28.1 on pci0
>>> ...
>>> mmcsd0: 16GB <SDHC SDC   1.0 SN 0000056F MFG 01/2012 by 116 JE> at mmc0 50.0MHz/4bit/2048-block
>>> ...
>>>   No visible delays in both cases.
>>>   Both boots are "cold", with AC cycle
>> So if I understand correctly, your problem is solved.
>>
> 
> 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 —

Really strange, on my configuration, under 13.0-STABLE 
(stable/13-n245247-53c0fd84096) all was working smoothly.

I switch back to taskqueue_swi_giant.

Please test from GitHub version 2.0h.

I am also interested by the output of
kenv | grep smbios.system

I think that in your case (P50s) inersion is not needed and
you must add

dev.rtsx.0.inversion=0 in loader.conf

The inversion heuristic is not working for you.

Please show the rtsx lines from dmesg.

> 
> 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.

Thanks, I forget to update the comment when I switch from 500000 to 250000.
> 
> Again, thank you very much for your work on this!
> 
> Best regards,
> 
> Marc Veldman
> 
> 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?0e13f794-a691-ddd1-4122-339bbc9e06f8>