Skip to contentSkip to conversation

fix NULL device in ipmi_si error message

PATCH In review Meelis Roos 2 participants 2 messages Jun 6, 2018 IPMI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix NULL device in ipmi_si error message

I noticed that 4.17.0 logs the follwing during ipmi_si setup:

ipmi_si 0000:01:04.6: probing via PCI
(NULL device *): Could not setup I/O space
ipmi_si 0000:01:04.6: [mem 0xf5ef0000-0xf5ef00ff] regsize 1 spacing 1 irq 21

Fix the "NULL device *) by moving io.dev assignment before its potential use by ipmi_pci_probe_regspacing().

Result:
ipmi_si 0000:01:04.6: probing via PCI
ipmi_si 0000:01:04.6: Could not setup I/O space
ipmi_si 0000:01:04.6: [mem 0xf5ef0000-0xf5ef00ff] regsize 1 spacing 1 irq 21

drivers/char/ipmi/ipmi_si_pci.c +2 -2
index f54ca6869ed2..022e03634ce2 100644
@@ -120,6 +120,8 @@ static int ipmi_pci_probe(struct pci_dev *pdev,
 	}
 	io.addr_data = pci_resource_start(pdev, 0);
 
+	io.dev = &pdev->dev;
+
 	io.regspacing = ipmi_pci_probe_regspacing(&io);
 	io.regsize = DEFAULT_REGSIZE;
 	io.regshift = 0;
@@ -128,8 +130,6 @@ static int ipmi_pci_probe(struct pci_dev *pdev,
 	if (io.irq)
 		io.irq_setup = ipmi_std_irq_setup;
 
-	io.dev = &pdev->dev;
-
 	dev_info(&pdev->dev, "%pR regsize %d spacing %d irq %d\n",
 		&pdev->resource[0], io.regsize, io.regspacing, io.irq);
 
Signature · 1 line
Meelis Roos ([email protected])
#1 lore raw
Quoted 6 lines · Meelis Roos

I noticed that 4.17.0 logs the follwing during ipmi_si setup:

ipmi_si 0000:01:04.6: probing via PCI
(NULL device *): Could not setup I/O space
ipmi_si 0000:01:04.6: [mem 0xf5ef0000-0xf5ef00ff] regsize 1 spacing 1 irq 21

Quoted 7 lines

Fix the "NULL device *) by moving io.dev assignment before its potential use by ipmi_pci_probe_regspacing().

Result:
ipmi_si 0000:01:04.6: probing via PCI
ipmi_si 0000:01:04.6: Could not setup I/O space
ipmi_si 0000:01:04.6: [mem 0xf5ef0000-0xf5ef00ff] regsize 1 spacing 1 irq 21

Looks good, queued for next release.

It does raise the question of why the I/O space setup is failing on some system (other have reported this, too).  I'm working on that.

Thanks,

-corey

Quoted 25 lines
drivers/char/ipmi/ipmi_si_pci.c +2 -2
index f54ca6869ed2..022e03634ce2 100644
@@ -120,6 +120,8 @@ static int ipmi_pci_probe(struct pci_dev *pdev,
  	}
  	io.addr_data = pci_resource_start(pdev, 0);
 
+	io.dev = &pdev->dev;
+
  	io.regspacing = ipmi_pci_probe_regspacing(&io);
  	io.regsize = DEFAULT_REGSIZE;
  	io.regshift = 0;
@@ -128,8 +130,6 @@ static int ipmi_pci_probe(struct pci_dev *pdev,
  	if (io.irq)
  		io.irq_setup = ipmi_std_irq_setup;
 
-	io.dev = &pdev->dev;
-
  	dev_info(&pdev->dev, "%pR regsize %d spacing %d irq %d\n",
  		&pdev->resource[0], io.regsize, io.regspacing, io.irq);