diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-18 14:25:31 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-18 14:25:31 -0400 |
commit | 2cca775baecbfede2fec20c99add709232311fe7 (patch) | |
tree | b0eefe80881d263ba7976174144ae4e9cf238425 /drivers/message | |
parent | eddeb0e2d863e3941d8768e70cb50c6120e61fa0 (diff) | |
parent | 94795b61e84994a3b058f92d041d1fb3d869c7d5 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (137 commits)
[SCSI] iscsi: bidi support for iscsi_tcp
[SCSI] iscsi: bidi support at the generic libiscsi level
[SCSI] iscsi: extended cdb support
[SCSI] zfcp: Fix error handling for blocked unit for send FCP command
[SCSI] zfcp: Remove zfcp_erp_wait from slave destory handler to fix deadlock
[SCSI] zfcp: fix 31 bit compile warnings
[SCSI] bsg: no need to set BSG_F_BLOCK bit in bsg_complete_all_commands
[SCSI] bsg: remove minor in struct bsg_device
[SCSI] bsg: use better helper list functions
[SCSI] bsg: replace kobject_get with blk_get_queue
[SCSI] bsg: takes a ref to struct device in fops->open
[SCSI] qla1280: remove version check
[SCSI] libsas: fix endianness bug in sas_ata
[SCSI] zfcp: fix compiler warning caused by poking inside new semaphore (linux-next)
[SCSI] aacraid: Do not describe check_reset parameter with its value
[SCSI] aacraid: Fix down_interruptible() to check the return value
[SCSI] sun3_scsi_vme: add MODULE_LICENSE
[SCSI] st: rename flush_write_buffer()
[SCSI] tgt: use KMEM_CACHE macro
[SCSI] initio: fix big endian problems for auto request sense
...
Diffstat (limited to 'drivers/message')
-rw-r--r-- | drivers/message/fusion/mptbase.c | 29 | ||||
-rw-r--r-- | drivers/message/fusion/mptbase.h | 5 | ||||
-rw-r--r-- | drivers/message/fusion/mptsas.c | 22 | ||||
-rw-r--r-- | drivers/message/fusion/mptscsih.c | 8 |
4 files changed, 42 insertions, 22 deletions
diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c index c6be6eba7dc3..db3c892f87fb 100644 --- a/drivers/message/fusion/mptbase.c +++ b/drivers/message/fusion/mptbase.c | |||
@@ -79,7 +79,7 @@ MODULE_VERSION(my_VERSION); | |||
79 | /* | 79 | /* |
80 | * cmd line parameters | 80 | * cmd line parameters |
81 | */ | 81 | */ |
82 | static int mpt_msi_enable; | 82 | static int mpt_msi_enable = -1; |
83 | module_param(mpt_msi_enable, int, 0); | 83 | module_param(mpt_msi_enable, int, 0); |
84 | MODULE_PARM_DESC(mpt_msi_enable, " MSI Support Enable (default=0)"); | 84 | MODULE_PARM_DESC(mpt_msi_enable, " MSI Support Enable (default=0)"); |
85 | 85 | ||
@@ -1686,6 +1686,11 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id) | |||
1686 | ioc->bus_type = SAS; | 1686 | ioc->bus_type = SAS; |
1687 | } | 1687 | } |
1688 | 1688 | ||
1689 | if (ioc->bus_type == SAS && mpt_msi_enable == -1) | ||
1690 | ioc->msi_enable = 1; | ||
1691 | else | ||
1692 | ioc->msi_enable = mpt_msi_enable; | ||
1693 | |||
1689 | if (ioc->errata_flag_1064) | 1694 | if (ioc->errata_flag_1064) |
1690 | pci_disable_io_access(pdev); | 1695 | pci_disable_io_access(pdev); |
1691 | 1696 | ||
@@ -1831,7 +1836,7 @@ mpt_suspend(struct pci_dev *pdev, pm_message_t state) | |||
1831 | CHIPREG_WRITE32(&ioc->chip->IntStatus, 0); | 1836 | CHIPREG_WRITE32(&ioc->chip->IntStatus, 0); |
1832 | 1837 | ||
1833 | free_irq(ioc->pci_irq, ioc); | 1838 | free_irq(ioc->pci_irq, ioc); |
1834 | if (mpt_msi_enable) | 1839 | if (ioc->msi_enable) |
1835 | pci_disable_msi(ioc->pcidev); | 1840 | pci_disable_msi(ioc->pcidev); |
1836 | ioc->pci_irq = -1; | 1841 | ioc->pci_irq = -1; |
1837 | pci_save_state(pdev); | 1842 | pci_save_state(pdev); |
@@ -2057,15 +2062,17 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag) | |||
2057 | if ((ret == 0) && (reason == MPT_HOSTEVENT_IOC_BRINGUP)) { | 2062 | if ((ret == 0) && (reason == MPT_HOSTEVENT_IOC_BRINGUP)) { |
2058 | ioc->pci_irq = -1; | 2063 | ioc->pci_irq = -1; |
2059 | if (ioc->pcidev->irq) { | 2064 | if (ioc->pcidev->irq) { |
2060 | if (mpt_msi_enable && !pci_enable_msi(ioc->pcidev)) | 2065 | if (ioc->msi_enable && !pci_enable_msi(ioc->pcidev)) |
2061 | printk(MYIOC_s_INFO_FMT "PCI-MSI enabled\n", | 2066 | printk(MYIOC_s_INFO_FMT "PCI-MSI enabled\n", |
2062 | ioc->name); | 2067 | ioc->name); |
2068 | else | ||
2069 | ioc->msi_enable = 0; | ||
2063 | rc = request_irq(ioc->pcidev->irq, mpt_interrupt, | 2070 | rc = request_irq(ioc->pcidev->irq, mpt_interrupt, |
2064 | IRQF_SHARED, ioc->name, ioc); | 2071 | IRQF_SHARED, ioc->name, ioc); |
2065 | if (rc < 0) { | 2072 | if (rc < 0) { |
2066 | printk(MYIOC_s_ERR_FMT "Unable to allocate " | 2073 | printk(MYIOC_s_ERR_FMT "Unable to allocate " |
2067 | "interrupt %d!\n", ioc->name, ioc->pcidev->irq); | 2074 | "interrupt %d!\n", ioc->name, ioc->pcidev->irq); |
2068 | if (mpt_msi_enable) | 2075 | if (ioc->msi_enable) |
2069 | pci_disable_msi(ioc->pcidev); | 2076 | pci_disable_msi(ioc->pcidev); |
2070 | return -EBUSY; | 2077 | return -EBUSY; |
2071 | } | 2078 | } |
@@ -2173,7 +2180,7 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag) | |||
2173 | /* | 2180 | /* |
2174 | * Initalize link list for inactive raid volumes. | 2181 | * Initalize link list for inactive raid volumes. |
2175 | */ | 2182 | */ |
2176 | init_MUTEX(&ioc->raid_data.inactive_list_mutex); | 2183 | mutex_init(&ioc->raid_data.inactive_list_mutex); |
2177 | INIT_LIST_HEAD(&ioc->raid_data.inactive_list); | 2184 | INIT_LIST_HEAD(&ioc->raid_data.inactive_list); |
2178 | 2185 | ||
2179 | if (ioc->bus_type == SAS) { | 2186 | if (ioc->bus_type == SAS) { |
@@ -2261,7 +2268,7 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag) | |||
2261 | out: | 2268 | out: |
2262 | if ((ret != 0) && irq_allocated) { | 2269 | if ((ret != 0) && irq_allocated) { |
2263 | free_irq(ioc->pci_irq, ioc); | 2270 | free_irq(ioc->pci_irq, ioc); |
2264 | if (mpt_msi_enable) | 2271 | if (ioc->msi_enable) |
2265 | pci_disable_msi(ioc->pcidev); | 2272 | pci_disable_msi(ioc->pcidev); |
2266 | } | 2273 | } |
2267 | return ret; | 2274 | return ret; |
@@ -2443,7 +2450,7 @@ mpt_adapter_dispose(MPT_ADAPTER *ioc) | |||
2443 | 2450 | ||
2444 | if (ioc->pci_irq != -1) { | 2451 | if (ioc->pci_irq != -1) { |
2445 | free_irq(ioc->pci_irq, ioc); | 2452 | free_irq(ioc->pci_irq, ioc); |
2446 | if (mpt_msi_enable) | 2453 | if (ioc->msi_enable) |
2447 | pci_disable_msi(ioc->pcidev); | 2454 | pci_disable_msi(ioc->pcidev); |
2448 | ioc->pci_irq = -1; | 2455 | ioc->pci_irq = -1; |
2449 | } | 2456 | } |
@@ -5159,13 +5166,13 @@ mpt_inactive_raid_list_free(MPT_ADAPTER *ioc) | |||
5159 | if (list_empty(&ioc->raid_data.inactive_list)) | 5166 | if (list_empty(&ioc->raid_data.inactive_list)) |
5160 | return; | 5167 | return; |
5161 | 5168 | ||
5162 | down(&ioc->raid_data.inactive_list_mutex); | 5169 | mutex_lock(&ioc->raid_data.inactive_list_mutex); |
5163 | list_for_each_entry_safe(component_info, pNext, | 5170 | list_for_each_entry_safe(component_info, pNext, |
5164 | &ioc->raid_data.inactive_list, list) { | 5171 | &ioc->raid_data.inactive_list, list) { |
5165 | list_del(&component_info->list); | 5172 | list_del(&component_info->list); |
5166 | kfree(component_info); | 5173 | kfree(component_info); |
5167 | } | 5174 | } |
5168 | up(&ioc->raid_data.inactive_list_mutex); | 5175 | mutex_unlock(&ioc->raid_data.inactive_list_mutex); |
5169 | } | 5176 | } |
5170 | 5177 | ||
5171 | /** | 5178 | /** |
@@ -5224,7 +5231,7 @@ mpt_inactive_raid_volumes(MPT_ADAPTER *ioc, u8 channel, u8 id) | |||
5224 | if (!handle_inactive_volumes) | 5231 | if (!handle_inactive_volumes) |
5225 | goto out; | 5232 | goto out; |
5226 | 5233 | ||
5227 | down(&ioc->raid_data.inactive_list_mutex); | 5234 | mutex_lock(&ioc->raid_data.inactive_list_mutex); |
5228 | for (i = 0; i < buffer->NumPhysDisks; i++) { | 5235 | for (i = 0; i < buffer->NumPhysDisks; i++) { |
5229 | if(mpt_raid_phys_disk_pg0(ioc, | 5236 | if(mpt_raid_phys_disk_pg0(ioc, |
5230 | buffer->PhysDisk[i].PhysDiskNum, &phys_disk) != 0) | 5237 | buffer->PhysDisk[i].PhysDiskNum, &phys_disk) != 0) |
@@ -5244,7 +5251,7 @@ mpt_inactive_raid_volumes(MPT_ADAPTER *ioc, u8 channel, u8 id) | |||
5244 | list_add_tail(&component_info->list, | 5251 | list_add_tail(&component_info->list, |
5245 | &ioc->raid_data.inactive_list); | 5252 | &ioc->raid_data.inactive_list); |
5246 | } | 5253 | } |
5247 | up(&ioc->raid_data.inactive_list_mutex); | 5254 | mutex_unlock(&ioc->raid_data.inactive_list_mutex); |
5248 | 5255 | ||
5249 | out: | 5256 | out: |
5250 | if (buffer) | 5257 | if (buffer) |
diff --git a/drivers/message/fusion/mptbase.h b/drivers/message/fusion/mptbase.h index caadc68c3000..a8f617447d22 100644 --- a/drivers/message/fusion/mptbase.h +++ b/drivers/message/fusion/mptbase.h | |||
@@ -51,6 +51,7 @@ | |||
51 | 51 | ||
52 | #include <linux/kernel.h> | 52 | #include <linux/kernel.h> |
53 | #include <linux/pci.h> | 53 | #include <linux/pci.h> |
54 | #include <linux/mutex.h> | ||
54 | 55 | ||
55 | #include "lsi/mpi_type.h" | 56 | #include "lsi/mpi_type.h" |
56 | #include "lsi/mpi.h" /* Fusion MPI(nterface) basic defs */ | 57 | #include "lsi/mpi.h" /* Fusion MPI(nterface) basic defs */ |
@@ -531,7 +532,7 @@ struct inactive_raid_component_info { | |||
531 | typedef struct _RaidCfgData { | 532 | typedef struct _RaidCfgData { |
532 | IOCPage2_t *pIocPg2; /* table of Raid Volumes */ | 533 | IOCPage2_t *pIocPg2; /* table of Raid Volumes */ |
533 | IOCPage3_t *pIocPg3; /* table of physical disks */ | 534 | IOCPage3_t *pIocPg3; /* table of physical disks */ |
534 | struct semaphore inactive_list_mutex; | 535 | struct mutex inactive_list_mutex; |
535 | struct list_head inactive_list; /* link list for physical | 536 | struct list_head inactive_list; /* link list for physical |
536 | disk that belong in | 537 | disk that belong in |
537 | inactive volumes */ | 538 | inactive volumes */ |
@@ -630,6 +631,7 @@ typedef struct _MPT_ADAPTER | |||
630 | int mtrr_reg; | 631 | int mtrr_reg; |
631 | struct pci_dev *pcidev; /* struct pci_dev pointer */ | 632 | struct pci_dev *pcidev; /* struct pci_dev pointer */ |
632 | int bars; /* bitmask of BAR's that must be configured */ | 633 | int bars; /* bitmask of BAR's that must be configured */ |
634 | int msi_enable; | ||
633 | u8 __iomem *memmap; /* mmap address */ | 635 | u8 __iomem *memmap; /* mmap address */ |
634 | struct Scsi_Host *sh; /* Scsi Host pointer */ | 636 | struct Scsi_Host *sh; /* Scsi Host pointer */ |
635 | SpiCfgData spi_data; /* Scsi config. data */ | 637 | SpiCfgData spi_data; /* Scsi config. data */ |
@@ -693,7 +695,6 @@ typedef struct _MPT_ADAPTER | |||
693 | struct mutex sas_discovery_mutex; | 695 | struct mutex sas_discovery_mutex; |
694 | u8 sas_discovery_runtime; | 696 | u8 sas_discovery_runtime; |
695 | u8 sas_discovery_ignore_events; | 697 | u8 sas_discovery_ignore_events; |
696 | u16 handle; | ||
697 | int sas_index; /* index refrencing */ | 698 | int sas_index; /* index refrencing */ |
698 | MPT_SAS_MGMT sas_mgmt; | 699 | MPT_SAS_MGMT sas_mgmt; |
699 | struct work_struct sas_persist_task; | 700 | struct work_struct sas_persist_task; |
diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c index 78734e25edd5..468480771f13 100644 --- a/drivers/message/fusion/mptsas.c +++ b/drivers/message/fusion/mptsas.c | |||
@@ -230,6 +230,20 @@ static inline MPT_ADAPTER *rphy_to_ioc(struct sas_rphy *rphy) | |||
230 | return ((MPT_SCSI_HOST *)shost->hostdata)->ioc; | 230 | return ((MPT_SCSI_HOST *)shost->hostdata)->ioc; |
231 | } | 231 | } |
232 | 232 | ||
233 | static struct mptsas_portinfo * | ||
234 | mptsas_get_hba_portinfo(MPT_ADAPTER *ioc) | ||
235 | { | ||
236 | struct list_head *head = &ioc->sas_topology; | ||
237 | struct mptsas_portinfo *pi = NULL; | ||
238 | |||
239 | /* always the first entry on sas_topology list */ | ||
240 | |||
241 | if (!list_empty(head)) | ||
242 | pi = list_entry(head->next, struct mptsas_portinfo, list); | ||
243 | |||
244 | return pi; | ||
245 | } | ||
246 | |||
233 | /* | 247 | /* |
234 | * mptsas_find_portinfo_by_handle | 248 | * mptsas_find_portinfo_by_handle |
235 | * | 249 | * |
@@ -1290,7 +1304,7 @@ static int mptsas_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy, | |||
1290 | struct mptsas_portinfo *port_info; | 1304 | struct mptsas_portinfo *port_info; |
1291 | 1305 | ||
1292 | mutex_lock(&ioc->sas_topology_mutex); | 1306 | mutex_lock(&ioc->sas_topology_mutex); |
1293 | port_info = mptsas_find_portinfo_by_handle(ioc, ioc->handle); | 1307 | port_info = mptsas_get_hba_portinfo(ioc); |
1294 | if (port_info && port_info->phy_info) | 1308 | if (port_info && port_info->phy_info) |
1295 | sas_address = | 1309 | sas_address = |
1296 | port_info->phy_info[0].phy->identify.sas_address; | 1310 | port_info->phy_info[0].phy->identify.sas_address; |
@@ -2028,8 +2042,7 @@ static int mptsas_probe_one_phy(struct device *dev, | |||
2028 | int i; | 2042 | int i; |
2029 | 2043 | ||
2030 | mutex_lock(&ioc->sas_topology_mutex); | 2044 | mutex_lock(&ioc->sas_topology_mutex); |
2031 | port_info = mptsas_find_portinfo_by_handle(ioc, | 2045 | port_info = mptsas_get_hba_portinfo(ioc); |
2032 | ioc->handle); | ||
2033 | mutex_unlock(&ioc->sas_topology_mutex); | 2046 | mutex_unlock(&ioc->sas_topology_mutex); |
2034 | 2047 | ||
2035 | for (i = 0; i < port_info->num_phys; i++) | 2048 | for (i = 0; i < port_info->num_phys; i++) |
@@ -2099,8 +2112,7 @@ mptsas_probe_hba_phys(MPT_ADAPTER *ioc) | |||
2099 | 2112 | ||
2100 | mptsas_sas_io_unit_pg1(ioc); | 2113 | mptsas_sas_io_unit_pg1(ioc); |
2101 | mutex_lock(&ioc->sas_topology_mutex); | 2114 | mutex_lock(&ioc->sas_topology_mutex); |
2102 | ioc->handle = hba->phy_info[0].handle; | 2115 | port_info = mptsas_get_hba_portinfo(ioc); |
2103 | port_info = mptsas_find_portinfo_by_handle(ioc, ioc->handle); | ||
2104 | if (!port_info) { | 2116 | if (!port_info) { |
2105 | port_info = hba; | 2117 | port_info = hba; |
2106 | list_add_tail(&port_info->list, &ioc->sas_topology); | 2118 | list_add_tail(&port_info->list, &ioc->sas_topology); |
diff --git a/drivers/message/fusion/mptscsih.c b/drivers/message/fusion/mptscsih.c index c207bda6723b..89c63147a15d 100644 --- a/drivers/message/fusion/mptscsih.c +++ b/drivers/message/fusion/mptscsih.c | |||
@@ -2304,14 +2304,14 @@ mptscsih_is_phys_disk(MPT_ADAPTER *ioc, u8 channel, u8 id) | |||
2304 | if (list_empty(&ioc->raid_data.inactive_list)) | 2304 | if (list_empty(&ioc->raid_data.inactive_list)) |
2305 | goto out; | 2305 | goto out; |
2306 | 2306 | ||
2307 | down(&ioc->raid_data.inactive_list_mutex); | 2307 | mutex_lock(&ioc->raid_data.inactive_list_mutex); |
2308 | list_for_each_entry(component_info, &ioc->raid_data.inactive_list, | 2308 | list_for_each_entry(component_info, &ioc->raid_data.inactive_list, |
2309 | list) { | 2309 | list) { |
2310 | if ((component_info->d.PhysDiskID == id) && | 2310 | if ((component_info->d.PhysDiskID == id) && |
2311 | (component_info->d.PhysDiskBus == channel)) | 2311 | (component_info->d.PhysDiskBus == channel)) |
2312 | rc = 1; | 2312 | rc = 1; |
2313 | } | 2313 | } |
2314 | up(&ioc->raid_data.inactive_list_mutex); | 2314 | mutex_unlock(&ioc->raid_data.inactive_list_mutex); |
2315 | 2315 | ||
2316 | out: | 2316 | out: |
2317 | return rc; | 2317 | return rc; |
@@ -2341,14 +2341,14 @@ mptscsih_raid_id_to_num(MPT_ADAPTER *ioc, u8 channel, u8 id) | |||
2341 | if (list_empty(&ioc->raid_data.inactive_list)) | 2341 | if (list_empty(&ioc->raid_data.inactive_list)) |
2342 | goto out; | 2342 | goto out; |
2343 | 2343 | ||
2344 | down(&ioc->raid_data.inactive_list_mutex); | 2344 | mutex_lock(&ioc->raid_data.inactive_list_mutex); |
2345 | list_for_each_entry(component_info, &ioc->raid_data.inactive_list, | 2345 | list_for_each_entry(component_info, &ioc->raid_data.inactive_list, |
2346 | list) { | 2346 | list) { |
2347 | if ((component_info->d.PhysDiskID == id) && | 2347 | if ((component_info->d.PhysDiskID == id) && |
2348 | (component_info->d.PhysDiskBus == channel)) | 2348 | (component_info->d.PhysDiskBus == channel)) |
2349 | rc = component_info->d.PhysDiskNum; | 2349 | rc = component_info->d.PhysDiskNum; |
2350 | } | 2350 | } |
2351 | up(&ioc->raid_data.inactive_list_mutex); | 2351 | mutex_unlock(&ioc->raid_data.inactive_list_mutex); |
2352 | 2352 | ||
2353 | out: | 2353 | out: |
2354 | return rc; | 2354 | return rc; |