All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] i2c: i801: blacklist Host Notify on HP EliteBook G3 850
@ 2018-04-02 12:25 Jason Andryuk
  2018-04-02 12:34 ` [PATCH v2] " Jason Andryuk
  0 siblings, 1 reply; 15+ messages in thread
From: Jason Andryuk @ 2018-04-02 12:25 UTC (permalink / raw)
  To: Jean Delvare, Wolfram Sang
  Cc: benjamin.tissoires, andyrtr, aduggan, Jason Andryuk, linux-i2c,
	linux-kernel

The HP EliteBook G3 850 has a weird bug where a subsequent cold boot
hangs while plugged in if Linux enables the Host Notify features of
i2c-i801.  The cold boot hang depends on how the system boots.  It does
not hang on UEFI Grub text boot or legacy Grub text boot.  But it does
hang on legacy Grub graphical boot and Intel Boot Agent PXE text boot.
Booting unplugged is not affected.

Disabling the Host Notify feature with disable_feature=0x20 works around
the bug, so automatically do so based on DMI information.

More information can be found here:
https://www.spinics.net/lists/linux-i2c/msg33938.html

Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
---
I only added my machine to the blacklist, since it's the only one I've
tested.  More systems can be added when identified and tested.

 drivers/i2c/busses/i2c-i801.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c
index 692b34125866..2ff10c41ccad 100644
--- a/drivers/i2c/busses/i2c-i801.c
+++ b/drivers/i2c/busses/i2c-i801.c
@@ -1042,6 +1042,24 @@ static const struct pci_device_id i801_ids[] = {
 MODULE_DEVICE_TABLE(pci, i801_ids);
 
 #if defined CONFIG_X86 && defined CONFIG_DMI
+static const struct dmi_system_id host_notify_dmi_blacklist[] = {
+	{
+		.ident = "HP EliteBook G3 850",
+		.matches = {
+			DMI_MATCH(DMI_BOARD_VENDOR, "HP"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "HP EliteBook 850 G3"),
+		},
+	},
+};
+
+static void blacklist_features(struct i801_priv *priv) {
+	if (dmi_check_system(host_notify_dmi_blacklist)) {
+		dev_warn(&priv->pci_dev->dev,
+			 "SMBus Host Notify disabled on this system");
+		priv->features &= ~FEATURE_HOST_NOTIFY;
+	}
+}
+
 static unsigned char apanel_addr;
 
 /* Scan the system ROM for the signature "FJKEYINF" */
@@ -1159,6 +1177,7 @@ static void i801_probe_optional_slaves(struct i801_priv *priv)
 #else
 static void __init input_apanel_init(void) {}
 static void i801_probe_optional_slaves(struct i801_priv *priv) {}
+static void blacklist_features(struct i801_priv *priv) {}
 #endif	/* CONFIG_X86 && CONFIG_DMI */
 
 #if IS_ENABLED(CONFIG_I2C_MUX_GPIO) && defined CONFIG_DMI
@@ -1562,6 +1581,7 @@ static int i801_probe(struct pci_dev *dev, const struct pci_device_id *id)
 				   i801_feature_names[i]);
 	}
 	priv->features &= ~disable_features;
+	blacklist_features(priv);
 
 	err = pcim_enable_device(dev);
 	if (err) {
-- 
2.14.3

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH v2] i2c: i801: blacklist Host Notify on HP EliteBook G3 850
  2018-04-02 12:25 [PATCH] i2c: i801: blacklist Host Notify on HP EliteBook G3 850 Jason Andryuk
@ 2018-04-02 12:34 ` Jason Andryuk
  2018-04-03 19:13   ` Andreas Radke
                     ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Jason Andryuk @ 2018-04-02 12:34 UTC (permalink / raw)
  To: Jean Delvare, Wolfram Sang
  Cc: benjamin.tissoires, andyrtr, aduggan, Jason Andryuk, linux-i2c,
	linux-kernel

The HP EliteBook G3 850 has a weird bug where a subsequent cold boot
hangs while plugged in if Linux enables the Host Notify features of
i2c-i801.  The cold boot hang depends on how the system boots.  It does
not hang on UEFI Grub text boot or legacy Grub text boot.  But it does
hang on legacy Grub graphical boot and Intel Boot Agent PXE text boot.
Booting unplugged is not affected.

Disabling the Host Notify feature with disable_feature=0x20 works around
the bug, so automatically do so based on DMI information.

More information can be found here:
https://www.spinics.net/lists/linux-i2c/msg33938.html

Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
---
I only added my machine to the blacklist, since it's the only one I've
tested.  More systems can be added when identified and tested.

v2: Fix open brace on function definition

 drivers/i2c/busses/i2c-i801.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c
index 692b34125866..3e8e613c0801 100644
--- a/drivers/i2c/busses/i2c-i801.c
+++ b/drivers/i2c/busses/i2c-i801.c
@@ -1042,6 +1042,25 @@ static const struct pci_device_id i801_ids[] = {
 MODULE_DEVICE_TABLE(pci, i801_ids);
 
 #if defined CONFIG_X86 && defined CONFIG_DMI
+static const struct dmi_system_id host_notify_dmi_blacklist[] = {
+	{
+		.ident = "HP EliteBook G3 850",
+		.matches = {
+			DMI_MATCH(DMI_BOARD_VENDOR, "HP"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "HP EliteBook 850 G3"),
+		},
+	},
+};
+
+static void blacklist_features(struct i801_priv *priv)
+{
+	if (dmi_check_system(host_notify_dmi_blacklist)) {
+		dev_warn(&priv->pci_dev->dev,
+			 "SMBus Host Notify disabled on this system");
+		priv->features &= ~FEATURE_HOST_NOTIFY;
+	}
+}
+
 static unsigned char apanel_addr;
 
 /* Scan the system ROM for the signature "FJKEYINF" */
@@ -1159,6 +1178,7 @@ static void i801_probe_optional_slaves(struct i801_priv *priv)
 #else
 static void __init input_apanel_init(void) {}
 static void i801_probe_optional_slaves(struct i801_priv *priv) {}
+static void blacklist_features(struct i801_priv *priv) {}
 #endif	/* CONFIG_X86 && CONFIG_DMI */
 
 #if IS_ENABLED(CONFIG_I2C_MUX_GPIO) && defined CONFIG_DMI
@@ -1562,6 +1582,7 @@ static int i801_probe(struct pci_dev *dev, const struct pci_device_id *id)
 				   i801_feature_names[i]);
 	}
 	priv->features &= ~disable_features;
+	blacklist_features(priv);
 
 	err = pcim_enable_device(dev);
 	if (err) {
-- 
2.14.3

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH v2] i2c: i801: blacklist Host Notify on HP EliteBook G3 850
  2018-04-02 12:34 ` [PATCH v2] " Jason Andryuk
