Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3069611pxb; Mon, 9 Nov 2020 01:26:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJxGcuOgQv31Lh9KZPRMmsQ1CdTu2oWM3EMCqm/98H1ynbkZMZDnfxzJVnq4KIyo3/R9Sgy/ X-Received: by 2002:a50:bb66:: with SMTP id y93mr14554885ede.244.1604913988955; Mon, 09 Nov 2020 01:26:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604913988; cv=none; d=google.com; s=arc-20160816; b=PqQK/j8fruOjL1pF3LP1vebD/PgBHSG2D0J3JFuQR7HgxsEKMbBECuy7in9XSjmSWp 8GDvIQNuP4hRNy3TingTiBMCSJ2FIy781SnaZLR9o1XR7GIpjVDz9MYAzbb14icppvO1 jyEmbNsEeYFFo5Qe6axwk7deFx6I894b78c3+kgiYw5N83YtN9cg/ibCqDICqs7qm2tg 7t0ziI5r0HaBDdUcHLs5TK0bw9HJakwBXQwKlR3NSHOSzesXi31MULZPMeMfZ0v8VD7+ bdneMha7x5eCFUeXIxR3TFyscoi8o1YMWKZQYUI0gZp9Y+ndhA3jcUJrrvw6L0IYZRpY u9Hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:dlp-filter:cms-type :content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:organization:from:cc:to:subject :dkim-signature:dkim-filter; bh=JT0sLbUUeWqaL2+bi/rEtX/1btMEnE0S/D8cJ+NVliE=; b=e2RS/on8YrJjPv/L3VA41SolC4PMfvbXn7s4FfN2ssymHtRrZ5wPcKCEk98NTDEoWN cU/7CmUZ5wcyUXuH1HLieLeJu209EyFex1B+4h85ay1o9Izavib3yqhSXjQe9XpBXoMZ 2Vdwcl5FSgE2vc13/rv+di+HJW1XTX4rA9AwjQmNXUDAfDLGDIHVGKRVCV/k7mfzHRhL aKQXPRnkgZxxVl+8URWvDAYHvITsNPigIy2Ig5Hba4OyBlSEGshvGnYWR24Yz+3zOfjz SJMS+D7bln8okQr5s5DRQgRmZ8babJrGa0dux11nRyImD1uDpYAnvkdWFPe13g6qwqrn bmlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b="ZJVP/CsY"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x18si7937125ejd.193.2020.11.09.01.26.05; Mon, 09 Nov 2020 01:26:28 -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=@samsung.com header.s=mail20170921 header.b="ZJVP/CsY"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728979AbgKIJYY (ORCPT + 99 others); Mon, 9 Nov 2020 04:24:24 -0500 Received: from mailout2.samsung.com ([203.254.224.25]:20632 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728049AbgKIJYX (ORCPT ); Mon, 9 Nov 2020 04:24:23 -0500 Received: from epcas1p4.samsung.com (unknown [182.195.41.48]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20201109092420epoutp020f1135a460f9b8b47ca93b4fc6c39465~FzKcsbLjg0744207442epoutp02M for ; Mon, 9 Nov 2020 09:24:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20201109092420epoutp020f1135a460f9b8b47ca93b4fc6c39465~FzKcsbLjg0744207442epoutp02M DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1604913860; bh=JT0sLbUUeWqaL2+bi/rEtX/1btMEnE0S/D8cJ+NVliE=; h=Subject:To:Cc:From:Date:In-Reply-To:References:From; b=ZJVP/CsY94iFlfJ7BMDgQM7upwKk/RZtif/bfvnGIIFJ5LPUaiI3Vv4WsewQKYj3S w5h6zf6nF4v6sX/sb9aZkaUA0wnAIzbHMI7TRNNCnWdTqez62ARgyVmtG5RbhOJLrS yyrbbhK6ChEsEiy4Vhw9/D6z3nzF7o/bS/yRqvEQ= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas1p1.samsung.com (KnoxPortal) with ESMTP id 20201109092420epcas1p1ec07f68c400c7a8a74a095bee14869b4~FzKcbOclS0299102991epcas1p1d; Mon, 9 Nov 2020 09:24:20 +0000 (GMT) Received: from epsmges1p3.samsung.com (unknown [182.195.40.157]) by epsnrtp1.localdomain (Postfix) with ESMTP id 4CV5D14HHYzMqYm2; Mon, 9 Nov 2020 09:24:17 +0000 (GMT) Received: from epcas1p1.samsung.com ( [182.195.41.45]) by epsmges1p3.samsung.com (Symantec Messaging Gateway) with SMTP id 1D.27.09582.3BA09AF5; Mon, 9 Nov 2020 18:24:03 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas1p1.samsung.com (KnoxPortal) with ESMTPA id 20201109092403epcas1p15a534e0343e77ac137a57ab45439b9fb~FzKMlq-q83262132621epcas1p1t; Mon, 9 Nov 2020 09:24:03 +0000 (GMT) Received: from epsmgms1p2.samsung.com (unknown [182.195.42.42]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20201109092403epsmtrp1252f23cefd897028d5b1c599c0e59b77~FzKMk6Z6Q0505205052epsmtrp1v; Mon, 9 Nov 2020 09:24:03 +0000 (GMT) X-AuditID: b6c32a37-8afff7000000256e-97-5fa90ab3473a Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgms1p2.samsung.com (Symantec Messaging Gateway) with SMTP id DC.F7.08745.3BA09AF5; Mon, 9 Nov 2020 18:24:03 +0900 (KST) Received: from [10.113.221.102] (unknown [10.113.221.102]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20201109092403epsmtip1b3be786c88ec2dff2593d9aecc098f13~FzKMVB4MF1708417084epsmtip1w; Mon, 9 Nov 2020 09:24:03 +0000 (GMT) Subject: Re: [PATCH] PM / devfreq: passive: Update frequency when start governor To: Marek Szyprowski , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: chanwoo@kernel.org, myungjoo.ham@samsung.com, kyungmin.park@samsung.com, Bartlomiej Zolnierkiewicz From: Chanwoo Choi Organization: Samsung Electronics Message-ID: <90d300a2-4dad-c920-beca-dcd7b4cbffee@samsung.com> Date: Mon, 9 Nov 2020 18:37:54 +0900 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Thunderbird/59.0 MIME-Version: 1.0 In-Reply-To: <21d84c20-ac34-7d05-3c7d-feb1a881980d@samsung.com> Content-Language: en-US Content-Transfer-Encoding: 8bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuplk+LIzCtJLcpLzFFi42LZdlhTV3cz18p4gw8nDCw2zljPajHxxhUW i7NNb9gtLu+aw2bxufcIo8XaI3fZLW43rmBzYPfYtKqTzaNvyypGj8+b5AKYo7JtMlITU1KL FFLzkvNTMvPSbZW8g+Od403NDAx1DS0tzJUU8hJzU22VXHwCdN0yc4CWKymUJeaUAoUCEouL lfTtbIryS0tSFTLyi0tslVILUnIKLAv0ihNzi0vz0vWS83OtDA0MjEyBChOyM/b97mQuaNCq eDx9HmMD4zblLkZODgkBE4kP++eygthCAjsYJe53ykPYnxgllvaIdTFyAdmfGSWe/5nJDNPQ vvQ0E0RiF6PE/lPnGCGc94wS39dtBRslLBAkMaF/MyOILSKQKXHk3CtWkCJmgWZGiXWvLoAV sQloSex/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1bxkl3u9oZQWpERYIkpjQv5kRxBYRyJTYsf8i2CBmgWZGie3Helgh Og4zSlzufcMMUsUmoCWx/8UNNhCbX0BR4uqPx2DdvAJ2EpMnTmEHsVkEVCQWzF8DZosKhEns XPKYCaJGUOLkzCcsIBdxCthLnGvPBgkzC6hL/Jl3iRnCFpe49WQ+E4QtL9G8dTbzBEbhWUi6 ZyFpmYWkZRaSlgWMLKsYJVMLinPTc4sNC4zyUsv1ihNzi0vz0vWS83M3MYJjR0trB+OeVR/0 DjEycTAeYpTgYFYS4XX6tyJeiDclsbIqtSg/vqg0J7X4EKM0B4uSOO/XWQvjhATSE0tSs1NT C1KLYLJMHJxSDUxMqz9w5UfJrtL4GbBP0UFIcnNn6jXzDY+2173//GLOqyevlvRVcp22d2Od /W1e1LUFmd+fRH+Lv7Ll6US7hw/UD7K8+z+p0KNR1uJ/rGH3vL2BB+7+7TLPr52jlTtxYo1A 0+JVE6cmSxy7wrTL3nahm8Du0jUvDcO9lQ7F9DG9MSw3YDa9f/nXuyyRpBztzG92nE2FrEdc grburV5expvdwcdaJPfnashPk2JD34S3WkeuuDBYnp9i792YuHDn3I4v7V5/vJcIZYtt987/ n3iDN2LxAbdZF7/f8voTEBq7yT8q7sS/Bc8vK+2e8ipihcLV63NLE9/rZS45ITHz4r3P9/Nz nmpLeLA+33kyXOavEktxRqKhFnNRcSIARjVV9AwDAAA= X-CMS-MailID: 20201109092403epcas1p15a534e0343e77ac137a57ab45439b9fb X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-Sendblock-Type: SVC_REQ_APPROVE CMS-TYPE: 101P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20201103065250epcas1p4421332566646a4464d7871429aabafd9 References: <20201103070646.18687-1-cw00.choi@samsung.com> <21d84c20-ac34-7d05-3c7d-feb1a881980d@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Marek, Thanks for bug reporting. I'll check and fix it. Best Regards, Chanwoo Choi On 11/9/20 6:22 PM, Marek Szyprowski wrote: > Hi Chanwoo, > > On 03.11.2020 08:06, Chanwoo Choi wrote: >> If the parent device changes the their frequency before registering >> the passive device, the passive device cannot receive the notification >> from parent device and then the passive device cannot be able to >> set the proper frequency according to the frequency of parent device. >> >> So, when start the passive governor, update the frequency >> according to the frequency of parent device. >> >> Signed-off-by: Chanwoo Choi > > This patch landed in linux next-20201109 as commit 9b38a4f6b664 ("PM / > devfreq: passive: Update frequency when start governor"). Sadly it > causes the following warning on various Exynos boards with default > exynos_defconfig build: > > exynos-bus: new bus device registered: soc:bus_dmc ( 50000 KHz ~ 400000 KHz) > exynos-bus: new bus device registered: soc:bus_leftbus ( 50000 KHz ~ > 200000 KHz) > ------------[ cut here ]------------ > WARNING: CPU: 1 PID: 22 at drivers/devfreq/devfreq.c:411 > devfreq_update_target+0xdc/0xec > Modules linked in: > CPU: 1 PID: 22 Comm: kworker/1:1 Not tainted 5.10.0-rc2-next-20201109 #1898 > Hardware name: Samsung Exynos (Flattened Device Tree) > Workqueue: events deferred_probe_work_func > [] (unwind_backtrace) from [] (show_stack+0x10/0x14) > [] (show_stack) from [] (dump_stack+0xb4/0xd4) > [] (dump_stack) from [] (__warn+0xd8/0x11c) > [] (__warn) from [] (warn_slowpath_fmt+0xb0/0xb8) > [] (warn_slowpath_fmt) from [] > (devfreq_update_target+0xdc/0xec) > [] (devfreq_update_target) from [] > (devfreq_passive_event_handler+0x80/0xc4) > [] (devfreq_passive_event_handler) from [] > (devfreq_add_device+0x4f8/0x5a0) > [] (devfreq_add_device) from [] > (devm_devfreq_add_device+0x48/0x84) > [] (devm_devfreq_add_device) from [] > (exynos_bus_probe+0x2ac/0x5c8) > [] (exynos_bus_probe) from [] > (platform_drv_probe+0x6c/0xa4) > [] (platform_drv_probe) from [] > (really_probe+0x200/0x4fc) > [] (really_probe) from [] > (driver_probe_device+0x78/0x1fc) > [] (driver_probe_device) from [] > (bus_for_each_drv+0x74/0xb8) > [] (bus_for_each_drv) from [] > (__device_attach+0xe4/0x17c) > [] (__device_attach) from [] > (bus_probe_device+0x88/0x90) > [] (bus_probe_device) from [] > (deferred_probe_work_func+0x3c/0xd0) > [] (deferred_probe_work_func) from [] > (process_one_work+0x234/0x7e4) > [] (process_one_work) from [] (worker_thread+0x44/0x51c) > [] (worker_thread) from [] (kthread+0x158/0x1a0) > [] (kthread) from [] (ret_from_fork+0x14/0x38) > Exception stack(0xc1e27fb0 to 0xc1e27ff8) > 7fa0:                                     00000000 00000000 00000000 > 00000000 > 7fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 > 00000000 > 7fe0: 00000000 00000000 00000000 00000000 00000013 00000000 > irq event stamp: 12147 > hardirqs last  enabled at (12171): [] console_unlock+0x430/0x6b0 > dwc2 12480000.hsotg: new device is high-speed > hardirqs last disabled at (12176): [] console_unlock+0x428/0x6b0 > softirqs last  enabled at (12168): [] __do_softirq+0x528/0x674 > softirqs last disabled at (12155): [] irq_exit+0x1dc/0x1e8 > ---[ end trace 89c1007ec29b9250 ]--- > > Reverting it on top of the linux-next fixes the warning, but I assume > that the proper fix would require locking changes during the devfreq > registration. > >> --- >> drivers/devfreq/governor_passive.c | 15 +++++++++++++++ >> 1 file changed, 15 insertions(+) >> >> diff --git a/drivers/devfreq/governor_passive.c b/drivers/devfreq/governor_passive.c >> index 63332e4a65ae..375aa636027c 100644 >> --- a/drivers/devfreq/governor_passive.c >> +++ b/drivers/devfreq/governor_passive.c >> @@ -141,6 +141,21 @@ static int devfreq_passive_event_handler(struct devfreq *devfreq, >> if (!p_data->this) >> p_data->this = devfreq; >> >> + /* >> + * If the parent device changes the their frequency before >> + * registering the passive device, the passive device cannot >> + * receive the notification from parent device and then the >> + * passive device cannot be able to set the proper frequency >> + * according to the frequency of parent device. >> + * >> + * When start the passive governor, update the frequency >> + * according to the frequency of parent device. >> + */ >> + ret = devfreq_update_target(devfreq, parent->previous_freq); >> + if (ret < 0) >> + dev_warn(&devfreq->dev, >> + "failed to update devfreq using passive governor\n"); >> + >> nb->notifier_call = devfreq_passive_notifier_call; >> ret = devfreq_register_notifier(parent, nb, >> DEVFREQ_TRANSITION_NOTIFIER); > > Best regards >