Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp250485lqb; Tue, 28 May 2024 14:35:04 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUpiHFcprK+0y0YevIO3LwOL9+ViaNjbnZQWVJY36urKkc7tiLoAgheTl0agmbir/tjt3fYpLj0yqGEhSqHYVFJDDeC1ZOrVf208nJxQA== X-Google-Smtp-Source: AGHT+IH826yZGDUL/lHRKdWySmG//0jYNB3cjbxkBUhhJDq4qTW7jxTg6U/x8eKrQ/vTJozy407U X-Received: by 2002:a81:ac02:0:b0:618:8a27:6150 with SMTP id 00721157ae682-62a08dccb87mr134457557b3.24.1716932103516; Tue, 28 May 2024 14:35:03 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716932103; cv=pass; d=google.com; s=arc-20160816; b=ICfIawmVDagJFqQyZwwEC+R50SQthVG/aJUJJxo/ez2vteStzXAJHaKORgmjdnLmSb xknNmknGNlGbxxn87MpHFuc8yRbDGFdv4H0lriW2aylpyLWT6oqIzb2wPS2ZhcxyFSWV 1Lq1RB7eOZekm974L3Wkl5dD2ITzr797iK00nqMYIc8R1znR1Xp8ZRaytzyhDXmusLx6 PxNbKZs/nAs4IhBqAzbK9Mr1Mx2fnAslDzyWSjUzZRQHWgj6rNlmSjNOvyR2Hm4apstq RmvM8MVVH+kHnYkBaWr0Mb3YSDZt1WxdTRSPVvonnONEUakeQfshioH4HKyW4yrqbk8x mcpQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=subject:cc:to:from:date:references:in-reply-to:message-id :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:feedback-id:dkim-signature:dkim-signature; bh=y7ZRNcwP4pjwdqwTtRlAY8w9sm0m48WlVfyUcA5amrM=; fh=Zsg+wsLfqWYbQl4kLc7shsSRQPPpxjNTJrP7y5tVlMk=; b=FXHp/JJ/dc6KM8KvbCeM3IJYU2vO0gvzSI+5AyNmOnvm+cltQ2sRSNOAgi3lMn4ZhZ fSjLF0yC8prLyzjFxoIA3TI408ReSN03+MymdFlfhyPCDSp/1PrUXWAtxDc32m/7qo0E 1Zpp2mEkjweT1VQij2u1yX9KVeHSLaE0vzuS6UtHEvDraXH9kkqroINvkVICT35HARkM 1mDqu3aTwMqfDJYRiY9HFR+tcWma5NKhmqiV3MmzESQyaeSHzrpIxvzlEFEo6t2xp3r+ fFOB8ZFbgxKGUBGEq5HHX3bPdcA30htTwJwbYRkKe6OHDrpBa/mx1tL++sWokc/SKZBw gYPQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ljones.dev header.s=fm2 header.b=d20xLBfh; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=UxHWfasx; arc=pass (i=1 dkim=pass dkdomain=ljones.dev dkim=pass dkdomain=messagingengine.com); spf=pass (google.com: domain of linux-kernel+bounces-193122-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-193122-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id af79cd13be357-794abd3a3e1si1091726985a.434.2024.05.28.14.35.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 May 2024 14:35:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-193122-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@ljones.dev header.s=fm2 header.b=d20xLBfh; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=UxHWfasx; arc=pass (i=1 dkim=pass dkdomain=ljones.dev dkim=pass dkdomain=messagingengine.com); spf=pass (google.com: domain of linux-kernel+bounces-193122-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-193122-linux.lists.archive=gmail.com@vger.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 3016F1C22F26 for ; Tue, 28 May 2024 21:35:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7B0F717B4F1; Tue, 28 May 2024 21:34:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ljones.dev header.i=@ljones.dev header.b="d20xLBfh"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="UxHWfasx" Received: from wfhigh5-smtp.messagingengine.com (wfhigh5-smtp.messagingengine.com [64.147.123.156]) (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 8E45217B4ED; Tue, 28 May 2024 21:34:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=64.147.123.156 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716932096; cv=none; b=su1VT0ReQXjE473f5Lo7xP/wIDTRuJRA6SlHhztBdwsMpsViwcI9bA+JXkqCUYVkG4pJ0YBgQ3Ixe/1YGlT20WZxLWSXyg6oAIW54+O2XML9mTO+obJJsqj+fyCmWDjWKTK/w3USZmfGBhfCUz826zN4zkLmXy2INDRFmo6bFmU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716932096; c=relaxed/simple; bh=OTUUZ1IOGn8N+025jO0LdHeT0aqbBWd4vImEqG7ne7A=; h=MIME-Version:Message-Id:In-Reply-To:References:Date:From:To:Cc: Subject:Content-Type; b=XYknWr2kDOj0uOWKIy01tORUBYKkxPH9iDw7JXs97ORQ/05g5a2V1ob0GQlOOjZBpWH7iS34dled2eLifrpQP8ah9HOfwxy/xmpqGCOXUAvUfbuo1pqA27rD9LJ1h3/6jhwkq1bs2rNcKVDoAoFS8VsDKm3TozZAE1ebtfVZ6bo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ljones.dev; spf=none smtp.mailfrom=ljones.dev; dkim=pass (2048-bit key) header.d=ljones.dev header.i=@ljones.dev header.b=d20xLBfh; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=UxHWfasx; arc=none smtp.client-ip=64.147.123.156 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ljones.dev Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ljones.dev Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailfhigh.west.internal (Postfix) with ESMTP id 68A0E1800103; Tue, 28 May 2024 17:34:53 -0400 (EDT) Received: from imap41 ([10.202.2.91]) by compute2.internal (MEProxy); Tue, 28 May 2024 17:34:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ljones.dev; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm2; t=1716932093; x=1717018493; bh=y7ZRNcwP4p jwdqwTtRlAY8w9sm0m48WlVfyUcA5amrM=; b=d20xLBfhlxbkU/SYrMvR0eoi4o P38uCGbL00szFMDeewkI5QLC0D9lUUXnL6xEI50wsxHaIDYOe9jPRGjjkvuISphu Kdgxk60UDYKdlAWA4hFbUAKjsOXPpUVm3Lbrathqh57/y69dU1qcIUUI/8QJQxbv 0U7d6qeTS/zJunOInz5ACXTEKg9xUCkN0+bzcYGCYKbahFH/TWDMe+tAAwfkv5Aj 4yxjPH5daLuOPpag3lKhHtHHPJ/Wv96r8AJddl7+EVWQpowmXxmqz2v99KIB2vNr zZPwCqMV4fxaU5V+F2jx1e0Lddzy9UmK1a472ZgZrZC8Lq9ZOjygCplZ4Myg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1716932093; x=1717018493; bh=y7ZRNcwP4pjwdqwTtRlAY8w9sm0m 48WlVfyUcA5amrM=; b=UxHWfasxL/NE8+/ONWIR9lUhoc95gRWvx5oR3Y3PVbmF pKfW0GtmXJ32YtR+62MwLQaynFI52BNUQuzXu01BDal8JNNqSyFR9SqzDhc1Im66 Hmop0qAsoi52cGdQBZLu07TJNw/p6e1FOEIIRz6BV9TQIJ/W5YupBoFic1SHgfew s0JkemMGHOgbp3Ap9kGqAjibJlnjUUGOtdg5Np2HnNI5BWCrUgxOQpEdeCYecJwC lI2sT4i8Z+qp/K76FGDyEeDUzEDMjmQO1LfgtnkVS7YiWTnnsvNKLBrPai1B1Hyi rvKOcUFFaYkw8IMkHPdon8LJPeWWH7O8G/mXdXzLEA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvdejkedgudefgecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enogfuuhhsphgvtghtffhomhgrihhnucdlgeelmdenucfjughrpefofgggkfgjfhffhffv vefutgesthdtredtreertdenucfhrhhomhepfdfnuhhkvgculfhonhgvshdfuceolhhukh gvsehljhhonhgvshdruggvvheqnecuggftrfgrthhtvghrnhephfeivdehffevtdehhfdt ffefheethfelfefgveeifffhgeeihfefheefhfeghfeknecuffhomhgrihhnpehgihhthh husgdrihhonecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhho mheplhhukhgvsehljhhonhgvshdruggvvh X-ME-Proxy: Feedback-ID: i5ec1447f:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 957612340080; Tue, 28 May 2024 17:34:52 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.11.0-alpha0-491-g033e30d24-fm-20240520.001-g033e30d2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <6d4e7f1e-ccd0-4ac5-b450-f9c5f8d5c90e@app.fastmail.com> In-Reply-To: <371d4109-a3bb-4c3b-802f-4ec27a945c99@amd.com> References: <20240528013626.14066-1-luke@ljones.dev> <20240528013626.14066-9-luke@ljones.dev> <6f4bc109-00d0-47b0-a581-b96a6152545c@amd.com> <4d6b9171-7248-4937-87de-7e921ed8e507@app.fastmail.com> <5f4799b1-0606-46a9-a347-5a03738db341@amd.com> <371d4109-a3bb-4c3b-802f-4ec27a945c99@amd.com> Date: Wed, 29 May 2024 09:34:31 +1200 From: "Luke Jones" To: "Mario Limonciello" , "Hans de Goede" , =?UTF-8?Q?Ilpo_J=C3=A4rvinen?= Cc: corentin.chary@gmail.com, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, richard@hughsie.com Subject: Re: [PATCH 8/9] platform/x86: asus-wmi: add apu_mem setting Content-Type: text/plain On Wed, 29 May 2024, at 9:16 AM, Mario Limonciello wrote: > >> For any "new" attributes it's better to put them in that API than code > >> duplication of the BIOS attributes API as well as a random sysfs file > >> API that you can never discard. > > > > Do you mean the firmware_attributes API? If so, I'm not opposed to adding all the existing ROG attributes to it also. > > > > If I'm understanding the docs correctly, for example this apu_mem attr would then become: > > - /sys/class/firmware-attributes/asus-bios/attributes/apu_mem/type > > - /sys/class/firmware-attributes/*/attributes/apu_mem/current_value > > - /sys/class/firmware-attributes/*/attributes/apu_mem/default_value > > - /sys/class/firmware-attributes/*/attributes/apu_mem/display_name > > - /sys/class/firmware-attributes/*/attributes/apu_mem/possible_values > > - ..etc > > > > That's absolutely much better than what I've been doing and I wish I'd known about it sooner. > > Yup! And even better "fwupdmgr get-bios-setting" and "fwupdmgr > set-bios-setting" [1] will work with bash completion too. > > If you want to build a GUI around it, it could use the fwupd dbus > interface for getting those settings and manipulating them. My existing GUI effort revolves around me adding these attrs to both kernel and a dbus interface. So if I can drop that then all the better > The dbus > interface policy is protected by PK. What is PK? And I'm guessing this restricts users to requiring permissions to change settings? > > > > So if I go ahead and convert all the new attr to this are there any issues with also converting much of the previous attr? And I'm aware of "don't break userspace" so really I'm a bit unsure how best to manage that (would a new module be better here also? "asus-bios.c" perhaps). > > > > What I don't want is a split between platform and firmware_attributes. > > > > My personal thought is add everything to the new API and then hide the > "old" interface behind some boolean Kconfig option that defaults to > disabled. If someone enables it then when it's "used" (IE read from / > written to) then do something like a pr_warn_once() that it's a > deprecated interface and it will go away. Wait until next LTS kernel, > and then rip it out after that. I'm happy to do this. On a serious note though, I should make a new module for this right? It would make it much much easier to manage the "conversion" I think, and then it would act as a separation of concerns. > > Need Hans and/or Ilpo agree to make with that though before you spend > too much effort on it though. Ack > > [1] https://fwupd.github.io/libfwupdplugin/bios-settings.html >