diff mbox series

ipmi:pci: Blacklist a Realtek "IPMI" device

Message ID fe18b975-a577-8b09-c1cc-488356fc60a7@molgen.mpg.de
State Superseded
Headers show
Series ipmi:pci: Blacklist a Realtek "IPMI" device | expand

Commit Message

Paul Menzel Jan. 23, 2019, 4:27 p.m. UTC
From: Corey Minyard <cminyard@mvista.com>

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 <chiu@endlessm.com>
Signed-off-by: Corey Minyard <cminyard@mvista.com>

Tested-by: Daniel Drake <drake@endlessm.com>


[ 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 <pmenzel@molgen.mpg.de>

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

-- 
2.17.1

Comments

Greg Kroah-Hartman Jan. 23, 2019, 4:32 p.m. UTC | #1
On Wed, Jan 23, 2019 at 05:27:51PM +0100, Paul Menzel wrote:
> From: Corey Minyard <cminyard@mvista.com>

> 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 <chiu@endlessm.com>

> Signed-off-by: Corey Minyard <cminyard@mvista.com>

> Tested-by: Daniel Drake <drake@endlessm.com>

> 

> [ 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 <pmenzel@molgen.mpg.de>

> ---

>  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
diff mbox series

Patch

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;