@ 2018-04-03 19:13   ` Andreas Radke
  2018-04-04 12:55     ` Jason Andryuk
  2018-04-04 20:56   ` Jean Delvare
  2018-04-05  1:34   ` [PATCH v2] " Sasha Levin
  2 siblings, 1 reply; 15+ messages in thread
From: Andreas Radke @ 2018-04-03 19:13 UTC (permalink / raw)
  To: Jason Andryuk
  Cc: Jean Delvare, Wolfram Sang, benjamin.tissoires, aduggan,
	linux-i2c, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 2476 bytes --]

Am Mon,  2 Apr 2018 08:34:35 -0400
schrieb Jason Andryuk <jandryuk@gmail.com>:

> The HP EliteBook G3 850 has a weird bug where a subsequent cold boot
> hangs while plugged in if Linux enables the Host Notify features of
> i2c-i801.  The cold boot hang depends on how the system boots.  It
> does not hang on UEFI Grub text boot or legacy Grub text boot.  But
> it does hang on legacy Grub graphical boot and Intel Boot Agent PXE
> text boot. Booting unplugged is not affected.
> 
> Disabling the Host Notify feature with disable_feature=0x20 works
> around the bug, so automatically do so based on DMI information.
> 
> More information can be found here:
> https://www.spinics.net/lists/linux-i2c/msg33938.html

I'm faced with similar cold boot issues on my HP ProBook 430 G4 model.
Trying your hint with adding 
"options i2c_i801 disable_features=0x20"
to /etc/modprobe.d/i2c_i801.conf doesn't seem to solve it for me.

