From patchwork Tue Jan 30 23:59:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Smart X-Patchwork-Id: 10192945 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9085D60291 for ; Tue, 30 Jan 2018 23:59:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 82C5427F54 for ; Tue, 30 Jan 2018 23:59:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 778FF280B0; Tue, 30 Jan 2018 23:59:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 007D327F54 for ; Tue, 30 Jan 2018 23:59:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754190AbeA3X7q (ORCPT ); Tue, 30 Jan 2018 18:59:46 -0500 Received: from mail-qk0-f196.google.com ([209.85.220.196]:38499 "EHLO mail-qk0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754168AbeA3X7d (ORCPT ); Tue, 30 Jan 2018 18:59:33 -0500 Received: by mail-qk0-f196.google.com with SMTP id t134so12531078qke.5 for ; Tue, 30 Jan 2018 15:59:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=j+3OM46Wr0bR0zjXy0c6oTDLg2nsWFgR2FHG5uryb3M=; b=mXBipBls/ZZjbsciM+73WQ0jGWTRbxJd2SPBfgkHd4j5gnjjK04cetVDmy4yhg81S4 t5rPZh25YLc8Wo0imQFABnvDY+Pzah2DOx0q6geMgMv7qMAULphu4iAwzPZWbi7fmu1C R2HIRQAbh/z11lBmR9wRNxpa4tyrrcH3GU6fuhbvDiGzHA4xMTJ/vwVyjhEnr7k+Ni4r rVjzKCDq7qgR49+4mAXIx4YFbG38+4cMlXZDUI/QkpZEtnIl4EOZ5koYZTjB4nzYBA8g T7iFapkQ/+0aDoP7dMuWM8q5k0RXZhCFGXXjVb96eIY7Y5fCGQW1M2NFeSYA50K3x7wR EwCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=j+3OM46Wr0bR0zjXy0c6oTDLg2nsWFgR2FHG5uryb3M=; b=YaEiLy3gI4ucxjwJQTXK0tgdQqQhqXrVdbtzrwSOc4s/MFtR5rN5kleygPOZVzO8jd 5PVTT1OtWagBRjjbU0atPfXy2iz7qRb7aZnq/0OYhWbwBqSvrQs+IdsDXmi4aDtGi6mW WM4mbMBMWdFvN/pzfo8XA2ucDGmqY2IXig8JGRjM7JYzJpyoPq7gwTj/NKNH+6ZdPnIV a7L4M7TtseV2S8nO/qpZZobDiah5iGIlqS2DtWSj6la4x7CoNv595fJZ6AnokOG6Nckh djm7FBwL/zGadlCWzYbUmXSl4LmolQQQpKLzxtlWtZGtb8b9t5JoQDiO0oapgrfvJWEY YzcA== X-Gm-Message-State: AKwxytcTl2QCNlabGq7XiJf5coJEb0spXpIKsZzQ/UvU+z+rQfh7L0Rg wWNGHje22vQly+G69g8/BLPPDA== X-Google-Smtp-Source: AH8x226W7+NCcSlME+pdVluOaM1XxH34k6DxdZJdVe5GT5OVh5+YWHAyl7CXUtH/zoXvhZ6vYA8T8A== X-Received: by 10.55.21.80 with SMTP id f77mr545362qkh.85.1517356772579; Tue, 30 Jan 2018 15:59:32 -0800 (PST) Received: from pallmd1.broadcom.com ([192.19.223.250]) by smtp.gmail.com with ESMTPSA id i39sm12438537qte.19.2018.01.30.15.59.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 30 Jan 2018 15:59:32 -0800 (PST) From: James Smart To: linux-scsi@vger.kernel.org Cc: James Smart , Dick Kennedy , James Smart Subject: [PATCH v3 16/19] lpfc: Treat SCSI Write operation Underruns as an error Date: Tue, 30 Jan 2018 15:59:00 -0800 Message-Id: <20180130235903.5316-17-jsmart2021@gmail.com> X-Mailer: git-send-email 2.13.1 In-Reply-To: <20180130235903.5316-1-jsmart2021@gmail.com> References: <20180130235903.5316-1-jsmart2021@gmail.com> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Currently, write underruns (mismatch of amount transferred vs scsi status and its residual) detected by the adapter are not being flagged as an error. Its expected the target controls the data transfer and would appropriately set the RSP values. Only read underruns are treated as errors. Revise the SCSI error handling to treat write underruns as an error as well. Signed-off-by: Dick Kennedy Signed-off-by: James Smart Reviewed-by: Hannes Reinecke --- drivers/scsi/lpfc/lpfc_scsi.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c index dcc86936e6fc..10c2dc0cf1fa 100644 --- a/drivers/scsi/lpfc/lpfc_scsi.c +++ b/drivers/scsi/lpfc/lpfc_scsi.c @@ -3772,20 +3772,18 @@ lpfc_handle_fcp_err(struct lpfc_vport *vport, struct lpfc_scsi_buf *lpfc_cmd, scsi_set_resid(cmnd, be32_to_cpu(fcprsp->rspResId)); lpfc_printf_vlog(vport, KERN_INFO, LOG_FCP_UNDER, - "9025 FCP Read Underrun, expected %d, " + "9025 FCP Underrun, expected %d, " "residual %d Data: x%x x%x x%x\n", fcpDl, scsi_get_resid(cmnd), fcpi_parm, cmnd->cmnd[0], cmnd->underflow); /* - * If there is an under run check if under run reported by + * If there is an under run, check if under run reported by * storage array is same as the under run reported by HBA. * If this is not same, there is a dropped frame. */ - if ((cmnd->sc_data_direction == DMA_FROM_DEVICE) && - fcpi_parm && - (scsi_get_resid(cmnd) != fcpi_parm)) { + if (fcpi_parm && (scsi_get_resid(cmnd) != fcpi_parm)) { lpfc_printf_vlog(vport, KERN_WARNING, LOG_FCP | LOG_FCP_ERROR, "9026 FCP Read Check Error "