Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp2667423rdh; Sun, 26 Nov 2023 15:05:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IHTvjALY+O4MUIbVYmn6x0gb7ixY1nIRnZYiSH84iMqOiD92MfOi1hYFl8i3pVLW1shcKGA X-Received: by 2002:a05:6e02:12c3:b0:35c:aeec:93fd with SMTP id i3-20020a056e0212c300b0035caeec93fdmr4276211ilm.5.1701039955092; Sun, 26 Nov 2023 15:05:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701039955; cv=none; d=google.com; s=arc-20160816; b=aLFOP8U9qf7ltVy52G9Do+MWYSkeRGiNCHXO3SsRq6YTSxDFM4w83I6qv6KPrzLyjT neU3X+FdLTQpq1CaV7aYgupE5AqIOT8GKup+G/83QSssE2R65FIY5BT/SpaSXHpvX1rY PnopbKT3eBcksHrkSWtfYRqoJdcd+l9YjG8/bgatXozOxuifhXiMUDtgWoqv/0EhuGlP VgQlJ0hqyQk2qqNZNST9RQwk3OmCmLszUP2ZgVa006np/UQ3bgrHsU6jfcXBkF/J5OfM /MU0ymbrsHdF1tBY3en897AZkdsbbZunw2l8gKkCsOzJZ8QWGeEtX03GtDnlRYSIRPqQ jxHQ== 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 Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id w189-20020a6362c6000000b005893c5bd119si8315635pgb.425.2023.11.26.15.05.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Nov 2023 15:05:55 -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 CCD478090072; Sun, 26 Nov 2023 15:05:53 -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 + 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 ); 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: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudeitddgtdejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffoggfgsedtkeertd ertddtnecuhfhrohhmpedfnfhukhgvucffrdculfhonhgvshdfuceolhhukhgvsehljhho nhgvshdruggvvheqnecuggftrfgrthhtvghrnhephefhtdegleetgfeijefgtddtheffie evhffgueffjeefheekteeifeevffeiledunecuffhomhgrihhnpehfrhgvvgguvghskhht ohhprdhorhhgpdhkvghrnhgvlhdrohhrghenucevlhhushhtvghrufhiiigvpedtnecurf grrhgrmhepmhgrihhlfhhrohhmpehluhhkvgeslhhjohhnvghsrdguvghv X-ME-Proxy: 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" 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" 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: 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:54 -0800 (PST) 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