2019-01-22 16:19:50

by Paul Menzel

[permalink] [raw]
Subject: ipmi_si: 90 s delay in system start with 4.14.94, but not 4.18.6

Dear Linux folks,


Using Linux 4.14.94 on a HP EliteDesk 705 G4 MT desktop system, there
is a 100 s delay during boot.

```
[ 0.000000] Linux version 4.14.94.mx64.239 ([email protected]) (gcc version 7.3.0 (GCC)) #1 SMP Mon Jan 21 11:39:45 CET 2019
[…]
[ 3.263092] ipmi message handler version 39.2
[ 3.263520] ipmi device interface
[ 3.263893] IPMI System Interface driver.
[ 3.264325] ipmi_si 0000:06:00.3: probing via PCI
[ 3.264804] ipmi_si 0000:06:00.3: [io 0x3000-0x30ff] regsize 1 spacing 1 irq 39
[ 3.265496] ipmi_si: Adding PCI-specified kcs state machine
[ 3.266019] ipmi_si: Trying PCI-specified kcs state machine at i/o address 0x3000, slave address 0x0, irq 39
[ 4.255042] tsc: Refined TSC clocksource calibration: 3593.250 MHz
[ 4.255618] clocksource: tsc: mask: 0xffffffffffffffff max_cycles: 0x33cb6addeae, max_idle_ns: 440795225061 ns
[ 5.264130] clocksource: Switched to clocksource tsc
[ 104.978023] ipmi_si 0000:06:00.3: There appears to be no BMC at this location
[ 104.978658] IPMI Watchdog: driver initialized
[ 104.979095] Copyright (C) 2004 MontaVista Software - IPMI Powerdown via sys_reboot.
[…]
```

Testing Linux 4.18.6 and 4.20, there is no such delay.

```
[ 0.000000] Linux version 4.18.6.mx64.221 ([email protected]) (gcc version 7.3.0 (GCC)) #1 SMP Thu Sep 6 07:51:05 CEST 2018
[…]
[ 2.951174] ipmi message handler version 39.2
[ 2.951604] ipmi device interface
[ 2.951973] IPMI System Interface driver.
[ 2.952404] ipmi_si: Unable to find any System Interface(s)
[ 2.952909] IPMI Watchdog: driver initialized
[ 2.953339] Copyright (C) 2004 MontaVista Software - IPMI Powerdown via sys_reboot.
[ 2.954053] input: Power Button as /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0C:00/input/input0
[…]
```

Do you have a suggestion, what commit might have fixed this? Quickly
going through the commit history, it looks like, last year a lot of
bug fixes and clean-up was done.

If nobody knows, I might bisect to find the commit fixing this, but
will probably put more effort into updating the system to the Linux
4.19 series, where the only problem holding us back is that Nvidia’s
driver 390.87 needs to be patched.


Kind regards,

Paul


Attachments:
=?utf-8?Q?hp-elitedesk-705=E2=80=93linux=5F4=2E14=2E94=E2=80=93messages=2Etxt?= (70.28 kB)
=?utf-8?Q?hp-elitedesk-705=E2=80=93linux=5F4=2E18=2E6=E2=80=93messages=2Etxt?= (71.07 kB)
smime.p7s (5.05 kB)
S/MIME Cryptographic Signature
Download all attachments

2019-01-22 21:04:13

by Corey Minyard

[permalink] [raw]
Subject: Re: ipmi_si: 90 s delay in system start with 4.14.94, but not 4.18.6

