From owner-freebsd-current@freebsd.org Fri May 7 16:34:57 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 5C12A634569 for ; Fri, 7 May 2021 16:34:57 +0000 (UTC) (envelope-from junchoon@dec.sakura.ne.jp) Received: from www121.sakura.ne.jp (www121.sakura.ne.jp [153.125.133.21]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4FcGJJ746Jz4q32; Fri, 7 May 2021 16:34:56 +0000 (UTC) (envelope-from junchoon@dec.sakura.ne.jp) Received: from kalamity.joker.local (115-38-180-10.area1c.commufa.jp [115.38.180.10]) (authenticated bits=0) by www121.sakura.ne.jp (8.16.1/8.16.1/[SAKURA-WEB]/20201212) with ESMTPA id 147GYkxJ096252; Sat, 8 May 2021 01:34:47 +0900 (JST) (envelope-from junchoon@dec.sakura.ne.jp) Date: Sat, 8 May 2021 01:34:45 +0900 From: Tomoaki AOKI To: freebsd-current@freebsd.org Cc: lev@FreeBSD.org Subject: Re: CURRENT crashes at early boot on Lenovo T540p: rtsx to blame - 13.0-RELEASE crashes same way! Message-Id: <20210508013445.d4391b5591f21aaa791d6aae@dec.sakura.ne.jp> In-Reply-To: <755d0029-bea6-3a43-c0c2-184349d88054@FreeBSD.org> References: <740cd7a0-3faf-7a56-80f7-dbb9bdacb55b@FreeBSD.org> <37122994-8172-b943-2602-fd1b4e9af78a@FreeBSD.org> <20210507132215.2469c296@ernst.home> <755d0029-bea6-3a43-c0c2-184349d88054@FreeBSD.org> Reply-To: junchoon@dec.sakura.ne.jp Organization: Junchoon corps X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; amd64-portbld-freebsd13.0) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4FcGJJ746Jz4q32 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: Fri, 07 May 2021 16:34:57 -0000 On Fri, 7 May 2021 16:59:35 +0300 Lev Serebryakov wrote: > On 07.05.2021 16:22, Gary Jennejohn wrote: > > >>>> 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. Have you try dev.rtsx.0.inversion=1 in /boot/loader.conf with the device enabled on BIOS? 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. > > -- > // Lev Serebryakov > _______________________________________________ > freebsd-current@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org" > -- Tomoaki AOKI