From patchwork Fri Dec 23 02:59:26 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Williams X-Patchwork-Id: 132947 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 2E168B71CD for ; Fri, 23 Dec 2011 13:59:30 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756312Ab1LWC72 (ORCPT ); Thu, 22 Dec 2011 21:59:28 -0500 Received: from mga03.intel.com ([143.182.124.21]:57474 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756308Ab1LWC71 (ORCPT ); Thu, 22 Dec 2011 21:59:27 -0500 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga101.ch.intel.com with ESMTP; 22 Dec 2011 18:59:26 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.71,315,1320652800"; d="scan'208";a="88797857" Received: from dwillia2-linux.jf.intel.com (HELO dwillia2-linux.localdomain) ([10.23.45.73]) by azsmga001.ch.intel.com with ESMTP; 22 Dec 2011 18:59:26 -0800 Received: from localhost6.localdomain6 (localhost.localdomain [127.0.0.1]) by dwillia2-linux.localdomain (Postfix) with ESMTP id 5C272500440; Thu, 22 Dec 2011 18:59:26 -0800 (PST) Subject: [PATCH v2 11/28] libsas: kill invocation of scsi_eh_finish_cmd from sas_ata_task_done To: linux-scsi@vger.kernel.org From: Dan Williams Cc: linux-ide@vger.kernel.org, "Darrick J. Wong" Date: Thu, 22 Dec 2011 18:59:26 -0800 Message-ID: <20111223025926.21827.8371.stgit@localhost6.localdomain6> In-Reply-To: <20111223025350.21827.85779.stgit@localhost6.localdomain6> References: <20111223025350.21827.85779.stgit@localhost6.localdomain6> User-Agent: StGit/0.15-7-g9bfb-dirty MIME-Version: 1.0 Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org Prior to the conversion to the new-style libata-eh sas_ata_task_done() may have been the last opportunity to clean up the scmd, but now libata-eh explicitly handles this case. It also races against sas-eh. If a lldd completes a task after SAS_TASK_STATE_ABORTED is set it could trigger a spurious decrement of shost->host_failed. Current lldds have the band-aid of checking SAS_TASK_STATE_ABORTED before calling ->task_done(), but better to just let the scmds escalate to libata for race free cleanup. Cc: Darrick J. Wong Signed-off-by: Dan Williams --- drivers/scsi/libsas/sas_ata.c | 14 -------------- 1 files changed, 0 insertions(+), 14 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 dd35a98..649b04b 100644 --- a/drivers/scsi/libsas/sas_ata.c +++ b/drivers/scsi/libsas/sas_ata.c @@ -145,20 +145,6 @@ static void sas_ata_task_done(struct sas_task *task) ata_qc_complete(qc); spin_unlock_irqrestore(dev->sata_dev.ap->lock, flags); - /* - * If the sas_task has an ata qc, a scsi_cmnd and the aborted - * flag is set, then we must have come in via the libsas EH - * functions. When we exit this function, we need to put the - * scsi_cmnd on the list of finished errors. The ata_qc_complete - * call cleans up the libata side of things but we're protected - * from the scsi_cmnd going away because the scsi_cmnd is owned - * by the EH, making libata's call to scsi_done a NOP. - */ - spin_lock_irqsave(&task->task_state_lock, flags); - if (qc->scsicmd && task->task_state_flags & SAS_TASK_STATE_ABORTED) - scsi_eh_finish_cmd(qc->scsicmd, &sas_ha->eh_done_q); - spin_unlock_irqrestore(&task->task_state_lock, flags); - qc_already_gone: list_del_init(&task->list); sas_free_task(task);