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 2A9A7171A9 for ; Mon, 22 May 2023 19:41:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AEF51C433D2; Mon, 22 May 2023 19:41:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1684784472; bh=FA7dxqNtmn5rTL1SXkwSDJ3nhxD4XuKLZ2jRLt+oH7U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=phvwL+JvbHBgmSog2mc+375szVOyGOuRJAY5qrns1MBmhwxZBgp8J0MqorkfBBk1f qoeJbHLhwGeuy1MfXPonrYd4o/o6CrMgq9lLBsne/6ln75R1NRuYlWvRcDQXnxP87f pmzdim1ywN9yte8NNRVrRBBht6VAb4aVZsH0lFzg= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Armin Wolf , "Rafael J. Wysocki" , Sasha Levin Subject: [PATCH 6.3 067/364] ACPI: EC: Fix oops when removing custom query handlers Date: Mon, 22 May 2023 20:06:12 +0100 Message-Id: <20230522190414.459737638@linuxfoundation.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230522190412.801391872@linuxfoundation.org> References: <20230522190412.801391872@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: Armin Wolf [ Upstream commit e5b492c6bb900fcf9722e05f4a10924410e170c1 ] When removing custom query handlers, the handler might still be used inside the EC query workqueue, causing a kernel oops if the module holding the callback function was already unloaded. Fix this by flushing the EC query workqueue when removing custom query handlers. Tested on a Acer Travelmate 4002WLMi Signed-off-by: Armin Wolf Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin --- drivers/acpi/ec.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c index 105d2e795afad..9658e348dc17d 100644 --- a/drivers/acpi/ec.c +++ b/drivers/acpi/ec.c @@ -1122,6 +1122,7 @@ static void acpi_ec_remove_query_handlers(struct acpi_ec *ec, void acpi_ec_remove_query_handler(struct acpi_ec *ec, u8 query_bit) { acpi_ec_remove_query_handlers(ec, false, query_bit); + flush_workqueue(ec_query_wq); } EXPORT_SYMBOL_GPL(acpi_ec_remove_query_handler); -- 2.39.2