Date: Wed, 12 May 2021 15:34:56 +0200 From: Gary Jennejohn <gljennjohn@gmail.com> To: Lev Serebryakov <lev@FreeBSD.org> Cc: Henri Hennebert <hlh@restart.be>, 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: <20210512133456.57f374f4@ernst.home> In-Reply-To: <e49c4a5e-d567-522b-c60c-59faa054c807@FreeBSD.org> References: <a7363387-c53f-d6c0-acc0-be9081590ea1@FreeBSD.org> <740cd7a0-3faf-7a56-80f7-dbb9bdacb55b@FreeBSD.org> <37122994-8172-b943-2602-fd1b4e9af78a@FreeBSD.org> <CALH631k8ek0UEB8LUv04YQg%2BzZUafUO2W4hcHBXqrTWDdDp7mg@mail.gmail.com> <20210512122747.51d2f574@laptop.domain> <1e23c1de-7529-0be9-c4ec-83d17b2b6bac@restart.be> <e49c4a5e-d567-522b-c60c-59faa054c807@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 12 May 2021 15:46:24 +0300 Lev Serebryakov <lev@FreeBSD.org> wrote: > On 12.05.2021 13:01, Henri Hennebert via freebsd-current wrote: > > > 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 :-( > Is sysctl debug.debugger_on_panic set to 1? You should automatically land in ddb if that is set. I suppose it is, since you posted some back trace in an earlier mail. It also seems to be the default, at least in my FreeBSD-14 kernel. AFAIK ddb has a command to generate a crash dump. But I can't easily check that :( It seems like there's a major bug when no SD card is inserted and the driver is in the kernel. And a timing problem when a card is in the slot at boot time. Good to know that the module still works. Difficult to debug without your laptop model in the hands of a developer. -- Gary Jennejohn
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20210512133456.57f374f4>