On 1/22/19 10:17 AM, Paul Menzel wrote:
> Dear Linux folks,
>
>
> Using Linux 4.14.94 on a HP EliteDesk 705 G4 MT desktop system, there
> is a 100 s delay during boot.
>
> ```
> [ 0.000000] Linux version 4.14.94.mx64.239 ([email protected]) (gcc version 7.3.0 (GCC)) #1 SMP Mon Jan 21 11:39:45 CET 2019
> […]
> [ 3.263092] ipmi message handler version 39.2
> [ 3.263520] ipmi device interface
> [ 3.263893] IPMI System Interface driver.
> [ 3.264325] ipmi_si 0000:06:00.3: probing via PCI
> [ 3.264804] ipmi_si 0000:06:00.3: [io 0x3000-0x30ff] regsize 1 spacing 1 irq 39
> [ 3.265496] ipmi_si: Adding PCI-specified kcs state machine
> [ 3.266019] ipmi_si: Trying PCI-specified kcs state machine at i/o address 0x3000, slave address 0x0, irq 39
> [ 4.255042] tsc: Refined TSC clocksource calibration: 3593.250 MHz
> [ 4.255618] clocksource: tsc: mask: 0xffffffffffffffff max_cycles: 0x33cb6addeae, max_idle_ns: 440795225061 ns
> [ 5.264130] clocksource: Switched to clocksource tsc
> [ 104.978023] ipmi_si 0000:06:00.3: There appears to be no BMC at this location
> [ 104.978658] IPMI Watchdog: driver initialized
> [ 104.979095] Copyright (C) 2004 MontaVista Software - IPMI Powerdown via sys_reboot.
> […]
> ```
>
> Testing Linux 4.18.6 and 4.20, there is no such delay.
>
> ```
> [ 0.000000] Linux version 4.18.6.mx64.221 ([email protected]) (gcc version 7.3.0 (GCC)) #1 SMP Thu Sep 6 07:51:05 CEST 2018
> […]
> [ 2.951174] ipmi message handler version 39.2
> [ 2.951604] ipmi device interface
> [ 2.951973] IPMI System Interface driver.
> [ 2.952404] ipmi_si: Unable to find any System Interface(s)
> [ 2.952909] IPMI Watchdog: driver initialized
> [ 2.953339] Copyright (C) 2004 MontaVista Software - IPMI Powerdown via sys_reboot.
> [ 2.954053] input: Power Button as /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0C:00/input/input0
> […]
> ```
>
> Do you have a suggestion, what commit might have fixed this? Quickly
> going through the commit history, it looks like, last year a lot of
> bug fixes and clean-up was done.

That's really strange.  Generally when something like this happens, it
means that there is sort of an IPMI interface there, but it's not complete.
This happens when the low-level hardware is there, but there is no
processor behind it to actually do anything.

But as you can see, in 4.18 it wasn't detecting anything, and in 4.19
it is seeing an IPMI device on the PCI bus.  The discovery here is done
by the PCI code, it's out of the IPMI drivers hands until the PCI code
delivers it.

So what I'm guessing is that something changed so that the PCI
code is now recognising that there is an IPMI device there by the
PCI class codes.  There really isn't a device completely there, so
it doesn't work.

I don't see anything in the IPMI code that would cause that.

If this is a problem, the device can be blacklisted in
ipmi_pci_blacklist in ipmi_si_pci.c.

-corey


>
> If nobody knows, I might bisect to find the commit fixing this, but
> will probably put more effort into updating the system to the Linux
> 4.19 series, where the only problem holding us back is that Nvidia’s
> driver 390.87 needs to be patched.
>
>
> Kind regards,
>
> Paul



2019-01-23 16:26:56

by Paul Menzel

[permalink] [raw]
Subject: Re: ipmi_si: 90 s delay in system start with 4.14.94, but not 4.18.6

Dear Corey,


On 01/22/19 21:58, Corey Minyard wrote:
> On 1/22/19 10:17 AM, Paul Menzel wrote:

