Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp8083703rdb; Thu, 4 Jan 2024 19:26:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IGsuY5lukzO2aDLLdLmHJhNwzjlEydV2s3ByzlBZxYGfkLxX48T3wNseCifiGDy3LYYQ0S8 X-Received: by 2002:a05:6a20:6a9c:b0:196:8132:82a1 with SMTP id bi28-20020a056a206a9c00b00196813282a1mr1086846pzb.105.1704425182226; Thu, 04 Jan 2024 19:26:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704425182; cv=none; d=google.com; s=arc-20160816; b=rAW7GVprngv6NKYmyX/dNMziCIo/79K7iO4oyGH/uOhGoQIYwvPTEcbMUsib2bIsJd XLcRLIs2vV7ZIsL7LAzXZ9A/iOWQrFZ+HK9/rj+ZOVYrwSLvJ7m0wtQl9LKW2aHEEWXh fyUWxnjJt7/5WKN74Ew3N+1x+rJbD3sXsWN6lUtdXOdNQ1n1lC0DrTn9CG+0Xvp72Gjk 3JWXeWa1cO1Zz+2nzdo33hKTBWsygQkSYQ3tba3nm6moBH0qJGwlQdaW3k+69LPMY5PU kgSIwmdkZczF9jkR1PhNDtm6w4GAao0NJBfC//sD5zkOjxVxbGVTWluWVgOo+vqsJixn qelA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=GN6N8A+PcCFQ4gruSHSLuqFko2lttyDNbK76ZrmbaBs=; fh=/smwwy4isokyLEk2vvCS9laoBjfGITr2ArFNOK32qoY=; b=WaUMLxi/YLlLxwbY7YFra3egtFlcL8v/PNZTHNYreDblpfER8f9Y8DL14+MPy2ejdq DTuh1iWJhpJn1WQJ/+VPVuS1T7Idi+P5yDhz6BKpgH8zeorHvaX87qa7CsORCGlrCDaG ckiZpflFBiwijofDNqngcB3uhCKSlwtaaIDf8pCFxEtI4K49G3xjClhAVWzRNcfnBrP3 RQ0E9ccHKgGmP5vpbiS3rRKbRtUu/O7bs/qzXHmI/Zz+6nsigjXRwktxw27ZalgzJYk8 rIs4XqHMpBSkwDd72ksEP4yW/gKlqalCJ9bt08FT4MIfgxsuIRlQ/kFvf9yeIRFyNVRl aslw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=Txf6ELmB; spf=pass (google.com: domain of linux-kernel+bounces-17451-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17451-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id ju19-20020a170903429300b001d44da4524fsi511414plb.25.2024.01.04.19.26.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jan 2024 19:26:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-17451-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=Txf6ELmB; spf=pass (google.com: domain of linux-kernel+bounces-17451-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17451-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id D8F03286AF5 for ; Fri, 5 Jan 2024 03:26:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A3F325220; Fri, 5 Jan 2024 03:26:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=canonical.com header.i=@canonical.com header.b="Txf6ELmB" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp-relay-internal-0.canonical.com (smtp-relay-internal-0.canonical.com [185.125.188.122]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7175D442C for ; Fri, 5 Jan 2024 03:26:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=canonical.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=canonical.com Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com [209.85.216.70]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 9FB603F5A6 for ; Fri, 5 Jan 2024 03:26:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1704425167; bh=GN6N8A+PcCFQ4gruSHSLuqFko2lttyDNbK76ZrmbaBs=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=Txf6ELmBs0SA0owxfOZuAPDP6K+r4xjz4x8CSz5VcG+Y3C4PEU8lYnba9m+kKPFpC duG1WITC/+SgaE2M08KgGJCPd3CHdTPDQ5QUkiVOHTiXdw5TJErDSrfo+6daHvBftl qlfWZw3Qy9GzfL7BNqfR7tdSmiIC9NSWf/NwYqtiwflyFg1CgkRP60iVtjMjA8sZof i8ovnSTMkNttSF1E6QRSs2lgf/cs2wmx4NVI4zdErmCb2yrt3yr9xwE1diN5jnJoGT GHvUdNAQSk6kUuFjvWiHfXLXhEGZPNwkPNbDN7GPRVJHTmNQCUz6Mk6Q+1RCGoRsqt rQ5OMvMQD+IQA== Received: by mail-pj1-f70.google.com with SMTP id 98e67ed59e1d1-28cb109eb73so857436a91.0 for ; Thu, 04 Jan 2024 19:26:07 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704425166; x=1705029966; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GN6N8A+PcCFQ4gruSHSLuqFko2lttyDNbK76ZrmbaBs=; b=tZVZugdEjmOaFOGODd8J+EkikSgRv5FtaaNq0VrpwyYgUXZ4p9S8Vs13D61FIkbQup FVa9iVspxfktnGmeCcySISYKdsivb41W2b4SlyBIznJ5ehHcyQ56zNxFA5cUx/r0gJTy xfz/3j2MpKxcQfXofUv2cJ4evYzuTDmN6PYaGQHggZ8VFvF1A+L/8Us1fLHlulv7BnCr JknKX4Tj9Vt9k2S8mDzLN71VZYcaECE6qKYt6hj84u3VEU23TuJUXct/LBKrmpZI1Ma/ wocB6VjjikCNdMeV2MVG6yVNdOfbGdGmku9ri8hJ+3lldJgdW7j3YmxNO/hI24zlWO6y sCBw== X-Gm-Message-State: AOJu0YyzJYFChWv+vMeLwhX65rHyG56x7uEf64zPDOSDPQwFIdqLTMdr BgquGwY6CJ4Kv1vUK+e4lGXs4cKbPt2MhWype9fdQeoD5BqJPRs2bqn7D3TjLSJV5IoysJ1jGBv lwlL9EKWBC7xCEbQJMbm1dWF7w82zFKrQYHtjyJDeDwONvxpeXRhCGlHR6RRv70Ng X-Received: by 2002:a17:90a:5382:b0:28c:d9e:9ebc with SMTP id y2-20020a17090a538200b0028c0d9e9ebcmr1193790pjh.18.1704425165724; Thu, 04 Jan 2024 19:26:05 -0800 (PST) X-Received: by 2002:a17:90a:5382:b0:28c:d9e:9ebc with SMTP id y2-20020a17090a538200b0028c0d9e9ebcmr1193786pjh.18.1704425165397; Thu, 04 Jan 2024 19:26:05 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240101181348.GA1684058@bhelgaas> <0f121140-e5dc-4c1a-b510-a9d791004a27@5challer.de> In-Reply-To: <0f121140-e5dc-4c1a-b510-a9d791004a27@5challer.de> From: Kai-Heng Feng Date: Fri, 5 Jan 2024 11:25:53 +0800 Message-ID: Subject: Re: [Regression] [PCI/ASPM] [ASUS PN51] Reboot on resume attempt (bisect done; commit found) To: Michael Schaller Cc: Bjorn Helgaas , bhelgaas@google.com, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, regressions@lists.linux.dev, macro@orcam.me.uk, ajayagarwal@google.com, sathyanarayanan.kuppuswamy@linux.intel.com, gregkh@linuxfoundation.org, hkallweit1@gmail.com, michael.a.bottini@linux.intel.com, johan+linaro@kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Michael, On Tue, Jan 2, 2024 at 2:57=E2=80=AFAM Michael Schaller wrote: > > On 01.01.24 19:13, Bjorn Helgaas wrote: > > On Mon, Dec 25, 2023 at 07:29:02PM +0100, Michael Schaller wrote: > >> Issue: > >> On resume from suspend to RAM there is no output for about 12 seconds,= then > >> shortly a blinking cursor is visible in the upper left corner on an > >> otherwise black screen which is followed by a reboot. > >> > >> Setup: > >> * Machine: ASUS mini PC PN51-BB757MDE1 (DMI model: MINIPC PN51-E1) > >> * Firmware: 0508 (latest; also tested previous 0505) > >> * OS: Ubuntu 23.10 (except kernel) > >> * Kernel: 6.6.8 (also tested 6.7-rc7; config attached) > >> > >> Debugging summary: > >> * Kernel 5.10.205 isn=E2=80=99t affected. > >> * Bisect identified commit 08d0cc5f34265d1a1e3031f319f594bd1970976c as > >> cause. > >> * PCI device 0000:03:00.0 (Intel 8265 Wifi) causes resume issues as lo= ng as > >> ASPM is enabled (default). > >> * The commit message indicates that a quirk could be written to mitiga= te the > >> issue but I don=E2=80=99t know how to write such a quirk. > >> > >> Confirmed workarounds: > >> * Connect a USB flash drive (no clue why; maybe this causes a delay th= at > >> lets the resume succeed) > >> * Revert commit 08d0cc5f34265d1a1e3031f319f594bd1970976c (commit seeme= d > >> intentional; a quirk seems to be the preferred solution) > >> * pcie_aspm=3Doff > >> * pcie_aspm.policy=3Dperformance > >> * echo 0 | sudo tee /sys/bus/pci/devices/0000:03:00.0/link/l1_aspm > >> > >> Debugging details: > >> * The resume trigger (power button, keyboard, mouse) doesn=E2=80=99t s= eem to make > >> any difference. > >> * Double checked that the kernel is configured to *not* reboot on pani= c. > >> * Double checked that there still isn't any kernel output without quie= t and > >> splash. > >> * The issue doesn=E2=80=99t happen if a USB flash drive is connected. = The content of > >> the flash drive doesn=E2=80=99t appear to matter. The USB port doesn= =E2=80=99t appear to > >> matter. > >> * No information in any logs after the reboot. I suspect the resume fr= om > >> suspend to RAM isn=E2=80=99t getting far enough as that logs could be = written. > >> * Kernel 5.10.205 isn=E2=80=99t affected. Kernel 5.15.145, 6.6.8 and 6= .7-rc7 are > >> affected. > >> * A kernel bisect has revealed the following commit as cause: > >> https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commi= t/?id=3D08d0cc5f34265d1a1e3031f319f594bd1970976c > >> * The commit was part of kernel 5.20 and has been backported to 5.15. > >> * The commit mentions that a device-specific quirk could be added in c= ase of > >> new issues. > >> * According to sysfs and lspci only device 0000:03:00.0 (Intel 8265 Wi= fi) > >> has ASPM enabled by default. > >> * Disabling ASPM for device 0000:03:00.0 lets the resume from suspend = to RAM > >> succeed. > >> * Enabling ASPM for all devices except 0000:03:00.0 lets the resume fr= om > >> suspend to RAM succeed. > >> * This would indicate that a quirk is missing for the device 0000:03:0= 0.0 > >> (Intel 8265 Wifi) but I have no clue how to write such a quirk or how = to get > >> the specifics for such a quirk. > >> * I still have no clue how a USB flash drive plays into all this. Mayb= e some > >> kind of a timing issue where the connected USB flash drive delays some= thing > >> long enough so that the resume succeeds. Maybe the code removed by com= mit > >> 08d0cc5f34265d1a1e3031f319f594bd1970976c caused a similar delay. =C2= =AF\_(=E3=83=84)_/=C2=AF > > > > Hmmm. 08d0cc5f3426 ("PCI/ASPM: Remove pcie_aspm_pm_state_change()") > > appeared in v6.0, released Oct 2, 2022, so it's been there a while. > > > > But I think the best option is to revert it until this issue is > > resolved. Per the commit log, 08d0cc5f3426 solved two problems: > > > > 1) ASPM config changes done via sysfs are lost if the device power > > state is changed, e.g., typically set to D3hot in .suspend() and > > D0 in .resume(). > > > > 2) If L1SS is restored during system resume, that restored state > > would be overwritten. > > > > Problem 2) relates to a patch that is currently reverted (a7152be79b62 > > ("Revert "PCI/ASPM: Save L1 PM Substates Capability for > > suspend/resume""), so I don't think reverting 08d0cc5f3426 will make > > this problem worse. > > > > Reverting 08d0cc5f3426 will make 1) a problem again. But my guess is > > ASPM changes via sysfs are fairly unusual and the device probably > > remains functional even though it may use more power because the ASPM > > configuration was lost. > > > > So unless somebody has a counter-argument, I plan to queue a revert of > > 08d0cc5f3426 ("PCI/ASPM: Remove pcie_aspm_pm_state_change()") for > > v6.7. > > > > Bjorn > > If it helps I could also try if a partial revert of 08d0cc5f3426 would > be sufficient. This might also narrow down the issue and give more > insight where the issue originates from. > > Let me know what you think. Just wondering, does `echo 0 > /sys/power/pm_asysnc` help? Kai-Heng > > Michael