root@laptop64:/root # systool -v -m
i2c_i801 Module = "i2c_i801"

  Attributes:
    coresize            = "28672"
    initsize            = "0"
    initstate           = "live"
    refcnt              = "0"
    srcversion          = "A40BF457CFB8C7887EB2045"
    taint               = ""
    uevent              = <store method only>

  Parameters:
    disable_features    = "32"

  Sections:
    .bss                = "0xffffffffc0801800"
    .data               = "0xffffffffc0801120"
    .exit.text          = "0xffffffffc07fe463"
    .gnu.linkonce.this_module= "0xffffffffc08014c0"
    .init.text          = "0xffffffffc070b000"
    .note.gnu.build-id  = "0xffffffffc07ff000"
    .orc_unwind         = "0xffffffffc0800140"
    .orc_unwind_ip      = "0xffffffffc07ffe38"
    .parainstructions   = "0xffffffffc07ff548"
    .rodata.str1.1      = "0xffffffffc07ff284"
    .rodata.str1.8      = "0xffffffffc07ff028"
    .rodata             = "0xffffffffc07ff560"
    .smp_locks          = "0xffffffffc07ff280"
    .strtab             = "0xffffffffc070d350"
    .symtab             = "0xffffffffc070c000"
    .text               = "0xffffffffc07fc000"
    __jump_table        = "0xffffffffc0801000"
    __mcount_loc        = "0xffffffffc08005d0"
    __param             = "0xffffffffc07ffe10"
    __verbose           = "0xffffffffc0801220"

My system boots legacy grub in text mode (KMS) and seems to keep hanging
even with that option set.

Do you have any further idea?

-Andy
Arch linux

[-- Attachment #2: Digitale Signatur von OpenPGP --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v2] i2c: i801: blacklist Host Notify on HP EliteBook G3 850
  2018-04-03 19:13   ` Andreas Radke
@ 2018-04-04 12:55     ` Jason Andryuk
  2018-04-04 14:02       ` Jean Delvare
  2018-04-06 15:23       ` Andreas Radke
  0 siblings, 2 replies; 15+ messages in thread
From: Jason Andryuk @ 2018-04-04 12:55 UTC (permalink / raw)
  To: Andreas Radke
  Cc: Jean Delvare, Wolfram Sang, benjamin.tissoires, aduggan,
	linux-i2c, open list

On Tue, Apr 3, 2018 at 3:13 PM, Andreas Radke <andyrtr@archlinux.org> wrote:
> Am Mon,  2 Apr 2018 08:34:35 -0400
> schrieb Jason Andryuk <jandryuk@gmail.com>:
>
>> The HP EliteBook G3 850 has a weird bug where a subsequent cold boot
>> hangs while plugged in if Linux enables the Host Notify features of
>> i2c-i801.  The cold boot hang depends on how the system boots.  It
>> does not hang on UEFI Grub text boot or legacy Grub text boot.  But
>> it does hang on legacy Grub graphical boot and Intel Boot Agent PXE
>> text boot. Booting unplugged is not affected.
>>
>> Disabling the Host Notify feature with disable_feature=0x20 works
>> around the bug, so automatically do so based on DMI information.
>>
>> More information can be found here:
>> https://www.spinics.net/lists/linux-i2c/msg33938.html
>
> I'm faced with similar cold boot issues on my HP ProBook 430 G4 model.
> Trying your hint with adding
> "options i2c_i801 disable_features=0x20"
> to /etc/modprobe.d/i2c_i801.conf doesn't seem to solve it for me.

Maybe verify the option is set by checking
/sys/module/i2c_i801/parameters/disable_features ?  Looks like dmesg
should also report "SMBus Host Notify disabled by user" when disabled.
I run with i801 built-in, so I was specifying the option on the kernel
command line.

> My system boots legacy grub in text mode (KMS) and seems to keep hanging
> even with that option set.

Your cold boot hang is in legacy grub itself?  Legacy grub text mode
actually doesn't hang my G3 850 - it was switching to the graphical
splash screen that seemed to do it.  PXE booting via F12 was another
consistent way to hang.  It was very early in the PXE boot code -
before it checked the link status.  So you could try that with it just
plugged into a switch even if you don't have a PXE boot setup.

>From my previous post:
"""
The Boot Agent hang prints "Client Mac Addr 00-11-22-33-44-55<cursor>"
and hangs.  A normal boot prints a GUID on the same line and
continues.
"""

Otherwise, unfortunately, it might just be a different issue.

> Do you have any further idea?

For the G3 850, I bisected to the commit introducing i801 Host Notify
support.  It's time consuming, but you could do the same.  I first
noticed the issue when I moved from a working stable 4.4 to stable
4.14.  I tried some fedora kernels in between which narrowed down the
bisect range.  You could similarly grab and test pre-compiled kernels
to more quickly hone in on the regression range.

Regards,
Jason

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v2] i2c: i801: blacklist Host Notify on HP EliteBook G3 850
  2018-04-04 12:55     ` Jason Andryuk
@ 2018-04-04 14:02       ` Jean Delvare
  2018-04-06 15:23       ` Andreas Radke
  1 sibling, 0 replies; 15+ messages in thread
From: Jean Delvare @ 2018-04-04 14:02 UTC (permalink / raw)
  To: Jason Andryuk
  Cc: Andreas Radke, Wolfram Sang, benjamin.tissoires, aduggan,
	linux-i2c, LKML

Hi Jason, Andreas,

On Wed, 4 Apr 2018 08:55:20 -0400, Jason Andryuk wrote:
> On Tue, Apr 3, 2018 at 3:13 PM, Andreas Radke <andyrtr@archlinux.org> wrote:
> > I'm faced with similar cold boot issues on my HP ProBook 430 G4 model.
> > Trying your hint with adding
> > "options i2c_i801 disable_features=0x20"
> > to /etc/modprobe.d/i2c_i801.conf doesn't seem to solve it for me.  
> 
> Maybe verify the option is set by checking
> /sys/module/i2c_i801/parameters/disable_features ?  Looks like dmesg
> should also report "SMBus Host Notify disabled by user" when disabled.
> I run with i801 built-in, so I was specifying the option on the kernel
> command line.

Another thing to think of is that you may have to rebuild the
initrd/initramfs after editing /etc/modprobe.d/i2c_i801.conf if
i2c-i801 happens to be part of it (and make sure
that /etc/modprobe.d/i2c_i801.conf is indeed included in
initrd/initramfs then.)

> > My system boots legacy grub in text mode (KMS) and seems to keep hanging
> > even with that option set.  
> 
> Your cold boot hang is in legacy grub itself?  Legacy grub text mode
> actually doesn't hang my G3 850 - it was switching to the graphical
> splash screen that seemed to do it.  PXE booting via F12 was another
> consistent way to hang.  It was very early in the PXE boot code -
> before it checked the link status.  So you could try that with it just
> plugged into a switch even if you don't have a PXE boot setup.
> 
> From my previous post:
> """
> The Boot Agent hang prints "Client Mac Addr 00-11-22-33-44-55<cursor>"
> and hangs.  A normal boot prints a GUID on the same line and
> continues.
> """
> 
> Otherwise, unfortunately, it might just be a different issue.

I recall reports about hangs when we first added support for
interrupts. I think we addressed all the bugs in this area since then
but maybe not. So you may want to try disable_features=0x30 to disable
both interrupts and SMBus Host Notify.

-- 
Jean Delvare
SUSE L3 Support

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v2] i2c: i801: blacklist Host Notify on HP EliteBook G3 850
  2018-04-02 12:34 ` [PATCH v2] " Jason Andryuk
  2018-04-03 19:13   ` Andreas Radke
@ 2018-04-04 20:56   ` Jean Delvare
  2018-04-05 18:38     ` [PATCH v3] " Jason Andryuk
  2018-04-05  1:34   ` [PATCH v2] " Sasha Levin
  2 siblings, 1 reply; 15+ messages in thread
