* [PATCH] PCI legacy I/O port free driver - Making MegaRAID SAS driver
@ 2009-08-07 5:24 Noriyuki Fujii
0 siblings, 0 replies; 3+ messages in thread
From: Noriyuki Fujii @ 2009-08-07 5:24 UTC (permalink / raw)
To: linux-scsi
[-- Attachment #1: Type: text/plain, Size: 516 bytes --]
Hi,
I made a patch for MegaRAID sas driver to make PCI legacy I/O port free.
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.
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.
I'm not in the linux-scsi mailing list.
Please reply to the following address.
E-Mail: n-fujii@np.css.fujitsu.com
Thanks,
Noriyuki Fujii
[-- Attachment #2: linux-2.6-scsi-megaraid-sas-make-legacy-i-o-port-free.patch --]
[-- Type: text/plain, Size: 1617 bytes --]
--- megaraid_sasOrg.c 2009-07-02 16:31:17.000000000 +0900
+++ megaraid_sasMod.c 2009-08-06 11:24:42.000000000 +0900
@@ -2573,7 +2573,9 @@ static int megasas_init_mfi(struct megas
instance->base_addr = pci_resource_start(instance->pdev, 0);
}
- if (pci_request_regions(instance->pdev, "megasas: LSI")) {
+ if (pci_request_selected_regions(instance->pdev,
+ pci_select_bars(instance->pdev, IORESOURCE_MEM),
+ "megasas: LSI")) {
printk(KERN_DEBUG "megasas: IO memory region busy!\n");
return -EBUSY;
}
@@ -2719,7 +2721,8 @@ static int megasas_init_mfi(struct megas
iounmap(instance->reg_set);
fail_ioremap:
- pci_release_regions(instance->pdev);
+ pci_release_selected_regions(instance->pdev,
+ pci_select_bars(instance->pdev, IORESOURCE_MEM));
return -EINVAL;
}
@@ -2739,7 +2742,8 @@ static void megasas_release_mfi(struct m
iounmap(instance->reg_set);
- pci_release_regions(instance->pdev);
+ pci_release_selected_regions(instance->pdev,
+ pci_select_bars(instance->pdev, IORESOURCE_MEM));
}
/**
@@ -3049,7 +3053,7 @@ megasas_probe_one(struct pci_dev *pdev,
/*
* PCI prepping: enable device set bus mastering and dma mask
*/
- rval = pci_enable_device(pdev);
+ rval = pci_enable_device_mem(pdev);
if (rval) {
return rval;
@@ -3343,7 +3347,7 @@ megasas_resume(struct pci_dev *pdev)
/*
* PCI prepping: enable device set bus mastering and dma mask
*/
- rval = pci_enable_device(pdev);
+ rval = pci_enable_device_mem(pdev);
if (rval) {
printk(KERN_INFO "megasas: Enable device failed\n");
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] PCI legacy I/O port free driver - Making MegaRAID SAS driver
@ 2009-11-20 7:27 Noriyuki Fujii
2009-12-02 7:41 ` Yinghai Lu
0 siblings, 1 reply; 3+ messages in thread
From: Noriyuki Fujii @ 2009-11-20 7:27 UTC (permalink / raw)
To: megaraidlinux, linux-scsi, James.Bottomley
Hi,
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.
Thanks,
Noriyuki Fujii
Signed-off-by: Noriyuki Fujii n-fujii@np.css.fujitsu.com
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 a39addc..8a58927 100644
--- a/drivers/scsi/megaraid/megaraid_sas.c
+++ b/drivers/scsi/megaraid/megaraid_sas.c
@@ -2087,7 +2087,9 @@ static int megasas_init_mfi(struct
megasas_instance *instance)
instance->base_addr = pci_resource_start(instance->pdev, 0);
}
- if (pci_request_regions(instance->pdev, "megasas: LSI")) {
+ if (pci_request_selected_regions(instance->pdev,
+ pci_select_bars(instance->pdev, IORESOURCE_MEM),
+ "megasas: LSI")) {
printk(KERN_DEBUG "megasas: IO memory region busy!\n");
return -EBUSY;
}
@@ -2220,7 +2222,8 @@ static int megasas_init_mfi(struct
megasas_instance *instance)
iounmap(instance->reg_set);
fail_ioremap:
- pci_release_regions(instance->pdev);
+ pci_release_selected_regions(instance->pdev,
+ pci_select_bars(instance->pdev, IORESOURCE_MEM));
return -EINVAL;
}
@@ -2240,7 +2243,8 @@ static void megasas_release_mfi(struct
megasas_instance *instance)
iounmap(instance->reg_set);
- pci_release_regions(instance->pdev);
+ pci_release_selected_regions(instance->pdev,
+ pci_select_bars(instance->pdev, IORESOURCE_MEM));
}
/**
@@ -2537,7 +2541,7 @@ megasas_probe_one(struct pci_dev *pdev, const
struct pci_device_id *id)
/*
* PCI prepping: enable device set bus mastering and dma mask
*/
- rval = pci_enable_device(pdev);
+ rval = pci_enable_device_mem(pdev);
if (rval) {
return rval;
@@ -2818,7 +2822,7 @@ megasas_resume(struct pci_dev *pdev)
/*
* PCI prepping: enable device set bus mastering and dma mask
*/
- rval = pci_enable_device(pdev);
+ rval = pci_enable_device_mem(pdev);
if (rval) {
printk(KERN_ERR "megasas: Enable device failed\n");
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] PCI legacy I/O port free driver - Making MegaRAID SAS driver
2009-11-20 7:27 [PATCH] PCI legacy I/O port free driver - Making MegaRAID SAS driver Noriyuki Fujii
@ 2009-12-02 7:41 ` Yinghai Lu
0 siblings, 0 replies; 3+ messages in thread
From: Yinghai Lu @ 2009-12-02 7:41 UTC (permalink / raw)
To: Noriyuki Fujii, James Bottomley
Cc: megaraidlinux, linux-scsi, James.Bottomley
2009/11/19 Noriyuki Fujii <n-fujii@np.css.fujitsu.com>:
> Hi,
>
> 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.
>
> Thanks,
> Noriyuki Fujii
>
> Signed-off-by: Noriyuki Fujii n-fujii@np.css.fujitsu.com
Tested-by: Yinghai Lu <yinghai@kernel.org>
YH
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-12-02 7:41 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-20 7:27 [PATCH] PCI legacy I/O port free driver - Making MegaRAID SAS driver Noriyuki Fujii
2009-12-02 7:41 ` Yinghai Lu
-- strict thread matches above, loose matches on Subject: below --
2009-08-07 5:24 Noriyuki Fujii
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).