Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp4292874ybz; Tue, 28 Apr 2020 08:53:03 -0700 (PDT) X-Google-Smtp-Source: APiQypIO3dcOwLxM3GRqCZ14hXDIEVVjYIctOsUU8tXE1j7sEHsUQN45gooBv4IKu6qvQgBfwv9L X-Received: by 2002:a50:e8c1:: with SMTP id l1mr10553564edn.81.1588089182793; Tue, 28 Apr 2020 08:53:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588089182; cv=none; d=google.com; s=arc-20160816; b=iOzsTjWpF6YSReGQ6VlAydTCwtE+f35y239dzRzYkiAnP3760fbnNknDzYMdEO9r0v D/PdA9+P7I8aepg/RPKCu5m50TnAnWI6QI7OkADjjJf130RdO/eF9SKuxjbrxUj19dyu /LHElXVz0OrO0nOZ+V9Y+LfhOmMbu3iIr0PnNYqONMk1qa+Riq00GS0ign+WFBAvJxd2 JiBDiLghMVqOWR+TI65bKgERcCrLSXEyV+Kky6So8/kt/gSpdzCyy4Agc6m+3Zr+7R47 VvLzh3JwNL6xS0E671tSeF28Vr5QWF5fkCZsiVc1W7xdR2n8oWfg4SoTABhNbBZty5r6 rhAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:date:message-id:autocrypt :openpgp:from:references:cc:to:subject:dkim-signature; bh=yT8C9Z0cwFWg9VQuzJhxHhG3ta75UnZwwwKuAE5M5tY=; b=IC5gl92/3wX09IJhB1rPYWi1NOwDg0bQt+YOuKNl2bcj+m/eqlXDmIXQjD4sQSKqAS qBCAhmVHbklwxEAgDKAN/tqzdMrPHbWHdXSBiRkykiJe4Wexrijjf0EsiOR3yLK5nWXo BG8hm3qceTa/zh6mGec5glq/tveeo0NI3RHqjOUPp+71BY4TtZ9I3kITs+SeN4l9vC/T PP/t47kpE6g+lUXBPHygMR09CzGtZkpbfRk+wb1hDzX0CwNYZKWu25cam93V79/Bsk7c sVpH02uT6rtdOHaDMg8kFOuI9/dJeUQJoRcNn8Xaq7LtIoUVr3tVR1r0uNY6aPWDJcoy wdlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="avd/pmgW"; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bs23si1966154edb.203.2020.04.28.08.52.39; Tue, 28 Apr 2020 08:53:02 -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=@linaro.org header.s=google header.b="avd/pmgW"; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728461AbgD1PuG (ORCPT + 99 others); Tue, 28 Apr 2020 11:50:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46884 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1728213AbgD1PuG (ORCPT ); Tue, 28 Apr 2020 11:50:06 -0400 Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E72CEC03C1AB for ; Tue, 28 Apr 2020 08:50:04 -0700 (PDT) Received: by mail-wr1-x444.google.com with SMTP id i10so25224886wrv.10 for ; Tue, 28 Apr 2020 08:50:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:openpgp:autocrypt:message-id:date :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=yT8C9Z0cwFWg9VQuzJhxHhG3ta75UnZwwwKuAE5M5tY=; b=avd/pmgWdLY1y8mQnSn0uB5ryWhU4mq8HAgoi7O/LPXfvHM9YVRyfiHaEF3eGtLHjo O2ubgIYBklniO3y6CuHwYELYbiKcaVmUSWntQbfaIK0CWhz66VXE9BlcdodN25zoASiS eAEvRHd3r1neXiHvCqN9XvQiuP9f3GZCRp2wvkHqQdy492cKSu0T8kGqzUmARV2JgDNW GHrv0i6AB1g9feyJR6CTpggjwMtw93bPmuWbLjwSZQjHYI7byREOTg8gbyIfm2/jrcRi kpmbYeqwuhKZT9h6zq7Zu9394OB0Pc3QYZtQ9a7HKRxAztXNrlgdvMQsnuzOKajqAJhl +GRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:autocrypt :message-id:date:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=yT8C9Z0cwFWg9VQuzJhxHhG3ta75UnZwwwKuAE5M5tY=; b=JsbigphpWkRQMlCz7qJmTYDLPWIouoBx6iPyUkR2q6mMFUKdnPPynKpjrS8zXijd5C 2p20dBariqagewPBJU5iLFFCqWeW0MWZgReMjmKHbXNn9ppt+/UObMflhWhuxDcgu28h HSr3atZwi7C/66wN05VGyZN/J8E1F/mOUhugoQzqPPPqLf1b1blKHyIPo+IdOOSKzAnX YoteECf+CODg8N84z0GErENhH5QumZpjmkoOqu3hcwlwhahRkkV8OI8NHn3+2uXlFWxy JhTSPvfT1AY31JhOWpev3QuDSsZ0j8GecTy8p+aYP2MKElcp+pLdKKDvYVnmGoeXJOIh HYeg== X-Gm-Message-State: AGi0Pubk6aMKJBl4hmCvcnNt8632bGw3FhMFqgEAHequEVLJh3mpOZWi F1AcXzk10N+Lianp9xiLlAMvQC7g37E= X-Received: by 2002:adf:c3ca:: with SMTP id d10mr35642201wrg.64.1588089002660; Tue, 28 Apr 2020 08:50:02 -0700 (PDT) Received: from [192.168.0.136] ([87.120.218.65]) by smtp.googlemail.com with ESMTPSA id f2sm27297345wro.59.2020.04.28.08.50.01 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Apr 2020 08:50:01 -0700 (PDT) Subject: Re: [PATCH] interconnect: Add helpers for enabling/disabling a path To: Matthias Kaehlcke Cc: linux-pm@vger.kernel.org, evgreen@chromium.org, bjorn.andersson@linaro.org, akashast@codeaurora.org, linux-kernel@vger.kernel.org References: <20200428091650.27669-1-georgi.djakov@linaro.org> <20200428152842.GG4525@google.com> From: Georgi Djakov Openpgp: preference=signencrypt Autocrypt: addr=georgi.djakov@linaro.org; prefer-encrypt=mutual; keydata= mQINBFjTuRcBEACyAOVzghvyN19Sa/Nit4LPBWkICi5W20p6bwiZvdjhtuh50H5q4ktyxJtp 1+s8dMSa/j58hAWhrc2SNL3fttOCo+MM1bQWwe8uMBQJP4swgXf5ZUYkSssQlXxGKqBSbWLB uFHOOBTzaQBaNgsdXo+mQ1h8UCgM0zQOmbs2ort8aHnH2i65oLs5/Xgv/Qivde/FcFtvEFaL 0TZ7odM67u+M32VetH5nBVPESmnEDjRBPw/DOPhFBPXtal53ZFiiRr6Bm1qKVu3dOEYXHHDt nF13gB+vBZ6x5pjl02NUEucSHQiuCc2Aaavo6xnuBc3lnd4z/xk6GLBqFP3P/eJ56eJv4d0B 0LLgQ7c1T3fU4/5NDRRCnyk6HJ5+HSxD4KVuluj0jnXW4CKzFkKaTxOp7jE6ZD/9Sh74DM8v etN8uwDjtYsM07I3Szlh/I+iThxe/4zVtUQsvgXjwuoOOBWWc4m4KKg+W4zm8bSCqrd1DUgL f67WiEZgvN7tPXEzi84zT1PiUOM98dOnmREIamSpKOKFereIrKX2IcnZn8jyycE12zMkk+Sc ASMfXhfywB0tXRNmzsywdxQFcJ6jblP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ql1omgEpjnFsPsyFebzcKGbdEr6vySGa3Cof+miX06hQXKe99a5+eHNhtZJcMAIO89wZmj 7ayYJIXFqjl/X0KBcCbiAl4vbdBw1bqFnO4zd1lMXKVoa29UHqby4MPbQhjWNVv9kqp8A39+ E9xw890l1xdERkjVKX6IEJu2hf7X3MMl9tOjBK6MvdOUxvh1bNNmXh7OlBL1MpJYY/ydIm3B KEmKjLDvB0pePJkdTw== Message-ID: Date: Tue, 28 Apr 2020 18:50:00 +0300 MIME-Version: 1.0 In-Reply-To: <20200428152842.GG4525@google.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Matthias, On 4/28/20 18:28, Matthias Kaehlcke wrote: > Hi Georgi, > > On Tue, Apr 28, 2020 at 12:16:50PM +0300, Georgi Djakov wrote: >> There is a repeated pattern in multiple drivers where they want to switch >> the bandwidth between zero and some other value. This is happening often >> in the suspend/resume callbacks. Let's add helper functions to enable and >> disable the path, so that callers don't have to take care of remembering >> the bandwidth values and handle this in the framework instead. >> >> With this patch the users can call icc_disable() and icc_enable() to lower >> their bandwidth request to zero and then restore it back to it's previous >> value. >> >> Suggested-by: Evan Green >> Suggested-by: Bjorn Andersson >> Signed-off-by: Georgi Djakov [..] >> + >> + return icc_set_bw(path, path->reqs[0].avg_bw, >> + path->reqs[0].peak_bw); >> +} > > The two functions are identical except for the assignment of the 'enabled' > flags. You could add a helper _icc_enable(struct icc_path *path, bool enable) > and call it from icc_enable/disable(). > Yes, indeed! Will send a v2. Thank you! BR, Georgi