From patchwork Tue Jul 9 09:33:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gergo Koteles X-Patchwork-Id: 13727559 Received: from irl.hu (irl.hu [95.85.9.111]) (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 971A3136657; Tue, 9 Jul 2024 09:38:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.85.9.111 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720517911; cv=none; b=Mu6+yhQbpaf4oFRRVvOIVmj7K8qeKfOsWigea1rb5zaex1j/iBTNEO164BLhr9mNS6Hu6jN6TyF2ddqzTM2pwRycdjZYRjIMJsfqfoqLJOEEYIywot290dL8AgwcOj31vu1g3pgQ4/mMbfLkylq2J1+bHvVTV33mDKGao4BGV4E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720517911; c=relaxed/simple; bh=exor/0LgprF/HFpm8SM8Q3DobD+hK94JEtk1/Zyltio=; h=From:To:Cc:Subject:Date:Message-ID:Mime-Version:Content-Type; b=CEX6vxGyo94gJRCYMpUwov+nnM6xbYOIMn5rkzhpJA5760QPGH9Q9C9+6qNEJuLq6zjb+r+D2D84CHDjlZYkE2Tc0+EqxHNfXNp2hp2UX1g5Eq+bnjerYuckU4X+X1/WXTO3hbrE8tnFxDItxkTZ61TVd0hoEoyplWKg3JrNUVM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=irl.hu; spf=pass smtp.mailfrom=irl.hu; arc=none smtp.client-ip=95.85.9.111 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=irl.hu Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=irl.hu Received: from fedori.lan (51b693a1.dsl.pool.telekom.hu [::ffff:81.182.147.161]) (AUTH: CRAM-MD5 soyer@irl.hu, ) by irl.hu with ESMTPSA id 00000000000713A4.00000000668D03DF.0016EC72; Tue, 09 Jul 2024 11:33:18 +0200 From: Gergo Koteles To: Hans de Goede , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Ike Panhc Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, Gergo Koteles Subject: [PATCH 0/4] platform/x86: ideapad-laptop: synchronize VPC commands Date: Tue, 9 Jul 2024 11:33:04 +0200 Message-ID: X-Mailer: git-send-email 2.45.2 Precedence: bulk X-Mailing-List: platform-driver-x86@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 X-Mime-Autoconverted: from 8bit to 7bit by courier 1.0 Hi, Sometimes the Yoga mode control switch did not work properly on my laptop, and sometimes even caused a platform profile switch. It turned out that it was caused by a race situation, the lenovo-ymc wmi notify handler was running at the same time as the ideapad-laptop acpi notify handler, and the partial results of the VPC calls in the two were mixed up. This series introduces a mutex and reorganizes the code a bit to eliminate this. Best regards, Gergo Koteles Gergo Koteles (4): platform/x86: ideapad-laptop: use cleanup.h platform/x86: ideapad-laptop: add a mutex to synchronize VPC commands platform/x86: ideapad-laptop: move ymc_trigger_ec from lenovo-ymc platform/x86: ideapad-laptop: move ACPI helpers from header to source file drivers/platform/x86/Kconfig | 1 + drivers/platform/x86/ideapad-laptop.c | 284 +++++++++++++++++++++----- drivers/platform/x86/ideapad-laptop.h | 140 +------------ drivers/platform/x86/lenovo-ymc.c | 34 +-- 4 files changed, 235 insertions(+), 224 deletions(-)