>> Using Linux 4.14.94 on a HP EliteDesk 705 G4 MT desktop system, there
>> is a 100 s delay during boot.
>>
>> ```
>> [    0.000000] Linux version 4.14.94.mx64.239 ([email protected]) (gcc version 7.3.0 (GCC)) #1 SMP Mon Jan 21 11:39:45 CET 2019
>> […]
>> [    3.263092] ipmi message handler version 39.2
>> [    3.263520] ipmi device interface
>> [    3.263893] IPMI System Interface driver.
>> [    3.264325] ipmi_si 0000:06:00.3: probing via PCI
>> [    3.264804] ipmi_si 0000:06:00.3: [io  0x3000-0x30ff] regsize 1 spacing 1 irq 39
>> [    3.265496] ipmi_si: Adding PCI-specified kcs state machine
>> [    3.266019] ipmi_si: Trying PCI-specified kcs state machine at i/o address 0x3000, slave address 0x0, irq 39
>> [    4.255042] tsc: Refined TSC clocksource calibration: 3593.250 MHz
>> [    4.255618] clocksource: tsc: mask: 0xffffffffffffffff max_cycles: 0x33cb6addeae, max_idle_ns: 440795225061 ns
>> [    5.264130] clocksource: Switched to clocksource tsc
>> [  104.978023] ipmi_si 0000:06:00.3: There appears to be no BMC at this location
>> [  104.978658] IPMI Watchdog: driver initialized
>> [  104.979095] Copyright (C) 2004 MontaVista Software - IPMI Powerdown via sys_reboot.
>> […]
>> ```
>>
>> Testing Linux 4.18.6 and 4.20, there is no such delay.
>>
>> ```
>> [    0.000000] Linux version 4.18.6.mx64.221 ([email protected]) (gcc version 7.3.0 (GCC)) #1 SMP Thu Sep 6 07:51:05 CEST 2018
>> […]
>> [    2.951174] ipmi message handler version 39.2
>> [    2.951604] ipmi device interface
>> [    2.951973] IPMI System Interface driver.
>> [    2.952404] ipmi_si: Unable to find any System Interface(s)
>> [    2.952909] IPMI Watchdog: driver initialized
>> [    2.953339] Copyright (C) 2004 MontaVista Software - IPMI Powerdown via sys_reboot.
>> [    2.954053] input: Power Button as /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0C:00/input/input0
>> […]
>> ```
>>
>> Do you have a suggestion, what commit might have fixed this? Quickly
>> going through the commit history, it looks like, last year a lot of
>> bug fixes and clean-up was done.
>
> That's really strange.  Generally when something like this happens, it
> means that there is sort of an IPMI interface there, but it's not complete.
> This happens when the low-level hardware is there, but there is no
> processor behind it to actually do anything.
>
> But as you can see, in 4.18 it wasn't detecting anything, and in 4.19
> it is seeing an IPMI device on the PCI bus.  The discovery here is done
> by the PCI code, it's out of the IPMI drivers hands until the PCI code
> delivers it.
>
> So what I'm guessing is that something changed so that the PCI
> code is now recognising that there is an IPMI device there by the
> PCI class codes.  There really isn't a device completely there, so
> it doesn't work.
>
> I don't see anything in the IPMI code that would cause that.
>
> If this is a problem, the device can be blacklisted in
> ipmi_pci_blacklist in ipmi_si_pci.c.

For whatever reason, I didn’t read that last paragraph, so bisection
brought me to your commit bc48fa1b9d (ipmi:pci: Blacklist a Realtek
"IPMI" device) doing exactly that, blacklisting the device.

$ lspci -nn -s 06:00.3
06:00.3 IPMI SMIC interface [0c07]: Realtek Semiconductor Co., Ltd. Device [10ec:816c] (rev 0e)

I’ll backported it to Linux 4.14.x, and send the commit to
[email protected].

[…]


Kind regards,

Paul


[1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=bc48fa1b9d3b04106055b27078da824cd209865a


Attachments:
smime.p7s (5.05 kB)
S/MIME Cryptographic Signature

2019-01-23 16:30:40

by Paul Menzel

[permalink] [raw]
Subject: [PATCH] ipmi:pci: Blacklist a Realtek "IPMI" device

From: Corey Minyard <[email protected]>
Date: Thu, 15 Feb 2018 16:58:26 -0600

[ upstream commit bc48fa1b9d3b04106055b27078da824cd209865a ]

Realtek has some sort of "Virtual" IPMI device on the PCI bus as a
KCS controller, but whatever it is, it's not one. Ignore it if seen.

Reported-by: Chris Chiu <[email protected]>
Signed-off-by: Corey Minyard <[email protected]>
Tested-by: Daniel Drake <[email protected]>

[ Commit 13d0b35c (ipmi_si: Move PCI setup to another file) from Linux
4.15-rc1 has not been back ported, so the PCI code is still in
`drivers/char/ipmi/ipmi_si_intf.c`, requiring to apply the commit
manually.

This fixes a 100 s boot delay on the HP EliteDesk 705 G4 MT with Linux
4.14.94. ]

Signed-off-by: Paul Menzel <[email protected]>
---
drivers/char/ipmi/ipmi_si_intf.c | 12 ++++++++++++
1 file changed, 12 insertions(+)

diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
index c04aa11f0e21..6d18f8090cea 100644
--- a/drivers/char/ipmi/ipmi_si_intf.c
+++ b/drivers/char/ipmi/ipmi_si_intf.c
@@ -2447,6 +2447,15 @@ static int ipmi_pci_probe_regspacing(struct smi_info *info)
return DEFAULT_REGSPACING;
}

