From nobody Wed Mar 23 09:48:17 2022 X-Original-To: bugs@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 ED7E31A32364 for ; Wed, 23 Mar 2022 09:48:17 +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 4KNk7P5BVPz4sXj for ; Wed, 23 Mar 2022 09:48:17 +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 8EAC421330 for ; Wed, 23 Mar 2022 09:48:17 +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 22N9mH4E023379 for ; Wed, 23 Mar 2022 09:48:17 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 22N9mH5E023378 for bugs@FreeBSD.org; Wed, 23 Mar 2022 09:48:17 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: bugs@FreeBSD.org Subject: [Bug 262734] LinuxKPI: [patch] call dev_pm_ops::prepare() upon suspend to prevent Xorg from crashing after resume Date: Wed, 23 Mar 2022 09:48:17 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: taku@tackymt.homeip.net X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter attachments.created Message-ID: 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: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1648028897; 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; bh=NwJp9B/VypPtr5tXCOIt24vilNMPQkxpBcmEWsmrDqo=; b=ynE0bmxLoB4Rfr4lqDazN4+LZuRjXsqAlis7UUtLNGjZOWpXWQARW2R58bjxihSAJNum8c yAljnubAr0kfMD2b8Ta9vR3dKgEp5e8NsFOB3Lq/GMH1U1MRuC2bGN6wueluuo+C+YGqUt 3CliRtXwzHQIxcslI+k2USHN1ZzffBC0EmHyGr92xSGKZeH1m+oHULS7LKc5RNCl0WzaTp PJ83wBMai0Dxl5litpLL+/t+xwmQbNBfzqpB67KP09UNMZbm1YVSXrOJQfvMtIszaaPY6e Q7jILsGLZvysmOd/lcOF6RSiKXsP+mvAUj2e5OQH3U0xzVJeg6k4OJmuB7HRmw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1648028897; a=rsa-sha256; cv=none; b=Pb35h7lWbig2hgb6w15Wl+/wA+vH1fJ3CbXVpWwCOy8l3sNWPBP9HIT8DCRTX0jit0eZGG uBxR9qJnPikmiGfn6jA0+Ae1RYa9HNsKKAPXUEL/IqER4nJOSqmfF0R6wqp6axeqIgZa+B 348H77XVMY4IQBrkjI/D0dukgnWG5z0JnVwad807YN8O4YFHTuX2qBacsozT+ud2xD9Gkk /vtD1fWmBsSoQIRUDDUXSC+1EaiKc7cvMycnvCPgH3SNvR/fM7mc8+/brRqcr0EHqJZofm pS3BQxUQRXcrXXreA6/pH4GdrwPfgvIKhQMYkGBA9r8QaAMdiJwy4iyeuYFl8w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D262734 Bug ID: 262734 Summary: LinuxKPI: [patch] call dev_pm_ops::prepare() upon suspend to prevent Xorg from crashing after resume Product: Base System Version: CURRENT Hardware: Any OS: Any Status: New Severity: Affects Many People Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: taku@tackymt.homeip.net Created attachment 232653 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D232653&action= =3Dedit Call dev_pm_ops::prepare() from linux_pci_suspend() The dev_pm_ops' prepare() method should be called prior to its suspend() method, according to the Linux documentation: https://www.kernel.org/doc/html/v5.4/driver-api/pm/types.html#c.dev_pm_ops Without doing so, at least on my X1 Carbon 6th gen., Xorg usually (but not always) crashes after resume. I also suspect that the lacking of calling prepare() contributes to the hang on resume, infrequent but not rare, albeit no evidence. I have a couple of variants to call prepare() method at the time: * call prepare() via power_suspend_early eventhandler: stucks inside switch_to_kernel_context_sync() once per several trials. * (patch attached) call prepare() directly from linux_pci_suspend(): survives at least 10 trials, no failures yet. --=20 You are receiving this mail because: You are the assignee for the bug.=