aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authoradam radford <aradford@gmail.com>2012-01-06 20:02:40 -0500
committerJames Bottomley <JBottomley@Parallels.com>2012-01-16 02:28:07 -0500
commit7895f9c957ff5dbce8e1b96ed11919bb2e20641f (patch)
tree9636ac28a509e40553170e7bf05774f9cdd30315 /drivers/scsi
parent882be7c3be72f6d72ae7a81e707154287ea5d289 (diff)
[SCSI] megaraid_sas: remove poll_mode_io code
This code has never worked correctly, doesn't disable interrupts when set as a module parameter, doesn't disable interrupts when set after driver load time in sysfs node, etc. Signed-off-by: Adam Radford <aradford@gmail.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/megaraid/megaraid_sas.h2
-rw-r--r--drivers/scsi/megaraid/megaraid_sas_base.c141
2 files changed, 0 insertions, 143 deletions
diff --git a/drivers/scsi/megaraid/megaraid_sas.h b/drivers/scsi/megaraid/megaraid_sas.h
index dd94c7d574fb..7a03a9a6bde0 100644
--- a/drivers/scsi/megaraid/megaraid_sas.h
+++ b/drivers/scsi/megaraid/megaraid_sas.h
@@ -773,7 +773,6 @@ struct megasas_ctrl_info {
773 773
774#define MFI_OB_INTR_STATUS_MASK 0x00000002 774#define MFI_OB_INTR_STATUS_MASK 0x00000002
775#define MFI_POLL_TIMEOUT_SECS 60 775#define MFI_POLL_TIMEOUT_SECS 60
776#define MEGASAS_COMPLETION_TIMER_INTERVAL (HZ/10)
777 776
778#define MFI_REPLY_1078_MESSAGE_INTERRUPT 0x80000000 777#define MFI_REPLY_1078_MESSAGE_INTERRUPT 0x80000000
779#define MFI_REPLY_GEN2_MESSAGE_INTERRUPT 0x00000001 778#define MFI_REPLY_GEN2_MESSAGE_INTERRUPT 0x00000001
@@ -1353,7 +1352,6 @@ struct megasas_instance {
1353 u32 mfiStatus; 1352 u32 mfiStatus;
1354 u32 last_seq_num; 1353 u32 last_seq_num;
1355 1354
1356 struct timer_list io_completion_timer;
1357 struct list_head internal_reset_pending_q; 1355 struct list_head internal_reset_pending_q;
1358 1356
1359 /* Ptr to hba specific information */ 1357 /* Ptr to hba specific information */
diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c
index 2bdc70754b14..f42bd88a30e0 100644
--- a/drivers/scsi/megaraid/megaraid_sas_base.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
@@ -59,14 +59,6 @@
59#include "megaraid_sas.h" 59#include "megaraid_sas.h"
60 60
61/* 61/*
62 * poll_mode_io:1- schedule complete completion from q cmd
63 */
64static unsigned int poll_mode_io;
65module_param_named(poll_mode_io, poll_mode_io, int, 0);
66MODULE_PARM_DESC(poll_mode_io,
67 "Complete cmds from IO path, (default=0)");
68
69/*
70 * Number of sectors per IO command 62 * Number of sectors per IO command
71 * Will be set in megasas_init_mfi if user does not provide 63 * Will be set in megasas_init_mfi if user does not provide
72 */ 64 */
@@ -1439,11 +1431,6 @@ megasas_build_and_issue_cmd(struct megasas_instance *instance,
1439 1431
1440 instance->instancet->fire_cmd(instance, cmd->frame_phys_addr, 1432 instance->instancet->fire_cmd(instance, cmd->frame_phys_addr,
1441 cmd->frame_count-1, instance->reg_set); 1433 cmd->frame_count-1, instance->reg_set);
1442 /*
1443 * Check if we have pend cmds to be completed
1444 */
1445 if (poll_mode_io && atomic_read(&instance->fw_outstanding))
1446 tasklet_schedule(&instance->isr_tasklet);
1447 1434
1448 return 0; 1435 return 0;
1449out_return_cmd: 1436out_return_cmd:
@@ -3370,47 +3357,6 @@ fail_fw_init:
3370 return -EINVAL; 3357 return -EINVAL;
3371} 3358}
3372 3359
3373/**
3374 * megasas_start_timer - Initializes a timer object
3375 * @instance: Adapter soft state
3376 * @timer: timer object to be initialized
3377 * @fn: timer function
3378 * @interval: time interval between timer function call
3379 */
3380static inline void
3381megasas_start_timer(struct megasas_instance *instance,
3382 struct timer_list *timer,
3383 void *fn, unsigned long interval)
3384{
3385 init_timer(timer);
3386 timer->expires = jiffies + interval;
3387 timer->data = (unsigned long)instance;
3388 timer->function = fn;
3389 add_timer(timer);
3390}
3391
3392/**
3393 * megasas_io_completion_timer - Timer fn
3394 * @instance_addr: Address of adapter soft state
3395 *
3396 * Schedules tasklet for cmd completion
3397 * if poll_mode_io is set
3398 */
3399static void
3400megasas_io_completion_timer(unsigned long instance_addr)
3401{
3402 struct megasas_instance *instance =
3403 (struct megasas_instance *)instance_addr;
3404
3405 if (atomic_read(&instance->fw_outstanding))
3406 tasklet_schedule(&instance->isr_tasklet);
3407
3408 /* Restart timer */
3409 if (poll_mode_io)
3410 mod_timer(&instance->io_completion_timer,
3411 jiffies + MEGASAS_COMPLETION_TIMER_INTERVAL);
3412}
3413
3414static u32 3360static u32
3415megasas_init_adapter_mfi(struct megasas_instance *instance) 3361megasas_init_adapter_mfi(struct megasas_instance *instance)
3416{ 3362{
@@ -3638,11 +3584,6 @@ static int megasas_init_fw(struct megasas_instance *instance)
3638 tasklet_init(&instance->isr_tasklet, instance->instancet->tasklet, 3584 tasklet_init(&instance->isr_tasklet, instance->instancet->tasklet,
3639 (unsigned long)instance); 3585 (unsigned long)instance);
3640 3586
3641 /* Initialize the cmd completion timer */
3642 if (poll_mode_io)
3643 megasas_start_timer(instance, &instance->io_completion_timer,
3644 megasas_io_completion_timer,
3645 MEGASAS_COMPLETION_TIMER_INTERVAL);
3646 return 0; 3587 return 0;
3647 3588
3648fail_init_adapter: 3589fail_init_adapter:
@@ -4369,9 +4310,6 @@ megasas_suspend(struct pci_dev *pdev, pm_message_t state)
4369 host = instance->host; 4310 host = instance->host;
4370 instance->unload = 1; 4311 instance->unload = 1;
4371 4312
4372 if (poll_mode_io)
4373 del_timer_sync(&instance->io_completion_timer);
4374
4375 megasas_flush_cache(instance); 4313 megasas_flush_cache(instance);
4376 megasas_shutdown_controller(instance, MR_DCMD_HIBERNATE_SHUTDOWN); 4314 megasas_shutdown_controller(instance, MR_DCMD_HIBERNATE_SHUTDOWN);
4377 4315
@@ -4511,12 +4449,6 @@ megasas_resume(struct pci_dev *pdev)
4511 } 4449 }
4512 4450
4513 instance->instancet->enable_intr(instance->reg_set); 4451 instance->instancet->enable_intr(instance->reg_set);
4514
4515 /* Initialize the cmd completion timer */
4516 if (poll_mode_io)
4517 megasas_start_timer(instance, &instance->io_completion_timer,
4518 megasas_io_completion_timer,
4519 MEGASAS_COMPLETION_TIMER_INTERVAL);
4520 instance->unload = 0; 4452 instance->unload = 0;
4521 4453
4522 /* 4454 /*
@@ -4570,9 +4502,6 @@ static void __devexit megasas_detach_one(struct pci_dev *pdev)
4570 host = instance->host; 4502 host = instance->host;
4571 fusion = instance->ctrl_context; 4503 fusion = instance->ctrl_context;
4572 4504
4573 if (poll_mode_io)
4574 del_timer_sync(&instance->io_completion_timer);
4575
4576 scsi_remove_host(instance->host); 4505 scsi_remove_host(instance->host);
4577 megasas_flush_cache(instance); 4506 megasas_flush_cache(instance);
4578 megasas_shutdown_controller(instance, MR_DCMD_CTRL_SHUTDOWN); 4507 megasas_shutdown_controller(instance, MR_DCMD_CTRL_SHUTDOWN);
@@ -5221,60 +5150,6 @@ megasas_sysfs_set_dbg_lvl(struct device_driver *dd, const char *buf, size_t coun
5221static DRIVER_ATTR(dbg_lvl, S_IRUGO|S_IWUSR, megasas_sysfs_show_dbg_lvl, 5150static DRIVER_ATTR(dbg_lvl, S_IRUGO|S_IWUSR, megasas_sysfs_show_dbg_lvl,
5222 megasas_sysfs_set_dbg_lvl); 5151 megasas_sysfs_set_dbg_lvl);
5223 5152
5224static ssize_t
5225megasas_sysfs_show_poll_mode_io(struct device_driver *dd, char *buf)
5226{
5227 return sprintf(buf, "%u\n", poll_mode_io);
5228}
5229
5230static ssize_t
5231megasas_sysfs_set_poll_mode_io(struct device_driver *dd,
5232 const char *buf, size_t count)
5233{
5234 int retval = count;
5235 int tmp = poll_mode_io;
5236 int i;
5237 struct megasas_instance *instance;
5238
5239 if (sscanf(buf, "%u", &poll_mode_io) < 1) {
5240 printk(KERN_ERR "megasas: could not set poll_mode_io\n");
5241 retval = -EINVAL;
5242 }
5243
5244 /*
5245 * Check if poll_mode_io is already set or is same as previous value
5246 */
5247 if ((tmp && poll_mode_io) || (tmp == poll_mode_io))
5248 goto out;
5249
5250 if (poll_mode_io) {
5251 /*
5252 * Start timers for all adapters
5253 */
5254 for (i = 0; i < megasas_mgmt_info.max_index; i++) {
5255 instance = megasas_mgmt_info.instance[i];
5256 if (instance) {
5257 megasas_start_timer(instance,
5258 &instance->io_completion_timer,
5259 megasas_io_completion_timer,
5260 MEGASAS_COMPLETION_TIMER_INTERVAL);
5261 }
5262 }
5263 } else {
5264 /*
5265 * Delete timers for all adapters
5266 */
5267 for (i = 0; i < megasas_mgmt_info.max_index; i++) {
5268 instance = megasas_mgmt_info.instance[i];
5269 if (instance)
5270 del_timer_sync(&instance->io_completion_timer);
5271 }
5272 }
5273
5274out:
5275 return retval;
5276}
5277
5278static void 5153static void
5279megasas_aen_polling(struct work_struct *work) 5154megasas_aen_polling(struct work_struct *work)
5280{ 5155{
@@ -5504,11 +5379,6 @@ megasas_aen_polling(struct work_struct *work)
5504 kfree(ev); 5379 kfree(ev);
5505} 5380}
5506 5381
5507
5508static DRIVER_ATTR(poll_mode_io, S_IRUGO|S_IWUSR,
5509 megasas_sysfs_show_poll_mode_io,
5510 megasas_sysfs_set_poll_mode_io);
5511
5512/** 5382/**
5513 * megasas_init - Driver load entry point 5383 * megasas_init - Driver load entry point
5514 */ 5384 */
@@ -5568,11 +5438,6 @@ static int __init megasas_init(void)
5568 if (rval) 5438 if (rval)
5569 goto err_dcf_dbg_lvl; 5439 goto err_dcf_dbg_lvl;
5570 rval = driver_create_file(&megasas_pci_driver.driver, 5440 rval = driver_create_file(&megasas_pci_driver.driver,
5571 &driver_attr_poll_mode_io);
5572 if (rval)
5573 goto err_dcf_poll_mode_io;
5574
5575 rval = driver_create_file(&megasas_pci_driver.driver,
5576 &driver_attr_support_device_change); 5441 &driver_attr_support_device_change);
5577 if (rval) 5442 if (rval)
5578 goto err_dcf_support_device_change; 5443 goto err_dcf_support_device_change;
@@ -5581,10 +5446,6 @@ static int __init megasas_init(void)
5581 5446
5582err_dcf_support_device_change: 5447err_dcf_support_device_change:
5583 driver_remove_file(&megasas_pci_driver.driver, 5448 driver_remove_file(&megasas_pci_driver.driver,
5584 &driver_attr_poll_mode_io);
5585
5586err_dcf_poll_mode_io:
5587 driver_remove_file(&megasas_pci_driver.driver,
5588 &driver_attr_dbg_lvl); 5449 &driver_attr_dbg_lvl);
5589err_dcf_dbg_lvl: 5450err_dcf_dbg_lvl:
5590 driver_remove_file(&megasas_pci_driver.driver, 5451 driver_remove_file(&megasas_pci_driver.driver,
@@ -5609,8 +5470,6 @@ err_pcidrv:
5609static void __exit megasas_exit(void) 5470static void __exit megasas_exit(void)
5610{ 5471{
5611 driver_remove_file(&megasas_pci_driver.driver, 5472 driver_remove_file(&megasas_pci_driver.driver,
5612 &driver_attr_poll_mode_io);
5613 driver_remove_file(&megasas_pci_driver.driver,
5614 &driver_attr_dbg_lvl); 5473 &driver_attr_dbg_lvl);
5615 driver_remove_file(&megasas_pci_driver.driver, 5474 driver_remove_file(&megasas_pci_driver.driver,
5616 &driver_attr_support_poll_for_event); 5475 &driver_attr_support_poll_for_event);