aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/mtip32xx
diff options
context:
space:
mode:
authorAsai Thambi S P <asamymuthupa@micron.com>2012-04-09 02:35:38 -0400
committerJens Axboe <axboe@kernel.dk>2012-04-09 02:35:38 -0400
commit8a857a880bd83ba4f217d55dd4a623a7e4b5cb47 (patch)
tree931c0d39ef2d68f68edf27342c306490ea086f6c /drivers/block/mtip32xx
parent8182b495281764ca518781e876c91900e75088d2 (diff)
mtip32xx: Shorten macro names
Shortened macros used to represent mtip_port->flags and dd->dd_flag Signed-off-by: Asai Thambi S P <asamymuthupa@micron.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/block/mtip32xx')
-rw-r--r--drivers/block/mtip32xx/mtip32xx.c124
-rw-r--r--drivers/block/mtip32xx/mtip32xx.h28
2 files changed, 75 insertions, 77 deletions
diff --git a/drivers/block/mtip32xx/mtip32xx.c b/drivers/block/mtip32xx/mtip32xx.c
index be96626accec..e57864a7912e 100644
--- a/drivers/block/mtip32xx/mtip32xx.c
+++ b/drivers/block/mtip32xx/mtip32xx.c
@@ -173,7 +173,7 @@ static void mtip_command_cleanup(struct driver_data *dd)
173 173
174 up(&port->cmd_slot); 174 up(&port->cmd_slot);
175 175
176 set_bit(MTIP_DD_FLAG_CLEANUP_BIT, &dd->dd_flag); 176 set_bit(MTIP_DDF_CLEANUP_BIT, &dd->dd_flag);
177 in_progress = 0; 177 in_progress = 0;
178} 178}
179 179
@@ -271,7 +271,7 @@ static int hba_reset_nosleep(struct driver_data *dd)
271 && time_before(jiffies, timeout)) 271 && time_before(jiffies, timeout))
272 mdelay(1); 272 mdelay(1);
273 273
274 if (test_bit(MTIP_DD_FLAG_REMOVE_PENDING_BIT, &dd->dd_flag)) 274 if (test_bit(MTIP_DDF_REMOVE_PENDING_BIT, &dd->dd_flag))
275 return -1; 275 return -1;
276 276
277 if (readl(dd->mmio + HOST_CTL) & HOST_RESET) 277 if (readl(dd->mmio + HOST_CTL) & HOST_RESET)
@@ -467,7 +467,7 @@ static void mtip_restart_port(struct mtip_port *port)
467 && time_before(jiffies, timeout)) 467 && time_before(jiffies, timeout))
468 ; 468 ;
469 469
470 if (test_bit(MTIP_DD_FLAG_REMOVE_PENDING_BIT, &port->dd->dd_flag)) 470 if (test_bit(MTIP_DDF_REMOVE_PENDING_BIT, &port->dd->dd_flag))
471 return; 471 return;
472 472
473 /* 473 /*
@@ -498,7 +498,7 @@ static void mtip_restart_port(struct mtip_port *port)
498 while (time_before(jiffies, timeout)) 498 while (time_before(jiffies, timeout))
499 ; 499 ;
500 500
501 if (test_bit(MTIP_DD_FLAG_REMOVE_PENDING_BIT, &port->dd->dd_flag)) 501 if (test_bit(MTIP_DDF_REMOVE_PENDING_BIT, &port->dd->dd_flag))
502 return; 502 return;
503 503
504 /* Clear PxSCTL.DET */ 504 /* Clear PxSCTL.DET */
@@ -512,7 +512,7 @@ static void mtip_restart_port(struct mtip_port *port)
512 && time_before(jiffies, timeout)) 512 && time_before(jiffies, timeout))
513 ; 513 ;
514 514
515 if (test_bit(MTIP_DD_FLAG_REMOVE_PENDING_BIT, &port->dd->dd_flag)) 515 if (test_bit(MTIP_DDF_REMOVE_PENDING_BIT, &port->dd->dd_flag))
516 return; 516 return;
517 517
518 if ((readl(port->mmio + PORT_SCR_STAT) & 0x01) == 0) 518 if ((readl(port->mmio + PORT_SCR_STAT) & 0x01) == 0)
@@ -545,7 +545,7 @@ static void mtip_timeout_function(unsigned long int data)
545 if (unlikely(!port)) 545 if (unlikely(!port))
546 return; 546 return;
547 547
548 if (test_bit(MTIP_DD_FLAG_RESUME_BIT, &port->dd->dd_flag)) { 548 if (test_bit(MTIP_DDF_RESUME_BIT, &port->dd->dd_flag)) {
549 mod_timer(&port->cmd_timer, 549 mod_timer(&port->cmd_timer,
550 jiffies + msecs_to_jiffies(30000)); 550 jiffies + msecs_to_jiffies(30000));
551 return; 551 return;
@@ -572,7 +572,7 @@ static void mtip_timeout_function(unsigned long int data)
572 572
573 cmdto_cnt++; 573 cmdto_cnt++;
574 if (cmdto_cnt == 1) 574 if (cmdto_cnt == 1)
575 set_bit(MTIP_FLAG_EH_ACTIVE_BIT, &port->flags); 575 set_bit(MTIP_PF_EH_ACTIVE_BIT, &port->flags);
576 576
577 /* 577 /*
578 * Clear the completed bit. This should prevent 578 * Clear the completed bit. This should prevent
@@ -610,7 +610,7 @@ static void mtip_timeout_function(unsigned long int data)
610 "%d commands timed out: restarting port", 610 "%d commands timed out: restarting port",
611 cmdto_cnt); 611 cmdto_cnt);
612 mtip_restart_port(port); 612 mtip_restart_port(port);
613 clear_bit(MTIP_FLAG_EH_ACTIVE_BIT, &port->flags); 613 clear_bit(MTIP_PF_EH_ACTIVE_BIT, &port->flags);
614 wake_up_interruptible(&port->svc_wait); 614 wake_up_interruptible(&port->svc_wait);
615 } 615 }
616 616
@@ -765,7 +765,7 @@ static void mtip_handle_tfe(struct driver_data *dd)
765 del_timer(&port->cmd_timer); 765 del_timer(&port->cmd_timer);
766 766
767 /* Set eh_active */ 767 /* Set eh_active */
768 set_bit(MTIP_FLAG_EH_ACTIVE_BIT, &port->flags); 768 set_bit(MTIP_PF_EH_ACTIVE_BIT, &port->flags);
769 769
770 /* Loop through all the groups */ 770 /* Loop through all the groups */
771 for (group = 0; group < dd->slot_groups; group++) { 771 for (group = 0; group < dd->slot_groups; group++) {
@@ -826,14 +826,14 @@ static void mtip_handle_tfe(struct driver_data *dd)
826 if (buf[259] & 0x1) { 826 if (buf[259] & 0x1) {
827 dev_info(&dd->pdev->dev, 827 dev_info(&dd->pdev->dev,
828 "Write protect bit is set.\n"); 828 "Write protect bit is set.\n");
829 set_bit(MTIP_DD_FLAG_WRITE_PROTECT_BIT, &dd->dd_flag); 829 set_bit(MTIP_DDF_WRITE_PROTECT_BIT, &dd->dd_flag);
830 fail_all_ncq_write = 1; 830 fail_all_ncq_write = 1;
831 fail_reason = "write protect"; 831 fail_reason = "write protect";
832 } 832 }
833 if (buf[288] == 0xF7) { 833 if (buf[288] == 0xF7) {
834 dev_info(&dd->pdev->dev, 834 dev_info(&dd->pdev->dev,
835 "Exceeded Tmax, drive in thermal shutdown.\n"); 835 "Exceeded Tmax, drive in thermal shutdown.\n");
836 set_bit(MTIP_DD_FLAG_OVER_TEMP_BIT, &dd->dd_flag); 836 set_bit(MTIP_DDF_OVER_TEMP_BIT, &dd->dd_flag);
837 fail_all_ncq_cmds = 1; 837 fail_all_ncq_cmds = 1;
838 fail_reason = "thermal shutdown"; 838 fail_reason = "thermal shutdown";
839 } 839 }
@@ -920,7 +920,7 @@ static void mtip_handle_tfe(struct driver_data *dd)
920 print_tags(dd, "TFE tags reissued:", tagaccum); 920 print_tags(dd, "TFE tags reissued:", tagaccum);
921 921
922 /* clear eh_active */ 922 /* clear eh_active */
923 clear_bit(MTIP_FLAG_EH_ACTIVE_BIT, &port->flags); 923 clear_bit(MTIP_PF_EH_ACTIVE_BIT, &port->flags);
924 wake_up_interruptible(&port->svc_wait); 924 wake_up_interruptible(&port->svc_wait);
925 925
926 mod_timer(&port->cmd_timer, 926 mod_timer(&port->cmd_timer,
@@ -988,7 +988,7 @@ static inline void mtip_process_legacy(struct driver_data *dd, u32 port_stat)
988 struct mtip_port *port = dd->port; 988 struct mtip_port *port = dd->port;
989 struct mtip_cmd *cmd = &port->commands[MTIP_TAG_INTERNAL]; 989 struct mtip_cmd *cmd = &port->commands[MTIP_TAG_INTERNAL];
990 990
991 if (test_bit(MTIP_FLAG_IC_ACTIVE_BIT, &port->flags) && 991 if (test_bit(MTIP_PF_IC_ACTIVE_BIT, &port->flags) &&
992 (cmd != NULL) && !(readl(port->cmd_issue[MTIP_TAG_INTERNAL]) 992 (cmd != NULL) && !(readl(port->cmd_issue[MTIP_TAG_INTERNAL])
993 & (1 << MTIP_TAG_INTERNAL))) { 993 & (1 << MTIP_TAG_INTERNAL))) {
994 if (cmd->comp_func) { 994 if (cmd->comp_func) {
@@ -1055,7 +1055,7 @@ static inline irqreturn_t mtip_handle_irq(struct driver_data *data)
1055 /* don't proceed further */ 1055 /* don't proceed further */
1056 return IRQ_HANDLED; 1056 return IRQ_HANDLED;
1057 } 1057 }
1058 if (test_bit(MTIP_DD_FLAG_REMOVE_PENDING_BIT, 1058 if (test_bit(MTIP_DDF_REMOVE_PENDING_BIT,
1059 &dd->dd_flag)) 1059 &dd->dd_flag))
1060 return rv; 1060 return rv;
1061 1061
@@ -1123,13 +1123,12 @@ static int mtip_quiesce_io(struct mtip_port *port, unsigned long timeout)
1123 1123
1124 to = jiffies + msecs_to_jiffies(timeout); 1124 to = jiffies + msecs_to_jiffies(timeout);
1125 do { 1125 do {
1126 if (test_bit(MTIP_FLAG_SVC_THD_ACTIVE_BIT, &port->flags) && 1126 if (test_bit(MTIP_PF_SVC_THD_ACTIVE_BIT, &port->flags) &&
1127 test_bit(MTIP_FLAG_ISSUE_CMDS_BIT, &port->flags)) { 1127 test_bit(MTIP_PF_ISSUE_CMDS_BIT, &port->flags)) {
1128 msleep(20); 1128 msleep(20);
1129 continue; /* svc thd is actively issuing commands */ 1129 continue; /* svc thd is actively issuing commands */
1130 } 1130 }
1131 if (test_bit(MTIP_DD_FLAG_REMOVE_PENDING_BIT, 1131 if (test_bit(MTIP_DDF_REMOVE_PENDING_BIT, &port->dd->dd_flag))
1132 &port->dd->dd_flag))
1133 return -EFAULT; 1132 return -EFAULT;
1134 /* 1133 /*
1135 * Ignore s_active bit 0 of array element 0. 1134 * Ignore s_active bit 0 of array element 0.
@@ -1193,7 +1192,7 @@ static int mtip_exec_internal_command(struct mtip_port *port,
1193 "Internal command already active\n"); 1192 "Internal command already active\n");
1194 return -EBUSY; 1193 return -EBUSY;
1195 } 1194 }
1196 set_bit(MTIP_FLAG_IC_ACTIVE_BIT, &port->flags); 1195 set_bit(MTIP_PF_IC_ACTIVE_BIT, &port->flags);
1197 1196
1198 if (atomic == GFP_KERNEL) { 1197 if (atomic == GFP_KERNEL) {
1199 if (fis->command != ATA_CMD_STANDBYNOW1) { 1198 if (fis->command != ATA_CMD_STANDBYNOW1) {
@@ -1202,8 +1201,7 @@ static int mtip_exec_internal_command(struct mtip_port *port,
1202 dev_warn(&port->dd->pdev->dev, 1201 dev_warn(&port->dd->pdev->dev,
1203 "Failed to quiesce IO\n"); 1202 "Failed to quiesce IO\n");
1204 release_slot(port, MTIP_TAG_INTERNAL); 1203 release_slot(port, MTIP_TAG_INTERNAL);
1205 clear_bit(MTIP_FLAG_IC_ACTIVE_BIT, 1204 clear_bit(MTIP_PF_IC_ACTIVE_BIT, &port->flags);
1206 &port->flags);
1207 wake_up_interruptible(&port->svc_wait); 1205 wake_up_interruptible(&port->svc_wait);
1208 return -EBUSY; 1206 return -EBUSY;
1209 } 1207 }
@@ -1256,7 +1254,7 @@ static int mtip_exec_internal_command(struct mtip_port *port,
1256 "within timeout of %lu ms\n", 1254 "within timeout of %lu ms\n",
1257 atomic, timeout); 1255 atomic, timeout);
1258 if (mtip_check_surprise_removal(port->dd->pdev) || 1256 if (mtip_check_surprise_removal(port->dd->pdev) ||
1259 test_bit(MTIP_DD_FLAG_REMOVE_PENDING_BIT, 1257 test_bit(MTIP_DDF_REMOVE_PENDING_BIT,
1260 &port->dd->dd_flag)) { 1258 &port->dd->dd_flag)) {
1261 rv = -ENXIO; 1259 rv = -ENXIO;
1262 goto exec_ic_exit; 1260 goto exec_ic_exit;
@@ -1268,7 +1266,7 @@ static int mtip_exec_internal_command(struct mtip_port *port,
1268 & (1 << MTIP_TAG_INTERNAL)) { 1266 & (1 << MTIP_TAG_INTERNAL)) {
1269 dev_warn(&port->dd->pdev->dev, 1267 dev_warn(&port->dd->pdev->dev,
1270 "Retiring internal command but CI is 1.\n"); 1268 "Retiring internal command but CI is 1.\n");
1271 if (test_bit(MTIP_DD_FLAG_REMOVE_PENDING_BIT, 1269 if (test_bit(MTIP_DDF_REMOVE_PENDING_BIT,
1272 &port->dd->dd_flag)) { 1270 &port->dd->dd_flag)) {
1273 hba_reset_nosleep(port->dd); 1271 hba_reset_nosleep(port->dd);
1274 rv = -ENXIO; 1272 rv = -ENXIO;
@@ -1290,7 +1288,7 @@ static int mtip_exec_internal_command(struct mtip_port *port,
1290 goto exec_ic_exit; 1288 goto exec_ic_exit;
1291 } 1289 }
1292 if ((fis->command != ATA_CMD_STANDBYNOW1) && 1290 if ((fis->command != ATA_CMD_STANDBYNOW1) &&
1293 test_bit(MTIP_DD_FLAG_REMOVE_PENDING_BIT, 1291 test_bit(MTIP_DDF_REMOVE_PENDING_BIT,
1294 &port->dd->dd_flag)) { 1292 &port->dd->dd_flag)) {
1295 rv = -ENXIO; 1293 rv = -ENXIO;
1296 goto exec_ic_exit; 1294 goto exec_ic_exit;
@@ -1302,7 +1300,7 @@ static int mtip_exec_internal_command(struct mtip_port *port,
1302 dev_err(&port->dd->pdev->dev, 1300 dev_err(&port->dd->pdev->dev,
1303 "Internal command did not complete [atomic]\n"); 1301 "Internal command did not complete [atomic]\n");
1304 rv = -EAGAIN; 1302 rv = -EAGAIN;
1305 if (test_bit(MTIP_DD_FLAG_REMOVE_PENDING_BIT, 1303 if (test_bit(MTIP_DDF_REMOVE_PENDING_BIT,
1306 &port->dd->dd_flag)) { 1304 &port->dd->dd_flag)) {
1307 hba_reset_nosleep(port->dd); 1305 hba_reset_nosleep(port->dd);
1308 rv = -ENXIO; 1306 rv = -ENXIO;
@@ -1316,7 +1314,7 @@ exec_ic_exit:
1316 /* Clear the allocated and active bits for the internal command. */ 1314 /* Clear the allocated and active bits for the internal command. */
1317 atomic_set(&int_cmd->active, 0); 1315 atomic_set(&int_cmd->active, 0);
1318 release_slot(port, MTIP_TAG_INTERNAL); 1316 release_slot(port, MTIP_TAG_INTERNAL);
1319 clear_bit(MTIP_FLAG_IC_ACTIVE_BIT, &port->flags); 1317 clear_bit(MTIP_PF_IC_ACTIVE_BIT, &port->flags);
1320 wake_up_interruptible(&port->svc_wait); 1318 wake_up_interruptible(&port->svc_wait);
1321 1319
1322 return rv; 1320 return rv;
@@ -1366,7 +1364,7 @@ static int mtip_get_identify(struct mtip_port *port, void __user *user_buffer)
1366 int rv = 0; 1364 int rv = 0;
1367 struct host_to_dev_fis fis; 1365 struct host_to_dev_fis fis;
1368 1366
1369 if (test_bit(MTIP_DD_FLAG_REMOVE_PENDING_BIT, &port->dd->dd_flag)) 1367 if (test_bit(MTIP_DDF_REMOVE_PENDING_BIT, &port->dd->dd_flag))
1370 return -EFAULT; 1368 return -EFAULT;
1371 1369
1372 /* Build the FIS. */ 1370 /* Build the FIS. */
@@ -2398,10 +2396,10 @@ static void mtip_hw_submit_io(struct driver_data *dd, sector_t start,
2398 * To prevent this command from being issued 2396 * To prevent this command from being issued
2399 * if an internal command is in progress or error handling is active. 2397 * if an internal command is in progress or error handling is active.
2400 */ 2398 */
2401 if (unlikely(test_bit(MTIP_FLAG_IC_ACTIVE_BIT, &port->flags) || 2399 if (unlikely(test_bit(MTIP_PF_IC_ACTIVE_BIT, &port->flags) ||
2402 test_bit(MTIP_FLAG_EH_ACTIVE_BIT, &port->flags))) { 2400 test_bit(MTIP_PF_EH_ACTIVE_BIT, &port->flags))) {
2403 set_bit(tag, port->cmds_to_issue); 2401 set_bit(tag, port->cmds_to_issue);
2404 set_bit(MTIP_FLAG_ISSUE_CMDS_BIT, &port->flags); 2402 set_bit(MTIP_PF_ISSUE_CMDS_BIT, &port->flags);
2405 return; 2403 return;
2406 } 2404 }
2407 2405
@@ -2447,7 +2445,7 @@ static struct scatterlist *mtip_hw_get_scatterlist(struct driver_data *dd,
2447 down(&dd->port->cmd_slot); 2445 down(&dd->port->cmd_slot);
2448 *tag = get_slot(dd->port); 2446 *tag = get_slot(dd->port);
2449 2447
2450 if (unlikely(test_bit(MTIP_DD_FLAG_REMOVE_PENDING_BIT, &dd->dd_flag))) { 2448 if (unlikely(test_bit(MTIP_DDF_REMOVE_PENDING_BIT, &dd->dd_flag))) {
2451 up(&dd->port->cmd_slot); 2449 up(&dd->port->cmd_slot);
2452 return NULL; 2450 return NULL;
2453 } 2451 }
@@ -2521,9 +2519,9 @@ static ssize_t mtip_hw_show_status(struct device *dev,
2521 struct driver_data *dd = dev_to_disk(dev)->private_data; 2519 struct driver_data *dd = dev_to_disk(dev)->private_data;
2522 int size = 0; 2520 int size = 0;
2523 2521
2524 if (test_bit(MTIP_DD_FLAG_OVER_TEMP_BIT, &dd->dd_flag)) 2522 if (test_bit(MTIP_DDF_OVER_TEMP_BIT, &dd->dd_flag))
2525 size += sprintf(buf, "%s", "thermal_shutdown\n"); 2523 size += sprintf(buf, "%s", "thermal_shutdown\n");
2526 else if (test_bit(MTIP_DD_FLAG_WRITE_PROTECT_BIT, &dd->dd_flag)) 2524 else if (test_bit(MTIP_DDF_WRITE_PROTECT_BIT, &dd->dd_flag))
2527 size += sprintf(buf, "%s", "write_protect\n"); 2525 size += sprintf(buf, "%s", "write_protect\n");
2528 else 2526 else
2529 size += sprintf(buf, "%s", "online\n"); 2527 size += sprintf(buf, "%s", "online\n");
@@ -2670,7 +2668,7 @@ static int mtip_ftl_rebuild_poll(struct driver_data *dd)
2670 timeout = jiffies + msecs_to_jiffies(MTIP_FTL_REBUILD_TIMEOUT_MS); 2668 timeout = jiffies + msecs_to_jiffies(MTIP_FTL_REBUILD_TIMEOUT_MS);
2671 2669
2672 do { 2670 do {
2673 if (unlikely(test_bit(MTIP_DD_FLAG_REMOVE_PENDING_BIT, 2671 if (unlikely(test_bit(MTIP_DDF_REMOVE_PENDING_BIT,
2674 &dd->dd_flag))) 2672 &dd->dd_flag)))
2675 return -EFAULT; 2673 return -EFAULT;
2676 if (mtip_check_surprise_removal(dd->pdev)) 2674 if (mtip_check_surprise_removal(dd->pdev))
@@ -2728,17 +2726,17 @@ static int mtip_service_thread(void *data)
2728 * is in progress nor error handling is active 2726 * is in progress nor error handling is active
2729 */ 2727 */
2730 wait_event_interruptible(port->svc_wait, (port->flags) && 2728 wait_event_interruptible(port->svc_wait, (port->flags) &&
2731 !test_bit(MTIP_FLAG_IC_ACTIVE_BIT, &port->flags) && 2729 !test_bit(MTIP_PF_IC_ACTIVE_BIT, &port->flags) &&
2732 !test_bit(MTIP_FLAG_EH_ACTIVE_BIT, &port->flags)); 2730 !test_bit(MTIP_PF_EH_ACTIVE_BIT, &port->flags));
2733 2731
2734 if (kthread_should_stop()) 2732 if (kthread_should_stop())
2735 break; 2733 break;
2736 2734
2737 if (unlikely(test_bit(MTIP_DD_FLAG_REMOVE_PENDING_BIT, 2735 if (unlikely(test_bit(MTIP_DDF_REMOVE_PENDING_BIT,
2738 &dd->dd_flag))) 2736 &dd->dd_flag)))
2739 break; 2737 break;
2740 set_bit(MTIP_FLAG_SVC_THD_ACTIVE_BIT, &port->flags); 2738 set_bit(MTIP_PF_SVC_THD_ACTIVE_BIT, &port->flags);
2741 if (test_bit(MTIP_FLAG_ISSUE_CMDS_BIT, &port->flags)) { 2739 if (test_bit(MTIP_PF_ISSUE_CMDS_BIT, &port->flags)) {
2742 slot = 1; 2740 slot = 1;
2743 /* used to restrict the loop to one iteration */ 2741 /* used to restrict the loop to one iteration */
2744 slot_start = num_cmd_slots; 2742 slot_start = num_cmd_slots;
@@ -2766,16 +2764,16 @@ static int mtip_service_thread(void *data)
2766 clear_bit(slot, port->cmds_to_issue); 2764 clear_bit(slot, port->cmds_to_issue);
2767 } 2765 }
2768 2766
2769 clear_bit(MTIP_FLAG_ISSUE_CMDS_BIT, &port->flags); 2767 clear_bit(MTIP_PF_ISSUE_CMDS_BIT, &port->flags);
2770 } else if (test_bit(MTIP_FLAG_REBUILD_BIT, &port->flags)) { 2768 } else if (test_bit(MTIP_PF_REBUILD_BIT, &port->flags)) {
2771 if (!mtip_ftl_rebuild_poll(dd)) 2769 if (!mtip_ftl_rebuild_poll(dd))
2772 set_bit(MTIP_DD_FLAG_REBUILD_FAILED_BIT, 2770 set_bit(MTIP_DDF_REBUILD_FAILED_BIT,
2773 &dd->dd_flag); 2771 &dd->dd_flag);
2774 clear_bit(MTIP_FLAG_REBUILD_BIT, &port->flags); 2772 clear_bit(MTIP_PF_REBUILD_BIT, &port->flags);
2775 } 2773 }
2776 clear_bit(MTIP_FLAG_SVC_THD_ACTIVE_BIT, &port->flags); 2774 clear_bit(MTIP_PF_SVC_THD_ACTIVE_BIT, &port->flags);
2777 2775
2778 if (test_bit(MTIP_FLAG_SVC_THD_SHOULD_STOP_BIT, &port->flags)) 2776 if (test_bit(MTIP_PF_SVC_THD_SHOULD_STOP_BIT, &port->flags))
2779 break; 2777 break;
2780 } 2778 }
2781 return 0; 2779 return 0;
@@ -2930,7 +2928,7 @@ static int mtip_hw_init(struct driver_data *dd)
2930 rv = -ENODEV; 2928 rv = -ENODEV;
2931 goto out2 ; 2929 goto out2 ;
2932 } 2930 }
2933 if (unlikely(test_bit(MTIP_DD_FLAG_REMOVE_PENDING_BIT, &dd->dd_flag))) { 2931 if (unlikely(test_bit(MTIP_DDF_REMOVE_PENDING_BIT, &dd->dd_flag))) {
2934 timetaken = jiffies - timetaken; 2932 timetaken = jiffies - timetaken;
2935 dev_warn(&dd->pdev->dev, 2933 dev_warn(&dd->pdev->dev,
2936 "Removal detected at %u ms\n", 2934 "Removal detected at %u ms\n",
@@ -2983,7 +2981,7 @@ static int mtip_hw_init(struct driver_data *dd)
2983 jiffies + msecs_to_jiffies(MTIP_TIMEOUT_CHECK_PERIOD)); 2981 jiffies + msecs_to_jiffies(MTIP_TIMEOUT_CHECK_PERIOD));
2984 2982
2985 2983
2986 if (test_bit(MTIP_DD_FLAG_REMOVE_PENDING_BIT, &dd->dd_flag)) { 2984 if (test_bit(MTIP_DDF_REMOVE_PENDING_BIT, &dd->dd_flag)) {
2987 rv = -EFAULT; 2985 rv = -EFAULT;
2988 goto out3; 2986 goto out3;
2989 } 2987 }
@@ -2995,7 +2993,7 @@ static int mtip_hw_init(struct driver_data *dd)
2995 2993
2996 if (*(dd->port->identify + MTIP_FTL_REBUILD_OFFSET) == 2994 if (*(dd->port->identify + MTIP_FTL_REBUILD_OFFSET) ==
2997 MTIP_FTL_REBUILD_MAGIC) { 2995 MTIP_FTL_REBUILD_MAGIC) {
2998 set_bit(MTIP_FLAG_REBUILD_BIT, &dd->port->flags); 2996 set_bit(MTIP_PF_REBUILD_BIT, &dd->port->flags);
2999 return MTIP_FTL_REBUILD_MAGIC; 2997 return MTIP_FTL_REBUILD_MAGIC;
3000 } 2998 }
3001 mtip_dump_identify(dd->port); 2999 mtip_dump_identify(dd->port);
@@ -3013,12 +3011,12 @@ static int mtip_hw_init(struct driver_data *dd)
3013 if (buf[259] & 0x1) { 3011 if (buf[259] & 0x1) {
3014 dev_info(&dd->pdev->dev, 3012 dev_info(&dd->pdev->dev,
3015 "Write protect bit is set.\n"); 3013 "Write protect bit is set.\n");
3016 set_bit(MTIP_DD_FLAG_WRITE_PROTECT_BIT, &dd->dd_flag); 3014 set_bit(MTIP_DDF_WRITE_PROTECT_BIT, &dd->dd_flag);
3017 } 3015 }
3018 if (buf[288] == 0xF7) { 3016 if (buf[288] == 0xF7) {
3019 dev_info(&dd->pdev->dev, 3017 dev_info(&dd->pdev->dev,
3020 "Exceeded Tmax, drive in thermal shutdown.\n"); 3018 "Exceeded Tmax, drive in thermal shutdown.\n");
3021 set_bit(MTIP_DD_FLAG_OVER_TEMP_BIT, &dd->dd_flag); 3019 set_bit(MTIP_DDF_OVER_TEMP_BIT, &dd->dd_flag);
3022 } 3020 }
3023 if (buf[288] == 0xBF) { 3021 if (buf[288] == 0xBF) {
3024 dev_info(&dd->pdev->dev, 3022 dev_info(&dd->pdev->dev,
@@ -3077,9 +3075,9 @@ static int mtip_hw_exit(struct driver_data *dd)
3077 * Send standby immediate (E0h) to the drive so that it 3075 * Send standby immediate (E0h) to the drive so that it
3078 * saves its state. 3076 * saves its state.
3079 */ 3077 */
3080 if (!test_bit(MTIP_DD_FLAG_CLEANUP_BIT, &dd->dd_flag)) { 3078 if (!test_bit(MTIP_DDF_CLEANUP_BIT, &dd->dd_flag)) {
3081 3079
3082 if (!test_bit(MTIP_FLAG_REBUILD_BIT, &dd->port->flags)) 3080 if (!test_bit(MTIP_PF_REBUILD_BIT, &dd->port->flags))
3083 if (mtip_standby_immediate(dd->port)) 3081 if (mtip_standby_immediate(dd->port))
3084 dev_warn(&dd->pdev->dev, 3082 dev_warn(&dd->pdev->dev,
3085 "STANDBY IMMEDIATE failed\n"); 3083 "STANDBY IMMEDIATE failed\n");
@@ -3260,7 +3258,7 @@ static int mtip_block_ioctl(struct block_device *dev,
3260 if (!dd) 3258 if (!dd)
3261 return -ENOTTY; 3259 return -ENOTTY;
3262 3260
3263 if (unlikely(test_bit(MTIP_DD_FLAG_REMOVE_PENDING_BIT, &dd->dd_flag))) 3261 if (unlikely(test_bit(MTIP_DDF_REMOVE_PENDING_BIT, &dd->dd_flag)))
3264 return -ENOTTY; 3262 return -ENOTTY;
3265 3263
3266 switch (cmd) { 3264 switch (cmd) {
@@ -3298,7 +3296,7 @@ static int mtip_block_compat_ioctl(struct block_device *dev,
3298 if (!dd) 3296 if (!dd)
3299 return -ENOTTY; 3297 return -ENOTTY;
3300 3298
3301 if (unlikely(test_bit(MTIP_DD_FLAG_REMOVE_PENDING_BIT, &dd->dd_flag))) 3299 if (unlikely(test_bit(MTIP_DDF_REMOVE_PENDING_BIT, &dd->dd_flag)))
3302 return -ENOTTY; 3300 return -ENOTTY;
3303 3301
3304 switch (cmd) { 3302 switch (cmd) {
@@ -3423,7 +3421,7 @@ static void mtip_make_request(struct request_queue *queue, struct bio *bio)
3423 int nents = 0; 3421 int nents = 0;
3424 int tag = 0; 3422 int tag = 0;
3425 3423
3426 if (test_bit(MTIP_DD_FLAG_REMOVE_PENDING_BIT, &dd->dd_flag)) { 3424 if (test_bit(MTIP_DDF_REMOVE_PENDING_BIT, &dd->dd_flag)) {
3427 bio_endio(bio, -ENXIO); 3425 bio_endio(bio, -ENXIO);
3428 return; 3426 return;
3429 } 3427 }
@@ -3590,7 +3588,7 @@ skip_create_disk:
3590 } 3588 }
3591 3589
3592 if (dd->mtip_svc_handler) { 3590 if (dd->mtip_svc_handler) {
3593 set_bit(MTIP_DD_FLAG_INIT_DONE_BIT, &dd->dd_flag); 3591 set_bit(MTIP_DDF_INIT_DONE_BIT, &dd->dd_flag);
3594 return rv; /* service thread created for handling rebuild */ 3592 return rv; /* service thread created for handling rebuild */
3595 } 3593 }
3596 3594
@@ -3650,13 +3648,13 @@ static int mtip_block_remove(struct driver_data *dd)
3650 struct kobject *kobj; 3648 struct kobject *kobj;
3651 3649
3652 if (dd->mtip_svc_handler) { 3650 if (dd->mtip_svc_handler) {
3653 set_bit(MTIP_FLAG_SVC_THD_SHOULD_STOP_BIT, &dd->port->flags); 3651 set_bit(MTIP_PF_SVC_THD_SHOULD_STOP_BIT, &dd->port->flags);
3654 wake_up_interruptible(&dd->port->svc_wait); 3652 wake_up_interruptible(&dd->port->svc_wait);
3655 kthread_stop(dd->mtip_svc_handler); 3653 kthread_stop(dd->mtip_svc_handler);
3656 } 3654 }
3657 3655
3658 /* Clean up the sysfs attributes, if created */ 3656 /* Clean up the sysfs attributes, if created */
3659 if (test_bit(MTIP_DD_FLAG_INIT_DONE_BIT, &dd->dd_flag)) { 3657 if (test_bit(MTIP_DDF_INIT_DONE_BIT, &dd->dd_flag)) {
3660 kobj = kobject_get(&disk_to_dev(dd->disk)->kobj); 3658 kobj = kobject_get(&disk_to_dev(dd->disk)->kobj);
3661 if (kobj) { 3659 if (kobj) {
3662 mtip_hw_sysfs_exit(dd, kobj); 3660 mtip_hw_sysfs_exit(dd, kobj);
@@ -3812,7 +3810,7 @@ static int mtip_pci_probe(struct pci_dev *pdev,
3812 */ 3810 */
3813 instance++; 3811 instance++;
3814 if (rv != MTIP_FTL_REBUILD_MAGIC) 3812 if (rv != MTIP_FTL_REBUILD_MAGIC)
3815 set_bit(MTIP_DD_FLAG_INIT_DONE_BIT, &dd->dd_flag); 3813 set_bit(MTIP_DDF_INIT_DONE_BIT, &dd->dd_flag);
3816 goto done; 3814 goto done;
3817 3815
3818block_initialize_err: 3816block_initialize_err:
@@ -3841,10 +3839,10 @@ static void mtip_pci_remove(struct pci_dev *pdev)
3841 struct driver_data *dd = pci_get_drvdata(pdev); 3839 struct driver_data *dd = pci_get_drvdata(pdev);
3842 int counter = 0; 3840 int counter = 0;
3843 3841
3844 set_bit(MTIP_DD_FLAG_REMOVE_PENDING_BIT, &dd->dd_flag); 3842 set_bit(MTIP_DDF_REMOVE_PENDING_BIT, &dd->dd_flag);
3845 3843
3846 if (mtip_check_surprise_removal(pdev)) { 3844 if (mtip_check_surprise_removal(pdev)) {
3847 while (!test_bit(MTIP_DD_FLAG_CLEANUP_BIT, &dd->dd_flag)) { 3845 while (!test_bit(MTIP_DDF_CLEANUP_BIT, &dd->dd_flag)) {
3848 counter++; 3846 counter++;
3849 msleep(20); 3847 msleep(20);
3850 if (counter == 10) { 3848 if (counter == 10) {
@@ -3882,7 +3880,7 @@ static int mtip_pci_suspend(struct pci_dev *pdev, pm_message_t mesg)
3882 return -EFAULT; 3880 return -EFAULT;
3883 } 3881 }
3884 3882
3885 set_bit(MTIP_DD_FLAG_RESUME_BIT, &dd->dd_flag); 3883 set_bit(MTIP_DDF_RESUME_BIT, &dd->dd_flag);
3886 3884
3887 /* Disable ports & interrupts then send standby immediate */ 3885 /* Disable ports & interrupts then send standby immediate */
3888 rv = mtip_block_suspend(dd); 3886 rv = mtip_block_suspend(dd);
@@ -3948,7 +3946,7 @@ static int mtip_pci_resume(struct pci_dev *pdev)
3948 dev_err(&pdev->dev, "Unable to resume\n"); 3946 dev_err(&pdev->dev, "Unable to resume\n");
3949 3947
3950err: 3948err:
3951 clear_bit(MTIP_DD_FLAG_RESUME_BIT, &dd->dd_flag); 3949 clear_bit(MTIP_DDF_RESUME_BIT, &dd->dd_flag);
3952 3950
3953 return rv; 3951 return rv;
3954} 3952}
diff --git a/drivers/block/mtip32xx/mtip32xx.h b/drivers/block/mtip32xx/mtip32xx.h
index ea5c7e7cb50d..5ad2d79f7c4b 100644
--- a/drivers/block/mtip32xx/mtip32xx.h
+++ b/drivers/block/mtip32xx/mtip32xx.h
@@ -114,22 +114,22 @@
114#define __force_bit2int (unsigned int __force) 114#define __force_bit2int (unsigned int __force)
115 115
116/* below are bit numbers in 'flags' defined in mtip_port */ 116/* below are bit numbers in 'flags' defined in mtip_port */
117#define MTIP_FLAG_IC_ACTIVE_BIT 0 117#define MTIP_PF_IC_ACTIVE_BIT 0
118#define MTIP_FLAG_EH_ACTIVE_BIT 1 118#define MTIP_PF_EH_ACTIVE_BIT 1
119#define MTIP_FLAG_SVC_THD_ACTIVE_BIT 2 119#define MTIP_PF_SVC_THD_ACTIVE_BIT 2
120#define MTIP_FLAG_ISSUE_CMDS_BIT 4 120#define MTIP_PF_ISSUE_CMDS_BIT 4
121#define MTIP_FLAG_REBUILD_BIT 5 121#define MTIP_PF_REBUILD_BIT 5
122#define MTIP_FLAG_SVC_THD_SHOULD_STOP_BIT 8 122#define MTIP_PF_SVC_THD_SHOULD_STOP_BIT 8
123 123
124/* below are bit numbers in 'dd_flag' defined in driver_data */ 124/* below are bit numbers in 'dd_flag' defined in driver_data */
125#define MTIP_DD_FLAG_REMOVE_PENDING_BIT 1 125#define MTIP_DDF_REMOVE_PENDING_BIT 1
126#define MTIP_DD_FLAG_RESUME_BIT 2 126#define MTIP_DDF_RESUME_BIT 2
127#define MTIP_DD_FLAG_CLEANUP_BIT 3 127#define MTIP_DDF_CLEANUP_BIT 3
128#define MTIP_DD_FLAG_INIT_DONE_BIT 4 128#define MTIP_DDF_INIT_DONE_BIT 4
129 129
130#define MTIP_DD_FLAG_WRITE_PROTECT_BIT 5 130#define MTIP_DDF_WRITE_PROTECT_BIT 5
131#define MTIP_DD_FLAG_OVER_TEMP_BIT 6 131#define MTIP_DDF_OVER_TEMP_BIT 6
132#define MTIP_DD_FLAG_REBUILD_FAILED_BIT 7 132#define MTIP_DDF_REBUILD_FAILED_BIT 7
133 133
134__packed struct smart_attr{ 134__packed struct smart_attr{
135 u8 attr_id; 135 u8 attr_id;