Skip to contentSkip to conversation

sky2: don't request unused i/o region

RFC In review Stephen Hemminger 2 participants 2 messages Feb 14, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

RFC 1/1 sky2: don't request unused i/o region

The sky2 driver only uses the PCI memory region (0) not the available I/O region. Some users want to use lots of boards, and the I/O space gets exhausted.

drivers/net/sky2.c +2 -2
@@ -4135,9 +4135,9 @@ static int __devinit sky2_probe(struct p
 		goto err_out;
 	}
 
-	err = pci_request_regions(pdev, DRV_NAME);
+	err = pci_request_region(pdev, 0, DRV_NAME);
 	if (err) {
-		dev_err(&pdev->dev, "cannot obtain PCI resources\n");
+		dev_err(&pdev->dev, "cannot obtain PCI resource\n");
 		goto err_out_disable;
 	}
 
#1 lore raw
Quoted 8 lines · Stephen Hemminger

The sky2 driver only uses the PCI memory region (0) not the available I/O region. Some users want to use lots of boards, and the I/O space gets exhausted.

drivers/net/sky2.c static int __devinit sky2_probe(struct p · line 4140

Quoted 8 lines
drivers/net/sky2.c +2 -2
@@ -4135,9 +4135,9 @@ static int __devinit sky2_probe(struct p
 		goto err_out;
 	}
 
-	err = pci_request_regions(pdev, DRV_NAME);
+	err = pci_request_region(pdev, 0, DRV_NAME);
 	if (err) {
-		dev_err(&pdev->dev, "cannot obtain PCI resources\n");
+		dev_err(&pdev->dev, "cannot obtain PCI resource\n");

Your description of the problem does not match the fix.

PCI resources are already allocated to the device (or not) by this point in the code. pci_request_region/regions is purely internal kernel software resource reservation -- protecting drivers from themselves, and arguably not really needed anymore on modern buses.

Thus, I cannot see how this patch can possibly "exhaust I/O space" -- the relevant PCI resources are allocated to the device, or not, regardless of these function calls.

As long as there is no resource conflict, you can have 1 million boards and still use pci_request_regions().

Jeff