From: Jean Delvare @ 2018-04-04 20:56 UTC (permalink / raw)
  To: Jason Andryuk
  Cc: Wolfram Sang, benjamin.tissoires, andyrtr, aduggan, linux-i2c,
	linux-kernel

Hi Jason,

On Mon,  2 Apr 2018 08:34:35 -0400, Jason Andryuk wrote:
> The HP EliteBook G3 850 has a weird bug where a subsequent cold boot
> hangs while plugged in if Linux enables the Host Notify features of
> i2c-i801.  The cold boot hang depends on how the system boots.  It does
> not hang on UEFI Grub text boot or legacy Grub text boot.  But it does
> hang on legacy Grub graphical boot and Intel Boot Agent PXE text boot.
> Booting unplugged is not affected.
> 
> Disabling the Host Notify feature with disable_feature=0x20 works around
> the bug, so automatically do so based on DMI information.
> 
> More information can be found here:
> https://www.spinics.net/lists/linux-i2c/msg33938.html
> 
> Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
> ---
> I only added my machine to the blacklist, since it's the only one I've
> tested.  More systems can be added when identified and tested.
> 
> v2: Fix open brace on function definition
> 
>  drivers/i2c/busses/i2c-i801.c | 21 +++++++++++++++++++++
>  1 file changed, 21 insertions(+)
> 
> diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c
> index 692b34125866..3e8e613c0801 100644
> --- a/drivers/i2c/busses/i2c-i801.c
> +++ b/drivers/i2c/busses/i2c-i801.c
> @@ -1042,6 +1042,25 @@ static const struct pci_device_id i801_ids[] = {
>  MODULE_DEVICE_TABLE(pci, i801_ids);
>  
>  #if defined CONFIG_X86 && defined CONFIG_DMI
> +static const struct dmi_system_id host_notify_dmi_blacklist[] = {
> +	{
> +		.ident = "HP EliteBook G3 850",
> +		.matches = {
> +			DMI_MATCH(DMI_BOARD_VENDOR, "HP"),
> +			DMI_MATCH(DMI_PRODUCT_NAME, "HP EliteBook 850 G3"),

Please consider using DMI_EXACT_MATCH if possible, as it is faster.

> +		},
> +	},
> +};

Arrays passed to dmi_check_system must be terminated with an empty
element.

> +
> +static void blacklist_features(struct i801_priv *priv)
> +{
> +	if (dmi_check_system(host_notify_dmi_blacklist)) {
> +		dev_warn(&priv->pci_dev->dev,
> +			 "SMBus Host Notify disabled on this system");
> +		priv->features &= ~FEATURE_HOST_NOTIFY;
> +	}
> +}
> +
>  static unsigned char apanel_addr;
>  
>  /* Scan the system ROM for the signature "FJKEYINF" */
> @@ -1159,6 +1178,7 @@ static void i801_probe_optional_slaves(struct i801_priv *priv)
>  #else
>  static void __init input_apanel_init(void) {}
>  static void i801_probe_optional_slaves(struct i801_priv *priv) {}
> +static void blacklist_features(struct i801_priv *priv) {}
>  #endif	/* CONFIG_X86 && CONFIG_DMI */
>  
>  #if IS_ENABLED(CONFIG_I2C_MUX_GPIO) && defined CONFIG_DMI
> @@ -1562,6 +1582,7 @@ static int i801_probe(struct pci_dev *dev, const struct pci_device_id *id)
>  				   i801_feature_names[i]);
>  	}
>  	priv->features &= ~disable_features;
> +	blacklist_features(priv);
>  
>  	err = pcim_enable_device(dev);
>  	if (err) {

Other than that, it looks good to me.

Reviewed-by: Jean Delvare <jdelvare@suse.de>

-- 
Jean Delvare
SUSE L3 Support

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v2] i2c: i801: blacklist Host Notify on HP EliteBook G3 850
  2018-04-02 12:34 ` [PATCH v2] " Jason Andryuk
  2018-04-03 19:13   ` Andreas Radke
  2018-04-04 20:56   ` Jean Delvare
@ 2018-04-05  1:34   ` Sasha Levin
  2018-04-05  7:09     ` Jean Delvare
  2 siblings, 1 reply; 15+ messages in thread
From: Sasha Levin @ 2018-04-05  1:34 UTC (permalink / raw)
  To: Sasha Levin, Jason Andryuk, Jean Delvare, Wolfram Sang
  Cc: benjamin.tissoires, andyrtr, stable

Hi Jason Andryuk.

[This is an automated email]

This commit has been processed by the -stable helper bot and determined
to be a high probability candidate for -stable trees. (score: 5.1557)

The bot has tested the following trees: v4.15.15, v4.14.32, v4.9.92, v4.4.126, 

v4.15.15: Build OK!
v4.14.32: Build OK!
v4.9.92: Build OK!
v4.4.126: Build failed! Errors:
    drivers/i2c/busses/i2c-i801.c:916:22: error: ‘FEATURE_HOST_NOTIFY’ undeclared (first use in this function); did you mean ‘X86_FEATURE_HWP_NOTIFY’?


Please let us know if you'd like to have this patch included in a stable tree.

--
Thanks.
Sasha

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v2] i2c: i801: blacklist Host Notify on HP EliteBook G3 850
  2018-04-05  1:34   ` [PATCH v2] " Sasha Levin
