From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 392602E92DD for ; Wed, 23 Jul 2025 15:06:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753283181; cv=none; b=NHhKWEmpLt5RE4CV+cgo9pjUKlXfPYX6dNcoM/rJVZDIPOTgGddUAow8wOz4YI9lZYTYt1AEzuK5Rr5u1xd+gGj4RYQLeyrqVb+EQzZbczh+nCp9r4sWvTNrYw+DjK1uN8zyQILUCtJ4XHZYMZ3D+JBBSWqx6nCvorl2AVvPmik= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753283181; c=relaxed/simple; bh=IrutvD/t3WsxBciy7jIL8z/hkUj+sQZtgmYA/RdlU5c=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Tvk451fnMH6IgRlclLyvx+DsOJu8iJMcXhyH6ZbUl6S2YjDE2dPm8+TZXfAhEei73o5fq1evvSi8iGWRmI0zJTsbT6ruhaSZd7iOcuSy44o2EgNqmg3Ewuv5rX7H25UQO99KoWsKeb4JqPHxehHYIXbwfcR4rm7IhqVp7u/dd7M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Z3wgCDBC; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Z3wgCDBC" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AA857C4CEE7; Wed, 23 Jul 2025 15:06:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1753283181; bh=IrutvD/t3WsxBciy7jIL8z/hkUj+sQZtgmYA/RdlU5c=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Z3wgCDBCx+QH20fGniZY7yKhzh+WsLJ2i7N+ulT/QlwjTrKMWjh/qSaO7jgPJwfFL 3bRtckHSH0EhRWqPPHpcgvzM6PzxWPyYYqZ4YE4jRN2q+lB1t5hMQ/7i4w98GHoNmq T+WIs30ulwrHAgH3XMw4mArQ/9bCUWN6Qh5BXv96YijsLvFTNhc/rxe5H/Bfo1TqHx zuD8wIRzfrY7OHbU5cMXZe+RYWidqRAlDxiLDQLStrjoNiJ3R5bKpcQEAIDiNj6Oji BYaWC4asTpEsvhui6qxTHzSzwY0e6fReCu5moVnhI9j+LPNbP/7rjPHdu6NZp/4jIR 2Iu7Gjfv1CkPQ== Date: Wed, 23 Jul 2025 11:06:17 -0400 From: Sasha Levin To: srinivas pandruvada Cc: Harshit Mogalapalli , stable@vger.kernel.org, Zhang Rui , "Rafael J . Wysocki" Subject: Re: [PATCH 5.15.y] powercap: intel_rapl: Do not change CLAMPING bit if ENABLE bit cannot be changed Message-ID: References: <2025070818-buddhism-wikipedia-516a@gregkh> <20250721001504.767161-1-sashal@kernel.org> <2b62ff30e0c3a256ec18d074623967e3b317e1e3.camel@linux.intel.com> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <2b62ff30e0c3a256ec18d074623967e3b317e1e3.camel@linux.intel.com> On Wed, Jul 23, 2025 at 06:48:08AM -0700, srinivas pandruvada wrote: >On Wed, 2025-07-23 at 12:11 +0530, Harshit Mogalapalli wrote: >> > + /* Check if the ENABLE bit was actually changed */ >> > + ret = rapl_read_data_raw(rd, PL1_ENABLE, true, &val); >> > + if (ret) { >> > + cpus_read_unlock(); >> > + return ret; >> > + } >> >> Shouldn't this be rapl_read_data_raw(rd, PL1_ENABLE, false, &val); ? >> >> >Correct. This will result in additional call to rapl_unit_xlate(), but >since for primitive PL1_ENABLE, the unit is ARBITRARY_UNIT, this will >not translate and return the same value. I was thinking we need to call rapl_unit_xlate() so we won't just get whatever the raw value is, but yes - since it's ARBITRARY_UNIT then it won't really do much. I guess in this case it doesn't really matter if we pass true or false here? -- Thanks, Sasha