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 0B4EF6FA1 for ; Mon, 3 Apr 2023 14:50:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 860BCC433D2; Mon, 3 Apr 2023 14:50:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1680533435; bh=K93TzVUGAbICEv8kzntBpyla6FXHDXRk6cf3zxbtReY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mX6hkagah542xA+01uY4UTSWaxI+mHuvEbw5A+nFOiuTAwREXWx8T8kV93jWpTYfR 3cYGpWk0pqR2sOky7PC5PnWn10ajt3CDukNobqTrt12byA7brGICOqRJQVHM2g12U5 T2zOMMU7u7W8wv5uik1oL4Ej+rc0AyYdVvEFIveg= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Srinivas Pandruvada , "Rafael J. Wysocki" Subject: [PATCH 6.2 153/187] thermal: intel: int340x: processor_thermal: Fix additional deadlock Date: Mon, 3 Apr 2023 16:09:58 +0200 Message-Id: <20230403140421.096958325@linuxfoundation.org> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230403140416.015323160@linuxfoundation.org> References: <20230403140416.015323160@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Srinivas Pandruvada commit a57cc2dbb3738930d9cb361b9b473f90c8ede0b8 upstream. Commit 52f04f10b900 ("thermal: intel: int340x: processor_thermal: Fix deadlock") addressed deadlock issue during user space trip update. But it missed a case when thermal zone device is disabled when user writes 0. Call to thermal_zone_device_disable() also causes deadlock as it also tries to lock tz->lock, which is already claimed by trip_point_temp_store() in the thermal core code. Remove call to thermal_zone_device_disable() in the function sys_set_trip_temp(), which is called from trip_point_temp_store(). Fixes: 52f04f10b900 ("thermal: intel: int340x: processor_thermal: Fix deadlock") Signed-off-by: Srinivas Pandruvada Cc: 6.2+ # 6.2+ Signed-off-by: Rafael J. Wysocki Signed-off-by: Greg Kroah-Hartman --- drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci.c | 1 - 1 file changed, 1 deletion(-) --- a/drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci.c +++ b/drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci.c @@ -181,7 +181,6 @@ static int sys_set_trip_temp(struct ther cancel_delayed_work_sync(&pci_info->work); proc_thermal_mmio_write(pci_info, PROC_THERMAL_MMIO_INT_ENABLE_0, 0); proc_thermal_mmio_write(pci_info, PROC_THERMAL_MMIO_THRES_0, 0); - thermal_zone_device_disable(tzd); pci_info->stored_thres = 0; return 0; }