@ 2018-04-05  7:09     ` Jean Delvare
  2018-04-06 20:04       ` Sasha Levin
  0 siblings, 1 reply; 15+ messages in thread
From: Jean Delvare @ 2018-04-05  7:09 UTC (permalink / raw)
  To: Sasha Levin
  Cc: Jason Andryuk, Wolfram Sang, benjamin.tissoires, andyrtr, stable

On Thu, 5 Apr 2018 01:34:22 +0000, Sasha Levin wrote:
> [This is an automated email]
> 
> This commit has been processed by the -stable helper bot and determined
> to be a high probability candidate for -stable trees. (score: 5.1557)

I have to admit I am curious how a bot can determine that. What are the
heuristics?

> The bot has tested the following trees: v4.15.15, v4.14.32, v4.9.92, v4.4.126, 
> 
> v4.15.15: Build OK!
> v4.14.32: Build OK!
> v4.9.92: Build OK!
> v4.4.126: Build failed! Errors:
>     drivers/i2c/busses/i2c-i801.c:916:22: error: ‘FEATURE_HOST_NOTIFY’ undeclared (first use in this function); did you mean ‘X86_FEATURE_HWP_NOTIFY’?

No. If FEATURE_HOST_NOTIFY is not defined, then the patch is not needed
in the first place.

