}
#undef C
-static enum sci_status sci_remote_device_suspend(struct isci_remote_device *idev)
+static enum sci_status sci_remote_device_suspend(struct isci_remote_device *idev,
+ enum sci_remote_node_suspension_reasons reason)
{
return sci_remote_node_context_suspend(&idev->rnc,
- SCI_SOFTWARE_SUSPENSION,
+ reason,
SCI_SOFTWARE_SUSPEND_EXPECTED_EVENT,
NULL, NULL);
}
set_bit(IDEV_IO_NCQERROR, &idev->flags);
/* Suspend the remote device so the I/O can be terminated. */
- sci_remote_device_suspend(idev);
+ sci_remote_device_suspend(idev, SCI_SW_SUSPEND_NORMAL);
/* Kill all outstanding requests for the device. */
sci_remote_device_terminate_requests(idev);
rnc_destruct_done,
idev);
else {
- sci_remote_device_suspend(idev);
+ sci_remote_device_suspend(
+ idev, SCI_SW_SUSPEND_LINKHANG_DETECT);
sci_remote_device_terminate_requests(idev);
}
return SCI_SUCCESS;
status = SCI_SUCCESS;
/* Suspend the associated RNC */
- sci_remote_node_context_suspend(
- &idev->rnc,
- SCI_SOFTWARE_SUSPENSION,
- SCI_SOFTWARE_SUSPEND_EXPECTED_EVENT,
- NULL, NULL);
+ sci_remote_device_suspend(idev, SCI_SW_SUSPEND_NORMAL);
dev_dbg(scirdev_to_dev(idev),
"%s: device: %p event code: %x: %s\n",
* the correct action when the remote node context is suspended
* and later resumed.
*/
- sci_remote_node_context_suspend(
- &idev->rnc, SCI_SOFTWARE_SUSPENSION,
- SCI_SOFTWARE_SUSPEND_EXPECTED_EVENT, NULL, NULL);
+ sci_remote_device_suspend(idev,
+ SCI_SW_SUSPEND_LINKHANG_DETECT);
status = sci_remote_node_context_start_task(&idev->rnc, ireq,
sci_remote_device_continue_request, idev);
dev_dbg(&ihost->pdev->dev,
"%s: isci_device = %p\n", __func__, idev);
- sci_remote_node_context_suspend(
- &idev->rnc, SCI_SOFTWARE_SUSPENSION,
- SCI_SOFTWARE_SUSPEND_EXPECTED_EVENT, NULL, NULL);
+ sci_remote_device_suspend(idev, SCI_SW_SUSPEND_LINKHANG_DETECT);
}
static void sci_remote_device_resetting_state_exit(struct sci_base_state_machine *sm)
/* Put the device into suspension. */
spin_lock_irqsave(&ihost->scic_lock, flags);
- sci_remote_device_suspend(idev);
+ sci_remote_device_suspend(idev, SCI_SW_SUSPEND_LINKHANG_DETECT);
spin_unlock_irqrestore(&ihost->scic_lock, flags);
/* Terminate and wait for the completions. */
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-
+#include <scsi/sas_ata.h>
#include "host.h"
#include "isci.h"
#include "remote_device.h"
if ((dest_select == RNC_DEST_SUSPENDED) ||
(dest_select == RNC_DEST_SUSPENDED_RESUME)) {
sci_remote_node_context_suspend(
- rnc, SCI_SOFTWARE_SUSPENSION,
+ rnc, SCI_SW_SUSPEND_NORMAL,
SCI_SOFTWARE_SUSPEND_EXPECTED_EVENT, NULL, NULL);
if (dest_select == RNC_DEST_SUSPENDED_RESUME) {
{
struct sci_remote_node_context *rnc
= container_of(sm, typeof(*rnc), sm);
+ struct isci_remote_device *idev = rnc_to_dev(rnc);
- isci_dev_set_hang_detection_timeout(rnc_to_dev(rnc), 0);
+ if (dev_is_sata(idev->domain_dev))
+ isci_dev_set_hang_detection_timeout(idev, 0);
}
static const struct sci_base_state sci_remote_node_context_state_table[] = {
suspend_type);
/* Disable automatic state continuations if explicitly suspending. */
- if ((suspend_reason != SCI_SOFTWARE_SUSPENSION) ||
+ if ((suspend_reason == SCI_HW_SUSPEND) ||
(sci_rnc->destination_state == RNC_DEST_FINAL))
dest_param = sci_rnc->destination_state;
wake_up_all(&ihost->eventq); /* Let observers look. */
return SCI_SUCCESS;
}
- if (suspend_reason == SCI_SOFTWARE_SUSPENSION) {
- isci_dev_set_hang_detection_timeout(idev, 0x00000001);
+ if ((suspend_reason == SCI_SW_SUSPEND_NORMAL) ||
+ (suspend_reason == SCI_SW_SUSPEND_LINKHANG_DETECT)) {
+
+ if ((suspend_reason == SCI_SW_SUSPEND_LINKHANG_DETECT)
+ && dev_is_sata(idev->domain_dev))
+ isci_dev_set_hang_detection_timeout(idev, 0x00000001);
+
sci_remote_device_post_request(
idev, SCI_SOFTWARE_SUSPEND_CMD);
}