From patchwork Sun Mar 11 04:39:07 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Williams X-Patchwork-Id: 145941 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 81457B6FA8 for ; Sun, 11 Mar 2012 15:24:57 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752763Ab2CKEYz (ORCPT ); Sat, 10 Mar 2012 23:24:55 -0500 Received: from mga09.intel.com ([134.134.136.24]:43899 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752793Ab2CKEYu (ORCPT ); Sat, 10 Mar 2012 23:24:50 -0500 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 10 Mar 2012 20:24:50 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.67,351,1309762800"; d="scan'208";a="119806523" Received: from dwillia2-linux.jf.intel.com ([10.23.45.110]) by orsmga002.jf.intel.com with ESMTP; 10 Mar 2012 20:23:49 -0800 Received: from dwillia2-linux.jf.intel.com (localhost.localdomain [IPv6:::1]) by dwillia2-linux.jf.intel.com (Postfix) with ESMTP id 2F91E800DF; Sat, 10 Mar 2012 20:39:07 -0800 (PST) Subject: [libsas PATCH v10 2/9] libsas: cleanup spurious calls to scsi_schedule_eh To: linux-scsi@vger.kernel.org From: Dan Williams Cc: linux-ide@vger.kernel.org Date: Sat, 10 Mar 2012 20:39:07 -0800 Message-ID: <20120311043906.27797.28938.stgit@dwillia2-linux.jf.intel.com> In-Reply-To: <20120311043722.27797.97791.stgit@dwillia2-linux.jf.intel.com> References: <20120311043722.27797.97791.stgit@dwillia2-linux.jf.intel.com> User-Agent: StGit/0.16-1-g7004 MIME-Version: 1.0 Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org eh is woken up automatically by the presence of failed commands, scsi_schedule_eh is reserved for cases where there are no failed commands. This guarantees that host_eh_sceduled is only incremented when an explicit eh request is made. Signed-off-by: Dan Williams --- drivers/scsi/libsas/sas_ata.c | 25 ------------------------- drivers/scsi/libsas/sas_scsi_host.c | 5 ----- include/scsi/sas_ata.h | 4 ---- 3 files changed, 0 insertions(+), 34 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-ide" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c index bc0cecc..729a7b6 100644 --- a/drivers/scsi/libsas/sas_ata.c +++ b/drivers/scsi/libsas/sas_ata.c @@ -574,31 +574,6 @@ int sas_ata_init_host_and_port(struct domain_device *found_dev) return 0; } -void sas_ata_task_abort(struct sas_task *task) -{ - struct ata_queued_cmd *qc = task->uldd_task; - struct completion *waiting; - - /* Bounce SCSI-initiated commands to the SCSI EH */ - if (qc->scsicmd) { - struct request_queue *q = qc->scsicmd->device->request_queue; - unsigned long flags; - - spin_lock_irqsave(q->queue_lock, flags); - blk_abort_request(qc->scsicmd->request); - spin_unlock_irqrestore(q->queue_lock, flags); - scsi_schedule_eh(qc->scsicmd->device->host); - return; - } - - /* Internal command, fake a timeout and complete. */ - qc->flags &= ~ATA_QCFLAG_ACTIVE; - qc->flags |= ATA_QCFLAG_FAILED; - qc->err_mask |= AC_ERR_TIMEOUT; - waiting = qc->private_data; - complete(waiting); -} - static void sas_get_ata_command_set(struct domain_device *dev) { struct dev_to_host_fis *fis = diff --git a/drivers/scsi/libsas/sas_scsi_host.c b/drivers/scsi/libsas/sas_scsi_host.c index f0b9b7b..49a9113 100644 --- a/drivers/scsi/libsas/sas_scsi_host.c +++ b/drivers/scsi/libsas/sas_scsi_host.c @@ -992,10 +992,6 @@ void sas_task_abort(struct sas_task *task) return; task->timer.function(task->timer.data); return; - } - - if (dev_is_sata(task->dev)) { - sas_ata_task_abort(task); } else { struct request_queue *q = sc->device->request_queue; unsigned long flags; @@ -1003,7 +999,6 @@ void sas_task_abort(struct sas_task *task) spin_lock_irqsave(q->queue_lock, flags); blk_abort_request(sc->request); spin_unlock_irqrestore(q->queue_lock, flags); - scsi_schedule_eh(sc->device->host); } } diff --git a/include/scsi/sas_ata.h b/include/scsi/sas_ata.h index cdccd2e..6d5d60c 100644 --- a/include/scsi/sas_ata.h +++ b/include/scsi/sas_ata.h @@ -38,7 +38,6 @@ static inline int dev_is_sata(struct domain_device *dev) int sas_get_ata_info(struct domain_device *dev, struct ex_phy *phy); int sas_ata_init_host_and_port(struct domain_device *found_dev); -void sas_ata_task_abort(struct sas_task *task); void sas_ata_strategy_handler(struct Scsi_Host *shost); void sas_ata_eh(struct Scsi_Host *shost, struct list_head *work_q, struct list_head *done_q); @@ -56,9 +55,6 @@ static inline int sas_ata_init_host_and_port(struct domain_device *found_dev) { return 0; } -static inline void sas_ata_task_abort(struct sas_task *task) -{ -} static inline void sas_ata_strategy_handler(struct Scsi_Host *shost) {