Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4846321rdb; Tue, 12 Dec 2023 10:51:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IGd74uPYOWyXi56yAx/LR5ZBmdfs8mKm1FvNByhI8HW2aTK0cuAjOwznPbP1KtoQUngmzd7 X-Received: by 2002:a05:6a20:5525:b0:187:6dd3:946c with SMTP id ko37-20020a056a20552500b001876dd3946cmr3660558pzb.61.1702407060398; Tue, 12 Dec 2023 10:51:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702407060; cv=none; d=google.com; s=arc-20160816; b=0QCX9e1Jrpg+ocwqFixyYpnVKX521jHhrznlUo4lrHtk+Faw3RrJgwcfpIWbDNeHKw 3igghtRp3nzquXgXUW0WO2Vkwd88JJ97XDhl3789x/jeaOb7Sf3mgyl8Y8LMmEZzN+fb x91l1pYplBdsWhXJCXx6ZRUNGjcNv5y+6QeKBZV2b3eXeyECE/Ka8+DG5KezTudHqM7E QetfdDGb3U0pUfJinb8mx85hO+bdl11/wUpZJ55Fzl8cgN7yjXPqXtiBF973vx2z1fGc 8aN6vrvOQCxzw+S/KQr1NiRZutUa51jOfMCcss6ecq5pH5FVe4HQ8OgwFcayfgthCc2C Ko1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=jfXftoO7RwkW3MAtte6UnPQmYVm94Kjd/pq7UxgFIig=; fh=b6jz0bdxnlnt0RSJHliaH022TdeHcNL6OWCvUlnI6JM=; b=xBPuYImufeMY3qrorD8G6wZtqWr1/V72mKjCMkVYCxAK9oOv0mycVKJQcUkoi4wNgv y7HPKNuilQGFzE4Io9FO1UazTXCZVX5tcGnWrVMqmNPrbPCrD8sLU9w2/W7WrTIaJt/E pp/qI29wBQow5ycnroS0DKeP8Y0uGv8m/jDlDD9AY8EAH4DRJ2FdUvy+n5OOQv/un2/M upQdNnzHr4E963BmoLnQiQ7iKzqOjxoWVisjDhwiAZjd7t5vmiKPL5p80iLP4F61/geC 0l3QEiXasS3XilIIxlHgWy20dZsHiOb3MIjWWNZJ0/euzKN+VgqTzFcBtiVt9tu3TA95 Lw5A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id fb4-20020a056a002d8400b006ce64b59391si8052818pfb.110.2023.12.12.10.51.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 10:51:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 80E3E80740DC; Tue, 12 Dec 2023 10:50:49 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376702AbjLLSu2 (ORCPT + 99 others); Tue, 12 Dec 2023 13:50:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50884 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376685AbjLLSuP (ORCPT ); Tue, 12 Dec 2023 13:50:15 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5EF691A1; Tue, 12 Dec 2023 10:50:17 -0800 (PST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 1CC581FB; Tue, 12 Dec 2023 10:51:03 -0800 (PST) Received: from [192.168.178.6] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6CE553F762; Tue, 12 Dec 2023 10:50:14 -0800 (PST) Message-ID: <2236f098-b889-4d70-b863-11a3f246889c@arm.com> Date: Tue, 12 Dec 2023 19:50:13 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v5 11/23] PM: EM: Add API for updating the runtime modifiable EM Content-Language: en-US To: Lukasz Luba , linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, rafael@kernel.org Cc: rui.zhang@intel.com, amit.kucheria@verdurent.com, amit.kachhap@gmail.com, daniel.lezcano@linaro.org, viresh.kumar@linaro.org, len.brown@intel.com, pavel@ucw.cz, mhiramat@kernel.org, qyousef@layalina.io, wvw@google.com References: <20231129110853.94344-1-lukasz.luba@arm.com> <20231129110853.94344-12-lukasz.luba@arm.com> From: Dietmar Eggemann In-Reply-To: <20231129110853.94344-12-lukasz.luba@arm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Tue, 12 Dec 2023 10:50:49 -0800 (PST) On 29/11/2023 12:08, Lukasz Luba wrote: [...] > diff --git a/kernel/power/energy_model.c b/kernel/power/energy_model.c > index 489a358b9a00..614891fde8df 100644 > --- a/kernel/power/energy_model.c > +++ b/kernel/power/energy_model.c > @@ -221,6 +221,52 @@ static int em_allocate_perf_table(struct em_perf_domain *pd, > return 0; > } > > +/** > + * em_dev_update_perf_domain() - Update runtime EM table for a device > + * @dev : Device for which the EM is to be updated > + * @table : The new EM table that is going to used from now s/going to used/going to be used > + * > + * Update EM runtime modifiable table for the @dev using the privided @table. s/privided/provided > + * > + * This function uses mutex to serialize writers, so it must not be called > + * from non-sleeping context. > + * > + * Return 0 on success or a proper error in case of failure. > + */ > +int em_dev_update_perf_domain(struct device *dev, > + struct em_perf_table __rcu *new_table) > +{ > + struct em_perf_table __rcu *old_table; > + struct em_perf_domain *pd; > + > + /* > + * The lock serializes update and unregister code paths. When the > + * EM has been unregistered in the meantime, we should capture that > + * when entering this critical section. It also makes sure that What do you want to capture here? You want to block in this moment, right? Don't understand the 2. sentence here. [...]