Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp661716ybt; Wed, 24 Jun 2020 08:15:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxYVAxYXLqRxmgERlqwxF0PX9EwINQm5zs/kJtZMoBnGX8OnxnzKnfh7vNBAjny4h6bgUKS X-Received: by 2002:a17:906:6959:: with SMTP id c25mr21239876ejs.375.1593011703682; Wed, 24 Jun 2020 08:15:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593011703; cv=none; d=google.com; s=arc-20160816; b=Httn21wKw+RvtAJvyz7O368gm+x8cumNtG/6GmH+xZJuFeD1Q2fbc6ZzLh81EgcSyb fJuXuk7qG4AfePve5w8AMZ82qn0X7xJNiGO9b241a0+ITZLf7EUtvTJqePgAps9enJzV CoSVRtKRZWwOWkk94QCpc8OvyWWC1tLtNRx4GDg7L0BHSAAnURIQTHXVwqtCodejsxWk KnXZOnAqG6U6my7TuGzPhQUQW8CMB/shL7dqWuI1MH29lPHWWjP2hmZ32Ie5XIMlLcm7 7XjVkwUibrOY2PYZqGepk1I3YVPC4Pu0LQU0ihC9G5BQiBLoWLa64lawKSLZzLJn8hsQ dd+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type :content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:cc:to:subject:dkim-signature :dkim-filter; bh=vIfCBmSC+5GtsPYmRCTd8QesuVfaXVykkj6k7TxHWDA=; b=CrbSqu6I5CKgvdwktSI+hXdOuiV5PInRg+vq6Os8kLBT78aBm6fJNK0UoIvT549pl8 ircCHRWY9QWZsXNx3cRIAf5eyvcruc0F+WXz9yW9Iw3WqLJWHqyHWzJIFtKvDqpbN5HH YcbWOBzgaHhyHLKhHxuuWirSjxgtMpcqT3/yntM68bpbgMvftJjZdy2QTFM29yHqQtkd rbjveEVxdALP2v0DzzHrZ6EHSqAkaSmzJ3G2VOl/lfVBA9mNgr7lqqp+Vk5skHtiWttj 71f5LpJJDhS3g0CX3Yt38K7IPWQG8R7u4zTRQzX2aLwIBd1YP9KqbkSu0SFEdWD8d3g8 Tpfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=d3Kbk6je; 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 k19si8291164ejc.167.2020.06.24.08.14.40; Wed, 24 Jun 2020 08:15:03 -0700 (PDT) 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=d3Kbk6je; 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 S2404243AbgFXPLi (ORCPT + 99 others); Wed, 24 Jun 2020 11:11:38 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:50818 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404238AbgFXPLh (ORCPT ); Wed, 24 Jun 2020 11:11:37 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200624151135euoutp02cb43cbb9c544f5781ef23901e2db6e00~bg4Pd41BE2380323803euoutp02u for ; Wed, 24 Jun 2020 15:11:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200624151135euoutp02cb43cbb9c544f5781ef23901e2db6e00~bg4Pd41BE2380323803euoutp02u DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1593011495; bh=vIfCBmSC+5GtsPYmRCTd8QesuVfaXVykkj6k7TxHWDA=; h=Subject:To:Cc:From:Date:In-Reply-To:References:From; b=d3Kbk6jeUH/b2U8aGb6xc4Ya2Uv1ARZ/vt/zcpb2yKnIdwyifNi/aogKF9wSFjcCY 0UfDxG+a4xfJBK1wYPPkNn1fpcJoTsVSCoacjsNacSk8Wvt/SunvyW8qmvUbe6HS+j yKx9sbNPfvw1rxIj4PokZL2Z4apGM1W75Z0Drnp0= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20200624151135eucas1p1335bb5b1799513a14a8efb3d455078b2~bg4PLTJKl1469014690eucas1p1P; Wed, 24 Jun 2020 15:11:35 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id BF.7B.06456.72D63FE5; Wed, 24 Jun 2020 16:11:35 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200624151134eucas1p1c70eef4c8ed9fd2fb0275cbec6576f44~bg4O0FaiQ1265612656eucas1p1Q; Wed, 24 Jun 2020 15:11:34 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200624151134eusmtrp1dfb6c70903341241eeeae3dbab271a31~bg4OzaZn01873818738eusmtrp1I; Wed, 24 Jun 2020 15:11:34 +0000 (GMT) X-AuditID: cbfec7f2-7efff70000001938-e6-5ef36d270ac2 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id D9.72.06017.62D63FE5; Wed, 24 Jun 2020 16:11:34 +0100 (BST) Received: from [106.210.123.115] (unknown [106.210.123.115]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200624151134eusmtip11cc243e141c704390f7521bb388feef3~bg4OEgzT22683126831eusmtip1N; Wed, 24 Jun 2020 15:11:33 +0000 (GMT) Subject: Re: brocken devfreq simple_ondemand for Odroid XU3/4? To: Lukasz Luba , Krzysztof Kozlowski , Willy Wolff Cc: Chanwoo Choi , MyungJoo Ham , Kyungmin Park , Kukjin Kim , linux-pm@vger.kernel.org, "linux-samsung-soc@vger.kernel.org" , linux-arm-kernel@lists.infradead.org, "linux-kernel@vger.kernel.org" From: Sylwester Nawrocki Message-ID: Date: Wed, 24 Jun 2020 17:11:33 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: <85f5a8c0-7d48-f2cd-3385-c56d662f2c88@arm.com> Content-Language: en-US Content-Transfer-Encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrCKsWRmVeSWpSXmKPExsWy7djP87rquZ/jDPqv81hc//Kc1aL/8Wtm i/PnN7BbnG16w26x6fE1VovLu+awWXzuPcJoMeP8PiaLhU0t7Ba3G1ewWXw78YjRgdtjzbw1 jB47Z91l99i0qpPNY/OSeo++LasYPT5vkgtgi+KySUnNySxLLdK3S+DKOHj1OGvBbr6KtdfX sTYw3uPuYuTkkBAwkdjZ+5Kli5GLQ0hgBaPEufOv2CCcL4wS75uamSGcz4wSfzZ0ssK0NP9b DNWynFGiv+k6E4TzkVFi8afjTCBVwgJ2EvOv7QLrEBGolLg18zvYXGaBt0wSe/7eZgNJsAkY SvQe7WMEsXmBGm63dQI1c3CwCKhKzPymBBIWFYiV6Fu6gA2iRFDi5MwnLCA2p4C1xJJZb8F2 MQuIS9x6Mh/KlpfY/nYO2NkSArfYJb5fOQd1tovE6huNzBC2sMSr41vYIWwZidOTe1ggGpoZ JXp232aHcCYwStw/voARospa4s65X2wg1zELaEqs36UPEXa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YKDWUmE1+ns6Tgh3pTEyqrUovz4otKc1OJDjKZA v01klhJNzgemj7ySeENTQ3MLS0NzY3NjMwslcd4OgYMxQgLpiSWp2ampBalFMH1MHJxSDYzp 7T/VVRL5E0yePJPhEOwMUTx9xN9tRlaOpkfuKvfe6nk9xWdTMu4/WvYztTZm24Kfx5fbL1Ta F5F4Onf5hwtcU14WXl166ZFiyQxLVsnjLpdZNZZUMnTHfmc4eIHbXpnhf0Eow6RlDuZi9y34 Um4HpEy8X1MSpCfxp8xPiWdeWtSMu6tfvVFiKc5INNRiLipOBACBoft/5wIAAA== X-CMS-MailID: 20200624151134eucas1p1c70eef4c8ed9fd2fb0275cbec6576f44 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200624103308eucas1p188a5fe3cee1916d9430c9971c2dab3a3 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200624103308eucas1p188a5fe3cee1916d9430c9971c2dab3a3 References: <20200623164733.qbhua7b6cg2umafj@macmini.local> <20200623191129.GA4171@kozik-lap> <85f5a8c0-7d48-f2cd-3385-c56d662f2c88@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi All, On 24.06.2020 12:32, Lukasz Luba wrote: > I had issues with devfreq governor which wasn't called by devfreq > workqueue. The old DELAYED vs DEFERRED work discussions and my patches > for it [1]. If the CPU which scheduled the next work went idle, the > devfreq workqueue will not be kicked and devfreq governor won't check > DMC status and will not decide to decrease the frequency based on low > busy_time. > The same applies for going up with the frequency. They both are > done by the governor but the workqueue must be scheduled periodically. As I have been working on resolving the video mixer IOMMU fault issue described here: https://patchwork.kernel.org/patch/10861757 I did some investigation of the devfreq operation, mostly on Odroid U3. My conclusions are similar to what Lukasz says above. I would like to add that broken scheduling of the performance counters read and the devfreq updates seems to have one more serious implication. In each call, which normally should happen periodically with fixed interval we stop the counters, read counter values and start the counters again. But if period between calls becomes long enough to let any of the counters overflow, we will get wrong performance measurement results. My observations are that the workqueue job can be suspended for several seconds and conditions for the counter overflow occur sooner or later, depending among others on the CPUs load. Wrong bus load measurement can lead to setting too low interconnect bus clock frequency and then bad things happen in peripheral devices. I agree the workqueue issue needs to be fixed. I have some WIP code to use the performance counters overflow interrupts instead of SW polling and with that the interconnect bus clock control seems to work much better. -- Regards, Sylwester