diff options
author | James Bottomley <jejb@titanic.(none)> | 2005-09-06 18:52:54 -0400 |
---|---|---|
committer | James Bottomley <jejb@titanic.(none)> | 2005-09-06 18:52:54 -0400 |
commit | 17fa53da1239b8712c5cebbd72a74c713b6c2db9 (patch) | |
tree | 8cf55e47ce681a6c899ccf8e06abeccecb20d38b /drivers/scsi/scsi_error.c | |
parent | 3173d8c342971a03857d8af749a3f57da7d06b57 (diff) | |
parent | fe1b2d544d71300f8e2d151c3c77a130d13a58be (diff) |
Merge by hand (conflicts in sd.c)
Diffstat (limited to 'drivers/scsi/scsi_error.c')
-rw-r--r-- | drivers/scsi/scsi_error.c | 35 |
1 files changed, 5 insertions, 30 deletions
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index 2686d5672e5e..895c9452be4c 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/string.h> | 20 | #include <linux/string.h> |
21 | #include <linux/slab.h> | 21 | #include <linux/slab.h> |
22 | #include <linux/kernel.h> | 22 | #include <linux/kernel.h> |
23 | #include <linux/kthread.h> | ||
23 | #include <linux/interrupt.h> | 24 | #include <linux/interrupt.h> |
24 | #include <linux/blkdev.h> | 25 | #include <linux/blkdev.h> |
25 | #include <linux/delay.h> | 26 | #include <linux/delay.h> |
@@ -115,7 +116,6 @@ void scsi_add_timer(struct scsi_cmnd *scmd, int timeout, | |||
115 | 116 | ||
116 | add_timer(&scmd->eh_timeout); | 117 | add_timer(&scmd->eh_timeout); |
117 | } | 118 | } |
118 | EXPORT_SYMBOL(scsi_add_timer); | ||
119 | 119 | ||
120 | /** | 120 | /** |
121 | * scsi_delete_timer - Delete/cancel timer for a given function. | 121 | * scsi_delete_timer - Delete/cancel timer for a given function. |
@@ -143,7 +143,6 @@ int scsi_delete_timer(struct scsi_cmnd *scmd) | |||
143 | 143 | ||
144 | return rtn; | 144 | return rtn; |
145 | } | 145 | } |
146 | EXPORT_SYMBOL(scsi_delete_timer); | ||
147 | 146 | ||
148 | /** | 147 | /** |
149 | * scsi_times_out - Timeout function for normal scsi commands. | 148 | * scsi_times_out - Timeout function for normal scsi commands. |
@@ -776,9 +775,11 @@ retry_tur: | |||
776 | __FUNCTION__, scmd, rtn)); | 775 | __FUNCTION__, scmd, rtn)); |
777 | if (rtn == SUCCESS) | 776 | if (rtn == SUCCESS) |
778 | return 0; | 777 | return 0; |
779 | else if (rtn == NEEDS_RETRY) | 778 | else if (rtn == NEEDS_RETRY) { |
780 | if (retry_cnt--) | 779 | if (retry_cnt--) |
781 | goto retry_tur; | 780 | goto retry_tur; |
781 | return 0; | ||
782 | } | ||
782 | return 1; | 783 | return 1; |
783 | } | 784 | } |
784 | 785 | ||
@@ -1583,16 +1584,8 @@ int scsi_error_handler(void *data) | |||
1583 | int rtn; | 1584 | int rtn; |
1584 | DECLARE_MUTEX_LOCKED(sem); | 1585 | DECLARE_MUTEX_LOCKED(sem); |
1585 | 1586 | ||
1586 | /* | ||
1587 | * Flush resources | ||
1588 | */ | ||
1589 | |||
1590 | daemonize("scsi_eh_%d", shost->host_no); | ||
1591 | |||
1592 | current->flags |= PF_NOFREEZE; | 1587 | current->flags |= PF_NOFREEZE; |
1593 | |||
1594 | shost->eh_wait = &sem; | 1588 | shost->eh_wait = &sem; |
1595 | shost->ehandler = current; | ||
1596 | 1589 | ||
1597 | /* | 1590 | /* |
1598 | * Wake up the thread that created us. | 1591 | * Wake up the thread that created us. |
@@ -1600,8 +1593,6 @@ int scsi_error_handler(void *data) | |||
1600 | SCSI_LOG_ERROR_RECOVERY(3, printk("Wake up parent of" | 1593 | SCSI_LOG_ERROR_RECOVERY(3, printk("Wake up parent of" |
1601 | " scsi_eh_%d\n",shost->host_no)); | 1594 | " scsi_eh_%d\n",shost->host_no)); |
1602 | 1595 | ||
1603 | complete(shost->eh_notify); | ||
1604 | |||
1605 | while (1) { | 1596 | while (1) { |
1606 | /* | 1597 | /* |
1607 | * If we get a signal, it means we are supposed to go | 1598 | * If we get a signal, it means we are supposed to go |
@@ -1622,7 +1613,7 @@ int scsi_error_handler(void *data) | |||
1622 | * semaphores isn't unreasonable. | 1613 | * semaphores isn't unreasonable. |
1623 | */ | 1614 | */ |
1624 | down_interruptible(&sem); | 1615 | down_interruptible(&sem); |
1625 | if (shost->eh_kill) | 1616 | if (kthread_should_stop()) |
1626 | break; | 1617 | break; |
1627 | 1618 | ||
1628 | SCSI_LOG_ERROR_RECOVERY(1, printk("Error handler" | 1619 | SCSI_LOG_ERROR_RECOVERY(1, printk("Error handler" |
@@ -1661,22 +1652,6 @@ int scsi_error_handler(void *data) | |||
1661 | * Make sure that nobody tries to wake us up again. | 1652 | * Make sure that nobody tries to wake us up again. |
1662 | */ | 1653 | */ |
1663 | shost->eh_wait = NULL; | 1654 | shost->eh_wait = NULL; |
1664 | |||
1665 | /* | ||
1666 | * Knock this down too. From this point on, the host is flying | ||
1667 | * without a pilot. If this is because the module is being unloaded, | ||
1668 | * that's fine. If the user sent a signal to this thing, we are | ||
1669 | * potentially in real danger. | ||
1670 | */ | ||
1671 | shost->eh_active = 0; | ||
1672 | shost->ehandler = NULL; | ||
1673 | |||
1674 | /* | ||
1675 | * If anyone is waiting for us to exit (i.e. someone trying to unload | ||
1676 | * a driver), then wake up that process to let them know we are on | ||
1677 | * the way out the door. | ||
1678 | */ | ||
1679 | complete_and_exit(shost->eh_notify, 0); | ||
1680 | return 0; | 1655 | return 0; |
1681 | } | 1656 | } |
1682 | 1657 | ||