Received: by 2002:ab2:6d45:0:b0:1fb:d597:ff75 with SMTP id d5csp176363lqr; Wed, 5 Jun 2024 02:38:40 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWvXiZuxqI3lbOPEOi8/VKQQXxOU2VJaMmcfOP1x2p8xuXFMYRIi9OPLMz+0wPBve977hVgfu7HFLR0zE8PRuo1p1m2lPnas2hVplgBgA== X-Google-Smtp-Source: AGHT+IHKOTXH4cXidVC03SXLEVgpxwaL+yl+IIZEQhcLKhvpiwFX1Rz5+F6hnuHOhYeHHlHUONxz X-Received: by 2002:a50:999e:0:b0:57a:33ff:ff1c with SMTP id 4fb4d7f45d1cf-57a8b6f79d1mr1630821a12.21.1717580320635; Wed, 05 Jun 2024 02:38:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717580320; cv=pass; d=google.com; s=arc-20160816; b=PomjuGhZWgjIs/yOvlqwqNocbSk98DEe0Dh078bXY7f9EOQGsPxNflpRMYR5WpoE2H vPkiOFJ1H1S+VX6SHF8cuJFbMP9bf4Uozob6sXijSZmkeaox32icPOf/t4XW/e6HbhA/ WVnnGx53ofX6AAV/x59E/943dFQ4u0NjTJjwWBgGvv/0JJsEyWWSJ3HZL5KiHiBjYvl2 +gFwk9adm87HD420QCdbU9G+uDD7UQy2hgeMtJaloicDVS/NLIlWdBgC9pBe18NIGDRc 6BZnrY+Q1mnRagc98jmmpDIRjeHgUiulGc0bRqj2l4RvZdhx3pzzx3ozv2Smgmxn3hhA uusw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=XJWsiS63yRgjTJc/MSTEgGfuopTHQhwDFILas4eh6TU=; fh=YhVFWa61906/YbE9NeMW4MNekQAT9+FiibKXBh6sHzA=; b=k575LveshAQ4BaWdndgNhtWAs6Ku5Xn0X2r6aEmF6XBpd8zELAr7K2ZWq3otsBZ+2j X1gsOlV3gB99BY+KpenmC/jSSDc4F02bFcP7K70ECm+CFX/bmiLxJ2vE8DrH/kNbsbqH s2rH7+xAL6kwh54A2bU8bQzirRL83c8V84QHF072+IQ/IV65WVf4hhhsYdb0rRWj4Ojt nbSM2vCVyV3sxi8TH8bztd3bXv9aZH28knD09vULhMkqZZJRLth8hbC+lCP0RjWQILHj tX1pN5Q1eR37zej9YTH25kBAs4Q95hX20QeEed4UKYmRX3D51bQOq9Qg6ARjYg54zjdy cUXQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=VKIh4okJ; arc=pass (i=1 spf=pass spfdomain=weissschuh.net dkim=pass dkdomain=weissschuh.net dmarc=pass fromdomain=weissschuh.net); spf=pass (google.com: domain of linux-kernel+bounces-202119-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202119-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=weissschuh.net Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57a31b81960si6119400a12.50.2024.06.05.02.38.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 02:38:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-202119-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=@weissschuh.net header.s=mail header.b=VKIh4okJ; arc=pass (i=1 spf=pass spfdomain=weissschuh.net dkim=pass dkdomain=weissschuh.net dmarc=pass fromdomain=weissschuh.net); spf=pass (google.com: domain of linux-kernel+bounces-202119-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202119-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=weissschuh.net 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 5E4B31F214BF for ; Wed, 5 Jun 2024 09:38:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 62DBE192B86; Wed, 5 Jun 2024 09:34:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="VKIh4okJ" Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) (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 B4A1F18FDDD; Wed, 5 Jun 2024 09:34:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.69.126.157 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717580043; cv=none; b=CJcNCJYDrmllfHL6tSwynrr6igXjwN2XPlK6baLoDMGPmc9ChwFLXgNukED3LfJgFN48RirRAhPm0PNmMDBwilasccT6NCDfx3TrahBTE+juASyRn7Mx4UyoTgQFT8vZs2/p0a6T1hJvybpmLyvl09WS1/iWbOdfmFzKxajP4Jg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717580043; c=relaxed/simple; bh=o3s3eeCGuDiHinRfMmQ6kt6dHWRjaZ0xd0fUvfgcYWs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=C0PnWgXPunl/HgRREFkcS5qRlLfO3I5qfIgQV7sZ1cGx3oOTEOzx1x9bJJE3Lm3d3dN1oWu7P9I0QMZgSeYGiz8uQGlOMSC1wgRPB52k8FOuZLX4L40K9xKxEQZQVIbLLYvHEsyn11fPf3JQqLKQLCbVIoHn29TxYg5qqg63KWI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net; spf=pass smtp.mailfrom=weissschuh.net; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b=VKIh4okJ; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=weissschuh.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1717580039; bh=o3s3eeCGuDiHinRfMmQ6kt6dHWRjaZ0xd0fUvfgcYWs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=VKIh4okJIDtWmWBa7iTGOvpbQKYWknJRrrEAEZ1ZPvZ8/fUCJiClTbmuRqQV2xWlD fClu3im9eqq4vN0HSAl9XCTAaUBg4Mj/B6QLlyI0uu+WOZ8NfJUzHDt4ToePa4VEsu uGq9TycDfo/HLCuKTnPFbZsfBAUcNM2KImuxDrmo= Date: Wed, 5 Jun 2024 11:33:58 +0200 From: Thomas =?utf-8?Q?Wei=C3=9Fschuh?= To: Dustin Howett Cc: Benson Leung , Guenter Roeck , Sebastian Reichel , Lee Jones , chrome-platform@lists.linux.dev, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Mario Limonciello , Stephen Horvath , Rajas Paranjpe Subject: Re: [PATCH v2 0/3] ChromeOS Embedded Controller charge control driver Message-ID: References: <20240528-cros_ec-charge-control-v2-0-81fb27e1cff4@weissschuh.net> <5baf3caf-dc09-4829-96db-2666fc902710@t-8ch.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On 2024-06-04 20:27:57+0000, Dustin Howett wrote: > On Mon, Jun 3, 2024 at 3:59 PM Thomas Weißschuh wrote: > > > > Can you try disabling all of the Framework-specific charge control > > settings and test again? > > Probably the different, disparate logics in the Framework ECs are > > conflicting with each other. > > Fascinating! This board does indeed support charge limiting through > both interfaces. It looks like the most recently set one wins for a > time. If it is the most recent one, shouldn't the driver have worked? What does "for a time" mean? I'm using only the upstream EC command and that seems to work fine. > The UEFI setup utility only sets the framework-specific charge limit value. > > We should probably find some way to converge them, for all of the > supported Framework Laptop programs. In the long term, Framework should align their implementation with upstream CrOS EC and either drop their custom command or make it a thin wrapper around the normal the upstream command. (As you are familiar with EC programming maybe you want to tackle this?) Until then I think we can detect at probe-time if the Framework APIs are available and use them to disable the Framework-specific mechanism. Then the CrOS EC commands should be usable. The drawback is, that userspace using the Framework APIs will break the driver. That userspace would need to migrate to the standard UAPI. Also the settings set in the firmware would be ignored at that point. I don't want to use the functionality of the Framework command because it's less featureful and I really hope it will go away at some point.