> Please let us know if you'd like to have this patch included in a stable tree.

Yes, I think the next iteration of the patch should be tagged to stable
trees inclusion.

-- 
Jean Delvare
SUSE L3 Support

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH v3] i2c: i801: blacklist Host Notify on HP EliteBook G3 850
  2018-04-04 20:56   ` Jean Delvare
@ 2018-04-05 18:38     ` Jason Andryuk
  2018-04-10  7:38       ` Jean Delvare
  2018-04-10 13:49       ` Sasha Levin
  0 siblings, 2 replies; 15+ messages in thread
From: Jason Andryuk @ 2018-04-05 18:38 UTC (permalink / raw)
  To: Jean Delvare, Wolfram Sang
  Cc: benjamin.tissoires, andyrtr, aduggan, Jason Andryuk, stable,
	linux-i2c, linux-kernel

The HP EliteBook G3 850 has a weird bug where a subsequent cold boot
hangs while plugged in if Linux enables the Host Notify features of
i2c-i801.  The cold boot hang depends on how the system boots.  It does
not hang on UEFI Grub text boot or legacy Grub text boot.  But it does
hang on legacy Grub graphical boot and Intel Boot Agent PXE text boot.
Booting unplugged is not affected.

Disabling the Host Notify feature with disable_feature=0x20 works around
the bug, so automatically do so based on DMI information.

More information can be found here:
https://www.spinics.net/lists/linux-i2c/msg33938.html

Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Cc: stable@vger.kernel.org
---
v3: Switch to DMI_EXACT_MATCH and add empty element to array

 drivers/i2c/busses/i2c-i801.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c
index 692b34125866..11149ddae745 100644
--- a/drivers/i2c/busses/i2c-i801.c
+++ b/drivers/i2c/busses/i2c-i801.c
@@ -1042,6 +1042,27 @@ static const struct pci_device_id i801_ids[] = {
 MODULE_DEVICE_TABLE(pci, i801_ids);
 
 #if defined CONFIG_X86 && defined CONFIG_DMI
+static const struct dmi_system_id host_notify_dmi_blacklist[] = {
+	{
+		.ident = "HP EliteBook G3 850",
+		.matches = {
+			DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "HP"),
+			DMI_EXACT_MATCH(DMI_PRODUCT_NAME,
+					"HP EliteBook 850 G3"),
+		},
+	},
+	{}
+};
+
+static void blacklist_features(struct i801_priv *priv)
+{
+	if (dmi_check_system(host_notify_dmi_blacklist)) {
+		dev_warn(&priv->pci_dev->dev,
+			 "SMBus Host Notify disabled on this system");
+		priv->features &= ~FEATURE_HOST_NOTIFY;
+	}
+}
+
 static unsigned char apanel_addr;
 
 /* Scan the system ROM for the signature "FJKEYINF" */
@@ -1159,6 +1180,7 @@ static void i801_probe_optional_slaves(struct i801_priv *priv)
 #else
 static void __init input_apanel_init(void) {}
 static void i801_probe_optional_slaves(struct i801_priv *priv) {}
+static void blacklist_features(struct i801_priv *priv) {}
 #endif	/* CONFIG_X86 && CONFIG_DMI */
 
 #if IS_ENABLED(CONFIG_I2C_MUX_GPIO) && defined CONFIG_DMI
@@ -1562,6 +1584,7 @@ static int i801_probe(struct pci_dev *dev, const struct pci_device_id *id)
 				   i801_feature_names[i]);
 	}
 	priv->features &= ~disable_features;
