From patchwork Tue Dec 13 17:56:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 9472879 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8D64260760 for ; Tue, 13 Dec 2016 17:56:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 93D7728640 for ; Tue, 13 Dec 2016 17:56:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8735E28644; Tue, 13 Dec 2016 17:56:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 37CDD28640 for ; Tue, 13 Dec 2016 17:56:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935336AbcLMR4s (ORCPT ); Tue, 13 Dec 2016 12:56:48 -0500 Received: from mail-pg0-f67.google.com ([74.125.83.67]:34061 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933939AbcLMR4g (ORCPT ); Tue, 13 Dec 2016 12:56:36 -0500 Received: by mail-pg0-f67.google.com with SMTP id e9so5153416pgc.1; Tue, 13 Dec 2016 09:56:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=1aytcEXDbVZuVjItDTKDdPe7czaxtk6SB5G8QMw1unM=; b=zad3i0Di1Q2iJ/qFjxaxTlDlRG3pC5O9D6F/rndIOlsg+GzhCQJFfvxic0SzY/QPb5 abhJopDUU1gpyl9juTZVJA1WqxtOCYKbQNsdhm6Fd+DtmFse1hphJYffV7FXgj7fIP5D 3TPE7K5UuCeinqatCDmhmMM/gjOAXAJnjTn93NGPkzmrH82L6M8cwk4/aF3Nxf42hAv2 2HVpQqGPndWxn7r79ovejwkQhfaUZOk0Sb7ovtsXWC56FN6O0dUF/IO/SZ7DRS0NRc68 qmaja6DHooSEHmhRJ/goCG/z3x/PvCD9yohKWU3ekXVsiv8MsxFYJHcCD8TGPp4JVScT 7Icg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=1aytcEXDbVZuVjItDTKDdPe7czaxtk6SB5G8QMw1unM=; b=kV9rPl7Gq/4Gm8e3H7IgkAqT12UD9UYe0IW/CdVqHUTtp/Y7633dkomf2Xdy1K0YWc eoHYoov2XbLf2CYxyDKq5UgP2f4F1GDk6OlPQHso4Fj1o6E8FUrsStX/UUHuVGXRxddX s3jQk+/funaRjjCQgXJCvTRiUxtZENRMNNC10Cg6gYibvevdPWfNXEsFoK50xz2ypLow aDsAbB7P5NLaeYhi2IUNl6KODl6Iu0f8LTerHmWkXc8Hz579i4LctSbhWUL5VZ+PmOXk VMFmYa7tguUl9oi6ccNNaOy38i9p3nTl3x82yaKY+61fKMqITQIb+44tN4jvUJMyUeSE dnEg== X-Gm-Message-State: AKaTC02cah2WyLxFI6rYjBFfUZ+sn5bMb7H9jL2VYlryWYawNgApz8UToFhPpI+C994ZRg== X-Received: by 10.99.98.2 with SMTP id w2mr179874248pgb.59.1481651795452; Tue, 13 Dec 2016 09:56:35 -0800 (PST) Received: from dtor-ws ([2620:0:1000:1311:84ca:cb68:b724:aed7]) by smtp.gmail.com with ESMTPSA id s8sm81539107pfj.45.2016.12.13.09.56.34 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Tue, 13 Dec 2016 09:56:34 -0800 (PST) Date: Tue, 13 Dec 2016 09:56:32 -0800 From: Dmitry Torokhov To: linux-input@vger.kernel.org Cc: Marcos Paulo de Souza , "Luis R. Rodriguez" , linux-kernel@vger.kernel.org Subject: [PATCH] Input: i8042 - force synchronous probing of PNP drivers Message-ID: <20161213175632.GA12528@dtor-ws> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We rely on the result of scanning PNP bus for keyboard and mouse devices to decide whether we should continue initialization of i8042 driver or not, so the probes can not be asynchronous. Also, it is not a good idea to unbind either of the PNP devices while i8042 is running, so let's disable bind/unbind for the PNP drivers through sysfs and rely on i8042 cleaning after itself properly. User can still unbind and rebind entire i8042 and that will take care of PNP drivers as well. Signed-off-by: Dmitry Torokhov Reviewed-by: Luis R. Rodriguez --- drivers/input/serio/i8042-x86ia64io.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h index 2503d01..79daea84 100644 --- a/drivers/input/serio/i8042-x86ia64io.h +++ b/drivers/input/serio/i8042-x86ia64io.h @@ -925,6 +925,10 @@ static struct pnp_driver i8042_pnp_kbd_driver = { .name = "i8042 kbd", .id_table = pnp_kbd_devids, .probe = i8042_pnp_kbd_probe, + .driver = { + .probe_type = PROBE_FORCE_SYNCHRONOUS, + .suppress_bind_attrs = true, + }, }; static struct pnp_device_id pnp_aux_devids[] = { @@ -947,6 +951,10 @@ static struct pnp_driver i8042_pnp_aux_driver = { .name = "i8042 aux", .id_table = pnp_aux_devids, .probe = i8042_pnp_aux_probe, + .driver = { + .probe_type = PROBE_FORCE_SYNCHRONOUS, + .suppress_bind_attrs = true, + }, }; static void i8042_pnp_exit(void)