Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1539663

[PATCH 2/4] Input: i8042 - trust firmware a bit more when probing on X86

From Dmitry Torokhov <dmitry.torokhov@gmail.com>
Newsgroups linux.kernel
Subject [PATCH 2/4] Input: i8042 - trust firmware a bit more when probing on X86
Date 2016-12-09 22:00 +0100
Message-ID <sMAqS-7Wr-31@gated-at.bofh.it> (permalink)
References <sMAqS-7Wr-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


The error message "Can't read CTR while initializing i8042" appears on
Cherry Trail-based devices at each boot time:

  i8042: PNP: No PS/2 controller found. Probing ports directly.
  i8042: Can't read CTR while initializing i8042
  i8042: probe of i8042 failed with error -5

This happens because we historically do not trust firmware on X86 and,
while noting that PNP does not show keyboard or mouse devices, we still
charge ahead and try to probe the controller. Let's relax this a bit and if
results of PNP probe agree with the results of platform
initialization/quirks conclude that there is, in fact, no i8042.

While at it, let's avoid using x86_platform.i8042_detect() and instead
abort execution early if platform indicates that it can not possibly have
i8042 (x86_platform.legacy.i8042 equals X86_LEGACY_I8042_PLATFORM_ABSENT).

Reported-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
 drivers/input/serio/i8042-x86ia64io.h | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h
index 2e6a938..6ecb214 100644
--- a/drivers/input/serio/i8042-x86ia64io.h
+++ b/drivers/input/serio/i8042-x86ia64io.h
@@ -991,7 +991,11 @@ static int __init i8042_pnp_init(void)
 #if defined(__ia64__)
 		return -ENODEV;
 #else
-		pr_info("PNP: No PS/2 controller found. Probing ports directly.\n");
+		pr_info("PNP: No PS/2 controller found.\n");
+		if (x86_platform.legacy.i8042 !=
+				X86_LEGACY_I8042_EXPECTED_PRESENT)
+			return -ENODEV;
+		pr_info("Probing ports directly.\n");
 		return 0;
 #endif
 	}
@@ -1078,8 +1082,8 @@ static int __init i8042_platform_init(void)
 
 #ifdef CONFIG_X86
 	u8 a20_on = 0xdf;
-	/* Just return if pre-detection shows no i8042 controller exist */
-	if (!x86_platform.i8042_detect())
+	/* Just return if platform does not have i8042 controller */
+	if (x86_platform.legacy.i8042 == X86_LEGACY_I8042_PLATFORM_ABSENT)
 		return -ENODEV;
 #endif
 
-- 
2.8.0.rc3.226.g39d4020

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/4] x86: Trust firmware a bit more about presence of 8042 Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2016-12-09 22:00 +0100
  [PATCH 4/4] x86/init: fix a couple typos in arch/x86/include/asm/x86_init.h Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2016-12-09 22:00 +0100
    [tip:x86/urgent] x86/init: Fix a couple of comment typos tip-bot for Dmitry Torokhov <tipbot@zytor.com> - 2016-12-19 11:50 +0100
  [PATCH 3/4] x86/init: remove i8042_detect() form platform ops Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2016-12-09 22:00 +0100
    [tip:x86/urgent] x86/init: Remove i8042_detect() from platform ops tip-bot for Dmitry Torokhov <tipbot@zytor.com> - 2016-12-19 11:50 +0100
  [PATCH 2/4] Input: i8042 - trust firmware a bit more when probing on X86 Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2016-12-09 22:00 +0100
    [tip:x86/urgent] Input: i8042 - Trust firmware a bit more when  probing on X86 tip-bot for Dmitry Torokhov <tipbot@zytor.com> - 2016-12-19 11:50 +0100
  Re: [PATCH 0/4] x86: Trust firmware a bit more about presence of 8042 Marcos Paulo de Souza <marcos.souza.org@gmail.com> - 2016-12-10 01:00 +0100
  Re: [PATCH 0/4] x86: Trust firmware a bit more about presence of 8042 Takashi Iwai <tiwai@suse.de> - 2016-12-12 15:40 +0100

csiph-web