Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp606797lqo; Fri, 10 May 2024 09:11:07 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXxld6uFIvSxvP4OivjTOjo2kdFxEFdrvBPPk9V9Sup90ZUOGwqFtYr4aUPHqxxepTaBgaWqNhxP3iMqgZthcwsiN5iWHYca4M1We5FYQ== X-Google-Smtp-Source: AGHT+IEARO7dA/cFvqE88uJrKuI6KLo+WLLLWzvKCAU+L2vTDCjYdZfTOjtK3l3IKYibL1XDZ7U4 X-Received: by 2002:a50:d583:0:b0:56c:5a12:ac53 with SMTP id 4fb4d7f45d1cf-5734d5e5066mr2068655a12.24.1715357467482; Fri, 10 May 2024 09:11:07 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715357467; cv=pass; d=google.com; s=arc-20160816; b=SEUO04QTt7znuhiQxXryy8/lqck9NoM4tFV05kAxtk14l5qf/FZ2Rv584gpmYVxz87 RCkZFrO+R0z0/rIzEvo+jZFsP1qxdLm1zIoKHoLzNrjX1UvWDmlheut6B6A5DYYRIe2z JBNeHH59npJRaYwymnb0ubeAH6V9fIunaYx0Zmg7QT/EX0cxeTpqdTjVqPfa5Qu+HO4w en/W3vgQbm2Dk7v0PfTomVqyc9txqO8bkVccOJmVkU8gtot9aDtZkGoZFXL1iiPSfRX5 dEEfX+gTeeBiHdpzEJgDjRgRkTuPuEHSCaBldtxsKn/hNCIMFOyZ+pL6TNBeeVvQ11j7 0xZQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=ui-outboundreport:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=xr1Ot3xxQfSAEra0ddoF6dHCjwQwKZTlryFWw7m/NIw=; fh=4/R9qJV5IUDPrYHQjJNxUYuhfn/JOSreriMLnc8jpoo=; b=ORCeyQEbiruxqoKVbYEtND8FK4irkzyhAdWQoMLVuWnoip/bOdfpCYV6rlOvaMlXDM YxWOLja/YUo755DuyFNkLDih8lM1GDebOb8opa5q7FtLGmaw5/aBY3+Cogu52jNSMSjH AS+HK1qlGfM7MtZ6ts3D4Nh3IENf6GXyKlOE6klf+RExpujo9T7GHAS0CMhm/m5SDhuM wIu6a8tmXUwpY/n9RzMI0X0BjnRqEe/h4Q788Tw9zXPh/0k5NL/B1JkwcwTSGVf23nbZ 3eF1iNMqpDQKjnTJFPoaHxyD7YSAXs43MZUa4vZJbdysggzzFKpiMDG1SLmR2hzpYEgv d7mQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmx.de header.s=s31663417 header.b="e5I/E8M9"; arc=pass (i=1 spf=pass spfdomain=gmx.de dkim=pass dkdomain=gmx.de dmarc=pass fromdomain=gmx.de); spf=pass (google.com: domain of linux-kernel+bounces-175997-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-175997-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=gmx.de Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-5733c3793b6si2162651a12.682.2024.05.10.09.11.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 May 2024 09:11:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-175997-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@gmx.de header.s=s31663417 header.b="e5I/E8M9"; arc=pass (i=1 spf=pass spfdomain=gmx.de dkim=pass dkdomain=gmx.de dmarc=pass fromdomain=gmx.de); spf=pass (google.com: domain of linux-kernel+bounces-175997-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-175997-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=gmx.de 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 068311F238DF for ; Fri, 10 May 2024 16:11:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0FFB4172799; Fri, 10 May 2024 16:10:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmx.de header.i=w_armin@gmx.de header.b="e5I/E8M9" Received: from mout.gmx.net (mout.gmx.net [212.227.17.22]) (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 74A93171E6A; Fri, 10 May 2024 16:10:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.227.17.22 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715357458; cv=none; b=Tw4LvjV9d1za4J3EXSt0EWk99HD9AI35NNYm54FrXXvi6WVcZK/BzF/kafq8W2BMZZpqWvYUTLRqmzRQmJ+Jd0xK2dO3xk/zdrYcvHVGlRtcN4Ofhyvp0Fbtu+ovU16vtdbrGA2ZnZk+RARse2UjZbr9lkp+Ed2SLQnuL/yQLsM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715357458; c=relaxed/simple; bh=vIb63Tg9ODhQyImpTi/p/It9EzWF4hC3W4ffMtiZYOc=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Uf5MbdukQH7Y7TDASAC37knLe72gkzlbWUTWWM5BOXr5VS6xZE/p32fnQDgaWn6JOX8g4Pni2rGvzI465zkM+MvPyBoWKS087leFZjTQoYe3V5YQ7p8dBw/uDk8U0ny9FdGEJeq8Xjwtl9/ANPP3GjvIYAc9ZPwp08WpI/x8HFw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.de; spf=pass smtp.mailfrom=gmx.de; dkim=pass (2048-bit key) header.d=gmx.de header.i=w_armin@gmx.de header.b=e5I/E8M9; arc=none smtp.client-ip=212.227.17.22 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1715357443; x=1715962243; i=w_armin@gmx.de; bh=xr1Ot3xxQfSAEra0ddoF6dHCjwQwKZTlryFWw7m/NIw=; h=X-UI-Sender-Class:Message-ID:Date:MIME-Version:Subject:To:Cc: References:From:In-Reply-To:Content-Type: Content-Transfer-Encoding:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=e5I/E8M97ujDrGuoRzcE1uYI1tMBXWaxpZW/QF7sf9dmS/1XyuWYFptOq+RzcyeA qZ6/+NU8OPM4d+SNBOJsYXRVxZORMmF3kxAahLTqtQrgplk1M87e7YagkjIlpCwTa RtjGu2secTOdpZZ6S1ymkY3noPAOmrzVDP0yNsKEedjFOdaaA6gA+n8wg71xd8VX9 YC67GaMDd12vIQo0XEMyH7qLNxiMhz+q1Ag95ueYahXI0V6QVvmZRt8jaoYscaFap vZvaHRhE1/EYvEYLaByvhtoMNoAMBk+/c3Y5N2o6wQE4iQLFvEw/4RBKEOD7Ly++t 0ggnz005491jJeY0/w== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from [141.30.226.129] ([141.30.226.129]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MD9T7-1rwyO21lYn-0094wz; Fri, 10 May 2024 18:10:43 +0200 Message-ID: Date: Fri, 10 May 2024 18:10:42 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v1 1/2] ACPI: EC: Install address space handler at the namespace root To: "Rafael J. Wysocki" , Linux ACPI Cc: LKML , Andy Shevchenko , Hans de Goede , Mario Limonciello , Heikki Krogerus References: <5787281.DvuYhMxLoT@kreacher> <4926735.31r3eYUQgx@kreacher> Content-Language: en-US From: Armin Wolf In-Reply-To: <4926735.31r3eYUQgx@kreacher> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:wT+tLSg2LVm+YP/FL5UN8kpyCaKCGFIvyGUPP/xh/wPnOaDV56r yYx/2FRPk8cGNlfVqBgjCf0IqqambicmHIL3lWGOQ5G3gCMKj6stPvWIzeEb9caTmxixewX m5weDTBex+msUw8JO9vU7W1pSq8SrJwArJSWnhedn3iJqQ///NUduLr68spl6hZF0gOaHIh YSK+t6W0r6y0xMdM9VsZw== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:B1Q9O29DO6k=;5JAa00wiMzS+9jZ5sBBfJXlIKvS ippXqs6y/q0bvs2T9xaBYAlJAayYnQUTHOxf4D/mOoSbtZAttUsXoyb0orxwYosAgL7QQ4cPR q3Ag/WlGGeNH/vsYQ9gTB/XRIvQ7m2WEr59Wa06UrLR2JN8vvn9Wm50oQgW96ViV1L/rL7rtq xFqZyi9evjXCkVRmn7inaS3W8/J7TseuOp606rnjJxf3ECWH3Q9McW4na3q6/a6Gtv9x3ovWG omSNmbe+gjyPxuLOo4iRpaMJN6JbawpCXGeE1xQ+ISJJibbZxvVM0ztfPLzXgOJyR/dUkCRYQ 06d7/QqSS1H37NIeUH9LMkWo4WCMFCLT0vMdGdFwTqa/MUTj7uHIkZIua/1NNSf2o00UoAml8 e5oUSBVNmSuWjWWL+vUMOgF6TDd4erprYxMqd0fIZEn+dYTUyYPx+j0WruUwvZYlueWJrco8h QsBVSex3BchnTMurJbpBNokazNs71bRhpCXKArW7TppKsvB1Q8yrcHjsBtC+M727w04Esuwml yL8ZsANJZuA1vLMRybJ/pDYdUFduehFwDogFP2joaDUii+B+i3VSXR280xUOhVNvgvfcv8tCH Tm0V7TIo5ZG+tT+TSmn7hAJqjHXSiJNOJJW7aWi2ba4z4xNbmfS89ZZHR3nDbuT+glBmqkx7z uv5UEK7sswUo7ugVDP1oYit7jWZm+xRCbjn3c9gcyi07MIfU6frDbr8lP9EOABF8Vn3+IuPDl olBBlEGD63e1H6JApPH+xs7tVE+YCJ+87vluubpDae11bNaqhlpt9j71wABOF7mkbdGAZqLvz YAkoUv+fdn8evLRs6bHAQ2Gl6r94JcOjjJnRpWKhiag3o= Am 10.05.24 um 16:03 schrieb Rafael J. Wysocki: > From: Rafael J. Wysocki > > It is reported that _DSM evaluation fails in ucsi_acpi_dsm() on Lenovo > IdeaPad Pro 5 due to a missing address space handler for the EC address > space: > > ACPI Error: No handler for Region [ECSI] (000000007b8176ee) [EmbeddedC= ontrol] (20230628/evregion-130) > > This happens because the EC driver only registers the EC address space > handler for operation regions defined in the EC device scope of the > ACPI namespace while the operation region being accessed by the _DSM > in question is located beyond that scope. > > To address this, modify the ACPI EC driver to install the EC address > space handler at the root of the ACPI namespace. > > Note that this change is consistent with some examples in the ACPI > specification in which EC operation regions located outside the EC > device scope are used (for example, see Section 9.17.15 in ACPI 6.5), > so the current behavior of the EC driver is arguably questionable. Hi, the patch itself looks good to me, but i wonder what happens if multiple ACPI EC devices are present. How would we handle such a situation? Thanks, Armin Wolf > Reported-by: webcaptcha > Link: https://bugzilla.kernel.org/show_bug.cgi?id=3D218789 > Link: https://uefi.org/specs/ACPI/6.5/09_ACPI_Defined_Devices_and_Device= _Specific_Objects.html#example-asl-code > Link: https://lore.kernel.org/linux-acpi/Zi+0whTvDbAdveHq@kuha.fi.intel.= com > Suggested-by: Heikki Krogerus > Signed-off-by: Rafael J. Wysocki > --- > drivers/acpi/ec.c | 10 +++++----- > drivers/acpi/internal.h | 1 - > 2 files changed, 5 insertions(+), 6 deletions(-) > > Index: linux-pm/drivers/acpi/ec.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- linux-pm.orig/drivers/acpi/ec.c > +++ linux-pm/drivers/acpi/ec.c > @@ -1488,7 +1488,7 @@ static int ec_install_handlers(struct ac > > if (!test_bit(EC_FLAGS_EC_HANDLER_INSTALLED, &ec->flags)) { > acpi_ec_enter_noirq(ec); > - status =3D acpi_install_address_space_handler_no_reg(ec->handle, > + status =3D acpi_install_address_space_handler_no_reg(ACPI_ROOT_OBJECT= , > ACPI_ADR_SPACE_EC, > &acpi_ec_space_handler, > NULL, ec); > @@ -1497,11 +1497,10 @@ static int ec_install_handlers(struct ac > return -ENODEV; > } > set_bit(EC_FLAGS_EC_HANDLER_INSTALLED, &ec->flags); > - ec->address_space_handler_holder =3D ec->handle; > } > > if (call_reg && !test_bit(EC_FLAGS_EC_REG_CALLED, &ec->flags)) { > - acpi_execute_reg_methods(ec->handle, ACPI_ADR_SPACE_EC); > + acpi_execute_reg_methods(ACPI_ROOT_OBJECT, ACPI_ADR_SPACE_EC); > set_bit(EC_FLAGS_EC_REG_CALLED, &ec->flags); > } > > @@ -1555,8 +1554,9 @@ static void ec_remove_handlers(struct ac > { > if (test_bit(EC_FLAGS_EC_HANDLER_INSTALLED, &ec->flags)) { > if (ACPI_FAILURE(acpi_remove_address_space_handler( > - ec->address_space_handler_holder, > - ACPI_ADR_SPACE_EC, &acpi_ec_space_handler))) > + ACPI_ROOT_OBJECT, > + ACPI_ADR_SPACE_EC, > + &acpi_ec_space_handler))) > pr_err("failed to remove space handler\n"); > clear_bit(EC_FLAGS_EC_HANDLER_INSTALLED, &ec->flags); > } > Index: linux-pm/drivers/acpi/internal.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- linux-pm.orig/drivers/acpi/internal.h > +++ linux-pm/drivers/acpi/internal.h > @@ -186,7 +186,6 @@ enum acpi_ec_event_state { > > struct acpi_ec { > acpi_handle handle; > - acpi_handle address_space_handler_holder; > int gpe; > int irq; > unsigned long command_addr; > > >