Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp1890247rdh; Sat, 25 Nov 2023 06:25:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IHiBHfa4JiDMkfE9a+UbgJDh+qLDAkitp026LGjX8CUgjplElrx8fBTpCh64I6e9vDxB/55 X-Received: by 2002:a05:6a20:2d1e:b0:18b:960a:efc2 with SMTP id g30-20020a056a202d1e00b0018b960aefc2mr6703274pzl.10.1700922354857; Sat, 25 Nov 2023 06:25:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700922354; cv=none; d=google.com; s=arc-20160816; b=EX+rU0e2z9H2YbMPVnzZ5RW7ASKR0sB2s3mXpU4MGCLaCCED2UI3ugagc8M7PoLpHT 7IN7S5N/SS1qn+VmhARW3f4bR0shTzUXNkI91vFCQ3UEKQT/EFFiotrW5g844Fus464j jaAcS2pPd258KJTx8qvlKZZRJDigoGIAI7CSIdg0sUHBXgwGifGE5vlxje94ntrEbY84 T8xZfnBw5ekNBqd5oeO1YsdEQ5MJAE0h+IpyMhAYyXYLudmjH04YQ79Fh6xqX8P0o2VP NZSh/sOZl4g5m3O00vu/qFU1MbBvPTEzZ62fQc2rtUb9toAWr8wFbTnCRHRxShg2wCGm +5PQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=om4cvqrGNZzHK5IOYrkm/sbDp+3pBIkDlxOhjKXyvVM=; fh=7qSEQ5xMh0fhluQ2Nr3/owzQ6EIv16Ys6s8fUtbyCto=; b=ZuVJIt1rXH63qE8vizgAT5a434BFatiTC2jNPoXbvy1v8r211kJ7B8m46wdhYp99Eu 1lGzbFn8EEaafXJX0wto7IQc4CuWQ3XsbitRRrVquSwg7nApEdx+Zfm74S27lTvA0tsE NT5uTycK2VuwPMMRbxbA8sv26wF6llaNJ6wxzGrJzXwykD+kVg2w//nnasT0dVgXAxJs LBrbvxdg5eCr3k8T1YeHTPmDyQdCJoBbXERoufv7QQGRADFh+4eF3FqOs0m7wuQHqtFH 9E0e/zaQ4pbh9Dp829n5edJNKuYuENhFSQlidPMRicgIHLUk2Rv9u7lddMLLO33bUHFv 8oug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=K3tIkUPZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id bz3-20020a056a02060300b005be09a118d3si6555262pgb.143.2023.11.25.06.25.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Nov 2023 06:25:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=K3tIkUPZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 1CDC780215BF; Sat, 25 Nov 2023 06:25:52 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232017AbjKYOZh (ORCPT + 99 others); Sat, 25 Nov 2023 09:25:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57820 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229569AbjKYOZg (ORCPT ); Sat, 25 Nov 2023 09:25:36 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF3F2BC for ; Sat, 25 Nov 2023 06:25:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1700922342; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=om4cvqrGNZzHK5IOYrkm/sbDp+3pBIkDlxOhjKXyvVM=; b=K3tIkUPZJpLyFsIlCDhvqGhYA1PBfW63BTrYssbOyitt3gkLktxEveWDuP5Ty43WG+bqte iIqZLErMBq5Cq5f3v6q8gbbNoZaJy5NnFNKKgvXCVTPPmLNQnWTI9zMkAUzXSP2fZ5K6YN xRQ5fZzfbKNnFJzlLcfef50gA5KQknU= Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-674-nYYUu-VOPemkf4trRx3T2w-1; Sat, 25 Nov 2023 09:25:40 -0500 X-MC-Unique: nYYUu-VOPemkf4trRx3T2w-1 Received: by mail-ej1-f69.google.com with SMTP id a640c23a62f3a-a00c4043a41so217512966b.0 for ; Sat, 25 Nov 2023 06:25:40 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700922339; x=1701527139; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=om4cvqrGNZzHK5IOYrkm/sbDp+3pBIkDlxOhjKXyvVM=; b=ctSsj1pa8pzrA56EAheYXME2EqPxO6fhVVnrQCr/c1wVYgYmKslfG+J+hSLYDDOTeB HP1uZgKlO4RgqqY4Iglds8prMHuGwF1OSy77P7buX64L4icFdFwhBA/PebQJ6C7cYSnB WJUAmXMj9/qHdulMBn0NgqXsBX4cDRlULtq2CtflntaNzAeDTWssf1T5PNtFyJPvwW/j vvd5nuezlv6DSZPhl0JwakBr4iC7Q+V+PY1vhSSDp3ON37+G3sx4pu9AWpBoIp++emNd lE5GK8n/QLe28KHeJr+KNR3WD4vGIjJofSqckhb86qFXDyJIYYTxehYf2IUTx+S0yTsL cbyA== X-Gm-Message-State: AOJu0YxuDZISfi/hCWn5oqIihQ8YHYycERFrheuDSbJpTzhF6fIlVzKL Ed1rai3vpkvYUYdXsAJ+so9DeRwXvzbHghAFo2FervRJHUxr6KKdBzK5ldIMjA6UXahFyV0jMzW DayNjWwzmyoHydC8L1xILIUtjdXb8gqmv X-Received: by 2002:a17:906:70c8:b0:9e2:9647:9a54 with SMTP id g8-20020a17090670c800b009e296479a54mr4234191ejk.3.1700922338916; Sat, 25 Nov 2023 06:25:38 -0800 (PST) X-Received: by 2002:a17:906:70c8:b0:9e2:9647:9a54 with SMTP id g8-20020a17090670c800b009e296479a54mr4234179ejk.3.1700922338608; Sat, 25 Nov 2023 06:25:38 -0800 (PST) Received: from ?IPV6:2001:1c00:c32:7800:5bfa:a036:83f0:f9ec? (2001-1c00-0c32-7800-5bfa-a036-83f0-f9ec.cable.dynamic.v6.ziggo.nl. [2001:1c00:c32:7800:5bfa:a036:83f0:f9ec]) by smtp.gmail.com with ESMTPSA id gg6-20020a170906e28600b00a090b36d618sm2299670ejb.60.2023.11.25.06.25.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 25 Nov 2023 06:25:37 -0800 (PST) Message-ID: <77b3eed7-825d-41c5-a802-ea891a16f992@redhat.com> Date: Sat, 25 Nov 2023 15:25:36 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: PROBLEM: asus_nb_wmi sends KEY_BRIGHTNESSDOWN on pressing CAPS Lock and PrntScrn on Zenbook S 13 UX5304VA Content-Language: en-US, nl To: Juri Vitali , James John , Corentin Chary , =?UTF-8?Q?Ilpo_J=C3=A4rvinen?= , Mark Gross Cc: platform-driver-x86@vger.kernel.org, acpi4asus-user@lists.sourceforge.net, linux-kernel@vger.kernel.org References: <39b5f902-3a7e-fc04-254e-776bf61f57e2@redhat.com> <024c4ad4-1a73-8c24-5e6f-f8c9f2f7b98f@redhat.com> <1884918.tdWV9SEqCh@dividebyzero.it> From: Hans de Goede In-Reply-To: <1884918.tdWV9SEqCh@dividebyzero.it> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Sat, 25 Nov 2023 06:25:52 -0800 (PST) Hi Juri, On 11/24/23 16:54, Juri Vitali wrote: > Hi, > Unfortunately those patches have broken the backlight reporting on older > laptops, which do rely on the old mechanism. Thank you for reporting this and sorry about the regression. And thank you for writing a good bug report with as much info included as possible, that is much appreciated. > For instance, on my Asus UX32A/VD when pressing the backlight up/down button > the backlight changes accordingly, Ok, so the embedded-controller (EC) is adjusting the brightness itself in reaction to the key presses, which means that the old behavior of sending KEY_BRIGHTNESSDOWN / KEY_BRIGHTNESSUP was not really correct because that will cause e.g. GNOME to then increase the brightness itself which means that if the new brightness is correctly reflected when reading it GNOME may increase the brightness an additional step on top of the step it has already been increased by the EC itself. Which makes me wonder how to properly solve this, so I have a bunch of questions: 1. What desktop environment are you using ? 2. Assuming you are using GNOME (for now) I guess that with older kernels you got an on-screen-display (OSD) notification about the brightness changing? Do you notice any difference in how many total steps you have going from min to max with older kernels vs the new kernel ? If the double increase problem happens I guess you only get 5 brightness levels in GNOME / 4 steps from going from minimal to maximum ? Note below questions should all be answered with the new kernel with the unknown key messages in dmesg. 3. Can you do: ls /sys/class/backlight And let me know the output, I wonder what method is being used to control backlight on your machine. 4. Can you do: cat /sys/class/backlight/$name/max_brightness What does this say? With $name being the name from 3. 5. Can you do: cat /sys/class/backlight/$name/brightness And then change the brightness using the keys, and then again do: cat /sys/class/backlight/$name/brightness What are the values shown before / after changing it ? 6. Can you repeat 5 but then do: cat /sys/class/backlight/$name/actual_brightness 7. Can you run: sudo acpidump -o acpidump.txt And then email me the generated acpidump.txt file in a private email ? > but the event is not caught by the system > (more precisely, dmesg is complaining of unknown key codes): > >> [ 3167.842213] asus_wmi: Unknown key code 0x29 >> [ 3168.105096] asus_wmi: Unknown key code 0x28 >> [ 3168.142526] asus_wmi: Unknown key code 0x27 >> [ 3168.178860] asus_wmi: Unknown key code 0x26 >> [ 3168.216027] asus_wmi: Unknown key code 0x25 >> [ 3168.256511] asus_wmi: Unknown key code 0x24 >> [ 3168.292907] asus_wmi: Unknown key code 0x23 >> [ 3168.329704] asus_wmi: Unknown key code 0x22 >> [ 3168.366554] asus_wmi: Unknown key code 0x21 >> [ 3168.406681] asus_wmi: Unknown key code 0x20 >> [ 3168.443330] asus_wmi: Unknown key code 0x20 >> [ 3168.480900] asus_wmi: Unknown key code 0x20 >> [ 3168.516326] asus_wmi: Unknown key code 0x20 >> [ 3168.554006] asus_wmi: Unknown key code 0x20 >> [ 3168.593320] asus_wmi: Unknown key code 0x20 >> [ 3168.630108] asus_wmi: Unknown key code 0x20 >> [ 3168.670110] asus_wmi: Unknown key code 0x20 >> [ 3168.943217] asus_wmi: Unknown key code 0x11 >> [ 3169.203349] asus_wmi: Unknown key code 0x12 >> [ 3169.243239] asus_wmi: Unknown key code 0x13 >> [ 3169.279881] asus_wmi: Unknown key code 0x14 >> [ 3169.316311] asus_wmi: Unknown key code 0x15 >> [ 3169.352887] asus_wmi: Unknown key code 0x16 >> [ 3169.392806] asus_wmi: Unknown key code 0x17 >> [ 3169.429301] asus_wmi: Unknown key code 0x18 >> [ 3169.465843] asus_wmi: Unknown key code 0x19 >> [ 3169.502404] asus_wmi: Unknown key code 0x1a >> [ 3169.542308] asus_wmi: Unknown key code 0x1a >> [ 3169.578938] asus_wmi: Unknown key code 0x1a >> [ 3169.615506] asus_wmi: Unknown key code 0x1a >> [ 3169.652002] asus_wmi: Unknown key code 0x1a >> [ 3169.692280] asus_wmi: Unknown key code 0x1a > > In this case it seems that the backlight-down codes go from 0x20 to 0x29 while > the -up from 0x11 to 0x1a, so assuming they are not clamped somewhere else > they should not conflict with the ones used on newer models. Thanks, that (the codes not overlapping with newer models codes) is useful information to have. With that it should be easy to restore the old behavior of sending KEY_BRIGHTNESSDOWN / UP, my questions above are mainly because I wonder if that is the right thing to do taking into account that the EC already adjusts the brightness itself. > By the way, I only found those codes to be reported by asus-wmi, while other > inputs remain silent while pressing those keys. Yes that is expected, for unknown asus-wmi events no events are send to userspace. Regards, Hans