From nobody Mon Dec 19 10:37:52 2022 X-Original-To: stable@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NbGPb6cn1z1GKfv for ; Mon, 19 Dec 2022 10:37:55 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mx.blih.net (mx.blih.net [212.83.155.74]) (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-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mx.blih.net", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NbGPb09dBz3q9r for ; Mon, 19 Dec 2022 10:37:54 +0000 (UTC) (envelope-from manu@bidouilliste.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bidouilliste.com header.s=mx header.b=YeYZc8hf; spf=pass (mx1.freebsd.org: domain of manu@bidouilliste.com designates 212.83.155.74 as permitted sender) smtp.mailfrom=manu@bidouilliste.com; dmarc=pass (policy=none) header.from=bidouilliste.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bidouilliste.com; s=mx; t=1671446273; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=A6HDRflfLB5QFk5pWvimFz7mgVzBsX0mDNED6kmEtc4=; b=YeYZc8hfA8qeAPzREMK7rRSepFWJPJFtySrAGBr/Ur6UokEti+iXUYJJc8eOaoR89oDwo5 vuTDDtblXv+o+jqS7qucgOeyJ7e3bOWFqlkiwfJ/Ajg5ljGpAu3fyjct22sWXmrzVZ8d1R EIUObROSMevUrdoRhlACheR0s2Yjvvg= Received: from amy.home.blih.net (lfbn-lyo-1-2174-135.w90-66.abo.wanadoo.fr [90.66.97.135]) by mx.blih.net (OpenSMTPD) with ESMTPSA id a0b977b2 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Mon, 19 Dec 2022 10:37:53 +0000 (UTC) Date: Mon, 19 Dec 2022 11:37:52 +0100 From: Emmanuel Vadot To: Doug Moore Cc: Adam McDougall , stable@freebsd.org Subject: Re: stable/13 - amdgpu broken with n253286-d8a88ec38149 Message-Id: <20221219113752.2bfaa7b8b5a02016ab3a5d1e@bidouilliste.com> In-Reply-To: References: <9f06d2a9-6bae-9c1b-8ac7-97a083dd0284@egr.msu.edu> <20221218170958.b0d6f9f294134a08c15dd328@bidouilliste.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; amd64-portbld-freebsd14.0) List-Id: Production branch of FreeBSD source code List-Archive: https://lists.freebsd.org/archives/freebsd-stable List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-stable@freebsd.org X-BeenThere: freebsd-stable@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Spamd-Result: default: False [-3.50 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; DMARC_POLICY_ALLOW(-0.50)[bidouilliste.com,none]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ip4:212.83.155.74/32]; R_DKIM_ALLOW(-0.20)[bidouilliste.com:s=mx]; MIME_GOOD(-0.10)[text/plain]; ASN(0.00)[asn:12876, ipnet:212.83.128.0/19, country:FR]; FROM_EQ_ENVFROM(0.00)[]; FREEMAIL_TO(0.00)[gmail.com]; MIME_TRACE(0.00)[0:+]; MLMMJ_DEST(0.00)[stable@freebsd.org]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FREEFALL_USER(0.00)[manu]; ARC_NA(0.00)[]; DKIM_TRACE(0.00)[bidouilliste.com:+]; FROM_HAS_DN(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-Rspamd-Queue-Id: 4NbGPb09dBz3q9r X-Spamd-Bar: --- X-ThisMailContainsUnwantedMimeParts: N On Mon, 19 Dec 2022 03:20:36 -0600 Doug Moore wrote: > Emmanuel - >=20 > If you are withdrawing your statement that this was a successfully=20 > tested change, then I should withdraw the change. Your change restored abi compat but it seems that the code isn't ok. > I don't know anything about drm_mm_insert_mode_in_range, or drm as a=20 > whole, but grepping the 13.1 drm directory for 'rbtree' or 'RB_TREE', I=20 > can't find anything.=A0 So I don't know where to look. The code that fails is here https://github.com/freebsd/drm-kmod/blob/5.10-lts/drivers/gpu/drm/drm_mm.c#= L167 and https://github.com/freebsd/drm-kmod/blob/5.10-lts/drivers/gpu/drm/drm_mm.c#= L531 > Doug >=20 > On 12/18/22 10:09, Emmanuel Vadot wrote: > > On Sun, 18 Dec 2022 19:34:19 -0500 > > Adam McDougall wrote: > > > >> Hello, > >> > >> I have a Dell R6525 which I use to make new FreeBSD builds from -stable > >> and distribute them to other systems as upgrades. I updated my 13-STAB= LE > >> tree to 20221217 and the kernel hangs during boot after printing > >> messages from mlx5 driver. I'm not even using a GPU. I don't know how > >> many of my systems this would affect but I'd rather prevent it than fi= nd > >> out. I recompiled the kernel commit by commit and d8a88ec38149 makes it > >> hang. I think I have little exposure to binary compat issues with 13 so > >> I will probably revert the commit locally for now. It boots with that > >> commit reverted though. > > Ok it seems that I've only tested 13.1 drm-kmod on stable and not > > recompiling it. > > So the new code is compatible with 13.1 but doesn't work ? > > Since the problem is also on mlx5 (which I guess uses the linuxkpi > > rb_tree stuff). > > My machine isn't frozen but the drm code is stuck in > > drm_mm_insert_node_in_range (which uses the rb_tree stuff). > > > > Doug, any ideas ? > > > >> On 12/18/2022 11:55 AM, Jeff Gibbons wrote: > >>> I see exactly the same thing Jonathan does, but in my case with > >>> i915kms.ko (which also comes from the /usr/ports/graphics/drm-510-kmo= d/ > >>> port, like his amdgpu.ko does). My video device is Intel's > >>> 'WhiskeyLake-U GT2 [UHD Graphics 620]'. This bug report may be > >>> related: > >>> > >>> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D267421 > >>> > >>> After I upgraded my Lenovo Thinkpad T490s laptop with yesterday's > >>> /usr/src/, my laptop hung completely every time I tried to load > >>> /boot/modules/i915kms.ko, requiring a power-off/power-on. It hung > >>> when loading i915kms even after I rebuilt and reinstalled > >>> /usr/ports/graphics/drm-510-kmod/ . > >>> > >>> I tried many things, including rebuilding several different recent > >>> versions of /usr/ports/graphics/drm-510-kmod/, but nothing cured it. > >>> > >>> After seeing Jonathan's email to this list, I tried reverting my > >>> /usr/src/ to Friday before that commit date that he gave, and > >>> after rebuilding my system and then rebuilding/installing > >>> /usr/ports/graphics/drm-510-kmod/ again (drm-510-kmod-5.10.113_8), > >>> I can now kldload i915kms again without crashing, and everything > >>> works. > >>> > >>> It behaves as if something around the time of that commit that > >>> Jonathan pointed to: > >>> > >>> commit d8a88ec381498f5942403088d28ee325b92e9a78 > >>> (Date: Fri Dec 16 03:15:28 2022 -0600) > >>> > >>> is preventing FreeBSD from working with /usr/ports/graphics/drm-510-k= mod/ > >>> > >>> Jeff > >>> -- > >>> Jeff Gibbons > >>> > >>> > >>> From: Jonathan Vasquez > >>> Date: Sat, 17 Dec 2022 16:43:15 UTC > >>> > >>> I redid another clean install of latest stable/13 and latest ports fo= r drm-kmod / drm-510-kmod/ and gpu-firmware-amd-kmod FLAVOR=3Dsienna_cichli= d and the same thing arises. The system locks up immediately when loading t= he amdgpu driver. > >>> > >>> current src commit: > >>> > >>> commit a3c07a933d5cb71a6d58cc9f0ecb5385a5e0ea29 (HEAD -> stable/13, o= rigin/stable/13) > >>> Author: Rick Macklem > >>> Date: Sun Nov 13 12:16:06 2022 -0800 > >>> rpcb_clnt.c: Do not force use of UDP > >>> > >>> current ports commit: > >>> > >>> commit 414eb4d80eb56f154435a5749ec08811bf192a83 (HEAD -> main, origin= /main, origin/HEAD) > >>> Author: Jan Beich > >>> Date: Sat Dec 17 16:14:16 2022 +0000 > >>> > >>> emulators/yuzu: requires C++20 after 7b88749b5e69 > >>> https://github.com/yuzu-emu/yuzu/commit/07632ad82508 > >>> > >>> root@leslie:/usr/src # pkg info drm-kmod > >>> drm-kmod-20220907_1 > >>> Name : drm-kmod > >>> Version : 20220907_1Installed on : Sat Dec 17 11:32:01 2022 EST > >>> > >>> root@leslie:/usr/src # pkg info drm-510-kmod > >>> drm-510-kmod-5.10.113_8 > >>> Name : drm-510-kmod > >>> Version : 5.10.113_8Installed on : Sat Dec 17 11:32:01 2022 EST > >>> > >>> Installing sienna_cichlid as usual gives the correct information: > >>> > >>> make install clean FLAVOR=3Dsienna_cichlid > >>> > >>> Installing gpu-firmware-amd-kmod-sienna-cichlid-20221207_1... > >>> =3D=3D=3D> Cleaning for gpu-firmware-amd-kmod-sienna-cichlid-20221207= _1 > >>> > >>> Although using pkg info says verde, I think that info is wrong even t= hough sienna_cichlid is in fact being used (but that's probably a separate = issue): > >>> > >>> gpu-firmware-amd-kmod-verde-20221207_1 > >>> Name : gpu-firmware-amd-kmod-verde > >>> Version : 20221207_1 > >>> Installed on : Sat Dec 17 09:39:52 2022 EST > >>> Origin : graphics/gpu-firmware-amd-kmod > >>> Architecture : FreeBSD:13:amd64 > >>> Prefix : /usr/local > >>> Categories : kld graphics > >>> Licenses : AMD > >>> Maintainer : x11@FreeBSD.org > >>> WWW : https://github.com/freebsd/drm-kmod-firmware > >>> Comment : Firmware modules for verde AMD GPUs > >>> Annotations : > >>> FreeBSD_version: 1301510 > >>> flavor : verde > >>> > >>> Jonathan Vasquez > >>> PGP: 34DA 858C 1447 509E C77A D49F FB85 90B7 C4CA 5279 > >>> Sent with ProtonMail Secure Email > >>> > >>> ------- Original Message ------- > >>> On Saturday, December 17th, 2022 at 08:52, Jonathan Vasquez wrote: > >>> > >>>> Hey Emmanuel, > >>>> > >>>> What do you recommend then? As part of my testing yesterday (and wha= t I described) was that I pulled down latest stable/13 and latest ports. Cl= eanly recompiled world, kernel, and drm-510-kmod but the system freezes whe= n loading the amdgpu module. From my understanding drm-kmod is just meta po= rt which will bring in drm-510-kmod so recompiling drm-kmod itself won't ma= ke s difference if I already recompiled drm-510-kmod. > >>>> > >>>> Jonathan Vasquez > >>>> PGP: 34DA 858C 1447 509E C77A D49F FB85 90B7 C4CA 5279 > >>>> Sent with ProtonMail Secure Email > >>>> > >>>> Sent from Proton Mail mobile > >>>> > >>>> -------- Original Message -------- > >>>> On Dec 17, 2022, 03:51, Emmanuel Vadot < manu@bidouilliste.com> wrot= e: > >>>> > >>>>> Hello Jonathan, On Sat, 17 Dec 2022 02:42:42 +0000 Jonathan Vasquez= wrote: > Oh, I think I understand a bit better what you meant. Yup, after = I found which stable/13 commit was problematic, I compiled HEAD~1 which sti= ll works, then I recompiled drm-510-kmod and it's working now. But I still = wanted to report it since I'm guessing there will need to be some tweaks ma= de to drm-510-kmod so that it works again with the latest stable/13. There = is no tweaks to be done for drm-kmod. In fact in the last two days to commi= ts who broke KBI between 13.1 and stable/13 were taken care of (one I've re= verted and the other one being the one Doug fixed). Yes it's a bit unfortun= ate for stable/13 users that we broke KBI a few times and that you needed t= o recompile drm-kmod for it to work but what I want is when 13.2 is release= d users don't have to recompile the ports and can safely upgrade their mach= ines (as the drm-510-kmod port will be compiled on 13.1 for 3 months). Chee= rs, > Jonathan Vasquez > > > PGP: 34DA 858C 1447 509E C77A D49F FB85 90B7 C4CA 5279 > Sent with Pr= otonMail Secure Email > > ------- Original Message ------- > On Friday, Dec= ember 16th, 2022 at 21:31, Jonathan Vasquez wrote: > > > Hey Doug, > > > > = Not a problem. I actually did clean rebuilds of everything, including pulli= ng the latest ports and cleanly reinstalling drm-510-kmod and gpu-firmware-= amd-kmod. But it still failed. > > > > Jonathan Vasquez > > PGP: 34DA 858C = 1447 509E C77A D49F FB85 90B7 C4CA 5279 > > Sent with ProtonMail Secure Ema= il > > > > Sent from Proton Mail mobile > > > > -------- Original Message -= ------- > > On Dec 16, 2022, 21:05, Doug Moore < unkadoug@gmail.com> wrote:= > > > >> Short answer - try rebuilding kmod from scratch. > >> > >> Long a= nswer - I moved into stable/13 changes from main that changed some binary-l= evel representations. One who found that the kmod he built before those cha= nges no longer worked pointed out my error. So I made a change to stable/13= recently to restore the ori > > gi > > --=20 Emmanuel Vadot