Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3155695pxb; Mon, 9 Nov 2020 04:15:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJw9JOzRbhjBqyrcGPVtYAioJk23kid7lYBfPTGDvPdqUziI0trk6vp+EqsdBkwA1xJbVtZY X-Received: by 2002:a05:6402:206:: with SMTP id t6mr14729565edv.291.1604924122750; Mon, 09 Nov 2020 04:15:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604924122; cv=none; d=google.com; s=arc-20160816; b=Df2n3jY7cux9jQSzwejd+rzpf7rbLvC5zxM4C56/llk5wbvlY7SPiEyOgmIRqwJe6o w5v958N4vc6topoXYUYB6umpDAK5d8YsyS1moBTY4Lk013pHSgEefh019/vRWMwAPPf5 t/AldqHmG8V85Aqh9qrW4Ri5A2Wt5B8ZzD0s3yhF9nF2SNSFTvJ945CXyWgXmPM2I4ax VooMcnirshH+Y1wfk8x3AcjYZEXsXOfRtQDU0OjegXrkXROgrmPycMuKm1PW7BE/QgYt XNqZVpPBNjpHgEp7eoiX/HeMLSKi4AXk6YUZUKHqz2wb4CSlV8nZT32mUlDAddAAMSjh Pm6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=W5HWc+OQnZIXaPxRdaKGwadXiYX+lR3siceba2kTEHQ=; b=b2OESaQEVA1x16N0ENNYz2MLnrz5shQ5qOA+JKh7UBUS+plwv89/IWy7Sy3BnVObrw W/AD076CtYl5VrxlrVkLIu/uNeDoiXi6z2Oy/YqJQurtIazgDYFn50QAeZ4JRBgkNT0i pTx9G6sGvSgUMGDd63rTtNuDA7HvvLosz3yD8yvvZDtqbAqulyKVEb+081osLxRKwA6s PQ2REcLRD4brTKptVrLHhxUD/hCRYNcronAryRyHLanNsHFGCVX3OmCdhOGPAQPX6TGJ ogHdIDwD4Xkyq/ZR8Yuvp0Ply0n7aU2XaXkZ7Ac+e8vTi3VmWimXUbZ5BUUvQEDAwv3G GKiA== ARC-Authentication-Results: i=1; mx.google.com; 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 r7si6684972ejb.27.2020.11.09.04.14.59; Mon, 09 Nov 2020 04:15:22 -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; 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 S1729697AbgKIMLR (ORCPT + 99 others); Mon, 9 Nov 2020 07:11:17 -0500 Received: from smtp2207-205.mail.aliyun.com ([121.197.207.205]:36774 "EHLO smtp2207-205.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727303AbgKIMLR (ORCPT ); Mon, 9 Nov 2020 07:11:17 -0500 X-Alimail-AntiSpam: AC=CONTINUE;BC=0.09605445|-1;CH=green;DM=|CONTINUE|false|;DS=CONTINUE|ham_system_inform|0.0380702-0.0163614-0.945568;FP=0|0|0|0|0|-1|-1|-1;HT=ay29a033018047213;MF=frank@allwinnertech.com;NM=1;PH=DS;RN=6;RT=6;SR=0;TI=SMTPD_---.IuVJ-Tc_1604923868; Received: from allwinnertech.com(mailfrom:frank@allwinnertech.com fp:SMTPD_---.IuVJ-Tc_1604923868) by smtp.aliyun-inc.com(10.147.40.44); Mon, 09 Nov 2020 20:11:12 +0800 From: Frank Lee To: sre@kernel.org, wens@csie.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, tiny.windzz@gmail.com Cc: Yangtao Li Subject: [PATCH 2/3] power: supply: axp20x_usb_power: Use power efficient workqueue for debounce Date: Mon, 9 Nov 2020 20:11:04 +0800 Message-Id: <20201109121104.18201-1-frank@allwinnertech.com> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yangtao Li The debounce timeout 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/power/supply/axp20x_usb_power.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/power/supply/axp20x_usb_power.c b/drivers/power/supply/axp20x_usb_power.c index 3b4fd710347d..70b28b699a80 100644 --- a/drivers/power/supply/axp20x_usb_power.c +++ b/drivers/power/supply/axp20x_usb_power.c @@ -92,7 +92,7 @@ static irqreturn_t axp20x_usb_power_irq(int irq, void *devid) power_supply_changed(power->supply); - mod_delayed_work(system_wq, &power->vbus_detect, DEBOUNCE_TIME); + mod_delayed_work(system_power_efficient_wq, &power->vbus_detect, DEBOUNCE_TIME); return IRQ_HANDLED; } @@ -117,7 +117,7 @@ static void axp20x_usb_power_poll_vbus(struct work_struct *work) out: if (axp20x_usb_vbus_needs_polling(power)) - mod_delayed_work(system_wq, &power->vbus_detect, DEBOUNCE_TIME); + mod_delayed_work(system_power_efficient_wq, &power->vbus_detect, DEBOUNCE_TIME); } static int axp20x_get_current_max(struct axp20x_usb_power *power, int *val) @@ -525,7 +525,7 @@ static int axp20x_usb_power_resume(struct device *dev) while (i < power->num_irqs) enable_irq(power->irqs[i++]); - mod_delayed_work(system_wq, &power->vbus_detect, DEBOUNCE_TIME); + mod_delayed_work(system_power_efficient_wq, &power->vbus_detect, DEBOUNCE_TIME); return 0; } @@ -647,7 +647,7 @@ static int axp20x_usb_power_probe(struct platform_device *pdev) INIT_DELAYED_WORK(&power->vbus_detect, axp20x_usb_power_poll_vbus); if (axp20x_usb_vbus_needs_polling(power)) - queue_delayed_work(system_wq, &power->vbus_detect, 0); + queue_delayed_work(system_power_efficient_wq, &power->vbus_detect, 0); return 0; } -- 2.28.0