From patchwork Mon Aug 1 12:41:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sreekanth Reddy X-Patchwork-Id: 12933740 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 B9D61C00144 for ; Mon, 1 Aug 2022 12:44:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234902AbiHAMop (ORCPT ); Mon, 1 Aug 2022 08:44:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234821AbiHAMoQ (ORCPT ); Mon, 1 Aug 2022 08:44:16 -0400 Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0EE2C4599A for ; Mon, 1 Aug 2022 05:29:39 -0700 (PDT) Received: by mail-pj1-x1035.google.com with SMTP id e8-20020a17090a280800b001f2fef7886eso11802838pjd.3 for ; Mon, 01 Aug 2022 05:29:39 -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=cGBVEJ3HQhgntAZUGI77BVY2BQhqSOt4jV1QeOBSK5Y=; b=RFrwn0lHJtZkRLD2q5KwDPFDMusUVVl5ex0NyUUtXlu/bqz596Iu6HEpy3jJtNrzNq 8Qi1e6nh8/DOsblwjfCLuuVYrZapJ73PUQHTCXACG55gtKHODy4lZalHypUigOMFfDzb kSeUpLhZIgFE7QVAXsWeM0D3NIUKYv2fvumZ0= 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=cGBVEJ3HQhgntAZUGI77BVY2BQhqSOt4jV1QeOBSK5Y=; b=cpsUJkocnoVoitSRQKuPf13U8lsQ+nsdxe505Uf5UNs2ukOr+9RAT2yv7/kHQIZQ9H 5+e0sr7w9MYTVdK9/P1meVjGSMeq80mQTmJvIIJPeWaZTCJ807JdTmEFHNVEa2zQdpC3 znYwEJQZJpQ1H1+uYcI1X8ZUiPAFDh5hvgC/yNu0qycFm6rX7g+kdqrCyVEID18fNpxY VgWtbq1fEVZtxA8Dl3x2Ib9K0XMw9ZexRGjyIV5DEim9fL3L5JqAsUnlR/w6TBxR3pjf HN+R7M0FwsLv36elgZR7LVqPzjP/47ss9pptJEbGnMIawLrPLWfxg8U9RmWxcYElk8FW 19dg== X-Gm-Message-State: ACgBeo2hFDOccSp17dOsqfuPkJKYdIZ1kpNI5acKT/rV6ApS7Yk/xGgS y1ucDonf0vWOG2LeLMKjyW1POwPI/WMUvCb043zIUzN72DADZecwfA2aFS9a19UIK0UP8Xeoo4n UAEYbRPl+yrFbdnLRAXg8J1LRFltHwTG8vOXayyBPd35Nzzb+u+5RBww1MPtzqXQCBhvAeQECve HplTYpjsmD X-Google-Smtp-Source: AA6agR6oAaX3qkDpv2F5FCNwhHiR21kR8KEa7qL+VgfY7fxuJKHTn9KPJVv5okBNLjHf7buJDavD7g== X-Received: by 2002:a17:902:d54c:b0:16d:9d52:2cb1 with SMTP id z12-20020a170902d54c00b0016d9d522cb1mr16282147plf.29.1659356978153; Mon, 01 Aug 2022 05:29:38 -0700 (PDT) Received: from dhcp-10-123-20-36.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id u3-20020a17090add4300b001f260b1954bsm8931912pjv.13.2022.08.01.05.29.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Aug 2022 05:29:37 -0700 (PDT) From: Sreekanth Reddy To: linux-scsi@vger.kernel.org Cc: martin.petersen@oracle.com, Sreekanth Reddy Subject: [PATCH 2/4] mpt3sas: Fix trace buffer registration failed Date: Mon, 1 Aug 2022 18:11:42 +0530 Message-Id: <20220801124144.11458-3-sreekanth.reddy@broadcom.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220801124144.11458-1-sreekanth.reddy@broadcom.com> References: <20220801124144.11458-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 84c87c2..df00deb 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_ctl.c +++ b/drivers/scsi/mpt3sas/mpt3sas_ctl.c @@ -1686,6 +1686,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]; @@ -1787,6 +1788,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; } @@ -2163,6 +2165,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; @@ -2417,6 +2420,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;