Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp694192lqp; Thu, 21 Mar 2024 12:35:29 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXeOQG7LiHSPEk/yRnIRwvsccahmiQY4ZVrHfdp+I9RzbkQUhl46xvdFRS63AsHW/MBTBeifkISgVQx84q4U8ROteapoISYKkgzaCAJRQ== X-Google-Smtp-Source: AGHT+IGw5Kq1CSLl7j0iPUp3g41zHdF8BZawTUyMJ/acAfXTjZS5r9A2d5D6cfh6QMifry2f6kyL X-Received: by 2002:a05:6214:1d29:b0:691:4f29:b5d5 with SMTP id f9-20020a0562141d2900b006914f29b5d5mr62863qvd.60.1711049729115; Thu, 21 Mar 2024 12:35:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711049729; cv=pass; d=google.com; s=arc-20160816; b=vOStfEz0tURC17tio4L53C/2gqrlI1fEYcSwh1OOTlEDRY22d1nLXGU8VswEKVyYjN cZVznpTrHHYjfo/WgBVkd0Te8ZWUF+W4K/DaJhjsuPDRsG2UrHiLJYEQYYF9i8qNPajf Z/CqPxolBkdDX6HYpCZPUhGdj1whEugdHEi4lCwoeekZCkzP9ek8KsWyDWuUxiNogEtA dsPDMXaaYnfFwEZmjKDXtezvAjeWdzUIhalaho6g24ZHedOKGncA7aUhI0ywsjB9N2Zn jo0VNrC6NEqVFwY/kIHuKnPGBsGROXahtAc0HsgGURe+IhC+dXfWxTDhQFGKaSfitAG+ 5S/w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=J9Pco6S4Kv7kmiixemlO3iESC3c53XN4Od3m/eIrRUU=; fh=ioMWnWtowhk3HBvhCOjNmK8xJXWkeaWr8of6U42MhKE=; b=YE3uSGWlO8tMSdHWzEoCu99GuJIlv+QWhiH8Y/dlEbqSMhen8qn3J1pm00Qtf+j779 21yQdUpXX7Skj6Op2TYeL4Aii4p37fJufcxGro0qCgFM9PmzvIjA9I8pUwQdb1Y08QE7 8X/25ZRwyh7mxc1xxIIGsIB+cM9GPqYCWBcB/r8ce1pdh/zIeJM1eITHbmjnnBoiyWz4 75ebIYxDqdsWVkbtrZx3EWGck0R7ZAKO6UzgxDlFIs/oMFRzOAmQQSSt4mOPbQeFfCEx 4KIRdlIyp5pm1se5NNTCiaZ5dDKln6i1EYR1Ljg/WidWtYW51LxwADCVd1KnZ2lb22Uo FmSw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=fail header.i=@rjwysocki.net header.s=dkim header.b=yOHiMWbG; arc=pass (i=1 spf=pass spfdomain=rjwysocki.net); spf=pass (google.com: domain of linux-kernel+bounces-110598-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-110598-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id dv12-20020ad44eec000000b0068f5a8dd904si447072qvb.326.2024.03.21.12.35.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Mar 2024 12:35:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-110598-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=fail header.i=@rjwysocki.net header.s=dkim header.b=yOHiMWbG; arc=pass (i=1 spf=pass spfdomain=rjwysocki.net); spf=pass (google.com: domain of linux-kernel+bounces-110598-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-110598-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id C73FA1C21FD6 for ; Thu, 21 Mar 2024 19:35:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 731EA135A5C; Thu, 21 Mar 2024 19:34:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=rjwysocki.net header.i=@rjwysocki.net header.b="yOHiMWbG" Received: from cloudserver094114.home.pl (cloudserver094114.home.pl [79.96.170.134]) (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 4B167134CF8; Thu, 21 Mar 2024 19:34:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=79.96.170.134 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711049668; cv=none; b=EMl5ZzFV0ge2tumEu1L93QF0DUcJRSCB8jqqxJakQ6hNx9Yc5Jacnr5SjQthe8VabP0idBPms4vaARLCzdoIQo1uKQ2CQWbhHSUkz/3dFcZEv9r85nCoOFRFC9FJZCRABLiUX/0CEqjlihPaIugwJlqKNRv3kKz7NxvpiVHA8mk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711049668; c=relaxed/simple; bh=dajy9VeGkzIBNNyZuqE7nHLnEax7VwLxo6Ui7Z7eK+4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=gSC2PjfYwvGDW39uWx4bKrn+6DqOQ/b+hAyMu0OdCISX407BT+KaVTjB1zzap39d2bvUtNmL0AmxloxbuaserR0hCJWXcrNVMV8Q45C8q4JCEk4GURmA5cHk8sZbdPkRDgKEeEdTBW969ICeIch+Acs9mYh7+6PXjPokWf0c4pg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rjwysocki.net; spf=pass smtp.mailfrom=rjwysocki.net; dkim=fail (2048-bit key) header.d=rjwysocki.net header.i=@rjwysocki.net header.b=yOHiMWbG reason="signature verification failed"; arc=none smtp.client-ip=79.96.170.134 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rjwysocki.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rjwysocki.net Received: from localhost (127.0.0.1) (HELO v370.home.net.pl) by /usr/run/smtp (/usr/run/postfix/private/idea_relay_lmtp) via UNIX with SMTP (IdeaSmtpServer 5.4.0) id 41bccc16fb59eeda; Thu, 21 Mar 2024 20:34:17 +0100 Received: from kreacher.localnet (unknown [195.136.19.94]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by cloudserver094114.home.pl (Postfix) with ESMTPSA id 502CD66B8D7; Thu, 21 Mar 2024 20:34:17 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rjwysocki.net; s=dkim; t=1711049657; bh=dajy9VeGkzIBNNyZuqE7nHLnEax7VwLxo6Ui7Z7eK+4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=yOHiMWbGEeOTcyRRar3EgXhJGZekiFI9WlePT0N7/1twJWhiwfoMTDA98XBzF6LJv nxhgy2toePTdywnux0iyTCwzo8DNw1AnmSSbe4uuyBUzbS+9tveFrUsSd2RI0adUZ6 OBBwg4+JYmq6K2+oHTOaoT86Ku24nQugypASB6ShZN/RwmTOMFJeg/w3OJseNm6vGp D12W/UCNK3O/Ph7u5p5XX0tQC/ZfgWdmoFCIgBNEG7rrZ0paNdfmkTCzQbzr6h/5VN QrH3dVlPA5nhAmKk2N0vL/B5pO62SopkRT+ofavZvktUwwezxylzRs6aIecjxNQw6C AfnTk78t9mwmg== From: "Rafael J. Wysocki" To: Linux PM Cc: LKML , Srinivas Pandruvada Subject: [PATCH v1 1/5] cpufreq: intel_pstate: Drop redundant locking from intel_pstate_driver_cleanup() Date: Thu, 21 Mar 2024 20:29:43 +0100 Message-ID: <6035571.lOV4Wx5bFT@kreacher> In-Reply-To: <12409658.O9o76ZdvQC@kreacher> References: <12409658.O9o76ZdvQC@kreacher> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8" X-CLIENT-IP: 195.136.19.94 X-CLIENT-HOSTNAME: 195.136.19.94 X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvledrleejgdeihecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfjqffogffrnfdpggftiffpkfenuceurghilhhouhhtmecuudehtdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvvefufffkjghfggfgtgesthfuredttddtjeenucfhrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqeenucggtffrrghtthgvrhhnpedvffeuiedtgfdvtddugeeujedtffetteegfeekffdvfedttddtuefhgeefvdejhfenucfkphepudelhedrudefiedrudelrdelgeenucevlhhushhtvghrufhiiigvpedunecurfgrrhgrmhepihhnvghtpeduleehrddufeeirdduledrleegpdhhvghlohepkhhrvggrtghhvghrrdhlohgtrghlnhgvthdpmhgrihhlfhhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqpdhnsggprhgtphhtthhopeefpdhrtghpthhtoheplhhinhhugidqphhmsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepshhrihhnihhvrghsrdhprghnughruhhvrggurgeslhhinhhugidrihhnthgvlhdrtghomh X-DCC--Metrics: v370.home.net.pl 1024; Body=3 Fuz1=3 Fuz2=3 From: Rafael J. Wysocki Remove the spinlock locking from intel_pstate_driver_cleanup() as it is not necessary because no other code accessing all_cpu_data[] can run in parallel with that function. Had the locking been necessary, though, it would have been incorrect because the lock in question is acquired from a hardirq handler and it cannot be acquired from thread context without disabling interrupts. Signed-off-by: Rafael J. Wysocki --- drivers/cpufreq/intel_pstate.c | 2 -- 1 file changed, 2 deletions(-) Index: linux-pm/drivers/cpufreq/intel_pstate.c =================================================================== --- linux-pm.orig/drivers/cpufreq/intel_pstate.c +++ linux-pm/drivers/cpufreq/intel_pstate.c @@ -3135,10 +3135,8 @@ static void intel_pstate_driver_cleanup( if (intel_pstate_driver == &intel_pstate) intel_pstate_clear_update_util_hook(cpu); - spin_lock(&hwp_notify_lock); kfree(all_cpu_data[cpu]); WRITE_ONCE(all_cpu_data[cpu], NULL); - spin_unlock(&hwp_notify_lock); } } cpus_read_unlock();