Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp38392rdb; Thu, 1 Feb 2024 01:02:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IFGbQQlI4uFHkukpFRi3E+ImjGT3AXlnEPYiKKK3rEQ+Ew51EiTWBUiFR7r/eKHw2flALPS X-Received: by 2002:ac8:5987:0:b0:42b:e9e3:92 with SMTP id e7-20020ac85987000000b0042be9e30092mr4794878qte.42.1706778137925; Thu, 01 Feb 2024 01:02:17 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706778137; cv=pass; d=google.com; s=arc-20160816; b=f5HxARQsvIoLg4RH1FoLBAv9agJJlXP8+q0EtFLAhSa7AmDhlVgswocdsBYlV2y3ky gjP+4X9/lAOLSJI8uBicd+tkADnHSkyO2n84hGliZLAN6IIk118vMvvZTO9Lb1mYpCSj oi4DIMRJcEB1yZ8UU6vTLqkZn9cQ9NjLvh9EfHix98M+E906yTUozlO2adzfQODRZk73 jFArKz8KhE1Qzy7cBoBcjygAsqxEqrY1+dVpYqPbmNEJjDM2/Yf/RI+YeG4g2B59V54O Wiidk30rEeVCCpPEW7fNRP0ilJAY9oYO7nN2sKNYek6925K8ruJYCMI3fWUPhy/+uFQl ghJQ== ARC-Message-Signature: i=2; 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=BI44NP3dAK0mdmDzCdTw2B5OH4IMuQfBMUx2warDaO8=; fh=b7rz1L9Ny813qhHNfJxkzflPvzKf+3d5MPTq/HjCINA=; b=N0fr8JNi7PqRB0yraRuZWqV9P0XuSJULseski+PlxFq0RYhrtyHvdI01RB4184NFDf XvdpedTqXLPJgV2rUx8EkD1oqq8T16dDUk+1LsvZ2PRzVw3OIh0TFk5F1d1EeeUJHpVU 5Pv9BL8CsF/iq1iLzMtdBMuXsmqDCjvSolSo1q/4mEYWvAqZzjtl/Lo3J8ooDVfCloFe axMgDPh1OkqL3izneVgIEZgg5cnBXJybEwdaIlkKA3ew0nxUJSpzUNJW78JdTQCVfGv8 1+yVnUWP0nxNXo6N665HceWAl2KwJeO72xc6eRf8ITqmzhp7eoL+jsn2TovUMyd0TtHk W7iA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="aq9nQ/0P"; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-47821-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47821-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com X-Forwarded-Encrypted: i=1; AJvYcCXZYNH9HMmtPquUWZN2aZyTlRA/iLAS9JiyZSY/JH8p0yGgQJxzCZ2jTxnujY/1pAuyVulQfQTxxQDY74alCo1aqelNyC0BkynZ9qsGCQ== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id u30-20020a05622a199e00b0042bf076b29fsi1659058qtc.131.2024.02.01.01.02.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 01:02:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-47821-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="aq9nQ/0P"; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-47821-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47821-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 94B021C2277F for ; Thu, 1 Feb 2024 09:02:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 300EA15AADD; Thu, 1 Feb 2024 09:02:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="aq9nQ/0P" Received: from mail-ed1-f51.google.com (mail-ed1-f51.google.com [209.85.208.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8F95114010 for ; Thu, 1 Feb 2024 09:02:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706778127; cv=none; b=RpjM1jAWJWIkfJXLrdZwlRk+QRAJbfXkvSEVHzkk3EqbcohshQMgiAAAQRzsIe60fRTOoDZw6a6YMAw7S6bPgY1wg06d5k3jRE74tKia1zfWjiFr50ZddGYo9nl9AV2cRmolZNEmPGFh2cRb+uM5iYZrIN7hrjUHay+iJRmEzXg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706778127; c=relaxed/simple; bh=LsreWoRfx0pNIFiAcMF+cfb38qMMG2mxUe6kV9wDkMQ=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=k4t+8t2hBU+I6q1pqThaZP+E4BQcwYEKSqYgkO0oYRTZ3BuNqJgvxUSeyvZR/ZYvZrJKEiQgvJ+P1WaEz4+5YfU9iLcMhY+hV09cgUgaMrDxnBhx0fG0Id5a+DOVKGnD0+43u7QRPLgbafnCbo78MMSxm0+MWWwVu7YG1NzGk94= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=aq9nQ/0P; arc=none smtp.client-ip=209.85.208.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-ed1-f51.google.com with SMTP id 4fb4d7f45d1cf-55818b7053eso12787a12.0 for ; Thu, 01 Feb 2024 01:02:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1706778124; x=1707382924; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=BI44NP3dAK0mdmDzCdTw2B5OH4IMuQfBMUx2warDaO8=; b=aq9nQ/0PjJk9Mxjodi3m0Y0kjfix456yaMM+XQ2GVTXh7ks+Wecofb33pFkWoUHDU1 F1+PxHKFKffuiI0rZuunstKPXuCW47CyROI0aqBaT3dsBJz5eOdj9xISPmSEeubjs4pZ 1I7mSuh3+/b2+B/zquMEEmZ41hxM0wOwkPwYgdjcaI2XtxgrYqR7Xr5IOwI/3jkjeyaO YHNvXuKhxZlb04wA4qRNtIPfjdWmZMMBboHw2+wesbQCA+dOy5Nj2xgq+cTtYxWiV2as yTApApGgy2wgREsgMRxtFPv80mRKfdOCm+gqaxIGG5OVDVd2fudl57vvLWk8K2CurUah zcyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706778124; x=1707382924; 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=BI44NP3dAK0mdmDzCdTw2B5OH4IMuQfBMUx2warDaO8=; b=JAwJeg5waJ8XgUjXN7yHazo+Mf6NkSHAnoPFmvEmyExKYNjv3JPaQvPrw1SK/WmukI m1FGm7dB5Fk/CEvPei0SrIhtlrftkmJuNO1rVk283OJl7lQJ3uWbYv0mOJWERmgdKJ6A rK+uY+3z+8xV+NheVHgbnoLhio3rcZ9zKk5fc3D42EP814gXWDuBbke5VB7PcxzOmFfe Qa3oVsm/Cvu0zqp4qwVzYhkpPCYcTPW8JTi2wxDTwpV3UfXC+fkLsaTDujhplu/Vqq2v jxO6FV1qjFsDWUeAFNHUR3fGm8Mx33yj6FTB7cGu/i8XeKOcjNNxuTOuH65q+qLT+wcZ 2Jxw== X-Gm-Message-State: AOJu0YyNAJ23VS9gOT3jUdWu8lLODlC5w1icEayymbWQ+wwe36NDCWOl 21TX2QuqG2KGHHwd9jMRAkbIFQYFiAX6MBLrmOprG3oz20DyHK4fKQr5aHI+RDDcwLwegI4aRrJ LinyXrl2yJiE9WpsasrmdHM4yADAdCk+u6Fsi X-Received: by 2002:a50:8e51:0:b0:55f:a1af:badc with SMTP id 17-20020a508e51000000b0055fa1afbadcmr165293edx.6.1706778123426; Thu, 01 Feb 2024 01:02:03 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240130064819.1362642-1-guanyulin@google.com> <0e4221b5-bafe-4bea-b533-0ed8add81ef1@rowland.harvard.edu> In-Reply-To: <0e4221b5-bafe-4bea-b533-0ed8add81ef1@rowland.harvard.edu> From: Guan-Yu Lin Date: Thu, 1 Feb 2024 17:02:00 +0800 Message-ID: Subject: Re: [PATCH] [RFC] usb: host: Allow userspace to control usb suspend flows To: Alan Stern Cc: gregkh@linuxfoundation.org, mathias.nyman@intel.com, royluo@google.com, hadess@hadess.net, benjamin.tissoires@redhat.com, heikki.krogerus@linux.intel.com, oneukum@suse.com, grundler@chromium.org, yajun.deng@linux.dev, dianders@chromium.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, badhri@google.com, albertccwang@google.com, pumahsu@google.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Jan 31, 2024 at 1:12=E2=80=AFAM Alan Stern wrote: > > On Tue, Jan 30, 2024 at 06:47:13AM +0000, Guan-Yu Lin wrote: > > In a system with sub-system engaged, the controllers are controlled by > > What is a sub-system and how does it become engaged? > The subsystem, run by the co-processor, provides basic functionality even w= hen the main system is suspended or otherwise occupied. In our design, the subsystem becomes engaged when the main system is powered on. The userspace will interact with and control both main system (main processor) and the su= b system (co-processor). That way, the controllers will not be occupied by bo= th processors simultaneously. > > > both the main processor and the co-processor. Chances are when the main > > processor decides to suspend the USB device, the USB device might still > > be used by the co-processor. In this scenario, we need a way to let > > system know whether it can suspend the USB device or not. We introduce = a > > new sysfs entry "deprecate_device_pm" to allow userspace to control the > > device power management functionality on demand. As the userspace shoul= d > > possess the information of both the main processor and the co-processor= , > > it should be able to address the conflict mentioned above. > > This description and the comments and documentation in the patch all > talk about "device power management". But in fact the patch only > affects system power management; it does not affect runtime power > management. > This description does introduce ambiguity, In addition, the implementation = does affect more functionality than I expected. I'll re-design the feature to le= t it only affect `suspend to RAM`. The related comments/commit message will also= be updated in the next version. > > Also, "deprecate_device_pm" does not seem like a very good name. > You're not deprecating power management; you're just disabling it > temporarily. You should find a better name. > Thanks for pointing that out. I'll use `disable_suspend2ram` in the next version to better reflect what this feature does. I'll also update other wordings accordingly. > > Do you really want your new flag to affect device suspend during > hibernation? Does the co-processor remain powered when the system is > powered off and unplugged? > The implementation will be modified in the next version. This feature will only focus on `suspend to RAM`. The co-processor will not be powered when the system is powered off. > > Do you really want the new sysfs flag to be present even on systems > that don't have a co-processor? > We've identified a use case where this feature would be essential, which is= a system with both the main processor and the co-processor. However, other us= e cases may also benefit from this feature. So, I think we could create a bui= ld flag for related data structures and codes. > > Why does this affect only the USB subsystem? Can't the co-processor > use other, non-USB, devices on the system? > In our use case, the co-processor only supports USB subsystem. There might = be other co-processors support more subsystems, but we're not sure about how t= hey will interact with the system. > > Alan Stern