diff options
author | Noriyuki Fujii <n-fujii@np.css.fujitsu.com> | 2009-11-20 02:27:20 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2009-12-10 09:54:16 -0500 |
commit | aeab3fd7b865bc4086a80a83cfdd67dded3b41a0 (patch) | |
tree | 131b4232f1406128464d34c0fbbb12ff66aede01 /drivers/scsi/megaraid | |
parent | d8705f11d89cfabf4a9f0ea234d4809b22abb33e (diff) |
[SCSI] megaraid_sas: make driver PCI legacy I/O port free driver
On the large servers, I/O port resource may not be assigned to all
the PCI devices since it is limited (to 64KB on Intel Architecture[1])
and it may also be fragmented (I/O base register of PCI-to-PCI bridge
will usually be aligned to a 4KB boundary[2]).
If no I/O port resource is assigned to devices, those devices do not
work.
[1] Some machines support 64KB I/O port space per PCI segment.
[2] Some P2P bridges support optional 1KB aligned I/O base.
Therefore, I made a patch for MegaRAID SAS driver to make PCI legacy
I/O port free. I have also tested the patch and it had no problem.
The way to make PCI legacy I/O port free is the same as Fusion-MPT
driver's and it has been merged into 2.6.30.4.
This has already been fixed in e1000 and lpfc.
As a result of the above, the driver can handle its device even when
there are a huge number of PCI devices being used on the system and no
I/O port region assigned to the device.
Signed-off-by: Noriyuki Fujii <n-fujii@np.css.fujitsu.com>
Acked-by: "Yang, Bo" <Bo.Yang@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/megaraid')
-rw-r--r-- | drivers/scsi/megaraid/megaraid_sas.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/scsi/megaraid/megaraid_sas.c b/drivers/scsi/megaraid/megaraid_sas.c index 134c63ef6d38..99ff99e45bee 100644 --- a/drivers/scsi/megaraid/megaraid_sas.c +++ b/drivers/scsi/megaraid/megaraid_sas.c | |||
@@ -2501,7 +2501,9 @@ static int megasas_init_mfi(struct megasas_instance *instance) | |||
2501 | instance->base_addr = pci_resource_start(instance->pdev, 0); | 2501 | instance->base_addr = pci_resource_start(instance->pdev, 0); |
2502 | } | 2502 | } |
2503 | 2503 | ||
2504 | if (pci_request_regions(instance->pdev, "megasas: LSI")) { | 2504 | if (pci_request_selected_regions(instance->pdev, |
2505 | pci_select_bars(instance->pdev, IORESOURCE_MEM), | ||
2506 | "megasas: LSI")) { | ||
2505 | printk(KERN_DEBUG "megasas: IO memory region busy!\n"); | 2507 | printk(KERN_DEBUG "megasas: IO memory region busy!\n"); |
2506 | return -EBUSY; | 2508 | return -EBUSY; |
2507 | } | 2509 | } |
@@ -2642,7 +2644,8 @@ static int megasas_init_mfi(struct megasas_instance *instance) | |||
2642 | iounmap(instance->reg_set); | 2644 | iounmap(instance->reg_set); |
2643 | 2645 | ||
2644 | fail_ioremap: | 2646 | fail_ioremap: |
2645 | pci_release_regions(instance->pdev); | 2647 | pci_release_selected_regions(instance->pdev, |
2648 | pci_select_bars(instance->pdev, IORESOURCE_MEM)); | ||
2646 | 2649 | ||
2647 | return -EINVAL; | 2650 | return -EINVAL; |
2648 | } | 2651 | } |
@@ -2662,7 +2665,8 @@ static void megasas_release_mfi(struct megasas_instance *instance) | |||
2662 | 2665 | ||
2663 | iounmap(instance->reg_set); | 2666 | iounmap(instance->reg_set); |
2664 | 2667 | ||
2665 | pci_release_regions(instance->pdev); | 2668 | pci_release_selected_regions(instance->pdev, |
2669 | pci_select_bars(instance->pdev, IORESOURCE_MEM)); | ||
2666 | } | 2670 | } |
2667 | 2671 | ||
2668 | /** | 2672 | /** |
@@ -2971,7 +2975,7 @@ megasas_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) | |||
2971 | /* | 2975 | /* |
2972 | * PCI prepping: enable device set bus mastering and dma mask | 2976 | * PCI prepping: enable device set bus mastering and dma mask |
2973 | */ | 2977 | */ |
2974 | rval = pci_enable_device(pdev); | 2978 | rval = pci_enable_device_mem(pdev); |
2975 | 2979 | ||
2976 | if (rval) { | 2980 | if (rval) { |
2977 | return rval; | 2981 | return rval; |
@@ -3276,7 +3280,7 @@ megasas_resume(struct pci_dev *pdev) | |||
3276 | /* | 3280 | /* |
3277 | * PCI prepping: enable device set bus mastering and dma mask | 3281 | * PCI prepping: enable device set bus mastering and dma mask |
3278 | */ | 3282 | */ |
3279 | rval = pci_enable_device(pdev); | 3283 | rval = pci_enable_device_mem(pdev); |
3280 | 3284 | ||
3281 | if (rval) { | 3285 | if (rval) { |
3282 | printk(KERN_ERR "megasas: Enable device failed\n"); | 3286 | printk(KERN_ERR "megasas: Enable device failed\n"); |