Received: by 10.213.65.68 with SMTP id h4csp1719605imn; Mon, 19 Mar 2018 11:22:13 -0700 (PDT) X-Google-Smtp-Source: AG47ELula/ZYdLynML+mYSxgMLqA3qw+L5p5BKHQ7tFT5cSG/FDuEUWt8TnExX53PhX6E2VvxELF X-Received: by 2002:a17:902:7088:: with SMTP id z8-v6mr13484741plk.174.1521483733309; Mon, 19 Mar 2018 11:22:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521483733; cv=none; d=google.com; s=arc-20160816; b=KXY77N22Fa5e3NDdmv6ofeGz11RB1nRyQlL/sH82idYkMu8pAXLd8Us+ANHM6zCDCJ vAd7vzQ9CHjQY3JXP+8SFXtr15BhYRyaU8ZP/ezBXnXj451dv0xAk4sMxTf5tziee+Yd jM50hQFhEsSb5wodEcJTzpu4MN1xjZ3OFZcPLagbAVdGauXlSyDxm5WEPet9DAfp12sT c00A0hqSUbPHQY7aXVir6AvLXtS+tPNrQXAwjmmQ1R1HHz7GmPFO/1VkFkB0ywOIRNf5 wKuGQ/Dt0WRdqmS4gggecJrXM6J3siRf06JQ0Fsv+JtYIhib+Mh6aZYKY9TL7sMOcwK7 Q5CA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=rHfX90v/YxQgp8Al8wOKoq9ZLBb8NY+iF2xKnBUXxBw=; b=b4dafEAodG5Rm0o8Jygqj1fB8pq2oyXm+PV7h5aENDe+p5cdsuwOxy9ttsjHA/bS6m CoF/K2Y9AFA8TGt4G5TgOknKws6nEW4WkJTK0B48yQt3ZHZoa7irt9wNNDGk2NpOWp8i 3EN0A2qoMpR6gvzvZVMYT+fsJdrKthoQdn1mPFkItLV+KE3w/z7BV0l2ep5dq5NHmC/O pjBkwMGqUPccIE8CnbeivzVVSyznqfe6iNFN1/qs43rf+0tF3kIfWbFiXhgZJ4AzKQjK ww9lryKL/whBXBBztoZu7yxrZ6L2UPUwpEAnS6R80mm5NxsyJ9QvSgfi95cBLCBbnR7g Kjtw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o12-v6si384257plg.715.2018.03.19.11.21.59; Mon, 19 Mar 2018 11:22:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030987AbeCSSUZ (ORCPT + 99 others); Mon, 19 Mar 2018 14:20:25 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:47646 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S969523AbeCSSUV (ORCPT ); Mon, 19 Mar 2018 14:20:21 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 9627C11BC; Mon, 19 Mar 2018 18:20:20 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Brian King , Wendy Xiong , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 4.9 054/241] scsi: ipr: Fix missed EH wakeup Date: Mon, 19 Mar 2018 19:05:19 +0100 Message-Id: <20180319180753.455784092@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180319180751.172155436@linuxfoundation.org> References: <20180319180751.172155436@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Brian King [ Upstream commit 66a0d59cdd12546ddf01d229de28b07ccf6d637f ] Following a command abort or device reset, ipr's EH handlers wait for the commands getting aborted to get sent back from the adapter prior to returning from the EH handler. This fixes up some cases where the completion handler was not getting called, which would have resulted in the EH thread waiting until it timed out, greatly extending EH time. Signed-off-by: Brian King Reviewed-by: Wendy Xiong Tested-by: Wendy Xiong Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/scsi/ipr.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) --- a/drivers/scsi/ipr.c +++ b/drivers/scsi/ipr.c @@ -836,8 +836,10 @@ static void ipr_sata_eh_done(struct ipr_ qc->err_mask |= AC_ERR_OTHER; sata_port->ioasa.status |= ATA_BUSY; - list_add_tail(&ipr_cmd->queue, &ipr_cmd->hrrq->hrrq_free_q); ata_qc_complete(qc); + if (ipr_cmd->eh_comp) + complete(ipr_cmd->eh_comp); + list_add_tail(&ipr_cmd->queue, &ipr_cmd->hrrq->hrrq_free_q); } /** @@ -5947,8 +5949,10 @@ static void ipr_erp_done(struct ipr_cmnd res->in_erp = 0; } scsi_dma_unmap(ipr_cmd->scsi_cmd); - list_add_tail(&ipr_cmd->queue, &ipr_cmd->hrrq->hrrq_free_q); scsi_cmd->scsi_done(scsi_cmd); + if (ipr_cmd->eh_comp) + complete(ipr_cmd->eh_comp); + list_add_tail(&ipr_cmd->queue, &ipr_cmd->hrrq->hrrq_free_q); } /** @@ -6338,8 +6342,10 @@ static void ipr_erp_start(struct ipr_ioa } scsi_dma_unmap(ipr_cmd->scsi_cmd); - list_add_tail(&ipr_cmd->queue, &ipr_cmd->hrrq->hrrq_free_q); scsi_cmd->scsi_done(scsi_cmd); + if (ipr_cmd->eh_comp) + complete(ipr_cmd->eh_comp); + list_add_tail(&ipr_cmd->queue, &ipr_cmd->hrrq->hrrq_free_q); } /** @@ -6365,8 +6371,10 @@ static void ipr_scsi_done(struct ipr_cmn scsi_dma_unmap(scsi_cmd); spin_lock_irqsave(ipr_cmd->hrrq->lock, lock_flags); - list_add_tail(&ipr_cmd->queue, &ipr_cmd->hrrq->hrrq_free_q); scsi_cmd->scsi_done(scsi_cmd); + if (ipr_cmd->eh_comp) + complete(ipr_cmd->eh_comp); + list_add_tail(&ipr_cmd->queue, &ipr_cmd->hrrq->hrrq_free_q); spin_unlock_irqrestore(ipr_cmd->hrrq->lock, lock_flags); } else { spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags);