aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/message/fusion/mptsas.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/message/fusion/mptsas.c')
-rw-r--r--drivers/message/fusion/mptsas.c62
1 files changed, 22 insertions, 40 deletions
diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c
index 55ff25244af4..83873e3d0ce7 100644
--- a/drivers/message/fusion/mptsas.c
+++ b/drivers/message/fusion/mptsas.c
@@ -72,6 +72,7 @@
72 */ 72 */
73#define MPTSAS_RAID_CHANNEL 1 73#define MPTSAS_RAID_CHANNEL 1
74 74
75#define SAS_CONFIG_PAGE_TIMEOUT 30
75MODULE_AUTHOR(MODULEAUTHOR); 76MODULE_AUTHOR(MODULEAUTHOR);
76MODULE_DESCRIPTION(my_NAME); 77MODULE_DESCRIPTION(my_NAME);
77MODULE_LICENSE("GPL"); 78MODULE_LICENSE("GPL");
@@ -324,7 +325,6 @@ mptsas_cleanup_fw_event_q(MPT_ADAPTER *ioc)
324{ 325{
325 struct fw_event_work *fw_event, *next; 326 struct fw_event_work *fw_event, *next;
326 struct mptsas_target_reset_event *target_reset_list, *n; 327 struct mptsas_target_reset_event *target_reset_list, *n;
327 u8 flush_q;
328 MPT_SCSI_HOST *hd = shost_priv(ioc->sh); 328 MPT_SCSI_HOST *hd = shost_priv(ioc->sh);
329 329
330 /* flush the target_reset_list */ 330 /* flush the target_reset_list */
@@ -344,15 +344,10 @@ mptsas_cleanup_fw_event_q(MPT_ADAPTER *ioc)
344 !ioc->fw_event_q || in_interrupt()) 344 !ioc->fw_event_q || in_interrupt())
345 return; 345 return;
346 346
347 flush_q = 0;
348 list_for_each_entry_safe(fw_event, next, &ioc->fw_event_list, list) { 347 list_for_each_entry_safe(fw_event, next, &ioc->fw_event_list, list) {
349 if (cancel_delayed_work(&fw_event->work)) 348 if (cancel_delayed_work(&fw_event->work))
350 mptsas_free_fw_event(ioc, fw_event); 349 mptsas_free_fw_event(ioc, fw_event);
351 else
352 flush_q = 1;
353 } 350 }
354 if (flush_q)
355 flush_workqueue(ioc->fw_event_q);
356} 351}
357 352
358 353
@@ -661,7 +656,7 @@ mptsas_add_device_component_starget_ir(MPT_ADAPTER *ioc,
661 cfg.pageAddr = starget->id; 656 cfg.pageAddr = starget->id;
662 cfg.cfghdr.hdr = &hdr; 657 cfg.cfghdr.hdr = &hdr;
663 cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER; 658 cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER;
664 cfg.timeout = 10; 659 cfg.timeout = SAS_CONFIG_PAGE_TIMEOUT;
665 660
666 if (mpt_config(ioc, &cfg) != 0) 661 if (mpt_config(ioc, &cfg) != 0)
667 goto out; 662 goto out;
@@ -851,7 +846,13 @@ mptsas_setup_wide_ports(MPT_ADAPTER *ioc, struct mptsas_portinfo *port_info)
851 port_details->num_phys--; 846 port_details->num_phys--;
852 port_details->phy_bitmask &= ~ (1 << phy_info->phy_id); 847 port_details->phy_bitmask &= ~ (1 << phy_info->phy_id);
853 memset(&phy_info->attached, 0, sizeof(struct mptsas_devinfo)); 848 memset(&phy_info->attached, 0, sizeof(struct mptsas_devinfo));
854 sas_port_delete_phy(port_details->port, phy_info->phy); 849 if (phy_info->phy) {
850 devtprintk(ioc, dev_printk(KERN_DEBUG,
851 &phy_info->phy->dev, MYIOC_s_FMT
852 "delete phy %d, phy-obj (0x%p)\n", ioc->name,
853 phy_info->phy_id, phy_info->phy));
854 sas_port_delete_phy(port_details->port, phy_info->phy);
855 }
855 phy_info->port_details = NULL; 856 phy_info->port_details = NULL;
856 } 857 }
857 858
@@ -1272,7 +1273,6 @@ mptsas_ioc_reset(MPT_ADAPTER *ioc, int reset_phase)
1272 } 1273 }
1273 mptsas_cleanup_fw_event_q(ioc); 1274 mptsas_cleanup_fw_event_q(ioc);
1274 mptsas_queue_rescan(ioc); 1275 mptsas_queue_rescan(ioc);
1275 mptsas_fw_event_on(ioc);
1276 break; 1276 break;
1277 default: 1277 default:
1278 break; 1278 break;
@@ -1318,7 +1318,7 @@ mptsas_sas_enclosure_pg0(MPT_ADAPTER *ioc, struct mptsas_enclosure *enclosure,
1318 cfg.pageAddr = form + form_specific; 1318 cfg.pageAddr = form + form_specific;
1319 cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER; 1319 cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER;
1320 cfg.dir = 0; /* read */ 1320 cfg.dir = 0; /* read */
1321 cfg.timeout = 10; 1321 cfg.timeout = SAS_CONFIG_PAGE_TIMEOUT;
1322 1322
1323 error = mpt_config(ioc, &cfg); 1323 error = mpt_config(ioc, &cfg);
1324 if (error) 1324 if (error)
@@ -1592,6 +1592,7 @@ mptsas_firmware_event_work(struct work_struct *work)
1592 mptsas_scan_sas_topology(ioc); 1592 mptsas_scan_sas_topology(ioc);
1593 ioc->in_rescan = 0; 1593 ioc->in_rescan = 0;
1594 mptsas_free_fw_event(ioc, fw_event); 1594 mptsas_free_fw_event(ioc, fw_event);
1595 mptsas_fw_event_on(ioc);
1595 return; 1596 return;
1596 } 1597 }
1597 1598
@@ -1891,7 +1892,7 @@ static struct scsi_host_template mptsas_driver_template = {
1891 .eh_bus_reset_handler = mptscsih_bus_reset, 1892 .eh_bus_reset_handler = mptscsih_bus_reset,
1892 .eh_host_reset_handler = mptscsih_host_reset, 1893 .eh_host_reset_handler = mptscsih_host_reset,
1893 .bios_param = mptscsih_bios_param, 1894 .bios_param = mptscsih_bios_param,
1894 .can_queue = MPT_FC_CAN_QUEUE, 1895 .can_queue = MPT_SAS_CAN_QUEUE,
1895 .this_id = -1, 1896 .this_id = -1,
1896 .sg_tablesize = MPT_SCSI_SG_DEPTH, 1897 .sg_tablesize = MPT_SCSI_SG_DEPTH,
1897 .max_sectors = 8192, 1898 .max_sectors = 8192,
@@ -1926,7 +1927,7 @@ static int mptsas_get_linkerrors(struct sas_phy *phy)
1926 cfg.pageAddr = phy->identify.phy_identifier; 1927 cfg.pageAddr = phy->identify.phy_identifier;
1927 cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER; 1928 cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER;
1928 cfg.dir = 0; /* read */ 1929 cfg.dir = 0; /* read */
1929 cfg.timeout = 10; 1930 cfg.timeout = SAS_CONFIG_PAGE_TIMEOUT;
1930 1931
1931 error = mpt_config(ioc, &cfg); 1932 error = mpt_config(ioc, &cfg);
1932 if (error) 1933 if (error)
@@ -2278,7 +2279,7 @@ mptsas_sas_io_unit_pg0(MPT_ADAPTER *ioc, struct mptsas_portinfo *port_info)
2278 cfg.pageAddr = 0; 2279 cfg.pageAddr = 0;
2279 cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER; 2280 cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER;
2280 cfg.dir = 0; /* read */ 2281 cfg.dir = 0; /* read */
2281 cfg.timeout = 10; 2282 cfg.timeout = SAS_CONFIG_PAGE_TIMEOUT;
2282 2283
2283 error = mpt_config(ioc, &cfg); 2284 error = mpt_config(ioc, &cfg);
2284 if (error) 2285 if (error)
@@ -2349,7 +2350,7 @@ mptsas_sas_io_unit_pg1(MPT_ADAPTER *ioc)
2349 2350
2350 cfg.cfghdr.ehdr = &hdr; 2351 cfg.cfghdr.ehdr = &hdr;
2351 cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER; 2352 cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER;
2352 cfg.timeout = 10; 2353 cfg.timeout = SAS_CONFIG_PAGE_TIMEOUT;
2353 cfg.cfghdr.ehdr->PageType = MPI_CONFIG_PAGETYPE_EXTENDED; 2354 cfg.cfghdr.ehdr->PageType = MPI_CONFIG_PAGETYPE_EXTENDED;
2354 cfg.cfghdr.ehdr->ExtPageType = MPI_CONFIG_EXTPAGETYPE_SAS_IO_UNIT; 2355 cfg.cfghdr.ehdr->ExtPageType = MPI_CONFIG_EXTPAGETYPE_SAS_IO_UNIT;
2355 cfg.cfghdr.ehdr->PageVersion = MPI_SASIOUNITPAGE1_PAGEVERSION; 2356 cfg.cfghdr.ehdr->PageVersion = MPI_SASIOUNITPAGE1_PAGEVERSION;
@@ -2411,7 +2412,7 @@ mptsas_sas_phy_pg0(MPT_ADAPTER *ioc, struct mptsas_phyinfo *phy_info,
2411 2412
2412 cfg.cfghdr.ehdr = &hdr; 2413 cfg.cfghdr.ehdr = &hdr;
2413 cfg.dir = 0; /* read */ 2414 cfg.dir = 0; /* read */
2414 cfg.timeout = 10; 2415 cfg.timeout = SAS_CONFIG_PAGE_TIMEOUT;
2415 2416
2416 /* Get Phy Pg 0 for each Phy. */ 2417 /* Get Phy Pg 0 for each Phy. */
2417 cfg.physAddr = -1; 2418 cfg.physAddr = -1;
@@ -2479,7 +2480,7 @@ mptsas_sas_device_pg0(MPT_ADAPTER *ioc, struct mptsas_devinfo *device_info,
2479 cfg.physAddr = -1; 2480 cfg.physAddr = -1;
2480 cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER; 2481 cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER;
2481 cfg.dir = 0; /* read */ 2482 cfg.dir = 0; /* read */
2482 cfg.timeout = 10; 2483 cfg.timeout = SAS_CONFIG_PAGE_TIMEOUT;
2483 2484
2484 memset(device_info, 0, sizeof(struct mptsas_devinfo)); 2485 memset(device_info, 0, sizeof(struct mptsas_devinfo));
2485 error = mpt_config(ioc, &cfg); 2486 error = mpt_config(ioc, &cfg);
@@ -2554,7 +2555,7 @@ mptsas_sas_expander_pg0(MPT_ADAPTER *ioc, struct mptsas_portinfo *port_info,
2554 cfg.pageAddr = form + form_specific; 2555 cfg.pageAddr = form + form_specific;
2555 cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER; 2556 cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER;
2556 cfg.dir = 0; /* read */ 2557 cfg.dir = 0; /* read */
2557 cfg.timeout = 10; 2558 cfg.timeout = SAS_CONFIG_PAGE_TIMEOUT;
2558 2559
2559 memset(port_info, 0, sizeof(struct mptsas_portinfo)); 2560 memset(port_info, 0, sizeof(struct mptsas_portinfo));
2560 error = mpt_config(ioc, &cfg); 2561 error = mpt_config(ioc, &cfg);
@@ -2635,7 +2636,7 @@ mptsas_sas_expander_pg1(MPT_ADAPTER *ioc, struct mptsas_phyinfo *phy_info,
2635 cfg.pageAddr = form + form_specific; 2636 cfg.pageAddr = form + form_specific;
2636 cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER; 2637 cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER;
2637 cfg.dir = 0; /* read */ 2638 cfg.dir = 0; /* read */
2638 cfg.timeout = 10; 2639 cfg.timeout = SAS_CONFIG_PAGE_TIMEOUT;
2639 2640
2640 error = mpt_config(ioc, &cfg); 2641 error = mpt_config(ioc, &cfg);
2641 if (error) 2642 if (error)
@@ -3307,6 +3308,7 @@ mptsas_send_expander_event(struct fw_event_work *fw_event)
3307 expander_data = (MpiEventDataSasExpanderStatusChange_t *) 3308 expander_data = (MpiEventDataSasExpanderStatusChange_t *)
3308 fw_event->event_data; 3309 fw_event->event_data;
3309 memcpy(&sas_address, &expander_data->SASAddress, sizeof(__le64)); 3310 memcpy(&sas_address, &expander_data->SASAddress, sizeof(__le64));
3311 sas_address = le64_to_cpu(sas_address);
3310 port_info = mptsas_find_portinfo_by_sas_address(ioc, sas_address); 3312 port_info = mptsas_find_portinfo_by_sas_address(ioc, sas_address);
3311 3313
3312 if (expander_data->ReasonCode == MPI_EVENT_SAS_EXP_RC_ADDED) { 3314 if (expander_data->ReasonCode == MPI_EVENT_SAS_EXP_RC_ADDED) {
@@ -4760,10 +4762,9 @@ mptsas_probe(struct pci_dev *pdev, const struct pci_device_id *id)
4760 4762
4761 /* set 16 byte cdb's */ 4763 /* set 16 byte cdb's */
4762 sh->max_cmd_len = 16; 4764 sh->max_cmd_len = 16;
4763 4765 sh->can_queue = min_t(int, ioc->req_depth - 10, sh->can_queue);
4764 sh->max_id = ioc->pfacts[0].PortSCSIID; 4766 sh->max_id = -1;
4765 sh->max_lun = max_lun; 4767 sh->max_lun = max_lun;
4766
4767 sh->transportt = mptsas_transport_template; 4768 sh->transportt = mptsas_transport_template;
4768 4769
4769 /* Required entry. 4770 /* Required entry.
@@ -4821,25 +4822,6 @@ mptsas_probe(struct pci_dev *pdev, const struct pci_device_id *id)
4821 dprintk(ioc, printk(MYIOC_s_DEBUG_FMT "ScsiLookup @ %p\n", 4822 dprintk(ioc, printk(MYIOC_s_DEBUG_FMT "ScsiLookup @ %p\n",
4822 ioc->name, ioc->ScsiLookup)); 4823 ioc->name, ioc->ScsiLookup));
4823 4824
4824 /* Clear the TM flags
4825 */
4826 hd->abortSCpnt = NULL;
4827
4828 /* Clear the pointer used to store
4829 * single-threaded commands, i.e., those
4830 * issued during a bus scan, dv and
4831 * configuration pages.
4832 */
4833 hd->cmdPtr = NULL;
4834
4835 /* Initialize this SCSI Hosts' timers
4836 * To use, set the timer expires field
4837 * and add_timer
4838 */
4839 init_timer(&hd->timer);
4840 hd->timer.data = (unsigned long) hd;
4841 hd->timer.function = mptscsih_timer_expired;
4842
4843 ioc->sas_data.ptClear = mpt_pt_clear; 4825 ioc->sas_data.ptClear = mpt_pt_clear;
4844 4826
4845 hd->last_queue_full = 0; 4827 hd->last_queue_full = 0;