From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f177.google.com (mail-pg1-f177.google.com [209.85.215.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8D3C72EF652 for ; Wed, 4 Feb 2026 18:28:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770229703; cv=none; b=kivNBwzcrTs8eAYYHREONs9ICeeNr+UBzMnVjt3YRGt7LqkIArq3pOUsHZe14AtZ3D59nWf00oqq0J2hPS5ap5YZ7Y44tGeyAFd2qIIWn2SNEoZdDgutDFTytle5JX1dvtq/r9ECcK7zdMfgX79hDti7dAD5gP70nFFCcMOgtqI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770229703; c=relaxed/simple; bh=1HsMu+8Fm+qVxsFAh9b5+jgcRsyFab0uFLZAECN1x4M=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=iGEACB75CsgZ3CSc8zfCmA0NL2Ux3+cRyPVt/H4el+64yALraWs8aw3JwB24D6YcJMBI7zuJ9CsEATFfGmqhBHsqx65Knj3MSmYk+/C60KI8jJ1LX4RAUovlPd6blEhhJFSR55RRdD3kHhikLkB3gER76bHJM0M3jAlFyR+tK5Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=bs6pkACe; arc=none smtp.client-ip=209.85.215.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bs6pkACe" Received: by mail-pg1-f177.google.com with SMTP id 41be03b00d2f7-c227206e6dcso7071a12.2 for ; Wed, 04 Feb 2026 10:28:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1770229703; x=1770834503; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Hz3BEokmg55/hHz91dlBVemctUY55XgvM8V1USUQ5ws=; b=bs6pkACehfUedVzT+DLho/yJmkSBM2NFT0YWSkdP+h5dshczU4hekK+bzITwv0RiZq 2eL8UxMApkrtYKaaBM9Z96WLmM/v9ZVVbCcIh17/pbXtyo/thrsJyS73tCydFCwL9GHI mJQpWN/ZX6iMNQn8qCvH03Dxwy9ZvPs6K7pLILdMM+K1PWTZGOo4cG87dBywzhcZi2Ke CTM0Sdp2xU/ydydAszlHGFmT3UfpUUm8NmfwjladKu7ZTjNwKHP4Bea1ozQfBewWBEhT uDeHlxymgO68c1BHeeQqG/57FuJPsNqEk/A1LMDg+2ol/tJI9RZzJOa9WqJbfEtOrHEN Hrig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770229703; x=1770834503; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Hz3BEokmg55/hHz91dlBVemctUY55XgvM8V1USUQ5ws=; b=ewN5PUAnKxX/Fe/NrQZBSYss2gLflz/u2i6uIpYWpBhXibeyE7zpjVRsI0GfKY+YG3 hP3TeO/HhZasf+CxZZH8uK1gHkzCHIHAaH1aPWdm/xsWszmnddUspkpBvwstKgYHhTql ztl1yqJ7QkpsWHfKYKTOXipj5QJyN2f5TLix3zhXvaIDYXuYdE5yzqRlIf0OShSI3cbr HacshITSqZAkS7d2x6o3q/r9DOaimeWOeNEF21BDL5OHcXWS3yT28cMMsBPcXH/QSp9g RlF6JK54dkzwKZ6TnQ7wFXThialG9anYwZAo2tXvRHupPa+o1/9ImDQbiR4+N10heciE js2w== X-Forwarded-Encrypted: i=1; AJvYcCV+hHr0WL13NDPsYsQ0VW/DkmUNaCSR4Toc6f9uwfom+FOKDOjZ485U3EA+gc/9YsBzXxmxqlm1/ChQhA4=@vger.kernel.org X-Gm-Message-State: AOJu0YwS9Ow5dcsb0PPQ4OgsYmmjFIOMZTvyjqXgs1ruh3E4mtWrr4CN CdLX4zB6n9kSqUOWk+Z1pFLVY0zXis1/xSotxOtAsI+ouP6lOgzVs3M= X-Gm-Gg: AZuq6aL4fSD00jR+6LcBeDznAbiPwWs/GVggzPFC5WTAVjS5SxkabM6c2QmMdl3ZBhV 6E6fwtnbFJjoqaB7fcfJhq98JexVzkx9cwz0GWSxMMSK7XkYozFqvXf+agkpOkGxL6yORda4Gk/ tQxgh87pA+hRhc+LAe4OSPahQ/kPsdcIC88jXJC4cy+tZQqeIxKiTV5ujVpGE7/rNaaMZiEts5p dke6dVOrWurLd2mDck7P7uh9XYRWjP4pZzBt2DrG1qwEn9Zj+K+4+y6FbveAmdGEN39qIjZbOIp Pbxsf0pf5NkSjB4vfrDnJyQhhToQaB7KIrsMWxxteqlD0OWCVPAg23d1aONCCBcDkFOCxC5fbfE RIQr90yhyObRt4W4xKsgJY4DjbYDbu2w+pR6RqLrr1/cY2pwfTftokzs/FGf6mDuxl6s6fF15Ix UqpnDYkvkKSUsnfA== X-Received: by 2002:a05:6a20:3d82:b0:35d:3523:c90d with SMTP id adf61e73a8af0-39371b7d745mr4058830637.0.1770229702860; Wed, 04 Feb 2026 10:28:22 -0800 (PST) Received: from at.. ([171.61.166.34]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-8241d1c0764sm3302188b3a.21.2026.02.04.10.28.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Feb 2026 10:28:22 -0800 (PST) From: Atharva Tiwari To: lukas@wunner.de Cc: atharvatiwarilinuxdev@gmail.com, hansg@kernel.org, ilpo.jarvinen@linux.intel.com, linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org Subject: Re: [PATCH v2] apple-gmux: preserve brightness using EFI Date: Wed, 4 Feb 2026 18:28:15 +0000 Message-ID: <20260204182816.1179-1-atharvatiwarilinuxdev@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: 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-Transfer-Encoding: 8bit > Older Intel Macs with a gmux can be booted in CSM mode (bypassing EFI). > I'm wondering what happens on those with the above change? > Do they only get the warning or do they crash? > The warning is probably uncalled for on CSM-booted Macs. I guess CSM-booted Macs would just trigger a warning when EFI isn’t enabled, as efi_rt_services_supported(EFI_RT_SUPPORTED_SET_VARIABLE) will return 0. > On my MacBookPro9,1 (which does have a gmux), the backlight-level variable > has 6 bytes which currently contain (hexdump): 07 00 00 80 35 00 > I guess this is actually a struct of a 32-bit and a 16-bit value > or alternatively three 16-bit values. Yet you're only writing a > single 16-bit value to the variable. How many bytes does the variable > have on your iMac and what are their contents? I'm worried that > your change may not be compatible with all Macs which have this variable. This function actually writes 6 bytes, which is u32 efi_attr (first 32-bits) and u16 efi_data (last 16-bits), but im confused about the fact, that the hexdumps show that ur attr are different. the attr should be 07 00 00 00 but its 07 00 00 80, i think we should retrieve the attr in the probe function and use that for writing. to fix this problem > Finally, there are Macs which don't have a gmux but which do have a > backlight. They usually control brightness through i915 I think. > It would be nice to save brightness to the EFI variable on those as well. There should be something for Amdgpus aswell for mac pro, but i cant test i915 nor amdgpu, as i dont have these devices. so i think we should currently drop this idea.