Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp8080715rdb; Thu, 4 Jan 2024 19:15:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IGLndzR+F3ByG2TyrHp51RZ6hW75PW9CXqD42pUo5lYGok/23Ka8CPtJd1fmrXeH7Xw7roO X-Received: by 2002:a05:6871:b23:b0:205:ca10:f779 with SMTP id fq35-20020a0568710b2300b00205ca10f779mr1414241oab.90.1704424520463; Thu, 04 Jan 2024 19:15:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704424520; cv=none; d=google.com; s=arc-20160816; b=Mzakdapk//c+qDjDcplVZuq7jHYvx/DB4+hwc4ZBPFEB6XFVE8TxF4Yex2z7/zCF4N 4/3jiKcFLv4YYjzqL28MRMoWTpG6WQPhAV+fVHYoB6NJUAFduMTzqETsWENUOW2cpauk 83+DsOM79dDFzUA4QKiK0lZH9fv6LmWYT0inz5aOnAbbgJFnGxI8NXsWXCy5+/aRKWOP YHY4CcLqy5sa2O5GSCC6NoZivW59cKr6WU33TjJKEvTo6LDMpFTrqvq94GPyFMdh36Ja Bgn8I5mH5tEDs6qZKEgu0aJfmZ0mpgByjldf5MkNasuCIkkaf0heHBKRIGK1HZ4gO+mp F0HA== 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=f1cXDgk0HWr0gWI2ojjEmuBHHD309E5GX6oCK9+DTMg=; fh=0/wcwaT5p29QkJgHejFzmT6wMNr0f27+PNVIzM3ILWc=; b=kUi24wbm4qdQxaeUD7+eE5PghW4NcOX3s+9tZOSaTiBaWn83aeaxZDqL6f7ty2g+8k xAZUP2n9RqoKFAS4/a+zE7WkyAKTvXevqxVY5KrXQnMMKrGppfKwWK0+UskmIDT47NSm Tir/WHSKZnzYU/Fdiv7Q9OAZCgI0mkMOZLWSYTKzBl0WKlkwbMDOZBj0+tGwA+GYe4fp a3rl42KwsG4fdlDrHolW3g7wN/YdJ3hkmH0UlDUYVbRtLfEjC5W/Llx8wzvFsukjaSjn h0h2puC/I2gA3zX/zeVEKP3SsLUcBT3c9UD4HrswVVN4Q0vEvKJalY1yJfrCJunby2Vk Xrdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=KCYrAru0; spf=pass (google.com: domain of linux-kernel+bounces-17446-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17446-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. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id k125-20020a632483000000b005cecc60c8c5si587568pgk.810.2024.01.04.19.15.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jan 2024 19:15:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-17446-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=KCYrAru0; spf=pass (google.com: domain of linux-kernel+bounces-17446-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17446-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 1A40D285C50 for ; Fri, 5 Jan 2024 03:15:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CC9BE4428; Fri, 5 Jan 2024 03:15:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=canonical.com header.i=@canonical.com header.b="KCYrAru0" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp-relay-internal-1.canonical.com (smtp-relay-internal-1.canonical.com [185.125.188.123]) (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 DDBB85392 for ; Fri, 5 Jan 2024 03:15:08 +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-oi1-f200.google.com (mail-oi1-f200.google.com [209.85.167.200]) (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-1.canonical.com (Postfix) with ESMTPS id 03B1F3F184 for ; Fri, 5 Jan 2024 03:15:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1704424507; bh=f1cXDgk0HWr0gWI2ojjEmuBHHD309E5GX6oCK9+DTMg=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=KCYrAru06jlw9WmIpPyvqCBpoxB8Z26SJ3QYCRaECwITLsgyur6i+Eo2lSR6hyTN2 P/guCqqBF3MiUTMTsZvsf7R8dU7cPVNIDHcADAvJSgFLwKT9Zs6qojWCAIfcqHdqn8 PKRIzJxh7YWqVqBZujkJj0YEuQuqpzJC4365SGQ4qrWrgWhwmGIzxYPqyOXLjJpqWc T6Ps+7d5Jkj+SQbAuQ2++hllPrpRBRU20NAmEEChXzggTqKNVtJPRJXOhWqhBQ3NnB 2t7qVe0qCrgkFASisD20TEgb7r0tyflwqwuuGWnKo2X3GrxrO2pjAiHWdL08g4q6kH Fc5HQ6CgWq+qA== Received: by mail-oi1-f200.google.com with SMTP id 5614622812f47-3bb907c0f3bso1218561b6e.2 for ; Thu, 04 Jan 2024 19:15:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704424506; x=1705029306; 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=f1cXDgk0HWr0gWI2ojjEmuBHHD309E5GX6oCK9+DTMg=; b=o3yi9zEljknEYyT4Wf5laY+IoIHBl/wK0QkzSxzlnVN9k8Zx0pOvvFdwg99OwVYHzr cVQ6oYgaGHNj3BuHbCInKWkdlaG/cE4PRPF06JQTTzZdZztCA7ob1Rq8E5XLqFX9Htcj nFAWTR1Mh0ZhPulqDQia2dIOJcvrcrrFkZuCi4JKo3eBQtcb+mSQszQGlVXMTwc4zEA+ Y04NRyoCktAtGLCDMZqI4MRvy8A+RXrasEbTDEPyqtg0K8kv8bvEHtyDWgHYhqiGEDXP q7HAJ9XLSvEoGK6F+4g2dKQ6J0tR7TsiqtdXGKpP1ur4XVoC1gE6ygKBJTGOE0BzKID8 BxwQ== X-Gm-Message-State: AOJu0YzZkPdAq09PlBdOemugdZRtF5GXOohnYAx5BkQJ6LXp+3dTNzq9 RSSl69DCBhYu29TiPh+FTOH/VRbwxNl3P5vDPxa9CXKyUCADQnPmW4tai3YO2i951CA1A0yww5O J1WS7W3ngXwbJ4pepDrs4Ad+lcxIWgXdeQpVsqDzCrzdFy8rd+6h4fwxrw02jyg2z X-Received: by 2002:a54:4593:0:b0:3bb:bf36:35ae with SMTP id z19-20020a544593000000b003bbbf3635aemr1232134oib.43.1704424506005; Thu, 04 Jan 2024 19:15:06 -0800 (PST) X-Received: by 2002:a54:4593:0:b0:3bb:bf36:35ae with SMTP id z19-20020a544593000000b003bbbf3635aemr1232123oib.43.1704424505720; Thu, 04 Jan 2024 19:15: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> In-Reply-To: From: Kai-Heng Feng Date: Fri, 5 Jan 2024 11:14:53 +0800 Message-ID: Subject: Re: [Regression] [PCI/ASPM] [ASUS PN51] Reboot on resume attempt (bisect done; commit found) To: =?UTF-8?Q?Ilpo_J=C3=A4rvinen?= Cc: Bjorn Helgaas , Michael Schaller , bhelgaas@google.com, linux-pci@vger.kernel.org, LKML , regressions@lists.linux.dev, macro@orcam.me.uk, ajayagarwal@google.com, sathyanarayanan.kuppuswamy@linux.intel.com, Greg Kroah-Hartman , 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 On Wed, Jan 3, 2024 at 11:41=E2=80=AFPM Ilpo J=C3=A4rvinen wrote: > > On Mon, 1 Jan 2024, 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 a= s > > > cause. > > > * PCI device 0000:03:00.0 (Intel 8265 Wifi) causes resume issues as l= ong as > > > ASPM is enabled (default). > > > * The commit message indicates that a quirk could be written to mitig= ate 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 t= hat > > > lets the resume succeed) > > > * Revert commit 08d0cc5f34265d1a1e3031f319f594bd1970976c (commit seem= ed > > > 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 = seem to make > > > any difference. > > > * Double checked that the kernel is configured to *not* reboot on pan= ic. > > > * Double checked that there still isn't any kernel output without qui= et 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 f= rom > > > 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/comm= it/?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 = case of > > > new issues. > > > * According to sysfs and lspci only device 0000:03:00.0 (Intel 8265 W= ifi) > > > 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 f= rom > > > suspend to RAM succeed. > > > * This would indicate that a quirk is missing for the device 0000:03:= 00.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. May= be some > > > kind of a timing issue where the connected USB flash drive delays som= ething > > > long enough so that the resume succeeds. Maybe the code removed by co= mmit > > > 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. > > Hi, > > I cannot understand how 1) even occurs. AFAICT, nothing > pcie_aspm_pm_state_change() calls into overwrites link->aspm_disable that > is the variable storing user inputs via sysfs. So how the changes via > sysfs are lost? Because it's states being enabled via sysfs get overwritten, not the disabled ones. Kai-Heng > > -- > i.