+static struct pci_device_id ipmi_pci_blacklist[] = {
+ /*
+ * This is a "Virtual IPMI device", whatever that is. It appears
+ * as a KCS device by the class, but it is not one.
+ */
+ { PCI_VDEVICE(REALTEK, 0x816c) },
+ { 0, }
+};
+
static int ipmi_pci_probe(struct pci_dev *pdev,
const struct pci_device_id *ent)
{
@@ -2454,6 +2463,9 @@ static int ipmi_pci_probe(struct pci_dev *pdev,
int class_type = pdev->class & PCI_ERMC_CLASSCODE_TYPE_MASK;
struct smi_info *info;

+ if (pci_match_id(ipmi_pci_blacklist, pdev))
+ return -ENODEV;
+
info = smi_info_alloc();
if (!info)
return -ENOMEM;
--
2.17.1


Attachments:
smime.p7s (5.05 kB)
S/MIME Cryptographic Signature

2019-01-23 16:33:46

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH] ipmi:pci: Blacklist a Realtek "IPMI" device

On Wed, Jan 23, 2019 at 05:27:51PM +0100, Paul Menzel wrote:
> From: Corey Minyard <[email protected]>
> Date: Thu, 15 Feb 2018 16:58:26 -0600
>
> [ upstream commit bc48fa1b9d3b04106055b27078da824cd209865a ]
>
> Realtek has some sort of "Virtual" IPMI device on the PCI bus as a
> KCS controller, but whatever it is, it's not one. Ignore it if seen.
>
> Reported-by: Chris Chiu <[email protected]>
> Signed-off-by: Corey Minyard <[email protected]>
> Tested-by: Daniel Drake <[email protected]>
>
> [ Commit 13d0b35c (ipmi_si: Move PCI setup to another file) from Linux
> 4.15-rc1 has not been back ported, so the PCI code is still in
> `drivers/char/ipmi/ipmi_si_intf.c`, requiring to apply the commit
> manually.
>
> This fixes a 100 s boot delay on the HP EliteDesk 705 G4 MT with Linux
> 4.14.94. ]
>
> Signed-off-by: Paul Menzel <[email protected]>
> ---
> drivers/char/ipmi/ipmi_si_intf.c | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
> index c04aa11f0e21..6d18f8090cea 100644
> --- a/drivers/char/ipmi/ipmi_si_intf.c
> +++ b/drivers/char/ipmi/ipmi_si_intf.c
> @@ -2447,6 +2447,15 @@ static int ipmi_pci_probe_regspacing(struct smi_info *info)
> return DEFAULT_REGSPACING;
> }
>
> +static struct pci_device_id ipmi_pci_blacklist[] = {
> + /*
> + * This is a "Virtual IPMI device", whatever that is. It appears
> + * as a KCS device by the class, but it is not one.
> + */
> + { PCI_VDEVICE(REALTEK, 0x816c) },
> + { 0, }
> +};
> +
> static int ipmi_pci_probe(struct pci_dev *pdev,
> const struct pci_device_id *ent)
> {
> @@ -2454,6 +2463,9 @@ static int ipmi_pci_probe(struct pci_dev *pdev,
> int class_type = pdev->class & PCI_ERMC_CLASSCODE_TYPE_MASK;
> struct smi_info *info;
>
> + if (pci_match_id(ipmi_pci_blacklist, pdev))
> + return -ENODEV;
> +

Your patch does not have tabs where it should have tabs :(

Can you fix this up and resend?

thanks,

greg k-h

2019-01-23 16:47:56

by Paul Menzel

[permalink] [raw]
Subject: [PATCH v2] ipmi:pci: Blacklist a Realtek "IPMI" device

From: Corey Minyard <[email protected]>
Date: Thu, 15 Feb 2018 16:58:26 -0600

[ upstream commit bc48fa1b9d3b04106055b27078da824cd209865a ]

Realtek has some sort of "Virtual" IPMI device on the PCI bus as a
KCS controller, but whatever it is, it's not one. Ignore it if seen.

Reported-by: Chris Chiu <[email protected]>
Signed-off-by: Corey Minyard <[email protected]>
Tested-by: Daniel Drake <[email protected]>

[ Commit 13d0b35c (ipmi_si: Move PCI setup to another file) from Linux
4.15-rc1 has not been back ported, so the PCI code is still in
`drivers/char/ipmi/ipmi_si_intf.c`, requiring to apply the commit
manually.

This fixes a 100 s boot delay on the HP EliteDesk 705 G4 MT with Linux
4.14.94. ]

Signed-off-by: Paul Menzel <[email protected]>
---

v2: Use tabs. Sorry for messing that up.

drivers/char/ipmi/ipmi_si_intf.c | 12 ++++++++++++
1 file changed, 12 insertions(+)

diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
index c04aa11f0e21..a106cf7b5ee0 100644
--- a/drivers/char/ipmi/ipmi_si_intf.c
+++ b/drivers/char/ipmi/ipmi_si_intf.c
@@ -2447,6 +2447,15 @@ static int ipmi_pci_probe_regspacing(struct smi_info *info)
return DEFAULT_REGSPACING;
}

+static struct pci_device_id ipmi_pci_blacklist[] = {
+ /*
+ * This is a "Virtual IPMI device", whatever that is. It appears
+ * as a KCS device by the class, but it is not one.
+ */
+ { PCI_VDEVICE(REALTEK, 0x816c) },
+ { 0, }
+};
+
static int ipmi_pci_probe(struct pci_dev *pdev,
const struct pci_device_id *ent)
{
@@ -2454,6 +2463,9 @@ static int ipmi_pci_probe(struct pci_dev *pdev,
int class_type = pdev->class & PCI_ERMC_CLASSCODE_TYPE_MASK;
struct smi_info *info;

+ if (pci_match_id(ipmi_pci_blacklist, pdev))
+ return -ENODEV;
+
info = smi_info_alloc();
if (!info)
return -ENOMEM;
--
2.17.1


Attachments:
smime.p7s (5.05 kB)
S/MIME Cryptographic Signature

2019-01-24 17:54:58

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH v2] ipmi:pci: Blacklist a Realtek "IPMI" device

On Wed, Jan 23, 2019 at 05:44:57PM +0100, Paul Menzel wrote:
> From: Corey Minyard <[email protected]>
> Date: Thu, 15 Feb 2018 16:58:26 -0600
>
> [ upstream commit bc48fa1b9d3b04106055b27078da824cd209865a ]
>
> Realtek has some sort of "Virtual" IPMI device on the PCI bus as a
> KCS controller, but whatever it is, it's not one. Ignore it if seen.
>
> Reported-by: Chris Chiu <[email protected]>
> Signed-off-by: Corey Minyard <[email protected]>
> Tested-by: Daniel Drake <[email protected]>
>
> [ Commit 13d0b35c (ipmi_si: Move PCI setup to another file) from Linux
> 4.15-rc1 has not been back ported, so the PCI code is still in
> `drivers/char/ipmi/ipmi_si_intf.c`, requiring to apply the commit
> manually.
>
> This fixes a 100 s boot delay on the HP EliteDesk 705 G4 MT with Linux
> 4.14.94. ]
>
> Signed-off-by: Paul Menzel <[email protected]>
> ---
>
> v2: Use tabs. Sorry for messing that up.

That worked, thanks.

greg k-h