Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1162691pxb; Thu, 24 Mar 2022 14:06:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwoMa4L/0GySKNJhStgJ5aaWgqvv7XFuDmAkUsPMCyrltHNmvJGfNcMR5mkRJFlrNXYNbnJ X-Received: by 2002:a50:c307:0:b0:418:ec3b:2242 with SMTP id a7-20020a50c307000000b00418ec3b2242mr8907411edb.229.1648155977928; Thu, 24 Mar 2022 14:06:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648155977; cv=none; d=google.com; s=arc-20160816; b=fcFEQfj4cqOJof2dGioSio6Pd/OGRAFwzda6pO64rMVwQOBlH5YTHFesIg+FNFusE+ 0aSJ6egwxpPjmbzv1FRC7JQpSwIIuSMeSVQ7tOOMAn7vHAVRBtKNlXK//0YttIdiEVzh ioMGrNd0MUImcj4a2quzOu3l8WRjq8ysmP+VrMwiwPfuafdcSVGLTRd14kQzxsZSmhd5 7Jk4TGXiCt10Pef2VkvHZHAVHarYFWhjsQlq0uWjmrEe3GIT09X+WKHZGL31gdvwiCLw vZiwwNpHqMN4CD/OFEcslz9ckPnm7ME3JkRhCZtSXVM8F0BbXfipl+4IAsbTKvImMPi1 YJ2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=n+dByFF7j+ZRlucq9xD46ICwSXqILbZB8pyFUkx2398=; b=vC4LW8iucFIR4oe1hukB+vSXtpgHUb87o/gd+ra+bVg76QGnUZeqycgoiiYOVSQti2 Q2/W7A2Y3dZ5PfcX6S6nLEmLcLlWR1T9J5exTjlMAGZ5N+TJKY02PsliemJFx2/KhSGk 9KvOsCfLNG9Gy7I4GZws01NF5Cnr+wJxGhQHiDbXMQLVTAJ9SD0tf6Vfo+LEUz5QKi+t 0td3iJqy3gCPY9oRR997lMUGMbAjo6UXmymlP6F03hN+9FNRUOkIKyrzd8FzJSP3Iczg YBOEoRK0v4yMRI+c+wqu1DkVY2Np66+JlnllQ+gZKfoC/GZ/uiNuzAWhArgnvmUnMUAN jNTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=MvHPNDY+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h19-20020a170906855300b006df76385dbcsi490606ejy.604.2022.03.24.14.05.51; Thu, 24 Mar 2022 14:06:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=MvHPNDY+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243545AbiCWKcX (ORCPT + 99 others); Wed, 23 Mar 2022 06:32:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229786AbiCWKcW (ORCPT ); Wed, 23 Mar 2022 06:32:22 -0400 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E83E6EB0A; Wed, 23 Mar 2022 03:30:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1648031451; x=1679567451; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=SV0+1VOXq+yxYQQCFdKG0nZadXPiB8XCijjjUS7LwI4=; b=MvHPNDY+0MNQM4fPyPTgPVAxo+zI3eqAeFin9sfkcNlh2BvYHvzrE+/o 8HJ22J20aLHSNkzUz2/DRlKPjdJkijHYIQVUT8dXTE2dDc+5QWfUUQ0KV ham8QzQ0iJlx6By9IWOSrkahnQWeLgK6ow98qh/KEe4gYQhU0KTVfutJ7 tUCtAG99kEKcp0C9xob6EWyCNyAYr/cwKXbYu8+jlBhzeblTeM5V3cSc0 KsO8d5kUqiSA2NVl8GUoy0NyFRKW3FHy45aUFxHJR3QQbZicEyOuoDd0S 1nYqActMOtfh2cO9CZ1L5irMod2llowrZ4vDJE2yT+MLx7tSg9vjM+VHr w==; X-IronPort-AV: E=McAfee;i="6200,9189,10294"; a="240238208" X-IronPort-AV: E=Sophos;i="5.90,203,1643702400"; d="scan'208";a="240238208" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Mar 2022 03:30:51 -0700 X-IronPort-AV: E=Sophos;i="5.90,203,1643702400"; d="scan'208";a="515731387" Received: from lahna.fi.intel.com (HELO lahna) ([10.237.72.162]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Mar 2022 03:30:47 -0700 Received: by lahna (sSMTP sendmail emulation); Wed, 23 Mar 2022 12:30:45 +0200 Date: Wed, 23 Mar 2022 12:30:45 +0200 From: "mika.westerberg@linux.intel.com" To: "Khandelwal, Rajat" Cc: "bleung@google.com" , "Malani, Prashant" , "jthies@google.com" , "Rao, Abhijeet" , "Regupathy, Rajaram" , "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] USB4/TBT device routers should wake up during S0ix when something gets connected/disconnected or a DP monitor gets plugged in Message-ID: References: <20220323101818.3503-1-rajat.khandelwal@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,SPF_HELO_NONE,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 Hi, If you want it to be woken up when something is plugged to the USB4 port then I suggest to add this to the "wakeup" capability of the usb4_port itself (see drivers/thunderbolt/usb4_port.c). And make it disabled by default too. On Wed, Mar 23, 2022 at 10:26:37AM +0000, Khandelwal, Rajat wrote: > +Mika > @Malani, Prashant @bleung@google.com This is the patch which fixes the partner issue. Kindly escalate your thoughts. > > Thanks > Rajat > > -----Original Message----- > From: Khandelwal, Rajat > Sent: Wednesday, March 23, 2022 3:48 PM > To: mika.westerberg@linux.intel.com > Cc: Khandelwal, Rajat ; bleung@google.com; jthies@google.com; Malani, Prashant ; Rao, Abhijeet ; Regupathy, Rajaram ; linux-usb@vger.kernel.org; linux-kernel@vger.kernel.org > Subject: [PATCH] USB4/TBT device routers should wake up during S0ix when something gets connected/disconnected or a DP monitor gets plugged in > > Device routers don't wake up during S0ix when something is plugged in/out or if a DP monitor gets connected. This causes the linux device to not wake up during S0ix cycling as the host router didn't wake up because the device router didn't. This patch adds a new functionality to linux. > > Signed-off-by: Rajat-Khandelwal > --- > drivers/thunderbolt/switch.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/drivers/thunderbolt/switch.c b/drivers/thunderbolt/switch.c index d026e305fe5d..4f8056724aa4 100644 > --- a/drivers/thunderbolt/switch.c > +++ b/drivers/thunderbolt/switch.c > @@ -3067,13 +3067,11 @@ void tb_switch_suspend(struct tb_switch *sw, bool runtime) > tb_switch_suspend(port->remote->sw, runtime); > } > > - if (runtime) { > + if (runtime || device_may_wakeup(&sw->dev)) { > /* Trigger wake when something is plugged in/out */ > flags |= TB_WAKE_ON_CONNECT | TB_WAKE_ON_DISCONNECT; > flags |= TB_WAKE_ON_USB4; > flags |= TB_WAKE_ON_USB3 | TB_WAKE_ON_PCIE | TB_WAKE_ON_DP; > - } else if (device_may_wakeup(&sw->dev)) { > - flags |= TB_WAKE_ON_USB4 | TB_WAKE_ON_USB3 | TB_WAKE_ON_PCIE; > } > > tb_switch_set_wake(sw, flags); > -- > 2.17.1