From patchwork Thu Mar 18 03:28:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 12147259 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BA95EC4332D for ; Thu, 18 Mar 2021 03:29:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 70DAF64F18 for ; Thu, 18 Mar 2021 03:29:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231219AbhCRD3G (ORCPT ); Wed, 17 Mar 2021 23:29:06 -0400 Received: from mail-pf1-f175.google.com ([209.85.210.175]:33516 "EHLO mail-pf1-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230157AbhCRD2t (ORCPT ); Wed, 17 Mar 2021 23:28:49 -0400 Received: by mail-pf1-f175.google.com with SMTP id x26so2513870pfn.0 for ; Wed, 17 Mar 2021 20:28:49 -0700 (PDT) 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:mime-version:content-transfer-encoding; bh=eH5H5mmCXB8ydpg0W8lBnsfgg64on1T1nw+umaCctAE=; b=eeCP/5nFesFOLnbXMWy5exdr9tG8c24wzcYxE2B6D6u+Jni01qYjgGmQLb1D0Q5DMi sZSSE3zxvCegSHrAc315Xs9EkTN6xxUytIl43DxPyHWIGfLLFsI0vQnk/YVPzkcBy/Rw XL+nfQrkv0SH/XpfY5nptEBthR2nfll1IiU6McQjSEeJj+JKolfXgtrZwRjgAEXdN5CP wYC9E/DKi7j8OqfgId8S7vckKQsE5KarFK5zm0EK9SQMJ5Oz2i3NFptJMqYvY/cg+sVn Q0KcTxKtq0RhPoK2X8MdCxBlBCUoFMG40xyjA2ol5wn4dNnS52Utu4Od+m/K+YU4s1MD OMWQ== X-Gm-Message-State: AOAM530b56FpfNjtAfpRy7D9noUjoBkp4m/FN6xoY3AKGr5pquR0wCI+ Wl+Q+Vvh1OqSc3YOusK/4U0= X-Google-Smtp-Source: ABdhPJyRrO5WkfIqpDB6DSi6ICve4t9lyo9YjZe9qa8ofY/GROiAlEu6hT8pXQkCBr3Fg69Ua4Nb0Q== X-Received: by 2002:a62:aa16:0:b029:1fb:51cd:c8e3 with SMTP id e22-20020a62aa160000b02901fb51cdc8e3mr2034864pff.60.1616038128792; Wed, 17 Mar 2021 20:28:48 -0700 (PDT) Received: from asus.hsd1.ca.comcast.net ([2601:647:4000:d7:7fb2:1f41:ab33:bae6]) by smtp.gmail.com with ESMTPSA id y68sm473687pgy.5.2021.03.17.20.28.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Mar 2021 20:28:48 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" , "James E . J . Bottomley" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Quinn Tran , Mike Christie , Daniel Wagner , Himanshu Madhani Subject: [PATCH v2 1/6] Revert "qla2xxx: Make sure that aborted commands are freed" Date: Wed, 17 Mar 2021 20:28:35 -0700 Message-Id: <20210318032840.7611-2-bvanassche@acm.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210318032840.7611-1-bvanassche@acm.org> References: <20210318032840.7611-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Calling vha->hw->tgt.tgt_ops->free_cmd() from qlt_xmit_response() is wrong since the command for which a response is sent must remain valid until the SCSI target core calls .release_cmd(). It has been observed that the following scenario triggers a kernel crash: - qlt_xmit_response() calls qlt_check_reserve_free_req(). - qlt_check_reserve_free_req() returns -EAGAIN. - qlt_xmit_response() calls vha->hw->tgt.tgt_ops->free_cmd(cmd). - transport_handle_queue_full() tries to retransmit the response. Fix this crash by reverting the patch that introduced it. Fixes: 0dcec41acb85 ("scsi: qla2xxx: Make sure that aborted commands are freed") Cc: Quinn Tran Cc: Mike Christie Reviewed-by: Daniel Wagner Reviewed-by: Himanshu Madhani Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx/qla_target.c | 13 +++++-------- drivers/scsi/qla2xxx/tcm_qla2xxx.c | 4 ---- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c index d6366a46283e..5e8b2653e134 100644 --- a/drivers/scsi/qla2xxx/qla_target.c +++ b/drivers/scsi/qla2xxx/qla_target.c @@ -3222,8 +3222,7 @@ int qlt_xmit_response(struct qla_tgt_cmd *cmd, int xmit_type, if (!qpair->fw_started || (cmd->reset_count != qpair->chip_reset) || (cmd->sess && cmd->sess->deleted)) { cmd->state = QLA_TGT_STATE_PROCESSED; - res = 0; - goto free; + return 0; } ql_dbg_qp(ql_dbg_tgt, qpair, 0xe018, @@ -3234,8 +3233,9 @@ int qlt_xmit_response(struct qla_tgt_cmd *cmd, int xmit_type, res = qlt_pre_xmit_response(cmd, &prm, xmit_type, scsi_status, &full_req_cnt); - if (unlikely(res != 0)) - goto free; + if (unlikely(res != 0)) { + return res; + } spin_lock_irqsave(qpair->qp_lock_ptr, flags); @@ -3255,8 +3255,7 @@ int qlt_xmit_response(struct qla_tgt_cmd *cmd, int xmit_type, vha->flags.online, qla2x00_reset_active(vha), cmd->reset_count, qpair->chip_reset); spin_unlock_irqrestore(qpair->qp_lock_ptr, flags); - res = 0; - goto free; + return 0; } /* Does F/W have an IOCBs for this request */ @@ -3359,8 +3358,6 @@ int qlt_xmit_response(struct qla_tgt_cmd *cmd, int xmit_type, qlt_unmap_sg(vha, cmd); spin_unlock_irqrestore(qpair->qp_lock_ptr, flags); -free: - vha->hw->tgt.tgt_ops->free_cmd(cmd); return res; } EXPORT_SYMBOL(qlt_xmit_response); diff --git a/drivers/scsi/qla2xxx/tcm_qla2xxx.c b/drivers/scsi/qla2xxx/tcm_qla2xxx.c index 30959f8da065..15650a0bde09 100644 --- a/drivers/scsi/qla2xxx/tcm_qla2xxx.c +++ b/drivers/scsi/qla2xxx/tcm_qla2xxx.c @@ -653,7 +653,6 @@ static int tcm_qla2xxx_queue_data_in(struct se_cmd *se_cmd) { struct qla_tgt_cmd *cmd = container_of(se_cmd, struct qla_tgt_cmd, se_cmd); - struct scsi_qla_host *vha = cmd->vha; if (cmd->aborted) { /* Cmd can loop during Q-full. tcm_qla2xxx_aborted_task @@ -666,7 +665,6 @@ static int tcm_qla2xxx_queue_data_in(struct se_cmd *se_cmd) cmd->se_cmd.transport_state, cmd->se_cmd.t_state, cmd->se_cmd.se_cmd_flags); - vha->hw->tgt.tgt_ops->free_cmd(cmd); return 0; } @@ -694,7 +692,6 @@ static int tcm_qla2xxx_queue_status(struct se_cmd *se_cmd) { struct qla_tgt_cmd *cmd = container_of(se_cmd, struct qla_tgt_cmd, se_cmd); - struct scsi_qla_host *vha = cmd->vha; int xmit_type = QLA_TGT_XMIT_STATUS; if (cmd->aborted) { @@ -708,7 +705,6 @@ static int tcm_qla2xxx_queue_status(struct se_cmd *se_cmd) cmd, kref_read(&cmd->se_cmd.cmd_kref), cmd->se_cmd.transport_state, cmd->se_cmd.t_state, cmd->se_cmd.se_cmd_flags); - vha->hw->tgt.tgt_ops->free_cmd(cmd); return 0; } cmd->bufflen = se_cmd->data_length; From patchwork Thu Mar 18 03:28:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 12147255 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 65356C433E9 for ; Thu, 18 Mar 2021 03:29:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0E97F64ED2 for ; Thu, 18 Mar 2021 03:29:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231231AbhCRD3H (ORCPT ); Wed, 17 Mar 2021 23:29:07 -0400 Received: from mail-pj1-f44.google.com ([209.85.216.44]:51930 "EHLO mail-pj1-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230341AbhCRD2u (ORCPT ); Wed, 17 Mar 2021 23:28:50 -0400 Received: by mail-pj1-f44.google.com with SMTP id s21so2188812pjq.1 for ; Wed, 17 Mar 2021 20:28:50 -0700 (PDT) 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:mime-version:content-transfer-encoding; bh=M3i/A8wZJUkDAs/8j8jYvPjyybv7H7EXp/+fIitr3iE=; b=NCgE6Yc9kVoDZFzU2FBiKJhKClkDqhsZRJRo8h7r0OGaJJSLH5kjPrYnIA/HLUCy+M zGVtnRytnAK7HzNXnEmPr//6Uio7NrIClbIJ71Nu75zFGhFrJFD3zwSZTyoFmNQRiS86 /sa8BMnQ98IYiWSSIeFCsMbuiyHMjrKXCE5+30vKtSz0L5fN8J7c7uu9PAP7ORHDZ/qU AMtY3HrKEfQLI7KRPIPk9AVvZKEN6ItazpkPb9ZvuyIkfQ4HL8TGqo2YogtWiIWqGrBR 85glOu73cj3GXSYnX1DME585GBCdxVBH8khUE89K5BgCo4iXJAF6V+kjPBE3eoXAdSoU Pstw== X-Gm-Message-State: AOAM53010S/5YszCg6ZZNFPu+agUgQAPfwFLV2+u7k1oxmwXuRljzxYu kLvaaVLgyXzHIQR6xzuqBLY= X-Google-Smtp-Source: ABdhPJwSj2xyWKWkqvkeYkQWL1o+8gnSZyQcrRQy3LXvCBXXR2TVnBDQUwWFXgGwbxKuahl3uG3oCA== X-Received: by 2002:a17:90a:bb95:: with SMTP id v21mr1987944pjr.30.1616038130352; Wed, 17 Mar 2021 20:28:50 -0700 (PDT) Received: from asus.hsd1.ca.comcast.net ([2601:647:4000:d7:7fb2:1f41:ab33:bae6]) by smtp.gmail.com with ESMTPSA id y68sm473687pgy.5.2021.03.17.20.28.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Mar 2021 20:28:49 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" , "James E . J . Bottomley" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Quinn Tran , Mike Christie , Daniel Wagner , Himanshu Madhani Subject: [PATCH v2 2/6] qla2xxx: Constify struct qla_tgt_func_tmpl Date: Wed, 17 Mar 2021 20:28:36 -0700 Message-Id: <20210318032840.7611-3-bvanassche@acm.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210318032840.7611-1-bvanassche@acm.org> References: <20210318032840.7611-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Since the target function pointers are not modified at runtime, declare the data structure with the target function pointers const. Cc: Quinn Tran Cc: Mike Christie Reviewed-by: Daniel Wagner Reviewed-by: Himanshu Madhani Signed-off-by: Bart Van Assche Reviewed-by: Lee Duncan --- drivers/scsi/qla2xxx/qla_def.h | 2 +- drivers/scsi/qla2xxx/tcm_qla2xxx.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index 49b42b430df4..3bdf55bb0833 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -3815,7 +3815,7 @@ struct qlt_hw_data { __le32 __iomem *atio_q_in; __le32 __iomem *atio_q_out; - struct qla_tgt_func_tmpl *tgt_ops; + const struct qla_tgt_func_tmpl *tgt_ops; struct qla_tgt_vp_map *tgt_vp_map; int saved_set; diff --git a/drivers/scsi/qla2xxx/tcm_qla2xxx.c b/drivers/scsi/qla2xxx/tcm_qla2xxx.c index 15650a0bde09..46111f031be9 100644 --- a/drivers/scsi/qla2xxx/tcm_qla2xxx.c +++ b/drivers/scsi/qla2xxx/tcm_qla2xxx.c @@ -1578,7 +1578,7 @@ static void tcm_qla2xxx_update_sess(struct fc_port *sess, port_id_t s_id, /* * Calls into tcm_qla2xxx used by qla2xxx LLD I/O path. */ -static struct qla_tgt_func_tmpl tcm_qla2xxx_template = { +static const struct qla_tgt_func_tmpl tcm_qla2xxx_template = { .find_cmd_by_tag = tcm_qla2xxx_find_cmd_by_tag, .handle_cmd = tcm_qla2xxx_handle_cmd, .handle_data = tcm_qla2xxx_handle_data, From patchwork Thu Mar 18 03:28:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 12147253 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 34C69C433E6 for ; Thu, 18 Mar 2021 03:29:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DF96664F18 for ; Thu, 18 Mar 2021 03:29:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231233AbhCRD3H (ORCPT ); Wed, 17 Mar 2021 23:29:07 -0400 Received: from mail-pf1-f178.google.com ([209.85.210.178]:44751 "EHLO mail-pf1-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230476AbhCRD2w (ORCPT ); Wed, 17 Mar 2021 23:28:52 -0400 Received: by mail-pf1-f178.google.com with SMTP id b184so2522371pfa.11 for ; Wed, 17 Mar 2021 20:28:52 -0700 (PDT) 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:mime-version:content-transfer-encoding; bh=o7BJY7aujxthvWxs/xiR8rg6myjeVd9MFv+Lm9F3Ikc=; b=rqIFZvxFQH4WQsuwasALHk2TdJuzZVJCwqxYzMZAAeSoS0Kj3SVDvUBK1SiSOw4Jdr eb1IxXzU0qp5+6e0vdYsuVMDw4Tqtd436HMeu0w1c9wBWVlbXrfQthKns5GE8iJjLbyL RB+XQnTIcg8+wxCJKaQZV/KB7g+Wnfp+vBTIYR9v6IRaRs49rxMSkJpCHHHFBfjYI+Nc OwcHs4Y24xZoaxdFzPPGPPj0Y92sYpL7Oq2CpBIC8Z4vVK2Q0ajc2uTeiwNv4Uc6RzJd 6H1NjndCPE3+gJDABoNtQyuFVh3nXAQs2kWzdzOVtO0i+vcs/LfHiQIVisFM9A33mr9+ bxFw== X-Gm-Message-State: AOAM5306vp8K717Zn9m1e36tVkdvNTO6eyqkN0fXP7nJ6+EkzPF+wyvR FErqLqhcrHtrKMc/hCadSgs= X-Google-Smtp-Source: ABdhPJwbcPM35Y2oMQDv+nG520eQssjBo2zCZaZHzFyx5c+jk297mNLL2vJs0/JoXXSaVkUgN6LAbA== X-Received: by 2002:a62:37c6:0:b029:1f0:abe0:8d1c with SMTP id e189-20020a6237c60000b02901f0abe08d1cmr2026505pfa.23.1616038131837; Wed, 17 Mar 2021 20:28:51 -0700 (PDT) Received: from asus.hsd1.ca.comcast.net ([2601:647:4000:d7:7fb2:1f41:ab33:bae6]) by smtp.gmail.com with ESMTPSA id y68sm473687pgy.5.2021.03.17.20.28.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Mar 2021 20:28:51 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" , "James E . J . Bottomley" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Quinn Tran , Mike Christie , Daniel Wagner , Himanshu Madhani Subject: [PATCH v2 3/6] qla2xxx: Fix endianness annotations Date: Wed, 17 Mar 2021 20:28:37 -0700 Message-Id: <20210318032840.7611-4-bvanassche@acm.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210318032840.7611-1-bvanassche@acm.org> References: <20210318032840.7611-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Fix all recently introduced endianness annotation issues. Cc: Quinn Tran Cc: Mike Christie Reviewed-by: Daniel Wagner Reviewed-by: Himanshu Madhani Signed-off-by: Bart Van Assche Reviewed-by: Lee Duncan --- drivers/scsi/qla2xxx/qla_def.h | 2 +- drivers/scsi/qla2xxx/qla_iocb.c | 3 ++- drivers/scsi/qla2xxx/qla_isr.c | 2 +- drivers/scsi/qla2xxx/qla_sup.c | 9 +++++---- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index 3bdf55bb0833..52ba75591f9a 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -1527,7 +1527,7 @@ struct init_sf_cb { * BIT_12 = Remote Write Optimization (1 - Enabled, 0 - Disabled) * BIT 11-0 = Reserved */ - uint16_t flags; + __le16 flags; uint8_t reserved1[32]; uint16_t discard_OHRB_timeout_value; uint16_t remote_write_opt_queue_num; diff --git a/drivers/scsi/qla2xxx/qla_iocb.c b/drivers/scsi/qla2xxx/qla_iocb.c index 8b41cbaf8535..eb2376b138c1 100644 --- a/drivers/scsi/qla2xxx/qla_iocb.c +++ b/drivers/scsi/qla2xxx/qla_iocb.c @@ -2379,7 +2379,8 @@ qla24xx_prli_iocb(srb_t *sp, struct logio_entry_24xx *logio) cpu_to_le32(NVME_PRLI_SP_FIRST_BURST); if (sp->vha->flags.nvme2_enabled) { /* Set service parameter BIT_7 for NVME CONF support */ - logio->io_parameter[0] |= NVME_PRLI_SP_CONF; + logio->io_parameter[0] |= + cpu_to_le32(NVME_PRLI_SP_CONF); /* Set service parameter BIT_8 for SLER support */ logio->io_parameter[0] |= cpu_to_le32(NVME_PRLI_SP_SLER); diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c index 27165abda96d..0fa7082f3cc8 100644 --- a/drivers/scsi/qla2xxx/qla_isr.c +++ b/drivers/scsi/qla2xxx/qla_isr.c @@ -3440,7 +3440,7 @@ qla24xx_abort_iocb_entry(scsi_qla_host_t *vha, struct req_que *req, return; abt = &sp->u.iocb_cmd; - abt->u.abt.comp_status = le16_to_cpu(pkt->comp_status); + abt->u.abt.comp_status = pkt->comp_status; orig_sp = sp->cmd_sp; /* Need to pass original sp */ if (orig_sp) diff --git a/drivers/scsi/qla2xxx/qla_sup.c b/drivers/scsi/qla2xxx/qla_sup.c index f771fabcba59..060c89237777 100644 --- a/drivers/scsi/qla2xxx/qla_sup.c +++ b/drivers/scsi/qla2xxx/qla_sup.c @@ -2621,10 +2621,11 @@ qla24xx_read_optrom_data(struct scsi_qla_host *vha, void *buf, } static int -qla28xx_extract_sfub_and_verify(struct scsi_qla_host *vha, uint32_t *buf, +qla28xx_extract_sfub_and_verify(struct scsi_qla_host *vha, __le32 *buf, uint32_t len, uint32_t buf_size_without_sfub, uint8_t *sfub_buf) { - uint32_t *p, check_sum = 0; + uint32_t check_sum = 0; + __le32 *p; int i; p = buf + buf_size_without_sfub; @@ -2790,8 +2791,8 @@ qla28xx_write_flash_data(scsi_qla_host_t *vha, uint32_t *dwptr, uint32_t faddr, goto done; } - rval = qla28xx_extract_sfub_and_verify(vha, dwptr, dwords, - buf_size_without_sfub, (uint8_t *)sfub); + rval = qla28xx_extract_sfub_and_verify(vha, (__le32 *)dwptr, + dwords, buf_size_without_sfub, (uint8_t *)sfub); if (rval != QLA_SUCCESS) goto done; From patchwork Thu Mar 18 03:28:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 12147263 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 19D2AC43332 for ; Thu, 18 Mar 2021 03:29:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D6E5664F09 for ; Thu, 18 Mar 2021 03:29:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231240AbhCRD3I (ORCPT ); Wed, 17 Mar 2021 23:29:08 -0400 Received: from mail-pj1-f44.google.com ([209.85.216.44]:54886 "EHLO mail-pj1-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230493AbhCRD2x (ORCPT ); Wed, 17 Mar 2021 23:28:53 -0400 Received: by mail-pj1-f44.google.com with SMTP id w8so2175109pjf.4 for ; Wed, 17 Mar 2021 20:28:53 -0700 (PDT) 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:mime-version:content-transfer-encoding; bh=TbYHENiZ2NxNmIK42cPP4InnrTTNciDDGhfK/nYZBv4=; b=GiXJ5FxP1ZbLCmnzW/z8qTnqFsjqW3FYmCOniXAvzkv9L369vwr6WFOVAVj8fdk2U7 2zyYuiX/LJG2iPakoxnFVI8dcuXjagNWoolTfAhcg417vy5JLzyoYKYw45WbOKDOPli6 rvVcrKD/EsBVNo+E0bntD33MX0UozF5J4g2v7VEY4hMA2uFAdXyyerI4dBIhg2CCDy+/ ZTY7saj3FtMccEnetOpNc76lpfuH4RjQ19cpSmNpjWsMkux/RhKZNW3gCBkeXZSmjx5z fYW/tCgeq2xFVZs4L6hvDF/0jiGpa8T6ZXtbLeali6erDaYx/U4H2znRUvS1yZGcWe0/ zjlA== X-Gm-Message-State: AOAM530x4Ss5S9THbW4mzK3fCXLjeFnNRXAJet78IXdFIktDRfIX+27t zU+Wqqin8iHqbghPlCwJSYI= X-Google-Smtp-Source: ABdhPJxm9QeD45ZJckgEZCvy31CUqZUDp+Qm1P+0bidH8W1I78Fp9fxiRk09sLnTiIfDi9Ibj3S5dA== X-Received: by 2002:a17:902:bf01:b029:e6:6b59:a48b with SMTP id bi1-20020a170902bf01b02900e66b59a48bmr7589959plb.55.1616038133348; Wed, 17 Mar 2021 20:28:53 -0700 (PDT) Received: from asus.hsd1.ca.comcast.net ([2601:647:4000:d7:7fb2:1f41:ab33:bae6]) by smtp.gmail.com with ESMTPSA id y68sm473687pgy.5.2021.03.17.20.28.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Mar 2021 20:28:52 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" , "James E . J . Bottomley" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Quinn Tran , Mike Christie , Daniel Wagner , Himanshu Madhani Subject: [PATCH v2 4/6] qla2xxx: Suppress Coverity complaints about dseg_r* Date: Wed, 17 Mar 2021 20:28:38 -0700 Message-Id: <20210318032840.7611-5-bvanassche@acm.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210318032840.7611-1-bvanassche@acm.org> References: <20210318032840.7611-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Change dseq_rq and dseg_rsp from scalar structure members into single-element arrays such that Coverity does not complain about the (*cur_dsd)++ statement in append_dsd64(). Cc: Quinn Tran Cc: Mike Christie Reviewed-by: Daniel Wagner Reviewed-by: Himanshu Madhani Signed-off-by: Bart Van Assche Reviewed-by: Lee Duncan --- drivers/scsi/qla2xxx/qla_mr.c | 12 ++++++------ drivers/scsi/qla2xxx/qla_mr.h | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_mr.c b/drivers/scsi/qla2xxx/qla_mr.c index ca7306685325..61eaf6c4ac47 100644 --- a/drivers/scsi/qla2xxx/qla_mr.c +++ b/drivers/scsi/qla2xxx/qla_mr.c @@ -3266,8 +3266,8 @@ qlafx00_fxdisc_iocb(srb_t *sp, struct fxdisc_entry_fx00 *pfxiocb) fx_iocb.req_xfrcnt = cpu_to_le16(fxio->u.fxiocb.req_len); put_unaligned_le64(fxio->u.fxiocb.req_dma_handle, - &fx_iocb.dseg_rq.address); - fx_iocb.dseg_rq.length = + &fx_iocb.dseg_rq[0].address); + fx_iocb.dseg_rq[0].length = cpu_to_le32(fxio->u.fxiocb.req_len); } @@ -3276,8 +3276,8 @@ qlafx00_fxdisc_iocb(srb_t *sp, struct fxdisc_entry_fx00 *pfxiocb) fx_iocb.rsp_xfrcnt = cpu_to_le16(fxio->u.fxiocb.rsp_len); put_unaligned_le64(fxio->u.fxiocb.rsp_dma_handle, - &fx_iocb.dseg_rsp.address); - fx_iocb.dseg_rsp.length = + &fx_iocb.dseg_rsp[0].address); + fx_iocb.dseg_rsp[0].length = cpu_to_le32(fxio->u.fxiocb.rsp_len); } @@ -3314,7 +3314,7 @@ qlafx00_fxdisc_iocb(srb_t *sp, struct fxdisc_entry_fx00 *pfxiocb) cpu_to_le16(bsg_job->request_payload.sg_cnt); tot_dsds = bsg_job->request_payload.sg_cnt; - cur_dsd = &fx_iocb.dseg_rq; + cur_dsd = &fx_iocb.dseg_rq[0]; avail_dsds = 1; for_each_sg(bsg_job->request_payload.sg_list, sg, tot_dsds, index) { @@ -3369,7 +3369,7 @@ qlafx00_fxdisc_iocb(srb_t *sp, struct fxdisc_entry_fx00 *pfxiocb) fx_iocb.rsp_dsdcnt = cpu_to_le16(bsg_job->reply_payload.sg_cnt); tot_dsds = bsg_job->reply_payload.sg_cnt; - cur_dsd = &fx_iocb.dseg_rsp; + cur_dsd = &fx_iocb.dseg_rsp[0]; avail_dsds = 1; for_each_sg(bsg_job->reply_payload.sg_list, sg, diff --git a/drivers/scsi/qla2xxx/qla_mr.h b/drivers/scsi/qla2xxx/qla_mr.h index 73be8348402a..eefbae9d7547 100644 --- a/drivers/scsi/qla2xxx/qla_mr.h +++ b/drivers/scsi/qla2xxx/qla_mr.h @@ -176,8 +176,8 @@ struct fxdisc_entry_fx00 { uint8_t flags; uint8_t reserved_1; - struct dsd64 dseg_rq; - struct dsd64 dseg_rsp; + struct dsd64 dseg_rq[1]; + struct dsd64 dseg_rsp[1]; __le32 dataword; __le32 adapid; From patchwork Thu Mar 18 03:28:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 12147261 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.9 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNWANTED_LANGUAGE_BODY, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D9A6BC4332E for ; Thu, 18 Mar 2021 03:29:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B5BDC64F21 for ; Thu, 18 Mar 2021 03:29:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231247AbhCRD3I (ORCPT ); Wed, 17 Mar 2021 23:29:08 -0400 Received: from mail-pl1-f174.google.com ([209.85.214.174]:35787 "EHLO mail-pl1-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230495AbhCRD2z (ORCPT ); Wed, 17 Mar 2021 23:28:55 -0400 Received: by mail-pl1-f174.google.com with SMTP id e14so581291plj.2 for ; Wed, 17 Mar 2021 20:28:55 -0700 (PDT) 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:mime-version:content-transfer-encoding; bh=+0tbxfnmah7usx0zbzOV8PfgFfcKPXhVDUPTh4o5nMs=; b=JVLIjG11L2s6XUrz+34NNClu26VO5ELNjnmRztapad3Y8HcYRkmizm5i5Fulsmmq29 0MKCY8aZf8sJaf+qOylAvOhBTacrCfFe2NrsWzMMTUNrYtRbeP4T9ZIps2+A4Udyu1fl YIQJF67Fla2A/2CVvldxfX6L/blGx03GaOYyygHzSgHCBi4Jxgp+62B4xEZPFGD+xiwY UPZZV5Yr15GmFGzH0LTb7MHhbinKDF+6P3jlG6mHJDgaeX9akA5xYA1ijAgL4QpSRR33 FvScYO+S12TfFlUIUDgDN8cs8dGu/rh3/EUDPUoTNtTUCWFI9tR0Dgsx5+jIFmkaQrBI PYAg== X-Gm-Message-State: AOAM532EiZ69dQFdDE9prlMj9q9YbyjWakzZYiG7nURL7IZvW9/Yqemu s9DJ9ncVSERDABVWkwE30s0= X-Google-Smtp-Source: ABdhPJwMoV24qWMIbPjduK+Kp9ozHTzmNtINRCVhQ2dcUC9svKmGqGrzRknh8KtzrKPveyIxwa9z0g== X-Received: by 2002:a17:902:e84a:b029:e6:d1ee:a1ed with SMTP id t10-20020a170902e84ab02900e6d1eea1edmr63640plg.78.1616038134828; Wed, 17 Mar 2021 20:28:54 -0700 (PDT) Received: from asus.hsd1.ca.comcast.net ([2601:647:4000:d7:7fb2:1f41:ab33:bae6]) by smtp.gmail.com with ESMTPSA id y68sm473687pgy.5.2021.03.17.20.28.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Mar 2021 20:28:54 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" , "James E . J . Bottomley" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Quinn Tran , Mike Christie , Daniel Wagner , Himanshu Madhani Subject: [PATCH v2 5/6] qla2xxx: Simplify qla8044_minidump_process_control() Date: Wed, 17 Mar 2021 20:28:39 -0700 Message-Id: <20210318032840.7611-6-bvanassche@acm.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210318032840.7611-1-bvanassche@acm.org> References: <20210318032840.7611-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org This patch fixes the following Coverity complaint: CID 177490 (#1 of 1): Unused value (UNUSED_VALUE) assigned_value: Assigning value from opcode & 0xffffff7fU to opcode here, but that stored value is overwritten before it can be used. Cc: Quinn Tran Cc: Mike Christie Reviewed-by: Daniel Wagner Reviewed-by: Himanshu Madhani Signed-off-by: Bart Van Assche Reviewed-by: Lee Duncan --- drivers/scsi/qla2xxx/qla_nx2.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_nx2.c b/drivers/scsi/qla2xxx/qla_nx2.c index 68a16c95dcb7..792c55fcec8c 100644 --- a/drivers/scsi/qla2xxx/qla_nx2.c +++ b/drivers/scsi/qla2xxx/qla_nx2.c @@ -2226,19 +2226,16 @@ qla8044_minidump_process_control(struct scsi_qla_host *vha, if (opcode & QLA82XX_DBG_OPCODE_WR) { qla8044_wr_reg_indirect(vha, crb_addr, crb_entry->value_1); - opcode &= ~QLA82XX_DBG_OPCODE_WR; } if (opcode & QLA82XX_DBG_OPCODE_RW) { qla8044_rd_reg_indirect(vha, crb_addr, &read_value); qla8044_wr_reg_indirect(vha, crb_addr, read_value); - opcode &= ~QLA82XX_DBG_OPCODE_RW; } if (opcode & QLA82XX_DBG_OPCODE_AND) { qla8044_rd_reg_indirect(vha, crb_addr, &read_value); read_value &= crb_entry->value_2; - opcode &= ~QLA82XX_DBG_OPCODE_AND; if (opcode & QLA82XX_DBG_OPCODE_OR) { read_value |= crb_entry->value_3; opcode &= ~QLA82XX_DBG_OPCODE_OR; @@ -2249,7 +2246,6 @@ qla8044_minidump_process_control(struct scsi_qla_host *vha, qla8044_rd_reg_indirect(vha, crb_addr, &read_value); read_value |= crb_entry->value_3; qla8044_wr_reg_indirect(vha, crb_addr, read_value); - opcode &= ~QLA82XX_DBG_OPCODE_OR; } if (opcode & QLA82XX_DBG_OPCODE_POLL) { poll_time = crb_entry->crb_strd.poll_timeout; @@ -2269,7 +2265,6 @@ qla8044_minidump_process_control(struct scsi_qla_host *vha, crb_addr, &read_value); } } while (1); - opcode &= ~QLA82XX_DBG_OPCODE_POLL; } if (opcode & QLA82XX_DBG_OPCODE_RDSTATE) { @@ -2283,7 +2278,6 @@ qla8044_minidump_process_control(struct scsi_qla_host *vha, qla8044_rd_reg_indirect(vha, addr, &read_value); index = crb_entry->crb_ctrl.state_index_v; tmplt_hdr->saved_state_array[index] = read_value; - opcode &= ~QLA82XX_DBG_OPCODE_RDSTATE; } if (opcode & QLA82XX_DBG_OPCODE_WRSTATE) { @@ -2303,7 +2297,6 @@ qla8044_minidump_process_control(struct scsi_qla_host *vha, } qla8044_wr_reg_indirect(vha, addr, read_value); - opcode &= ~QLA82XX_DBG_OPCODE_WRSTATE; } if (opcode & QLA82XX_DBG_OPCODE_MDSTATE) { @@ -2316,7 +2309,6 @@ qla8044_minidump_process_control(struct scsi_qla_host *vha, read_value |= crb_entry->value_3; read_value += crb_entry->value_1; tmplt_hdr->saved_state_array[index] = read_value; - opcode &= ~QLA82XX_DBG_OPCODE_MDSTATE; } crb_addr += crb_entry->crb_strd.addr_stride; } From patchwork Thu Mar 18 03:28:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 12147257 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BEB4AC4332B for ; Thu, 18 Mar 2021 03:29:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9454064F38 for ; Thu, 18 Mar 2021 03:29:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231249AbhCRD3I (ORCPT ); Wed, 17 Mar 2021 23:29:08 -0400 Received: from mail-pj1-f41.google.com ([209.85.216.41]:39598 "EHLO mail-pj1-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230507AbhCRD24 (ORCPT ); Wed, 17 Mar 2021 23:28:56 -0400 Received: by mail-pj1-f41.google.com with SMTP id ot17-20020a17090b3b51b0290109c9ac3c34so2005264pjb.4 for ; Wed, 17 Mar 2021 20:28:56 -0700 (PDT) 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:mime-version:content-transfer-encoding; bh=Gg1avgyywlAHUAw1chJwnBc0TLhADSublheldOVu61M=; b=hEZfGqdrEJ6I7hJesWWpAfSghcm2e3hrwtjL2qgIokUzCAdF5XqMcXgg9IwuM2XmTY kg9P4KMPWWvJie/xZj3pNW1Wn1afuvOruH616842aUVrPsdP4CvRfu+banUMQ0SDK/i+ diCXZ3e978eCMLFb5bmJYepXExnUQ1mKuZblCF2iTvqJ8VKM3ePUUcoBfFnXzPCsgNDQ sceVKPm5sF9MAlNWN8rtmxCU5AWdmSO5FYHHIf4dpNEiAHJoKakw/+Ko2L1RoCm9qMUD CZHazWHQ1/j7eiT09bo//E93eq6/rvpVEv1cHN/RWOQIFhqcWnSNSRhW/P8ABjpVyepP K0Ug== X-Gm-Message-State: AOAM530Cxk7qZmPid/Z+zW02d1g/1SIbup1fIcrNxYMSG/M0lLx7STO9 wVtq31vfGaGqlLsvEVycaBY= X-Google-Smtp-Source: ABdhPJwsDkVBOrj2nEYQ5MzBN7993O+BogBD6xAASTHbkGfRMbDRwO0Qd6ZvKGa0SpihtQX4C4DhFg== X-Received: by 2002:a17:902:ee95:b029:e5:e2c7:5f76 with SMTP id a21-20020a170902ee95b02900e5e2c75f76mr7650216pld.25.1616038136329; Wed, 17 Mar 2021 20:28:56 -0700 (PDT) Received: from asus.hsd1.ca.comcast.net ([2601:647:4000:d7:7fb2:1f41:ab33:bae6]) by smtp.gmail.com with ESMTPSA id y68sm473687pgy.5.2021.03.17.20.28.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Mar 2021 20:28:55 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" , "James E . J . Bottomley" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Quinn Tran , Mike Christie , Himanshu Madhani , Daniel Wagner Subject: [PATCH v2 6/6] qla2xxx: Always check the return value of qla24xx_get_isp_stats() Date: Wed, 17 Mar 2021 20:28:40 -0700 Message-Id: <20210318032840.7611-7-bvanassche@acm.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210318032840.7611-1-bvanassche@acm.org> References: <20210318032840.7611-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org This patch fixes the following Coverity warning: CID 361199 (#1 of 1): Unchecked return value (CHECKED_RETURN) 3. check_return: Calling qla24xx_get_isp_stats without checking return value (as is done elsewhere 4 out of 5 times). Cc: Quinn Tran Cc: Mike Christie Cc: Himanshu Madhani Cc: Daniel Wagner Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx/qla_attr.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index 63391c9be05d..5813b17f1633 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c @@ -2864,6 +2864,8 @@ qla2x00_reset_host_stats(struct Scsi_Host *shost) vha->qla_stats.jiffies_at_last_reset = get_jiffies_64(); if (IS_FWI2_CAPABLE(ha)) { + int rval; + stats = dma_alloc_coherent(&ha->pdev->dev, sizeof(*stats), &stats_dma, GFP_KERNEL); if (!stats) { @@ -2873,7 +2875,9 @@ qla2x00_reset_host_stats(struct Scsi_Host *shost) } /* reset firmware statistics */ - qla24xx_get_isp_stats(base_vha, stats, stats_dma, BIT_0); + rval = qla24xx_get_isp_stats(base_vha, stats, stats_dma, BIT_0); + ql_log(ql_log_warn, vha, 0x70d9, + "Resetting ISP statistics failed: rval = %d\n", rval); dma_free_coherent(&ha->pdev->dev, sizeof(*stats), stats, stats_dma);