[patch 2.6.16-mm2] Make fusion MPT driver legacy I/O port free

From: Masao Fukuchi
Date: Fri Mar 31 2006 - 08:11:46 EST


Hi,

I made a patch for Fusion MPT driver to make PCI legacy I/O
port free.

The way to make PCI legacy I/O port free function is based on
Kaneshige-san's patch which was uploaded several weeks ago and
is already merged into kernel 2.6.16-mm2.

Fusion MPT driver basically doesn't use PCI legacy I/O port.
But some PCI card/controller still use PCI legacy I/O port for
download boot operation.
So this driver needs to set I/O port at download boot operation.

I'm not a member of this mailing list, please cc to my e-mail
address.

Thanks,
Masao Fukuchi

Signed-off-by: Masao Fukuchi <masao.fukuchi@xxxxxxxxxxxxxx>

-----------------------------------------------------------
diff -uarN linux-2.6.16-mm2.org/drivers/message/fusion/mptbase.c linux-2.6.16-
mm2/drivers/message/fusion/mptbase.c
--- linux-2.6.16-mm2.org/drivers/message/fusion/mptbase.c 2006-03-31 16:41:47.000000000
+0900
+++ linux-2.6.16-mm2/drivers/message/fusion/mptbase.c 2006-03-31 21:16:12.000000000 +0900
@@ -1155,8 +1155,8 @@
#ifdef CONFIG_PROC_FS
struct proc_dir_entry *dent, *ent;
#endif
-
- if (pci_enable_device(pdev))
+ int bars = pci_select_bars(pdev, IORESOURCE_MEM);
+ if (pci_enable_device_bars(pdev, bars))
return r;

dinitprintk((KERN_WARNING MYNAM ": mpt_adapter_install\n"));
@@ -1572,6 +1572,7 @@
MPT_ADAPTER *ioc = pci_get_drvdata(pdev);
u32 device_state = pdev->current_state;
int recovery_state;
+ int bars;

printk(MYIOC_s_INFO_FMT
"pci-resume: pdev=0x%p, slot=%s, Previous operating state [D%d]\n",
@@ -1579,7 +1580,9 @@

pci_set_power_state(pdev, 0);
pci_restore_state(pdev);
- pci_enable_device(pdev);
+ bars = pci_select_bars(pdev, IORESOURCE_MEM);
+ if (pci_enable_device_bars(pdev, bars))
+ return -ENODEV;

/* enable interrupts */
CHIPREG_WRITE32(&ioc->chip->IntMask, MPI_HIM_DIM);
@@ -2575,6 +2578,7 @@
int r;
int count;
int cntdn;
+ int bars;

memset(&ioc_init, 0, sizeof(ioc_init));
memset(&init_reply, 0, sizeof(init_reply));
@@ -2587,7 +2591,13 @@
* Set this flag if cached_fw set for either IOC.
*/
if (ioc->facts.Flags & MPI_IOCFACTS_FLAGS_FW_DOWNLOAD_BOOT)
+ {
ioc->upload_fw = 1;
+ bars = pci_select_bars(ioc->pcidev, IORESOURCE_MEM | IORESOURCE_IO);
+ if (pci_enable_device_bars(ioc->pcidev, bars))
+ return -ENODEV;
+ }
+
else
ioc->upload_fw = 0;
ddlprintk((MYIOC_s_INFO_FMT "upload_fw %d facts.Flags=%x\n",
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/