Received: by 2002:a05:7412:bc1a:b0:d7:7d3a:4fe2 with SMTP id ki26csp674978rdb; Sat, 19 Aug 2023 20:02:39 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHFjV281jyRivQ5rsPExaN1n2MHGsBv5OTgv2S6brn91megzGhuRQUER1NEaq3YsFce45aB X-Received: by 2002:a0d:d54a:0:b0:591:15a6:c11f with SMTP id x71-20020a0dd54a000000b0059115a6c11fmr972034ywd.50.1692500559392; Sat, 19 Aug 2023 20:02:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692500559; cv=none; d=google.com; s=arc-20160816; b=iPQqmYrIokK+Z41PFrN4ntXjr1+8i04GhQ8bn9mIY+ttjkP03Prm5xmlMCR2eGN02z wvUJJfsmKlwXlvJW5o/8T+R3Xi2M289d9xv8oXHU5FNGOHOtUQtcnQQjTHHvfNopNThV +mccIe1072KLrd4yIl1V0Rz8Tc7BIJYtxOtMtTG/2GSwCN3Cdgq4ACs8K2yHPEma9t3W qsiaO4aGOyTQ0q538+dtq0HXu8nogrPgsLKokH3WRlfhCAa/hXyFyY6AuNxlFhUimSB0 g54/myXpo1DBXLUMLq69iym+eBFpTo2q0FcbkHwMrDMdq2CXB7VxEGYBQi2D6K9/a909 SJjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=aMvgSbgqyUgIQZ3+GZOkLrlpdxkRXe8W5LiEy++bY6k=; fh=reEYjyP1Mm+PIwHKg06jJJPkJcyvRW+EUfFQCyJnnJw=; b=hajFYRZgLhl5RyftwpZYu/HRuwcZGwexjD7Svvdn2j0/WqAG4D2U+hT3VwJdYiXHjc phVWvwk6aYTRQ4zLh8ADYjexSRLiLWTmZa2eeOB7n74r/j5AkOL601lAa2eBjBQ8IqhZ gKVNRGg7CO3tQ1x+q8VMNhpmJ5CV0BFawzwjkD17RTZu97RfO9WAzNRmilgNhYSeooYY vujze2CPDtVZ8/a5OS1gHih900vO5LJcXHGVvGJ89RXrXGa7+7Qz3yds9UCoeBqN+QOA I5mjHnlWs5ntv73uoIAj7w7v+LhWaf2VCRWdnrrD6iQPPOhxG37Y/6f4j/ueEoa+Xo+y ql3w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=harvard.edu Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id l65-20020a633e44000000b0056601c94983si1394037pga.25.2023.08.19.20.02.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Aug 2023 20:02:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=harvard.edu Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5E87D34AE5B; Sat, 19 Aug 2023 12:05:06 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357507AbjHRDTm (ORCPT + 99 others); Thu, 17 Aug 2023 23:19:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38198 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352726AbjHRDTL (ORCPT ); Thu, 17 Aug 2023 23:19:11 -0400 Received: from netrider.rowland.org (netrider.rowland.org [192.131.102.5]) by lindbergh.monkeyblade.net (Postfix) with SMTP id 69C2630F6 for ; Thu, 17 Aug 2023 20:19:09 -0700 (PDT) Received: (qmail 18388 invoked by uid 1000); 17 Aug 2023 23:19:08 -0400 Date: Thu, 17 Aug 2023 23:19:08 -0400 From: Alan Stern To: Kai-Heng Feng Cc: mathias.nyman@intel.com, Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] xhci: Disable connect, disconnect and over-current wakeup on system suspend Message-ID: References: <20230817093305.212821-1-kai.heng.feng@canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,SPF_HELO_PASS,SPF_PASS autolearn=no 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 On Fri, Aug 18, 2023 at 08:00:39AM +0800, Kai-Heng Feng wrote: > On Thu, Aug 17, 2023 at 10:07 PM Alan Stern wrote: > > > > On Thu, Aug 17, 2023 at 05:33:05PM +0800, Kai-Heng Feng wrote: > > > The system is designed to let display and touchpanel share the same > > > power source, so when the display becomes off, the USB touchpanel also > > > lost its power and disconnect itself from USB bus. That doesn't play > > > well when most Desktop Environment lock and turnoff the display right > > > before entering system suspend. > > > > I don't see why that should cause any trouble. The display gets locked > > and turned off, the touchpanel disconnects from the USB bus, and then > > the system goes into suspend. Why would there be a wakeup signal at > > this point? > > The disconnecting can happens during the system suspend process, so > the suspend process is aborted. Maybe these systems need to add a little delay when the display is turned off, in order to give the touchpanel time to disconnect before the system suspend begins. > > > So for system-wide suspend, also disable connect, disconnect and > > > over-current wakeup to prevent spurious wakeup. > > > > Whether to disable these things is part of the userspace policy. The > > kernel should not make the decision; the user does by enabling or > > disabling wakeups. > > The power/wakeup is already disabled. In that case the root hub should not generate a wakeup request in response to the touchpanel disconnecting. > The disconnecting event is from roothub and if roothub wakeup is > disabled, other USB devices lose the ability to wake the system up > from system suspend. That shouldn't happen either. Disabling wakeup on the root hub should not prevent the root hub from relaying wakeup requests it receives from downstream devices. It should merely prevent the root hub from generating its own wakeup requests for connects, disconnects, and over-current events. It sounds like the xhci root-hub code isn't doing the right thing, at least, not on your systems. Alan Stern