+	blacklist_features(priv);
 
 	err = pcim_enable_device(dev);
 	if (err) {
-- 
2.14.3

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH v2] i2c: i801: blacklist Host Notify on HP EliteBook G3 850
  2018-04-04 12:55     ` Jason Andryuk
  2018-04-04 14:02       ` Jean Delvare
@ 2018-04-06 15:23       ` Andreas Radke
  1 sibling, 0 replies; 15+ messages in thread
From: Andreas Radke @ 2018-04-06 15:23 UTC (permalink / raw)
  To: Jason Andryuk
  Cc: Jean Delvare, Wolfram Sang, benjamin.tissoires, aduggan,
	linux-i2c, open list

[-- Attachment #1: Type: text/plain, Size: 535 bytes --]

My boot issue happens right after the BIOS when the initrd should be
loaded and then no grub (v2.0) menu appears.

It seems I could fix it for me disabling  Host Notify + Interrupts with
options i2c_i801 disable_features=0x30 and then rebuilding initrd.
The touchpad is still working. Still testing more days if it will hang
again.

Is there anything further I can do to help? I can't tell when this hang
was introduced. When I received the HP Arch was running 4.9 lts kernel
and it already hung there.

-Andy
Arch linux

[-- Attachment #2: Digitale Signatur von OpenPGP --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v2] i2c: i801: blacklist Host Notify on HP EliteBook G3 850
  2018-04-05  7:09     ` Jean Delvare
@ 2018-04-06 20:04       ` Sasha Levin
  0 siblings, 0 replies; 15+ messages in thread
From: Sasha Levin @ 2018-04-06 20:04 UTC (permalink / raw)
  To: Jean Delvare
  Cc: Jason Andryuk, Wolfram Sang, benjamin.tissoires, andyrtr, stable

On Thu, Apr 05, 2018 at 09:09:43AM +0200, Jean Delvare wrote:
>On Thu, 5 Apr 2018 01:34:22 +0000, Sasha Levin wrote:
>> [This is an automated email]
>>
>> This commit has been processed by the -stable helper bot and determined
>> to be a high probability candidate for -stable trees. (score: 5.1557)
>
>I have to admit I am curious how a bot can determine that. What are the
>heuristics?

Things like code metrics, words in the commit message, files changed,
author, who reviewed/signed-off/etc.

See https://soarsmu.github.io/papers/icse12-patch.pdf for some academic
background :)

--
Thanks,
Sasha

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v3] i2c: i801: blacklist Host Notify on HP EliteBook G3 850
  2018-04-05 18:38     ` [PATCH v3] " Jason Andryuk
@ 2018-04-10  7:38       ` Jean Delvare
  2018-04-10  9:10         ` Wolfram Sang
  2018-04-10 13:49       ` Sasha Levin
  1 sibling, 1 reply; 15+ messages in thread
From: Jean Delvare @ 2018-04-10  7:38 UTC (permalink / raw)
  To: Jason Andryuk
  Cc: Wolfram Sang, benjamin.tissoires, andyrtr, aduggan, stable,
	linux-i2c, linux-kernel

On Thu,  5 Apr 2018 14:38:24 -0400, Jason Andryuk wrote:
> The HP EliteBook G3 850 has a weird bug where a subsequent cold boot
> hangs while plugged in if Linux enables the Host Notify features of
> i2c-i801.  The cold boot hang depends on how the system boots.  It does
> not hang on UEFI Grub text boot or legacy Grub text boot.  But it does
> hang on legacy Grub graphical boot and Intel Boot Agent PXE text boot.
> Booting unplugged is not affected.
> 
> Disabling the Host Notify feature with disable_feature=0x20 works around
> the bug, so automatically do so based on DMI information.
> 
> More information can be found here:
> https://www.spinics.net/lists/linux-i2c/msg33938.html
> 
> Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
> Reviewed-by: Jean Delvare <jdelvare@suse.de>
> Cc: stable@vger.kernel.org
> ---
> v3: Switch to DMI_EXACT_MATCH and add empty element to array
> 
>  drivers/i2c/busses/i2c-i801.c | 23 +++++++++++++++++++++++
>  1 file changed, 23 insertions(+)
> (...)

Wolfram and stable, please hold on with this patch, Jason and I may have
found a proper fix so blacklisting would no longer be needed.

-- 
Jean Delvare
SUSE L3 Support

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v3] i2c: i801: blacklist Host Notify on HP EliteBook G3 850
  2018-04-10  7:38       ` Jean Delvare
