i2c: i801: blacklist Host Notify on HP EliteBook G3 850
PATCH 1/1 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
---
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(+)
drivers/i2c/busses/i2c-i801.c +20 -0
@@ -1042,6 +1042,24 @@ static const struct pci_device_id i801_ids[] = {MODULE_DEVICE_TABLE (pci, i801_ids);#if definedCONFIG_X86 && definedCONFIG_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 ) && definedCONFIG_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) {
Signature · 1 line
2.14.3
PATCH v2 1/1 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
---
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(+)
drivers/i2c/busses/i2c-i801.c +21 -0
@@ -1042,6 +1042,25 @@ static const struct pci_device_id i801_ids[] = {MODULE_DEVICE_TABLE (pci, i801_ids);#if definedCONFIG_X86 && definedCONFIG_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 ) && definedCONFIG_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) {
Signature · 1 line
2.14.3
Am Mon, 2 Apr 2018 08:34:35 -0400
schrieb Jason Andryuk <[email protected]>:
Quoted 7 lines
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.
Quoted 5 lines
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 -mi2c_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
Quoted 13 lines · Andreas Radke
Am Mon, 2 Apr 2018 08:34:35 -0400
schrieb Jason Andryuk <[email protected]>:Quoted 10 lines
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.
Quoted 7 lines
Quoted 2 lines
More information can be found here:
https://www.spinics.net/lists/linux-i2c/msg33938.htmlI'm faced with similar cold boot issues on my HP ProBook 430 G4 model. Trying your hint with adding
"optionsi2c_i801disable_features=0x20"
to/etc/modprobe.d/i2c_i801.confdoesn'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.
Quoted 2 lines
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.
Quoted 1 line
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.
Quoted 1 line
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
Hi Jason, Andreas,
Quoted 11 lines · Jason Andryuk
Quoted 4 lines · Andreas Radke
I'm faced with similar cold boot issues on my HP ProBook 430 G4 model. Trying your hint with adding
"optionsi2c_i801disable_features=0x20"
to/etc/modprobe.d/i2c_i801.confdoesn'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.)
Quoted 10 lines
Quoted 2 lines
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.
Quoted 8 lines
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.
Signature · 2 lines
Jean Delvare SUSE L3 Support
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
Hi Jason,
Quoted 28 lines · Jason Andryuk
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.htmlSigned-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(+)drivers/i2c/busses/i2c-i801.c +0
-0
drivers/i2c/busses/i2c-i801.c static const struct pci_device_id i801_ids[] = { · line 1050
Quoted 9 lines
drivers/i2c/busses/i2c-i801.c +6
-0@@ -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.
drivers/i2c/busses/i2c-i801.c static const struct pci_device_id i801_ids[] = { · line 1053
Quoted 3 lines
drivers/i2c/busses/i2c-i801.c +3
-0+ }, + }, +};
Arrays passed to dmi_check_system must be terminated with an empty element.
Quoted 22 lines
drivers/i2c/busses/i2c-i801.c +11
-0+ +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 ) && definedCONFIG_DMI
drivers/i2c/busses/i2c-i801.c static int i801_probe(struct pci_dev *dev, const struct pci_device_id *id) · line 1588
Quoted 7 lines
drivers/i2c/busses/i2c-i801.c +1
-0@@ -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.
Signature · 2 lines
Jean Delvare SUSE L3 Support
PATCH v3 1/1 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
---
v3: Switch to DMI_EXACT_MATCH and add empty element to array
drivers/i2c/busses/i2c-i801.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+)
drivers/i2c/busses/i2c-i801.c +23 -0
@@ -1042,6 +1042,27 @@ static const struct pci_device_id i801_ids[] = {MODULE_DEVICE_TABLE (pci, i801_ids);#if definedCONFIG_X86 && definedCONFIG_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 ) && definedCONFIG_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) {
Signature · 1 line
2.14.3
Quoted 16 lines · Jason Andryuk
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.htmlSigned-off-by Jason Andryuk <[email protected]>Reviewed-by Jean Delvare <[email protected]>
Quoted 6 lines
---
v3: Switch toDMI_EXACT_MATCHand add empty element to arraydrivers/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.
Signature · 2 lines
Jean Delvare SUSE L3 Support
Quoted 7 lines
Quoted 4 lines
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!
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
Jean Delvare
maintainerQuoted 17 lines · Sasha Levin
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’?
Quoted 1 line
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.
Signature · 2 lines
Jean Delvare SUSE L3 Support
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
Quoted 4 lines · Sasha Levin
[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?
Quoted 7 lines
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.
Quoted 1 line
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.
Signature · 2 lines
Jean Delvare SUSE L3 Support
Quoted 8 lines · Jean Delvare
Quoted 4 lines · Sasha Levin
[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