Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp675842lqo; Fri, 10 May 2024 11:06:34 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUquD2I6jWBnngeQ8LGcW+Kmx9Ntwsp2Aua4eM+occZa+9NXx/KCbt88UPBQMDVfrUESFtkkcrKSE1/knqT2Cq6P4IkvhuxSQnzWSsEZw== X-Google-Smtp-Source: AGHT+IGLxhRbiVmbua/hsN7QCnmgpZBM7f8W+J7N0usPbPblZ4Tjm0nB7ou8eZ15WpjYL4Xr6RWe X-Received: by 2002:a05:620a:e88:b0:790:c7f6:595f with SMTP id af79cd13be357-792c7574885mr326840485a.12.1715364394503; Fri, 10 May 2024 11:06:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715364394; cv=pass; d=google.com; s=arc-20160816; b=F6Tcoy8DvgYxSoQc5qMokcEk3DOBR35VmiOB0l4RkaryMCrr5+a/s+db2tM0CR2Ck0 9YmW1LrXofadqK++FsC2WL9FeErhh+8XU2FKwoYbyRklrY9yxDGOEM8/tBcP4s0FhVZB XuiTt2TQwpCvNWWS3YoaOZJfMNrYS4wQNJ15UDNIJ1boANXIDG60/XkYGVPOoxeVoKlK cXJWwVdfcQ3LKvViqFEeH2qJjIEmW5qckSU6W+l6wY1Adb1R+w7w88sIzQ6V/CpeU+LD NHORpcVEwxqEAfFBcyTcPPw2kf5p5ySqATmQOSvFCUN2IkToLj9WF6Adyh/HTYqYR+8h 8Zwg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=QM9gUzhggChrI9aIhnUmpVycNc0gbUYrBlwN5YA7WQ4=; fh=7mS+Gm2I9QnUKSShRVlLflSLpAQjEzisSiwLXn1ISbU=; b=xQW+OKKc4mZQIyyf7GXEKXXV+OphSXh30OgEq4e93lo+h8xs+dQ0rFwE7xiFUqddRe rwoyfLCTzMaP2JE65Kg/Mxn6EKORTQQcOc6PFbJlOTDQwaSv2YxQ+rGV6Y14iOqLYokS lqJCW55RrLqoKMvImxswlxayCO/ELFQrmcmw6P2pSDDxpoOuHDHCCNLIb57z8tWT70+N LP6teV6qzXt2YSDVmqAr2TiPFM/e4bstIjYlYN0LCMnpg4f/V8i7TyJMj0aTMmMIfu35 H/eXZ9Heh+jP5996tGYKdToI9QBi3r9Fz/HNmi6n6YRxfG/9N6zd4j9asOcrlUxF949m OKBg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=r1SkcAHV; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-176083-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-176083-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id af79cd13be357-792bf30b244si400109285a.352.2024.05.10.11.06.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 May 2024 11:06:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-176083-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=r1SkcAHV; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-176083-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-176083-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 2C3B51C20C8D for ; Fri, 10 May 2024 18:06:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1421E2744A; Fri, 10 May 2024 18:06:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="r1SkcAHV" 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 1508818EA2; Fri, 10 May 2024 18:06:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715364385; cv=none; b=Fot+cqh6gu5jIpn/oXDNpYiOVZ+CyB0hLQfhJdnzCUTlDxGbwhxgDSqCXwOXifzPF23yLIQyCAKI7iNfBR6DoMqhh0FW9fayM8BYdbrUJuC9wfmZvt2mkG3i5rniHmeoGSXlMZu7f1FtGrGYKtrlEcOcHiNU1gcd27ziK1NOkQk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715364385; c=relaxed/simple; bh=pDK2he9KeGXWjli/boof22TeDiv4PEIudBXfbVKGCKc=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=UvwTVnA7RfEpZYBuhHSpdwhy+PmSqWtUekxNekG86bVMW4tJHv8nYlv8zWMPBXY5wRuB4OP/joK2I7xS0a8OvxikZCURhQjvixdv6jxg05LELDAoLsvvmJZiW4E5aE+1jtUk0yNmqZh5CGKpjHy83QUW9yrYeq0tW2dXifR4mKo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=r1SkcAHV; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 89660C4AF07; Fri, 10 May 2024 18:06:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715364383; bh=pDK2he9KeGXWjli/boof22TeDiv4PEIudBXfbVKGCKc=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=r1SkcAHVOyhXBlsJnPfLQVRV4wcLncznZyHpwii6VcrmiyYqi53wDNSCHqtDUaICL Xj+hY7Ow9tBmAA4g/Ov88Ur1nWV5oKdcm/c0htpZQAjnMpP/M/DCtCFe3ZCBnmlWd0 gRmEyHNybV+mp/1B/GbDlOtoKF1sF38e8/ZyMZq2CBTBG9/bIgthIIC8L9XRbLKgVZ ayqUHAs+giQnsTOrtWrFwIew9GUSemM1PNijzTifV1+de20vBduQQlMSbsU5ZAqJGi BCxh6P2KB+keB5MUoEOiv7DO6h8mAihNysH9HDOKrae2eTTdBM49CJ14lVXfaldhRB awOP7u5SYpVOw== Received: by mail-oo1-f50.google.com with SMTP id 006d021491bc7-5b2770fc936so451379eaf.2; Fri, 10 May 2024 11:06:23 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCXydFufcqLdCSyeHKPx+8nVrgHHGsvJqelLwqAMiuj3L1jge89I46Iykr7OJLJnm9NaEi6PntpNDw7CTcQKYqyMHNXHb61O9qewMLqTOGek1c7KmjvJavu6jrhbBNKarwY62MQpjnTW4Q== X-Gm-Message-State: AOJu0Yyn3tIm7d8cFjblBofZcvq6w6jfoVoZdPMsJMq41RobXUXs3p0M uZ676DmnRVAIiUCTkrYWqPQDsJDaOvV+IZQCL2VOKKdJdbk/HMMLTgDtTJANRMKZ91NBvsRD/if jRX8hceU7WmFllaJsZNzTlxwAm9A= X-Received: by 2002:a05:6820:2602:b0:5b2:8017:fb68 with SMTP id 006d021491bc7-5b2815cd95fmr3384445eaf.0.1715364382864; Fri, 10 May 2024 11:06:22 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <5787281.DvuYhMxLoT@kreacher> <4926735.31r3eYUQgx@kreacher> <568291fc-fd79-4f08-9eb7-aed7f5a32345@gmx.de> <0cdf0af6-851b-4781-83fe-99320c35544f@amd.com> In-Reply-To: From: "Rafael J. Wysocki" Date: Fri, 10 May 2024 20:06:11 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v1 1/2] ACPI: EC: Install address space handler at the namespace root To: Andy Shevchenko Cc: Mario Limonciello , Armin Wolf , "Rafael J. Wysocki" , "Rafael J. Wysocki" , Linux ACPI , LKML , Hans de Goede , Heikki Krogerus Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, May 10, 2024 at 7:50=E2=80=AFPM Andy Shevchenko wrote: > > On Fri, May 10, 2024 at 12:40:05PM -0500, Mario Limonciello wrote: > > On 5/10/2024 12:29, Andy Shevchenko wrote: > > > On Fri, May 10, 2024 at 06:52:41PM +0200, Armin Wolf wrote: > > > > Am 10.05.24 um 18:41 schrieb Rafael J. Wysocki: > > > > > On Fri, May 10, 2024 at 6:10=E2=80=AFPM Armin Wolf wrote: > > > > > > 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] (000000007b8176e= e) [EmbeddedControl] (20230628/evregion-130) > > > > > > > > > > > > > > This happens because the EC driver only registers the EC addr= ess space > > > > > > > handler for operation regions defined in the EC device scope = of the > > > > > > > ACPI namespace while the operation region being accessed by t= he _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 t= he EC > > > > > > > device scope are used (for example, see Section 9.17.15 in AC= PI 6.5), > > > > > > > so the current behavior of the EC driver is arguably question= able. > > > > > > 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 situati= on? > > > > > I'm wondering if this is a theoretical question or do you have an= y > > > > > existing or planned systems in mind? > > > > > > > > > > ec_read(), ec_write() and ec_transaction() use only the first EC = that > > > > > has been found anyway. > > > > > > > > Its a theoretical question, i do not know of any systems which have= more than > > > > one ACPI EC device. > > > > > > The specification is clear about this case in the "ACPI Embedded Cont= roller > > > Interface Specification": > > > > > > "The ACPI standard supports multiple embedded controllers in a syst= em, > > > each with its own resources. Each embedded controller has a flat > > > byte-addressable I/O space, currently defined as 256 bytes." > > > > > > However, I haven't checked deeper, so it might be a leftover in the d= ocumentation. > > > > > > The OperationRegion() has no reference to the EC (or in general, devi= ce) which > > > we need to speak to. The only possibility to declare OpRegion() for t= he second+ > > > EC is to use vendor specific RegionSpace, AFAIU. So, even if ACPI spe= cification > > > supports 2+ ECs, it doesn't support OpRegion():s for them under the s= ame > > > RegionSpace. > > > > > > That said, the commit message might be extended to summarize this, bu= t at > > > the same time I see no way how this series can break anything even in= 2+ ECs > > > environments. > > > > It's deviating from the patch, but in practice /why/ would you even wan= t to > > have a design with two ECs? In general that is going to mean a much mo= re > > complex state machine with synchronizing the interaction between both o= f > > them and the host. > > > > Understanding the benefit of such a design might make it easier to > > hypothesize impacts. > > First that comes to my mind (but hypothetical), is the separate CPU/EC ad= d-on > cards. If the main firmware somehow supports all of these add-on platform= s, > it might need to handle 2+ ECs. > > Again, it might be ACPI specification issue. For instance, the cited piec= e > doesn't tell about 16-bit EC accesses. IMV this is a matter of what is testable. We can only seriously say that we support 1 EC in the system, because that's what we can test. Now, the specification allows (theoretically) multiple ECs to be supported which does not mean that it will ever be done in practice and it also does not mean that this is a good idea.