From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 398FBC433EF for ; Sat, 16 Jun 2018 16:02:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E301C20891 for ; Sat, 16 Jun 2018 16:02:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E301C20891 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756885AbeFPQCS (ORCPT ); Sat, 16 Jun 2018 12:02:18 -0400 Received: from mx2.suse.de ([195.135.220.15]:36922 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752631AbeFPQCQ (ORCPT ); Sat, 16 Jun 2018 12:02:16 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext-too.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 35BDDAF5B; Sat, 16 Jun 2018 16:02:15 +0000 (UTC) Date: Sat, 16 Jun 2018 18:02:14 +0200 Message-ID: From: Takashi Iwai To: Pali =?UTF-8?B?Um9ow6Fy?= Cc: Henrique de Moraes Holschuh , ibm-acpi-devel@lists.sourceforge.net, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: ThinkPad T480s & LED_MUTE, LED_MICMUTE In-Reply-To: <20180616154309.ualrx2py6ndr5xgz@pali> References: <20180608111057.4wxpg7m7nm7suf6n@pali> <20180615190959.pqipwnm6a3tf3lxc@pali> <20180616154309.ualrx2py6ndr5xgz@pali> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 16 Jun 2018 17:43:09 +0200, Pali Rohár wrote: > > On Saturday 16 June 2018 09:05:41 Takashi Iwai wrote: > > On Fri, 15 Jun 2018 21:09:59 +0200, > > Pali Rohár wrote: > > > > > > On Friday 15 June 2018 14:51:47 Takashi Iwai wrote: > > > > On Fri, 08 Jun 2018 13:10:57 +0200, > > > > Pali Rohár wrote: > > > > > > > > > > Hi! With up-to-date thinkpad_acpi.ko driver on ThinkPad T480s I'm seeing > > > > > a strange behavior of LEDs which are integrated into mic mute (Fn+F4) > > > > > and mute (Fn+F1) keys. > > > > > > > > > > When thinkpad_acpi.ko is not loaded, then mute key is working fine. When > > > > > pressed, it correctly generates KEY_MUTE on AT Translated Set 2 keyboard > > > > > input device and also turn on/of mute led. But when micmute key is > > > > > pressed then, nothing happen. No key event is reported and also led is > > > > > not turned on/off. > > > > > > > > > > On the other hand, when thinkpad_acpi.ko is loaded, then both buttons > > > > > mute and micmute correctly generates input events; mute via AT keyboard > > > > > and micmute via ThinkPad Extra Buttons. But led is not changed. When > > > > > thinkpad_acpi.ko is loaded it turn off both leds (mute and micmute) and > > > > > leds after pressing any of those buttons, leds are not turned on again. > > > > > > > > > > When thinkpad_acpi.ko is unloaded, then pressing mute button again start > > > > > switching led on/off. > > > > > > > > > > So it seems that some init sequence of thinkpad_acpi.ko breaks mute led. > > > > > And fini sequence of thinkpad_acpi.ko makes mute led working again. > > > > > > > > Usually the mute LED on Thinkpad is triggered from HD-audio driver > > > > (sound/pci/hda/thinkpad_helper.c), and it's a soft-bound via > > > > symbol_request(tpacpi_led_set). I thought thinkpad_acpi is > > > > auto-loaded when the module gets bound. > > > > > > > > A possible explanation would be that TPT480s has neither IBM0068, > > > > LEN0068 nor LEN0268 ACPI HIDs, hence the driver is not auto-loaded. > > > > > > I have Debian Stretch kernel (4.9) which does not have LEN0268 alias for > > > thinkpad_acpi.ko. So thinkpad_acpi.ko is not loaded automatically. But I > > > have put thinkpad_acpi into /etc/modules and it is now automatically > > > loaded at boot. > > > > That's odd. It's exposed via > > MODULE_DEVICE_TABLE(acpi, ibm_htk_device_ids); > > > > It's been already in 4.9. At this point, something is fishy. > > $ /sbin/modinfo thinkpad_acpi | grep alias > alias: dmi:bvnIBM:bvrI[MU]ET??WW* > alias: tpacpi > alias: acpi*:LEN0068:* > alias: acpi*:IBM0068:* > > No there is no LEN0268 on 4.9. OK, that's the cause. It's really old. The commit a3c42a467a25 ("platform/x86: thinkpad_acpi: Adding new hotkey ID for Lenovo thinkpad") has to be backported. Also, in the HD-audio side, the commit 2ecb704a1290 ("ALSA: hda - add a new condition to check if it is thinkpad") is needed, too. > > > I also compiled upstream version of thinkpad_acpi.ko, loaded it in > > > Stretch kernel, but it behaves in same way. > > > > > > Maybe... there could be a problem that thinkpad_acpi.ko must be already > > > loaded when sound subsystem is doing initialization? If yes, this could > > > explain it as /etc/modules is loaded at later stage and manually loading > > > of new version of thinkpad_acpi.ko at runtime does not help when sound > > > subsystem is already running. > > > > Not really. The HD-audio driver tries to bind with tpacpi_led_set() > > via symbol_request(). i.e. if it's not present, it tries to load a > > module. > > > > Check whether hda_fixup_thinkpad_acpi() is called and the symbol gets > > loaded or not. > > > > But, I don't think it's worth to debug such an old kernel primarily. > > It is default one used by the last released Debian stable version. Heh, that explains :) And there was a recent regression in HD-audio that was addressed in 4.9.104. If you're using some earlier 4.9.x, you might hit the problem regarding HD-audio thinkpad_acpi binding. (But I guess it doesn't work in anyway without the backport of the commit above.) > > Could you test the latest Linus tree or 4.17.x at least as a test > > basis? > > Ok, will do that later. If my analysis above is correct, everything should work with the recent upstream kernel as is. Once after you confirm it, I can cook a patch to add the mixer enum to change LED behavior as you wanted. Takashi