Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756521AbdLPAsz (ORCPT ); Fri, 15 Dec 2017 19:48:55 -0500 Received: from mail-it0-f67.google.com ([209.85.214.67]:36926 "EHLO mail-it0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755938AbdLPAsu (ORCPT ); Fri, 15 Dec 2017 19:48:50 -0500 X-Google-Smtp-Source: ACJfBovTDq+xYuDXYya184czy2d1+Bl+mEZrEyCh+EuS4Tce6LjxxT2CXa0xZO9vTlushndju9KIdQ== Date: Fri, 15 Dec 2017 16:48:46 -0800 From: Dmitry Torokhov To: Benjamin Tissoires Cc: Samuel Thibault , Peter Hutterer , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH 2/2] input - leds: fix input_led_disconnect path Message-ID: <20171216004846.3blocf4u45adwalh@dtor-ws> References: <20171214132522.20346-1-benjamin.tissoires@redhat.com> <20171214132522.20346-3-benjamin.tissoires@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171214132522.20346-3-benjamin.tissoires@redhat.com> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1077 Lines: 30 Hi Benjamin, On Thu, Dec 14, 2017 at 02:25:22PM +0100, Benjamin Tissoires wrote: > Before unregistering the led classes, we have to be sure there is no > more events in the input pipeline. > Closing the input node before removing the led classes flushes the > pipeline and this prevents segfaults. I do not think this actually the issue. input_leds_event() is an empty stub, it does not really do anything with events it receives form input core, and it does not reference the led structures. The way input leds work is that input driver owns the hardware led and is responsible for communicating with it. The LED subsystem is a secondary interface, requests coming from /sys/class/led/... are being forwarded to the input core and then to the input hardware driver by the way of: input_leds_brightness_set() -> input_inject_event() -> input_handle_event()-> disposition & INPUT_PASS_TO_DEVICE dev->event() (in atkbd or hid-input) actual control of LED I do not see how stopping event flow from input core to input-leds would help here. Thanks. -- Dmitry