Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2982443pxb; Mon, 1 Nov 2021 05:50:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzieoYaDMuEMH4gi/82YI3Fs92+7mU/Yw1AblBMZZ8CK6stjcva6DT2qAtfcmnARwZj8Mfc X-Received: by 2002:a6b:fc11:: with SMTP id r17mr20705750ioh.59.1635771006548; Mon, 01 Nov 2021 05:50:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635771006; cv=none; d=google.com; s=arc-20160816; b=eFn3P91j+boO+8WUiQVtKVUaPyj4P2O2M8jC51BvoQayXIY8L6vTuSv+n4zagNDAEO IYVpS54V8E31EKEsUUogGICbI2VC0BuwOkpkWHYNMkSoJC23ixGt5up3ZUFUHPGAe5+m 4pL1SatCWd2TKVxFvyA2ShnUaUnGV76KTKqA0pc4A9qag2K6RCAQPCLEzU9YN97VOKG7 wSegsYZwmk6RUpZUGhoPUMBmH3iaZkLtx9NyApPQxJUdZi3Gu1fPiizfCLwXWTVqyBnb sjP4UZnvMLVGM7bTEXCjJXEfUfmsKGe+K3XgNKsQ2ZOBBkyZyU/Fb/ZHqSXziFPFG7oO 2Hpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=ZpaAK7SVyC4mTYjNmVCpvtwx0Wqw3mo9pI1TD6kWlk8=; b=HlKiD5RZ5QtfyQwnR+GgnuHM0zwM1C+/vfu0lzP+iAxbA15GvsFoe2O2l1OQLmuZES 4+m27Uts4m6J5F8MmahJJVwPnxSrlbNgNA+lXbKo7ZaZyo0xflNO+su1AVYyJea7u1Of vW0TGfMhBEBohjYBZ+woLJmezYl67nZ+bvwRKe+/3vEaRPbNvtvANudQD07NBod76V+c 9TOJu6dCQxKMZr0Uxn75Ms7ZkiwHwiDqV6brl/DRGVOM/FJ7/6bQ4Rh/HBBAvPGloFuS 469WvkqMFFg6fkmdEjVm53M4jzxReP+BkzRAWHV+InoTTUgVAJxh/4zaAPU4UtKVcnxH ELUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=GX3iuQ+M; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z22si22830055jat.125.2021.11.01.05.49.48; Mon, 01 Nov 2021 05:50:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=GX3iuQ+M; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232486AbhKAMvF (ORCPT + 99 others); Mon, 1 Nov 2021 08:51:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:38202 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232467AbhKAMvD (ORCPT ); Mon, 1 Nov 2021 08:51:03 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8B91560EE3; Mon, 1 Nov 2021 12:48:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1635770909; bh=+SBk+SYjceFJkTq8C08W0GYFlIzex7exv2uuONzJ/AE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=GX3iuQ+MYB8VQXKve+uwP/BpakNk11zhXlpKFoKMMptJcpGEDgR2S27KZt3GdK+ii 0P+UqJcX3m3RHayEcQOCh/HjJv358Z8b55erptWDW6u81d3NAKl7s4BIg/CkxqthBk h+EIfh54x7iMazpQxGqDQ1h5XzxbMzmGuwd+Q6Rs= Date: Mon, 1 Nov 2021 13:48:25 +0100 From: Greg KH To: =?utf-8?B?5bi45buJ5b+X?= Cc: linux-kernel , "dmitry.torokhov" , jirislaby , Andy Shevchenko , 282827961 <282827961@qq.com> Subject: Re: [PATCH v9] tty: Fix the keyboard led light display problem Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 01, 2021 at 08:35:47PM +0800, 常廉志 wrote: > > Switching from the desktop environment to the tty environment, > > the state of the keyboard led lights and the state of the keyboard > > lock are inconsistent. This is because the attribute kb->kbdmode > > of the tty bound in the desktop environment (Xorg) is set to > > VC_OFF, which causes the ledstate and kb->ledflagstate > > values of the bound tty to always be 0, which causes the switch > > from the desktop When to the tty environment, the LED light > > status is inconsistent with the keyboard lock status. > > > > Signed-off-by: lianzhi chang > > --- > > v7-->v8: > > Optimize the implementation of kbd_update_ledstate function > > > > Why not adopt the opinions of Greg KH and Andy Shevchenko: > > (1) In the structure struct input_dev, the definition of led is > > like this: unsigned long led[BITS_TO_LONGS(LED_CNT)]; If you > > define it like this: unsigned long newstate = *dev->led; I > > always feel that there is still big end and Little endian problem. > > (2) The test_bit function is used to avoid the problem of large > > and small ends, and the current algorithm (v8) also exists > > elsewhere in the kernel: the atkbd_set_leds function (drivers/ > > input/keyboard/atkbd.c). > > (3) In the current keyboard.c code, the code is already very good, > > and it is already relatively independent. If you modify the type > > of ledstate to u64 or modify the macro definitions such as > > VC_NUMLOCK, it feels that it is not very meaningful, and this It > > will also cause other related modifications. Of course, this is > > only my current opinion. If everyone still feels that it is > > necessary to modify, I will do it this way. Of course, this > > process may be a bit longer, and I think it is necessary to > > conduct more tests. > > > > v9: Change description information: xorg-->Xorg > > …… > > Hi, friends, I would like to ask whether this version of patch is possible, if not, > I will try my best to find a way to complete the next version! It's the merge window right now, we can't do anything with this until after 5.16-rc1 is out. So give us until then at the least please, then I will review it again. thanks, greg k-h