From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BEA6EC2D0E4 for ; Tue, 17 Nov 2020 04:48:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5859324698 for ; Tue, 17 Nov 2020 04:48:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727069AbgKQEsl (ORCPT ); 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2CB03C2D0E4 for ; Tue, 17 Nov 2020 04:49:28 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A0AEE24695 for ; Tue, 17 Nov 2020 04:49:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="whR0T/yh"; dkim=temperror (0-bit key) header.d=sholland.org header.i=@sholland.org header.b="bjV5VA6y"; dkim=temperror (0-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="jxgbeDiH" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A0AEE24695 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=sholland.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=okTtbmgnbx/EqXBos4uFBhi2340AjqATX1l5MjeCgi8=; b=whR0T/yhg8WTY4VygPEgqyc9V N3Quv+Usr8dxS6jP1Yxhg3gygGoFJ66LNf2dx1H8/+lOgNUJU50z46z4RGRml6hPJ/rAY0pdZkBK7 bEeE5uDGtt97EFG3amFo4YFR/Rgom6c4wdiNJHqOf4OisQjEiIrfN4JhsraAXofthXLowjZHDA6jA HnwAUAT5dihqGZn77wj9J8004lcn8V7fIXR3keVz3KYyWjb1efE00KPcZ2M88Gyeo0eFucrMfpRFV qJ9NrCmLxgoLEzT3x02BU2JDjdiTEcOvPGnJTFd7oKITsCZ67ThCexO6vRzjkNMcKjH3GdVm5sxec 0+YLLRIHA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kesvA-0002fG-BS; Tue, 17 Nov 2020 04:48:48 +0000 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kesv6-0002er-W2 for linux-arm-kernel@lists.infradead.org; Tue, 17 Nov 2020 04:48:46 +0000 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 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-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201116_234845_228898_17C8C221 X-CRM114-Status: GOOD ( 23.97 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: tiny.windzz@gmail.com, wens@csie.org, krzk@kernel.org, linux-kernel@vger.kernel.org, vkoul@kernel.org, Frank Lee , colin.king@canonical.com, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel