netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] sky2: don't request unused i/o region
@ 2008-02-14  3:02 Stephen Hemminger
  2008-02-14  4:40 ` Jeff Garzik
  0 siblings, 1 reply; 2+ messages in thread
From: Stephen Hemminger @ 2008-02-14  3:02 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: netdev

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.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>

--- a/drivers/net/sky2.c	2008-02-13 18:58:21.000000000 -0800
+++ b/drivers/net/sky2.c	2008-02-13 18:58:55.000000000 -0800
@@ -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;
 	}
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [RFC] sky2: don't request unused i/o region
  2008-02-14  3:02 [RFC] sky2: don't request unused i/o region Stephen Hemminger
@ 2008-02-14  4:40 ` Jeff Garzik
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Garzik @ 2008-02-14  4:40 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev

Stephen Hemminger wrote:
> 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.
> 
> Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
> 
> --- a/drivers/net/sky2.c	2008-02-13 18:58:21.000000000 -0800
> +++ b/drivers/net/sky2.c	2008-02-13 18:58:55.000000000 -0800
> @@ -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




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-02-14  4:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-14  3:02 [RFC] sky2: don't request unused i/o region Stephen Hemminger
2008-02-14  4:40 ` Jeff Garzik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).