From nobody Thu Apr 21 07:44:32 2022 X-Original-To: x11@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 73DD4198B690 for ; Thu, 21 Apr 2022 07:44:35 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4KkV1D6Lfbz4d92 for ; Thu, 21 Apr 2022 07:44:32 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6696B2479A for ; Thu, 21 Apr 2022 07:44:32 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 23L7iWbe047057 for ; Thu, 21 Apr 2022 07:44:32 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 23L7iW54047056 for x11@FreeBSD.org; Thu, 21 Apr 2022 07:44:32 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: x11@FreeBSD.org Subject: [Bug 254472] graphics/drm-fbsd13-kmod Xorg crash on resume Date: Thu, 21 Apr 2022 07:44:32 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Ports & Packages X-Bugzilla-Component: Individual Port(s) X-Bugzilla-Version: Latest X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: maurizio1018@gmail.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: x11@FreeBSD.org X-Bugzilla-Flags: maintainer-feedback? X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: X11 List-Archive: https://lists.freebsd.org/archives/freebsd-x11 List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-x11@freebsd.org X-BeenThere: freebsd-x11@freebsd.org MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1650527073; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PXq8dLuHu7R40U320Xm4DbXajEgaBB/cdaYJxZubbVM=; b=c4P7O49rnGq1h9OUvezUnQZOhJoRhmhSwAugflqM7eZsIPEh1zQoQvdwQlsWF8kzHiXGw8 ka3dGvSceiNATvdXq2YwrKY3VzZkg2NVaP9WQ+OvQN156OGTbVSwrfJXUQ0jLB5Vhp3cW5 C33L7ZoZlSGOLfCpkmZE0+kLQeGRD1wzHXvtoM69SMGap9bxojqWTVfbxnZXTAGIurC/T+ 3vMaJR1CCpXLb1of0F4uOw+PrqYo0NNT8R9wC8Ha7cjMICf2w87YYa5CiUyNH9Rlqb9PRO 2kVoYVFwFNKhhEuiE2MA1+K2VStUgnB1QZ0CWm6URnHwtk+aOChyHmBBA/n7fA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1650527073; a=rsa-sha256; cv=none; b=RORzlgrp0LNT8hS/j5LARWyOE3PQg7D4gf0fy+11WikxZKRpS7TwYc223N3gOI7M9mQxP+ wMw2Tj6YTbNt4NrHAky6FRDWB8gQCAAb22B73UsZ4Sc7K4DGs6GfP0Y/VOmUAYXg7yw15f OMN8TpVkndI0MYMXRjWmARr1IcJGWbHvyOxIoFO5+c7vQWuX5Iks9eLtiahkDkindqFk1K spHw1S2au0G2/8j0Ok4Nqx0o1R6bBcOi360a774/p7DIBpdh+OSF6j/3LHE1kXwcrL4TEu K59U8wozMjYcRo5rtX+5hnk/rKK7O12Web8mFGExf1tZDSccig8dWJ2ZyKwuFg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D254472 --- Comment #6 from Maurizio --- I have found a workaround for this bug, an i915kms kernel driver patch. I have tested the patch on a Lenovo Thinkpad T450. NOTICE: I don=E2=80=99t know if this patch can damage your laptop, if it h= appens it is not my responsibility. The patch changes only one line of code in the source file drm-kmod-drm_v5.4.144_6/drivers/gpu/drm/i915/i915_gem.c in the function wait_for_timelines: I have replaced the line: timeout =3D i915_request_wait(rq, wait, timeout); with:=20=20=20=20=20=20 timeout =3D i915_request_wait(rq, wait, MAX_SCHEDULE_TIMEOUT); the rest of the patch lines are only printf messages to display the time sp= ent in the function. The i915_request_wait function never timeouts. I have warn= ed you with the above notice because my laptop can take more than 4 seconds to resume. Before applying the patch you must be able to build the graphics/drm-fbsd13-kmod port from source. Building the patched i915kms driver: # cd /usr/ports/graphics/drm-fbsd13-kmod/ # make clean # make config select =E2=80=9CBuild with debugging support=E2=80=9D # mkdir files Copy the patch file patch-drivers_gpu_drm_i915_i915__gem.c in the files directory and verify it # ls /usr/ports/graphics/drm-fbsd13-kmod/files patch-drivers_gpu_drm_i915_i915__gem.c # make build deinstall reinstall should compile and install the patched code without errors. Reboot for runn= ing the new driver. How this patch works on my laptop in the suspend/resume cycle. When suspend/resume works fast, I have this output at the console: vgapci0: child drmn0 requested pci_enable_io Start of i915_gem_wait_for_idle() flags=3D12 (locked), timeout=3D200 Calling wait_for_timelines() flags=3D12 (locked), timeout=3D2147483647 (forever) End of i915_gem_wait_for_idle() in 0 tick(s) rtsx0: Resume The i915_gem_wait_for_idle function takes less than one ms (tick =3D ms).= =20=20 When the suspend/resume cycle is slow, I have an output similar to: vgapci0: child drmn0 requested pci_enable_io Start of i915_gem_wait_for_idle() flags=3D12 (locked), timeout=3D200 Calling wait_for_timelines() drmn0: Resetting rcs0 for hang on rcs0 flags=3D12 (locked), timeout=3D2147483647 (forever) End of i915_gem_wait_for_idle() in 4138 tick(s) Start of i915_gem_wait_for_idle() flags=3D12 (locked), timeout=3D200 Calling wait_for_timelines() flags=3D12 (locked), timeout=3D2147483647 (forever) End of i915_gem_wait_for_idle() in 0 tick(s) rtsx0: Resume The message =E2=80=9Cdrmn0: Resetting rcs0 for hang on rcs0=E2=80=9D is wri= tten to the console and the i915_gem_wait_for_idle function takes more than 4 seconds to finish. The i915_gem_wait_for_idle is called again without errors and the laptop resumes. --=20 You are receiving this mail because: You are the assignee for the bug.=