Message ID | 20231126230521.125708-1-luke@ljones.dev |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp2728725vqx; Sun, 26 Nov 2023 15:05:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IEwQS/aGFKzN96XepUT4n2wiWLnI1rtjd7TKMhA6XYkDVKzKMQRM+m0JhYpszuSTZBu+x5W X-Received: by 2002:a05:6a20:daa4:b0:18c:380e:1684 with SMTP id iy36-20020a056a20daa400b0018c380e1684mr10146745pzb.42.1701039954633; Sun, 26 Nov 2023 15:05:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701039954; cv=none; d=google.com; s=arc-20160816; b=j4IkVsgVifoag3v+/ts/8rhR43mFzyimp0rBjgtmk1V+zMnh6kWv7VC797F/K6Kg/f 5fNksKUrMKbALZ45Li+YfwiT+JLEO9pk803dDkIfj0to1Fbc9MiXFH1YEuTc5Uinfc/y P38FaHlSZqdmwBTdLROZ3BNNiWE1IDd2uz8zubHZ+My/X+5qhz2y0esSor7zFsOPBoOD 3yizF6INXAV/fq0MqgvNKQEERyjS4/Q5rVnIaNbcTOJudHdlt/t5LPvTm/GMUtZmaXmc Cn8zZ9O4w9aJe4cX3PoPpSrKxG53O+DdV3a/Ut/pBdXvjcWgBoTuYrOlxW01AoMApDFj 08xg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:feedback-id:dkim-signature :dkim-signature; bh=C18hZ8S/pLgCzSdaAeL/mnxamIQnFEpzLk13rIQ2vPU=; fh=KBOOsaW3YEneVcYsdRdNlUHz1Q41m6vPI9Uc3mM7Mz4=; b=AcSNh+hPWSjpywSxrzniHCzV2n2YovF7suS3oylNssdA4k+gQfAKRvKzLP+hNoGCFm jwKsOY5Q3ymP44pyaI2VU4YOywoNjesWXY9Vn3M6KmB7XrtmWMhcO9LJO4tc/GllEYEs WeD8gBAvLnhWwMW5iP4QHpiMRy38LB763WPTHyoweuGqNNX9ry3QQuWCzJoDh3XruIWf g2d13iV2C+68hK/zcbloQ7Oo5r+QaBB++UfP9c1OGLAlCtX7mJT4k4YDHwEVN5NtK7Z0 w6ciw6mAf7nZp8Xd0S7nCn8r8mIzHZHHYUb8FSQtMppmuxBitG/8lXYEIxjnt2Q7HOXF zC8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ljones.dev header.s=fm2 header.b=GgFQFSk5; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=eddodv50; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id p16-20020a056a000b5000b006c0e3332534si8828434pfo.42.2023.11.26.15.05.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Nov 2023 15:05:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@ljones.dev header.s=fm2 header.b=GgFQFSk5; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=eddodv50; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id D0DF18068863; Sun, 26 Nov 2023 15:05:52 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230427AbjKZXFh (ORCPT <rfc822;kernel.ruili@gmail.com> + 99 others); Sun, 26 Nov 2023 18:05:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229447AbjKZXFf (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sun, 26 Nov 2023 18:05:35 -0500 Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3FF21F0; Sun, 26 Nov 2023 15:05:40 -0800 (PST) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 4E7F23200A62; Sun, 26 Nov 2023 18:05:35 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Sun, 26 Nov 2023 18:05:35 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ljones.dev; h=cc :cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:message-id:mime-version:reply-to:sender:subject :subject:to:to; s=fm2; t=1701039934; x=1701126334; bh=C18hZ8S/pL gCzSdaAeL/mnxamIQnFEpzLk13rIQ2vPU=; b=GgFQFSk540SnWnj187J4D4Q5Y7 DbirXyRwWkBqojr47wP6EUqikTXDh5drj6Irqvn0APH3bjhYwd6OZrMh6YbMs1QG t2qLhpvbKTkestHxJKI9xPPDk0jkjX4q5OypJIFq4kXJH2r1D/1AbgDr9sS40Lmz C1c7Uc4NHklmwBp+tJMAVN8trQ4iwi/5npZo5wMsd0uHhL02iOW+mUKG/QtMDVS2 7MoMiW4Ec73BgYHCGZj0KxsB7dwkwnr7CcdfvcfZLwX4Bfi3pyn/+vctRlNt/0F2 A9Q/tnvuF65glupFsES7YG/Ib2SBQD/Wi054VesYGBcEGrG1mnLg2han+mEg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:message-id:mime-version:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1701039934; x=1701126334; bh=C18hZ8S/pLgCz SdaAeL/mnxamIQnFEpzLk13rIQ2vPU=; b=eddodv50GRFxYOEbH8VhJvEs6THh+ AL+tyXyEA6Nyvu+SVwJ9NARuw3nPP3NEz4t5WDrdDEGTCkEhEJ1I2cdI1coV3wU1 R3zmpeT7NOk+RcH9JOTYRx/ExPMFoCl187u0NS6/LyvIWJUvK/av2S2ItwTW7VnD Ns0jFpNOz9yZszpVonkB5YserotXOQjqWC6hvah65hDSg4yJIqsy8UzYzEq5rpqa bsFzTC7Yx0KA727mvnXG3rZhDGb1io/otUEvsio192a4itw0s6Vf+O8SwABlg1J4 SNUC5i5bj3NlXSvwtwjveq8h8k3f0cpkgjh9rOOLYusT5/nQQwyNY3YZQ== X-ME-Sender: <xms:Pc9jZWHe_4j0LRYn5Ar8D0pYjMgOxztRzZInp_qGdrdVbOOe8kEGxA> <xme:Pc9jZXXxHp6MzASqct1QW3amVl8svDYjhtHJhK7OMG73fXaED8tLrsJleIvxAU6S_ -reBTVlq403yLvwTxA> X-ME-Received: <xmr:Pc9jZQJFWCUCsJWulyPVwnLcqhXDmF7ejADvC7Ug0pLmr8WFJsBPXOi7VRai> X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudeitddgtdejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffoggfgsedtkeertd ertddtnecuhfhrohhmpedfnfhukhgvucffrdculfhonhgvshdfuceolhhukhgvsehljhho nhgvshdruggvvheqnecuggftrfgrthhtvghrnhephefhtdegleetgfeijefgtddtheffie evhffgueffjeefheekteeifeevffeiledunecuffhomhgrihhnpehfrhgvvgguvghskhht ohhprdhorhhgpdhkvghrnhgvlhdrohhrghenucevlhhushhtvghrufhiiigvpedtnecurf grrhgrmhepmhgrihhlfhhrohhmpehluhhkvgeslhhjohhnvghsrdguvghv X-ME-Proxy: <xmx:Pc9jZQGaUNMFU8Nny32SBVxZu5TLB96bWFTAt7W_ehbAQ-6A1CFbZQ> <xmx:Pc9jZcU83nZggLffpsDK2Zw8XC1F8_CgE3Uw0N3Vea4F0cz0vQUXyA> <xmx:Pc9jZTN6u6MbGx8_7RP4rxJUqW8JSIEeMtnsuqDKZMljpslIbKzrEg> <xmx:Ps9jZTTTF8hNOUV5D9_kcHe4Tm-gV9rqixPKFdABpqHx-7QJFTd_1Q> Feedback-ID: i5ec1447f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 26 Nov 2023 18:05:31 -0500 (EST) From: "Luke D. Jones" <luke@ljones.dev> To: hdegoede@redhat.com Cc: ilpo.jarvinen@linux.intel.com, corentin.chary@gmail.com, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, "Luke D. Jones" <luke@ljones.dev> Subject: [PATCH v2 0/1] platform/x86: asus-wmi: disable USB0 hub on ROG Ally before suspend Date: Mon, 27 Nov 2023 12:05:20 +1300 Message-ID: <20231126230521.125708-1-luke@ljones.dev> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Sun, 26 Nov 2023 15:05:53 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783669667260672112 X-GMAIL-MSGID: 1783669671389580437 |
Series |
platform/x86: asus-wmi: disable USB0 hub on ROG Ally before suspend
|
|
Message
Luke Jones
Nov. 26, 2023, 11:05 p.m. UTC
This is a fix for the ROG Ally not being able to use the N-Key device after a suspend/resume cycle. The root of the issue is that ASUS changed the MCU firmware to dfisconnect the USB0 hub when the screen is switched off during the s2idle suspend path. I tried many many different tactics to try and get this s2idle part to work but it seems there are races between this and other subsystems. What has so far been reliable and consistent is a manual call to the CSEE method that is called in ACPI by the Microsoft DSM screen off path followed by a short sleep in asus-wmi. The PM prepare hook looks to be the earliest possible place. A sleep that is too long ends up with USB subsystem registering a disconnect, and thus on resume the device paths change. Too short and it is unreliable. Some discussion regarding this mess is at https://gitlab.freedesktop.org/drm/amd/-/issues/2719#note_2181402 Changelog: - v2: - Emit dev_err(), but don't return error codes - Add check for MCU power save mode being enabled and disable if active - General cleanup and rename some vars/funcs - v1: https://lore.kernel.org/all/20231124082749.23353-1-luke@ljones.dev/ Luke D. Jones (1): platform/x86: asus-wmi: disable USB0 hub on ROG Ally before suspend drivers/platform/x86/asus-wmi.c | 50 ++++++++++++++++++++++ include/linux/platform_data/x86/asus-wmi.h | 3 ++ 2 files changed, 53 insertions(+)
Comments
On Mon, Nov 27 2023 at 12:05:20 PM +13:00:00, Luke D. Jones <luke@ljones.dev> wrote: > This is a fix for the ROG Ally not being able to use the N-Key device > after a suspend/resume cycle. > > The root of the issue is that ASUS changed the MCU firmware to > dfisconnect the USB0 hub when the > screen is switched off during the s2idle suspend path. I tried many > many different tactics to try > and get this s2idle part to work but it seems there are races between > this and other subsystems. > > What has so far been reliable and consistent is a manual call to the > CSEE method that is called in > ACPI by the Microsoft DSM screen off path followed by a short sleep > in asus-wmi. The PM prepare > hook looks to be the earliest possible place. A sleep that is too > long ends up with USB subsystem > registering a disconnect, and thus on resume the device paths change. > Too short and it is unreliable. > > Some discussion regarding this mess is at > https://gitlab.freedesktop.org/drm/amd/-/issues/2719#note_2181402 > > Changelog: > - v2: > - Emit dev_err(), but don't return error codes > - Add check for MCU power save mode being enabled and disable if > active > - General cleanup and rename some vars/funcs > - v1: > https://lore.kernel.org/all/20231124082749.23353-1-luke@ljones.dev/ > > Luke D. Jones (1): > platform/x86: asus-wmi: disable USB0 hub on ROG Ally before suspend > > drivers/platform/x86/asus-wmi.c | 50 > ++++++++++++++++++++++ > include/linux/platform_data/x86/asus-wmi.h | 3 ++ > 2 files changed, 53 insertions(+) > > -- > 2.43.0 > Hans I omitted your review tag as I made more changes than requested.
On Mon, 27 Nov 2023 12:05:20 +1300, Luke D. Jones wrote: > This is a fix for the ROG Ally not being able to use the N-Key device after a suspend/resume cycle. > > The root of the issue is that ASUS changed the MCU firmware to dfisconnect the USB0 hub when the > screen is switched off during the s2idle suspend path. I tried many many different tactics to try > and get this s2idle part to work but it seems there are races between this and other subsystems. > > What has so far been reliable and consistent is a manual call to the CSEE method that is called in > ACPI by the Microsoft DSM screen off path followed by a short sleep in asus-wmi. The PM prepare > hook looks to be the earliest possible place. A sleep that is too long ends up with USB subsystem > registering a disconnect, and thus on resume the device paths change. Too short and it is unreliable. > > [...] Thank you for your contribution, it has been applied to my local review-ilpo branch. Note it will show up in the public platform-drivers-x86/review-ilpo branch only once I've pushed my local branch there, which might take a while. The list of commits applied: [1/1] platform/x86: asus-wmi: disable USB0 hub on ROG Ally before suspend commit: e0894ff038d86f30614ec16ec26dacb88c8d2bd4 -- i.