Received: by 10.213.65.68 with SMTP id h4csp1714480imn; Mon, 19 Mar 2018 11:14:20 -0700 (PDT) X-Google-Smtp-Source: AG47ELu4nXM5+rJtPIAwXTOlwnejwGX1FSml8WsRwEXo9E+Ei8fxu4GtgMLkZfziUI5cuzt/+sU4 X-Received: by 2002:a17:902:8d92:: with SMTP id v18-v6mr13378322plo.21.1521483260612; Mon, 19 Mar 2018 11:14:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521483260; cv=none; d=google.com; s=arc-20160816; b=W4sZrt7ovPKbuS+o46RE54xIm0mw+CcMahE6aOI8qB7jMyIweL+314/8KQmE+IEbEj RXksi+u0YrquNB1vc8ADOxs1A7yp6i3ykp8xjpNxpUvpGL4jXo90LROCFU6xifYQooWJ EipK51ckv4GkKqla3zBwsUtCbsKIyC1Gfr9qU+Y8dS2zC6Twu2aDJ03GuKWYQLlKcvbc T+m8b72coV1iXJZg/aOSLiUiG9v+21gxgNyTGWAfv55duP6uPz2za8XQo50u1a/fLhzB 7J2xTAU3K22i2XWoXfgL+pPuXnSSCbP6419457wKzimAWsZDTY8qOcYBnbvwz6uQufo5 th2w== 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=rKTgKyNmVwLjN8Gto5SLhjjHF5btsSTH872RkDRVh6U=; b=p1w3W0xZQlghUC+gDbTy5NRZ6/0E9F558HnGsJrZfqW+wT1zSrGnSGHsI9OkOrLOj6 kn7bbXeBgpqc/e28z4mHrmmRsRwtXfiiw0A2jDx5OxN7p0Tv+mCkFsHQra786cFDJYo8 6Jxl6qsQgrdVw9kcwFUTM5TD5yU7dWOnAANb2UbRGvgKcScleeHmmmxX2/XpnxvAumZE 7g5CQVi+LwViq8waP8HLhaQHtQ6n9tlhRsRj58wVKUQ0qbN+t62tZ69AEXdVz9/NGeRr mHmewu2O95v12xqhENagJHkbAKA49DOfhCgHNdZyNhzorkq53GfWSjBEU705ZfXKgF9l 1N7A== 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 c5si303798pfn.386.2018.03.19.11.14.06; Mon, 19 Mar 2018 11:14:20 -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 S1030497AbeCSSND (ORCPT + 99 others); Mon, 19 Mar 2018 14:13:03 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:42926 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S968556AbeCSSMw (ORCPT ); Mon, 19 Mar 2018 14:12:52 -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 7B3A811B4; Mon, 19 Mar 2018 18:12:51 +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.4 025/134] scsi: ipr: Fix missed EH wakeup Date: Mon, 19 Mar 2018 19:05:08 +0100 Message-Id: <20180319171852.848050844@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180319171849.024066323@linuxfoundation.org> References: <20180319171849.024066323@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.4-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 @@ -835,8 +835,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); } /** @@ -5864,8 +5866,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); } /** @@ -6255,8 +6259,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); } /** @@ -6282,8 +6288,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);