From patchwork Thu Aug 25 07:54:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sreekanth Reddy X-Patchwork-Id: 600196 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AE794C04AA5 for ; Thu, 25 Aug 2022 07:43:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236070AbiHYHnC (ORCPT ); Thu, 25 Aug 2022 03:43:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37668 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238507AbiHYHmu (ORCPT ); Thu, 25 Aug 2022 03:42:50 -0400 Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C9F0A3441 for ; Thu, 25 Aug 2022 00:42:45 -0700 (PDT) Received: by mail-pj1-x1034.google.com with SMTP id n65-20020a17090a5ac700b001fbb4fad865so518963pji.1 for ; Thu, 25 Aug 2022 00:42:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc; bh=QGYWF+NS2PttYj3I8aGAZ/ViUqq7S7cYk1IYTUwu/HY=; b=e+pstbdNl3phss/HI0LC5+XKwx9avnQXLuDIpUJY9cAaZnENnHJFI2ZawRW44su88j Z9DJoPp8q1+ySvweo43pVFImh6OdleY2OaxNkAjvIPPaBDeY7BsTDjdY2cyMTliVU5H8 lnbZUSx7y6MY44SjWP+sGMv1MtmwJkXeN4gFA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:x-gm-message-state:from:to:cc; bh=QGYWF+NS2PttYj3I8aGAZ/ViUqq7S7cYk1IYTUwu/HY=; b=g+ekPpgnsUsKm67ci8F6SOGZD2Ox4tSUXgIkbYueA+W7sW51igmN9l7Fh3BfeXOPiZ PJbxKZrA6ZnTBMNX6q9eR0YNWjD2vcZQJsDAZi9D2Arm7PXlOtPYx84zzkB4hlm93RSC FJCm6QsVTJNLmmDM2zNJnDd7B5ftYX/nPvSyHZpO+rjJ39gXIhedNb6QoTgrr8qTQVbx q5fiEabuQuOuNfVGR3aoqu6SZtCEhFcxhNmzDlgghSG1adI1GLje+XWJNrHhJfBSZZJz LmNdx078chikIYWDmpUxR/h9jjZITjttk2D5k8TG9QaREX0tmstYE5XaaktaMmfpyUih YZuw== X-Gm-Message-State: ACgBeo3OLPDLiuMX3GPQ+pQn6NjPZISkM4dBoBU+reg32f1cUSXowY5p ikjGGOj+5G8iEKD6SpMOHnwsjdHK/Ltr57/ehTq1Abdax1lDG3OF+OolySuvGshSccyM4zrgODR wk4c2qdRmyLOefR5i6McdyY9Mq5hrndg+A7693//4lCBwPLj5a8FPmh4aJ9Dl8SqxhIPXx4q1HB 7gwuO1pbli X-Google-Smtp-Source: AA6agR5t9WBy8zoWEOnre62ftFZZD4ctasTcqwUIj6hJhKqtRNXgRhF4qskJs0Bt9HYUcc0zp2Ih9A== X-Received: by 2002:a17:90b:1bca:b0:1fb:7eaf:8955 with SMTP id oa10-20020a17090b1bca00b001fb7eaf8955mr7949729pjb.37.1661413363807; Thu, 25 Aug 2022 00:42:43 -0700 (PDT) Received: from dhcp-10-123-20-36.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id ns3-20020a17090b250300b001fbb0d07363sm644916pjb.39.2022.08.25.00.42.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Aug 2022 00:42:43 -0700 (PDT) From: Sreekanth Reddy To: linux-scsi@vger.kernel.org Cc: martin.petersen@oracle.com, Sreekanth Reddy Subject: [PATCH v2 2/4] mpt3sas: Fix trace buffer registration failed Date: Thu, 25 Aug 2022 13:24:55 +0530 Message-Id: <20220825075457.16422-3-sreekanth.reddy@broadcom.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220825075457.16422-1-sreekanth.reddy@broadcom.com> References: <20220825075457.16422-1-sreekanth.reddy@broadcom.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org The ExtendedType field was set to one in the diag buffer register command and hence MPT Endpoint firmware is failing the request with Invalid Field IOCStatus. So, memset the request frame to zero before framing the diag buffer register command. Signed-off-by: Sreekanth Reddy --- drivers/scsi/mpt3sas/mpt3sas_ctl.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/scsi/mpt3sas/mpt3sas_ctl.c b/drivers/scsi/mpt3sas/mpt3sas_ctl.c index c47da95..0d8b1e9 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_ctl.c +++ b/drivers/scsi/mpt3sas/mpt3sas_ctl.c @@ -1694,6 +1694,7 @@ _ctl_diag_register_2(struct MPT3SAS_ADAPTER *ioc, ioc->ctl_cmds.status = MPT3_CMD_PENDING; memset(ioc->ctl_cmds.reply, 0, ioc->reply_sz); mpi_request = mpt3sas_base_get_msg_frame(ioc, smid); + memset(mpi_request, 0, ioc->request_sz); ioc->ctl_cmds.smid = smid; request_data = ioc->diag_buffer[buffer_type]; @@ -1795,6 +1796,7 @@ _ctl_diag_register_2(struct MPT3SAS_ADAPTER *ioc, if (rc && request_data) { dma_free_coherent(&ioc->pdev->dev, request_data_sz, request_data, request_data_dma); + ioc->diag_buffer[buffer_type] = NULL; ioc->diag_buffer_status[buffer_type] &= ~MPT3_DIAG_BUFFER_IS_DRIVER_ALLOCATED; } @@ -2171,6 +2173,7 @@ mpt3sas_send_diag_release(struct MPT3SAS_ADAPTER *ioc, u8 buffer_type, ioc->ctl_cmds.status = MPT3_CMD_PENDING; memset(ioc->ctl_cmds.reply, 0, ioc->reply_sz); mpi_request = mpt3sas_base_get_msg_frame(ioc, smid); + memset(mpi_request, 0, ioc->request_sz); ioc->ctl_cmds.smid = smid; mpi_request->Function = MPI2_FUNCTION_DIAG_RELEASE; @@ -2425,6 +2428,7 @@ _ctl_diag_read_buffer(struct MPT3SAS_ADAPTER *ioc, void __user *arg) ioc->ctl_cmds.status = MPT3_CMD_PENDING; memset(ioc->ctl_cmds.reply, 0, ioc->reply_sz); mpi_request = mpt3sas_base_get_msg_frame(ioc, smid); + memset(mpi_request, 0, ioc->request_sz); ioc->ctl_cmds.smid = smid; mpi_request->Function = MPI2_FUNCTION_DIAG_BUFFER_POST;