2018-04-02 12:27:31

by Jason Andryuk

[permalink] [raw]
Subject: [PATCH] i2c: i801: blacklist Host Notify on HP EliteBook G3 850

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 <[email protected]>
---
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



2018-04-02 12:36:04

by Jason Andryuk

[permalink] [raw]
Subject: [PATCH v2] i2c: i801: blacklist Host Notify on HP EliteBook G3 850

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 <[email protected]>
---
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


2018-04-03 19:22:17

by Andreas Radke

[permalink] [raw]
Subject: Re: [PATCH v2] i2c: i801: blacklist Host Notify on HP EliteBook G3 850

Am Mon, 2 Apr 2018 08:34:35 -0400
schrieb Jason Andryuk <[email protected]>:

> 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


Attachments:
(No filename) (499.00 B)
Digitale Signatur von OpenPGP

2018-04-04 12:58:28

by Jason Andryuk

[permalink] [raw]
Subject: Re: [PATCH v2] i2c: i801: blacklist Host Notify on HP EliteBook G3 850

On Tue, Apr 3, 2018 at 3:13 PM, Andreas Radke <[email protected]> wrote:
> Am Mon, 2 Apr 2018 08:34:35 -0400
> schrieb Jason Andryuk <[email protected]>:
>
>> 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

2018-04-04 14:04:52

by Jean Delvare

[permalink] [raw]
Subject: Re: [PATCH v2] i2c: i801: blacklist Host Notify on HP EliteBook G3 850

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 <[email protected]> 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

2018-04-04 20:58:09

by Jean Delvare

[permalink] [raw]
Subject: Re: [PATCH v2] i2c: i801: blacklist Host Notify on HP EliteBook G3 850

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 <[email protected]>
> ---
> 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 <[email protected]>

--
Jean Delvare
SUSE L3 Support

2018-04-05 18:40:16

by Jason Andryuk

[permalink] [raw]
Subject: [PATCH v3] i2c: i801: blacklist Host Notify on HP EliteBook G3 850

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 <[email protected]>
Reviewed-by: Jean Delvare <[email protected]>
Cc: [email protected]
---
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


2018-04-06 15:26:02

by Andreas Radke

[permalink] [raw]
Subject: Re: [PATCH v2] i2c: i801: blacklist Host Notify on HP EliteBook G3 850

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


Attachments:
(No filename) (499.00 B)
Digitale Signatur von OpenPGP

2018-04-10 07:43:08

by Jean Delvare

[permalink] [raw]
Subject: Re: [PATCH v3] i2c: i801: blacklist Host Notify on HP EliteBook G3 850

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 <[email protected]>
> Reviewed-by: Jean Delvare <[email protected]>
> Cc: [email protected]
> ---
> 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

2018-04-10 09:14:26

by Wolfram Sang

[permalink] [raw]
Subject: Re: [PATCH v3] i2c: i801: blacklist Host Notify on HP EliteBook G3 850


> > 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!


Attachments:
(No filename) (289.00 B)
signature.asc (849.00 B)
Download all attachments