Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3597676pxb; Mon, 16 Nov 2020 20:50:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJwHbsv4csQE/d7VFdrDpmwpAGG/jAiqgTB15QZzKW/y1pm14zO+VW+P9T09pMpT19ge7sNV X-Received: by 2002:a17:906:c096:: with SMTP id f22mr17131541ejz.488.1605588650145; Mon, 16 Nov 2020 20:50:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605588650; cv=none; d=google.com; s=arc-20160816; b=hsOVQLDg3JbXbZfzLcKRjplffygpsGMrk0SdiMXOE6eOclLM7gAd7XyYibQTYyV6hN eaq1I83qRKHi4/pm5SguLpzoAck4IqPwkVdHzjYIYJ23B4KEDe1OU2QPBTWLwsCA26W/ rQMpJVnGTiYn6fWit3q01UZAy6F+81mrIm9EEAUKYsq93EnFwFUd6FlGtyer4tk7NSUn h3bMyo9gsJbLDFUavWjkqriiO17OZPyPpAUY3y6M0LlideIqXjdfQRZ8M4pC1o3BN3Ph GmS5NWUwYS6npD6gHXHP2jgU3kUtevQz1dNqtaIV4NegiWh7EkVVWiz3tQA+/hMn9Zw5 RxBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature:dkim-signature; bh=U664ImZm7nx3wttpQWP2v553YO5GQB0UIUFjQe/fRSE=; b=oFXgEWNBKKNiyr2/iqhq4ABENFXPfiIXe1W2BheeIOMmovdqn7jegi1tcy3ht9bK7m hqaPLnIW6CsH0nY0eiCfgcSIHUl30vSAgiuMRtTvBK1raGB70gQkqnp8ZagveAJ6TaH2 vzE0cyTc4lt3ssWuYb1smHBDubkiPsbLVtwc/gUUvbAnqhI4yOCguOncI5HFEP1J0tng ZrCtCvaLeg10iE5RXSXUMuGXlLUbxA8zI2YTicmk6PqMeqHhcOJ4Y3nu8H4PY76WVrTQ kdFT3vHF52JWQJG+/e6wIEEq0ky4jEngVcK/Q4EQC/6RRETcE2++emT/tuEYxltIe/4J vexA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sholland.org header.s=fm1 header.b=bjV5VA6y; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=jxgbeDiH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hh13si13194993ejb.360.2020.11.16.20.50.27; Mon, 16 Nov 2020 20:50:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@sholland.org header.s=fm1 header.b=bjV5VA6y; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=jxgbeDiH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726980AbgKQEsl (ORCPT + 99 others); Mon, 16 Nov 2020 23:48:41 -0500 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]:35821 "EHLO wout1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726339AbgKQEsl (ORCPT ); Mon, 16 Nov 2020 23:48:41 -0500 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id D2E4A133C; Mon, 16 Nov 2020 23:48:39 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Mon, 16 Nov 2020 23:48:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm1; bh=U 664ImZm7nx3wttpQWP2v553YO5GQB0UIUFjQe/fRSE=; b=bjV5VA6ypKU8XqzUf 3uzwl9UiWxGJj0nondnuYmEEJx7egRCPOZiml3zpv3fSXZILD+nWfxb1hmRmKNFP d0d7dU1K/T378nmfhEoXzAoSNySgyP3B+FKGROFkR3u6nTR8bJPHrmwmImjigeWs vdJzLy6ShLrjHLLwwqcQbEVogNKL/FRetpvE6/jMSHUrANo/nQwHo2D/8cBtyVuv GO2vQ307KF6mljcQVDmwFXharjryfe0uDZPGiol1xIDWHdaw3pckX2u6Tg6PFasV 7dr/pPaqoHkuFcPO4jvUVs/ZB68rajFaRv34MouQewRP6eFn/7ZX+PlzoKQ33wmG ayzHw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=U664ImZm7nx3wttpQWP2v553YO5GQB0UIUFjQe/fR SE=; b=jxgbeDiHC6UqxHT89BqFAM3uaFrMvjzmpybgOMzfnaHyM6JNgSiB8YLxf 30f4oF61cCSNxAZES5YvG8UxjLxHMn4fivSR5QPuMuV97Wpug5VtjAV2aRPlaAsj DuYmjkC7oEC76bGLggRdgK2o1Mu1Msd5dt1oE++WC1gFppouXfnVkUBvb5DlP4zM LiXS9QyZa+jlHI6Da7xPJ7w3zPzLbw/AQTJTHMaDtO9szcw/5fsQIOTc3TtcJvdS ojba0/bB6o++mxN+7GoethAt246DXI+vNPilgFknHbahhHctIZdblY70oP7lmFkO BkNpfA64AQomNt0fYG8TU0aIMG0qg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrudefvddgieehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepuffvfhfhkffffgggjggtgfesthejredttdefjeenucfhrhhomhepufgrmhhu vghlucfjohhllhgrnhguuceoshgrmhhuvghlsehshhholhhlrghnugdrohhrgheqnecugg ftrfgrthhtvghrnhepjeelteehieekgefgieejueejjeekhfejvddtieevleefjeehleev tdejkedtheffnecuffhomhgrihhnpegsohhothhlihhnrdgtohhmnecukfhppeejtddrud efhedrudegkedrudehudenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgr ihhlfhhrohhmpehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhg X-ME-Proxy: Received: from [192.168.50.169] (70-135-148-151.lightspeed.stlsmo.sbcglobal.net [70.135.148.151]) by mail.messagingengine.com (Postfix) with ESMTPA id C94C43280063; Mon, 16 Nov 2020 23:48:37 -0500 (EST) Subject: Re: [PATCH 3/3] phy: sun4i-usb: Use power efficient workqueue for debounce and poll To: Maxime Ripard Cc: Frank Lee , vkoul@kernel.org, wens@csie.org, krzk@kernel.org, colin.king@canonical.com, tiny.windzz@gmail.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org References: <20201109121214.19012-1-frank@allwinnertech.com> <20201112095307.pblcmrn6smyecvqi@gilmour.lan> From: Samuel Holland Message-ID: <971979a1-a69e-c3fe-6799-805407315885@sholland.org> Date: Mon, 16 Nov 2020 22:48:37 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <20201112095307.pblcmrn6smyecvqi@gilmour.lan> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/12/20 3:53 AM, Maxime Ripard wrote: > On Tue, Nov 10, 2020 at 09:44:37PM -0600, Samuel Holland wrote: >> On 11/9/20 6:12 AM, Frank Lee wrote: >>> From: Yangtao Li >>> >>> The debounce and poll time is generally quite long and the work not >>> performance critical so allow the scheduler to run the work anywhere >>> rather than in the normal per-CPU workqueue. >>> >>> Signed-off-by: Yangtao Li >>> --- >>> drivers/phy/allwinner/phy-sun4i-usb.c | 14 +++++++------- >>> 1 file changed, 7 insertions(+), 7 deletions(-) >>> >>> diff --git a/drivers/phy/allwinner/phy-sun4i-usb.c b/drivers/phy/allwinner/phy-sun4i-usb.c >>> index 651d5e2a25ce..4787ad13b255 100644 >>> --- a/drivers/phy/allwinner/phy-sun4i-usb.c >>> +++ b/drivers/phy/allwinner/phy-sun4i-usb.c >>> @@ -326,7 +326,7 @@ static int sun4i_usb_phy_init(struct phy *_phy) >>> /* Force ISCR and cable state updates */ >>> data->id_det = -1; >>> data->vbus_det = -1; >>> - queue_delayed_work(system_wq, &data->detect, 0); >>> + queue_delayed_work(system_power_efficient_wq, &data->detect, 0); >>> } >>> >>> return 0; >>> @@ -444,7 +444,7 @@ static int sun4i_usb_phy_power_on(struct phy *_phy) >>> >>> /* We must report Vbus high within OTG_TIME_A_WAIT_VRISE msec. */ >> >> This doesn't sound like "not performance critical" to me. My understanding is >> the debouncing has a deadline from the USB spec. Maybe this is more flexible >> than the comment makes it sound? > > It's not really clear to me what the power_efficient workqueue brings to > the table exactly from the comments on WQ_POWER_EFFICIENT (and the > associated gmane link is long dead). > > It's only effect seems to be that it sets WQ_UNBOUND when the proper > command line option is set, and WQ_UNBOUND allows for the scheduled work > to run on any CPU instead of the local one. > > Given that we don't have any constraint on the CPU here, and the CPU > locality shouldn't really make any difference, I'm not sure we should > expect any meaningful difference. > > This is also what the rest of the similar drivers seem to be using: > https://elixir.bootlin.com/linux/v5.10-rc3/source/drivers/usb/common/usb-conn-gpio.c#L119 > https://elixir.bootlin.com/linux/v5.10-rc3/source/drivers/usb/core/hub.c#L1254 Thanks for the explanation. Then the patch looks fine to me. Reviewed-by: Samuel Holland Cheers, Samuel