From owner-freebsd-current@freebsd.org Wed May 12 13:34:59 2021 Return-Path: Delivered-To: freebsd-current@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CB0FA63EC23 for ; Wed, 12 May 2021 13:34:59 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com [IPv6:2a00:1450:4864:20::52a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FgG4M504zz4btb; Wed, 12 May 2021 13:34:59 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: by mail-ed1-x52a.google.com with SMTP id bf4so27097742edb.11; Wed, 12 May 2021 06:34:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references:reply-to :mime-version:content-transfer-encoding; bh=Wbf4W6gFCUF80JPkt6hSdFsQsbIVHC0gHnsQ2IvArOM=; b=s9MzSgQgaT+NrvylDjwZEBh014Jt+KDl/y3tLL1Db7DJcOuye8FV0WfTXEVla88neY ATKDLElkFKQXCaQcP8XUmvtEqDGdIuTWULvWOx8XbdCpEnrcbHFhJKjTGpZSMOOo6WF7 8f76nGxigl2K1K2p49+OwEJd2Evu75fGD/99QP6ZFd5GUam7ixeYX+F2ndqOGPTlJ6ax Fp9LfDzg+cHE84oFTBYP2t62/BCUSJ3K+7fL0DIQLhCXFimT4HZ9W+kzwOCCiV7KV9Ku XiiZiBa99zd1GhqrAS+XthIf3jqkGVNxgpJgBVmDWRcgYquDjovE2b47C6JLuZ0mRaPv LqHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:reply-to:mime-version:content-transfer-encoding; bh=Wbf4W6gFCUF80JPkt6hSdFsQsbIVHC0gHnsQ2IvArOM=; b=bIJEMHtsUw4dfiTYbZERLP2WdWIAFTryWUxgG5eBP0ywMremFn3RaV8ub7F8/CDim8 prTA1w1wrgTCMmogsZY8vZtsUYW4CQ33LkQgvM6dwNWVyuQmBt6slERPPNlGnSYv5pKV PcV9E5JuROqYuvxNIlyBx9Faj125ga85RnttXoUId+0PL0c3dwIT1cdGoqYJHPOIAXCC MSWOdjy2+s2QkBElvbqDkueC73+Xqp1zKP//7t1Sn6UPoobkronW25crGS14f/WBZ9LI +YFGjRBD+Myq1TXSRIgciGmDjghOyDxqCtQik/c1IC8WdDoUFoCA+cRs9/xemNsi61mZ doiw== X-Gm-Message-State: AOAM532OKvj8W67jfwUuUedq8dkpgX/YvZqJUCsov+SM50YZF+hNxoJZ cBDDY1OARPcA//hWJK7ggAjXyajxwnQ= X-Google-Smtp-Source: ABdhPJwd9JhvbSZE+ATsHOaPHGV+HFfbdMwly8Sm/9q29jkQZ6JDT5KgTKqg9rpv9axNYoW11P4kEw== X-Received: by 2002:a05:6402:3104:: with SMTP id dc4mr42403357edb.144.1620826497971; Wed, 12 May 2021 06:34:57 -0700 (PDT) Received: from ernst.home (pd9e23d76.dip0.t-ipconnect.de. [217.226.61.118]) by smtp.gmail.com with ESMTPSA id y21sm16694986edv.77.2021.05.12.06.34.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 May 2021 06:34:57 -0700 (PDT) Date: Wed, 12 May 2021 15:34:56 +0200 From: Gary Jennejohn To: Lev Serebryakov Cc: Henri Hennebert , 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: References: <740cd7a0-3faf-7a56-80f7-dbb9bdacb55b@FreeBSD.org> <37122994-8172-b943-2602-fd1b4e9af78a@FreeBSD.org> <20210512122747.51d2f574@laptop.domain> <1e23c1de-7529-0be9-c4ec-83d17b2b6bac@restart.be> Reply-To: gljennjohn@gmail.com X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; amd64-portbld-freebsd14.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4FgG4M504zz4btb X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 May 2021 13:34:59 -0000 On Wed, 12 May 2021 15:46:24 +0300 Lev Serebryakov 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