From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=198.175.65.11 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796415254; b=WBbRyRm5iPBHb6Ljqxe9iAD8fVXMSiUm32nrjldx0eTlqYsOLTFnC5yOcpSJcOafijwE 7IUXfTgjujcJH28DW9L2iBapM+k6HLkqwWHmwivl+mHFDnZcCNBwJtVeyeSg1eqUU0mUw TwFsc+fPhz0EEZDEWuiD+wVjOaKHIAzUXZ+U6Xugkky5rbJv95fIa0hFdtnLQWgruszrB UNnYJDHHwH2gbpBIXHhscgp30FFiBxHu9wnyTKcA7eoZNIF+zHCggbIf0oVXzn/i6XRBp F0mHEwRrFMq+YAcaQg6DH90Yx+mdilYtJlFwRI+7CALoRCt74B5tZ8tOVn4YffoaC5g== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796415254; h=DMARC-Filter:DKIM-Signature:X-CSE-ConnectionGUID:X-CSE-MsgGUID: X-IronPort-AV:X-IronPort-AV:Received:X-CSE-ConnectionGUID: X-CSE-MsgGUID:X-ExtLoop1:X-IronPort-AV:Received:Date:From:To:Cc: Subject:Message-ID:References:MIME-Version:Content-Type: Content-Disposition:Content-Transfer-Encoding:In-Reply-To: Organization; bh=oLS+N0gVmnHXmGgpC1FLFELTNjblGmslWtiawG9bJgs=; b=4KhBiKU9Moiu58ZoAYpAKQv/EpvgoXUVwjFgMpu5q5WTlN7GyQ13iE9jWgg9M8Plqjdg cu+8Tsx45XqVOhs09cHwNhWslCXVRzgz4s6FcuPZ7xmysB2xd9krJ6NLSMor/JYfJxi+u kqpUycClNaza6OC3h3GpAevFK4104PmQEUEp+4ienKdljZbSqRJrKzGeuA8g4mGHpmKQm ynyBTCzxmRjWCqoZ3HyzJrSVR3GxoW0SxUJXr7/Q6AY0SEobl1KQxGjDBlkGZPTQ8M3mD 8avoJy0sJ0jokx2kTzyaGbguULVuFE/7yXbrsteLqQT3AGKatb6hiGx67KJJMsiC6SQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=GScwYSMu; arc=none smtp.remote-ip=198.175.65.11 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.11]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EE52F606A322; Fri, 4 Dec 2026 20:14:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org EE52F606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=GScwYSMu DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1796415253; x=1827951253; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=oLS+N0gVmnHXmGgpC1FLFELTNjblGmslWtiawG9bJgs=; b=GScwYSMuerwq1UVTdmqdXqk3zZr++wO2ngqpQWdII6DaNxxrHs240fig 5UBXolVolSWeBWH8E6ASnlTJ85N5y6EX8RlesUlQlttjSVje1TLS8HGEv GZPDxHV6nx+wUIAK/2IhyTQtXWtZqzTdYtH/sm+WrkBNsovpk0Awez4WY E6gSy6saWwu7xVAPYoYcckYZQke7yhmSa+8lIAqgnpJdCNOXoLtUC3f9O 9yT8osIx8X1HHm+w/6OIyMrdvcz3IJDfslph5ScUsWkxx8huLqK+HZdkb 36J75/EY0x2KMv5lJHcozp72iOHLwfW7XQIHGGzwSGEAwfI6Zed75+PjU g==; X-CSE-ConnectionGUID: fsPYeR8xShWy8gicUD074Q== X-CSE-MsgGUID: CHrc7TrtTfemPkr5AW/Qjw== X-IronPort-AV: E=McAfee;i="6800,10657,11986"; a="5307080" X-IronPort-AV: E=Sophos;i="6.29,79,1794902400"; d="scan'208";a="5307080" Received: from fmviesa003.fm.intel.com ([10.60.135.143]) by orvoesa103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Dec 2026 12:14:12 -0800 X-CSE-ConnectionGUID: uNYUllRARE6VxRWmDjSADA== X-CSE-MsgGUID: 8DPlWNA+QrOHzmwnUMF81g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.29,79,1794902400"; d="scan'208";a="14359523" Received: from alekseim-mobl.ger.corp.intel.com (HELO localhost) ([10.245.245.10]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Dec 2026 12:14:00 -0800 Date: Fri, 4 Dec 2026 22:13:57 +0200 From: Andy Shevchenko To: Aditya Garg Cc: Atharva Tiwari , Ihor Odainyi , Antoine Sidem , Bjorn Helgaas , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , "Rafael J. Wysocki" , Len Brown , Linus Walleij , Bartosz Golaszewski , Sven Peter , Janne Grunau , Neal Gompa , Guenter Roeck , Jonathan Cameron , David Lechner , Nuno =?utf-8?B?U++/vQ==?= , Andy Shevchenko , Lee Jones , Pavel Machek , Griffin Kroah-Hartman , Hans de Goede , Ilpo =?iso-8859-1?Q?J=E4rvinen?= , Sebastian Reichel , Alexandre Belloni , Wim Van Sebroeck , Jarkko Sakkinen , Mimi Zohar , Roberto Sassu , Dmitry Kasatkin , Eric Snowberg , Paul Moore , James Morris , "Serge E. Hallyn" , linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-acpi@vger.kernel.org, linux-gpio@vger.kernel.org, asahi@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-hwmon@vger.kernel.org, linux-iio@vger.kernel.org, linux-leds@vger.kernel.org, mfd@lists.linux.dev, platform-driver-x86@vger.kernel.org, linux-pm@vger.kernel.org, linux-rtc@vger.kernel.org, linux-watchdog@vger.kernel.org, linux-integrity@vger.kernel.org, keyrings@vger.kernel.org, linux-security-module@vger.kernel.org Subject: Re: [PATCH 11/14] acpi: disable battery and adapter for x86 apple machines Message-ID: References: X-Mailing-List: linux-gpio@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - c/o Alberga Business Park, 6 krs, Bertel Jungin Aukio 5, 02600 Espoo On Fri, Dec 04, 2026 at 10:02:46PM +0200, Andy Shevchenko wrote: > On Sat, Dec 05, 2026 at 12:21:14AM +0530, Aditya Garg wrote: > > > On 4 Dec 2026, at 10:45 PM, Andy Shevchenko wrote: > > > On Fri, Dec 04, 2026 at 08:26:48PM +0530, Aditya Garg wrote: > > >>> On 04-Dec-26 07:38 PM, Andy Shevchenko wrote: > > >>> On Fri, Dec 04, 2026 at 08:12:51AM -0500, Atharva Tiwari wrote: ... > > >>>> + if (IS_ENABLED(CONFIG_MACSMC_ACPI) && > > >>>> + IS_ENABLED(CONFIG_MACSMC_POWER) && x86_apple_machine) > > >>>> + return -ENODEV; > > >>> > > >>> This is a hack. And it's even indented wrongly. > > >> > > >> Do you have a better idea to avoid using duplicate devices? > > > > > > The commit message is poorly written to advice anything. > > > It's unclear why we have duplicate drivers for the same ACPI HID to begin with. > > > Can MAC case be enumerated differently? When the SMS driver is not compiled > > > this one is still in use, why is it not a problem? So, there are many unaswered > > > questions... > > > > On Macs you can get battery and adapter stats using both ACPI and SMC. The > > SMC reported values are more reliable so we developed a driver for that. But > > if we use that driver, Linux thinks there are 2 batteries, one from ACPI and > > other from SMC. So we need to disable it from ACPI. > > > > One way is to simply check is the device is a Mac and disable ACPI > > permanently. Other way is check if SMC is compiled or not. If not, fall back > > to ACPI so that we don't loose battery. > > Should we just disable ACPI0002 enumeration via a quirk in somewhere drivers/acpi/ ? > Like acpi_create_platform_device() blocks the devices in the forbidden_id_list. Since we have already acpi_quirk_skip_acpi_ac_and_battery() quirk, perhaps the proper place is to have it only in utils.c and apply in sbs.c via a call to acpi_quirk_skip_acpi_ac_and_battery(). Would that work? > > I understand the issue with commit messages. The author's native language > > isn't English so he is unable to communicate properly and thus is using AI to > > write the messages. I'll try and help him here. -- With Best Regards, Andy Shevchenko