@ 2018-04-10  9:10         ` Wolfram Sang
  0 siblings, 0 replies; 15+ messages in thread
From: Wolfram Sang @ 2018-04-10  9:10 UTC (permalink / raw)
  To: Jean Delvare
  Cc: Jason Andryuk, benjamin.tissoires, andyrtr, aduggan, stable,
	linux-i2c, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 289 bytes --]


> >  drivers/i2c/busses/i2c-i801.c | 23 +++++++++++++++++++++++
> >  1 file changed, 23 insertions(+)
> > (...)
> 
> Wolfram and stable, please hold on with this patch, Jason and I may have
> found a proper fix so blacklisting would no longer be needed.

Awesome, thanks Jean!


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v3] i2c: i801: blacklist Host Notify on HP EliteBook G3 850
  2018-04-05 18:38     ` [PATCH v3] " Jason Andryuk
  2018-04-10  7:38       ` Jean Delvare
@ 2018-04-10 13:49       ` Sasha Levin
  2018-04-10 14:39         ` Jean Delvare
  1 sibling, 1 reply; 15+ messages in thread
From: Sasha Levin @ 2018-04-10 13:49 UTC (permalink / raw)
  To: Sasha Levin, Jason Andryuk, Jean Delvare, Wolfram Sang
  Cc: benjamin.tissoires, andyrtr, stable, stable

Hi,

[This is an automated email]

This commit has been processed because it contains a -stable tag.
The stable tag indicates that it's relevant for the following trees: all

The bot has tested the following trees: v4.16.1, v4.15.16, v4.14.33, v4.9.93, v4.4.127.

v4.16.1: Build OK!
v4.15.16: Build OK!
v4.14.33: Build OK!
v4.9.93: Build OK!
v4.4.127: Build failed! Errors:
    i2c-i801.c:918:22: error: ‘FEATURE_HOST_NOTIFY’ undeclared (first use in this function); did you mean ‘X86_FEATURE_HWP_NOTIFY’?


Please let us know if you'd like to have this patch included in a stable tree.

--
Thanks,
Sasha

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v3] i2c: i801: blacklist Host Notify on HP EliteBook G3 850
  2018-04-10 13:49       ` Sasha Levin
@ 2018-04-10 14:39         ` Jean Delvare
  0 siblings, 0 replies; 15+ messages in thread
From: Jean Delvare @ 2018-04-10 14:39 UTC (permalink / raw)
  To: Sasha Levin, Jason Andryuk, Wolfram Sang
  Cc: benjamin.tissoires, andyrtr, stable

On mar., 2018-04-10 at 13:49 +0000, Sasha Levin wrote:
> Hi,
> 
> [This is an automated email]
> 
> This commit has been processed because it contains a -stable tag.
> The stable tag indicates that it's relevant for the following trees: all
> 
> The bot has tested the following trees: v4.16.1, v4.15.16, v4.14.33, v4.9.93, v4.4.127.
> 
> v4.16.1: Build OK!
> v4.15.16: Build OK!
> v4.14.33: Build OK!
> v4.9.93: Build OK!
> v4.4.127: Build failed! Errors:
>     i2c-i801.c:918:22: error: ‘FEATURE_HOST_NOTIFY’ undeclared (first use in this function); did you mean ‘X86_FEATURE_HWP_NOTIFY’?
> 
> 
> Please let us know if you'd like to have this patch included in a stable tree.

Nack. As stated somewhere else in this thread, odds are that this
blacklisting won't be needed after all.

-- 
Jean Delvare
SUSE L3 Support

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2018-04-10 14:39 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-02 12:25 [PATCH] i2c: i801: blacklist Host Notify on HP EliteBook G3 850 Jason Andryuk
2018-04-02 12:34 ` [PATCH v2] " Jason Andryuk
2018-04-03 19:13   ` Andreas Radke
2018-04-04 12:55     ` Jason Andryuk
2018-04-04 14:02       ` Jean Delvare
2018-04-06 15:23       ` Andreas Radke
2018-04-04 20:56   ` Jean Delvare
2018-04-05 18:38     ` [PATCH v3] " Jason Andryuk
2018-04-10  7:38       ` Jean Delvare
2018-04-10  9:10         ` Wolfram Sang
2018-04-10 13:49       ` Sasha Levin
2018-04-10 14:39         ` Jean Delvare
2018-04-05  1:34   ` [PATCH v2] " Sasha Levin
2018-04-05  7:09     ` Jean Delvare
2018-04-06 20:04       ` Sasha Levin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.