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 49EEBC388F9 for ; Wed, 11 Nov 2020 03:46:30 +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 A96E82078E for ; Wed, 11 Nov 2020 03:46:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="VzFAYf+7"; dkim=temperror (0-bit key) header.d=sholland.org header.i=@sholland.org header.b="ZQeRRIlu"; dkim=temperror (0-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="l9wDrZpx" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A96E82078E 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=wLlC4tUMVDqnirkevubdBdVs6ycI5hFPz/v5NceBs3I=; b=VzFAYf+7Ss0BNEENQQjZoYBYo jPibTmm9CPJgB1P/Kx6vwwvwa8HqQO9nJ0lfUhEMEiCJsGd9+lXBF4C91Jbz52siWWpdWlUcFsxym 28D/qMgd/IxiDJinMKZcySMMWL0vRwcvpsnUq5/0htjHlzQhoP1S5AahrLveC/Ef+TvLJBJM99aDO pyYTuTERf9L5cLja0D6o27/9w87lIQP1f6t4vBxfPnZgY/65iHkGbKEBeFRwIj6cQaKfCM2OoiCDf OgrIg/9sOSLx6HLf92h4tjFXFCG5kr6HbGFER8NfDMOUEc53ZY7V9x8kJ8T/1vAa1XTxUYxuk0Y9l RIIGMDvUQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kch3z-0008KY-Mi; Wed, 11 Nov 2020 03:44:51 +0000 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kch3w-0008K0-Qe for linux-arm-kernel@lists.infradead.org; Wed, 11 Nov 2020 03:44:49 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id C45DB168A; Tue, 10 Nov 2020 22:44:41 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Tue, 10 Nov 2020 22:44:42 -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=M bK62lfa8XqQ5uQpEMNmODTXXUW5ssZlsBtuCAcsjHw=; b=ZQeRRIlu5RRQSjaJV DabQsIHjtrX9diTzh1dbhHfKBKg9gxux67QCjj7dvZTlBFLGclnObL3rJkFwIbno Pyp+1Dy2Ze8Nq+0Y/t5g+HR5i9lq6S4IQORd1XDBNFrOEi7jtB89TFwZTfxMzOIb O+z5SopD5RWMJkue3kXVw795qIySgLDDQRZa0oGh96prI63hm3vg/0up1sKS73i9 H22zMeK5VrQD9MFWiGLgewjmywnBVxkFEpmErFaC07jK3TloBqAc48LVWQrvJFWF cJEtg0VhH16zIPrACcmCodChMVVFGLN23D3CwqLf+u+oU7Ych86WazUVwenz+/SK gtnVg== 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=MbK62lfa8XqQ5uQpEMNmODTXXUW5ssZlsBtuCAcsj Hw=; b=l9wDrZpxX9ozjQp14/v2qpNp4v3anPxU1/7XiQtzgrH2VMPqHbq6cGM1M JtYgroDNJ64e75liN3mIcijWMJtg4G95JuyPr7B4fcGmkG08nnGavjc8hKCf+gHQ h3rE0ittFD+q2XPP2bJRMjTNCqrpuVzlDYomelg0TiMRrUt+Av9w7fmJIvR1GIeD nXWJFYW4Mb5fU1tx85UjmoG+rIrhuSt/aGhYFPRU5RZBQvTzz1fd/i/aiT16vHCz 3XP+lfMsJJ1TuUu5kfKnsn7UYiZski9wrc6rp6olO0QLaQxlaCV0ZDP9xXl9iO/P 2+2g+HjSerHlmjPuYmR5QmYqyHc0g== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrudduledggeduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepuffvfhfhkffffgggjggtgfesthejredttdefjeenucfhrhhomhepufgrmhhu vghlucfjohhllhgrnhguuceoshgrmhhuvghlsehshhholhhlrghnugdrohhrgheqnecugg ftrfgrthhtvghrnhepgfevffetleehffejueekvdekvdeitdehveegfeekheeuieeiueet uefgtedtgeegnecukfhppeejtddrudefhedrudegkedrudehudenucevlhhushhtvghruf hiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehsrghmuhgvlhesshhhohhllhgr nhgurdhorhhg 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 C7E32328005E; Tue, 10 Nov 2020 22:44:38 -0500 (EST) Subject: Re: [PATCH 3/3] phy: sun4i-usb: Use power efficient workqueue for debounce and poll To: Frank Lee , vkoul@kernel.org, mripard@kernel.org, wens@csie.org, krzk@kernel.org, colin.king@canonical.com, tiny.windzz@gmail.com References: <20201109121214.19012-1-frank@allwinnertech.com> From: Samuel Holland Message-ID: Date: Tue, 10 Nov 2020 21:44: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: <20201109121214.19012-1-frank@allwinnertech.com> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201110_224449_067922_ADFC28AC X-CRM114-Status: GOOD ( 20.51 ) 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: linux-kernel@vger.kernel.org, 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/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? > if (phy->index == 0 && sun4i_usb_phy0_poll(data)) > - mod_delayed_work(system_wq, &data->detect, DEBOUNCE_TIME); > + mod_delayed_work(system_power_efficient_wq, &data->detect, DEBOUNCE_TIME); > > return 0; > } > @@ -465,7 +465,7 @@ static int sun4i_usb_phy_power_off(struct phy *_phy) > * Vbus gpio to not trigger an edge irq on Vbus off, so force a rescan. > */ > if (phy->index == 0 && !sun4i_usb_phy0_poll(data)) > - mod_delayed_work(system_wq, &data->detect, POLL_TIME); > + mod_delayed_work(system_power_efficient_wq, &data->detect, POLL_TIME); > > return 0; > } > @@ -504,7 +504,7 @@ static int sun4i_usb_phy_set_mode(struct phy *_phy, > > data->id_det = -1; /* Force reprocessing of id */ > data->force_session_end = true; > - queue_delayed_work(system_wq, &data->detect, 0); > + queue_delayed_work(system_power_efficient_wq, &data->detect, 0); > > return 0; > } > @@ -616,7 +616,7 @@ static void sun4i_usb_phy0_id_vbus_det_scan(struct work_struct *work) > extcon_set_state_sync(data->extcon, EXTCON_USB, vbus_det); > > if (sun4i_usb_phy0_poll(data)) > - queue_delayed_work(system_wq, &data->detect, POLL_TIME); > + queue_delayed_work(system_power_efficient_wq, &data->detect, POLL_TIME); > } > > static irqreturn_t sun4i_usb_phy0_id_vbus_det_irq(int irq, void *dev_id) > @@ -624,7 +624,7 @@ static irqreturn_t sun4i_usb_phy0_id_vbus_det_irq(int irq, void *dev_id) > struct sun4i_usb_phy_data *data = dev_id; > > /* vbus or id changed, let the pins settle and then scan them */ > - mod_delayed_work(system_wq, &data->detect, DEBOUNCE_TIME); > + mod_delayed_work(system_power_efficient_wq, &data->detect, DEBOUNCE_TIME); > > return IRQ_HANDLED; > } > @@ -638,7 +638,7 @@ static int sun4i_usb_phy0_vbus_notify(struct notifier_block *nb, > > /* Properties on the vbus_power_supply changed, scan vbus_det */ > if (val == PSY_EVENT_PROP_CHANGED && psy == data->vbus_power_supply) > - mod_delayed_work(system_wq, &data->detect, DEBOUNCE_TIME); > + mod_delayed_work(system_power_efficient_wq, &data->detect, DEBOUNCE_TIME); > > return NOTIFY_OK; > } > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel