From patchwork Fri May 8 08:51:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chandrakanth Patil X-Patchwork-Id: 11536009 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7BB81139F for ; Fri, 8 May 2020 08:51:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 628E4208D6 for ; Fri, 8 May 2020 08:51:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="dGxd/hii" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726746AbgEHIvp (ORCPT ); Fri, 8 May 2020 04:51:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726638AbgEHIvp (ORCPT ); Fri, 8 May 2020 04:51:45 -0400 Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B314C05BD09 for ; Fri, 8 May 2020 01:51:45 -0700 (PDT) Received: by mail-wm1-x342.google.com with SMTP id y24so9777382wma.4 for ; Fri, 08 May 2020 01:51:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id; bh=GTjfeLZr6qS9lCebo0Oi2u+gWYCLyvnmU1MVj1pW/Tc=; b=dGxd/hii6j+GES6t/mDi2Arr/f8FWTzss8lXWYrY2wLyGjkKVy4kB4Cnln5gMKv2+u jNuaDMYwDCRwAB9zaykC0CPyzC2Y7Yu5wQIJ2DxrYwytHuvfsIlkhM+JfTinuWevF7bL lG7wsmfGcDHQfNjs9pwOzCXNsdiy3nwEk5UqI= 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; bh=GTjfeLZr6qS9lCebo0Oi2u+gWYCLyvnmU1MVj1pW/Tc=; b=pYH985x39uWfF81n3oj3lPyUvmv6mGU2vwdFg5VcgovF1j6dYHIZP6s9cLEc5h8WhW oOKgOu1RluIah7mRZt6YFUemtuzZhNDZ/OKXnitnHujE08GogcyMjNtG0uhKE37V3mZd uUMjb1KizyBtVFBPHlpDRv9PV8kCXkjy+ID/D2J2bbBPMP0jK3KKjd47oUnR1KJnGjsg cYzP0R6Xe4lLNAGLXSbor4NgRYPue2o7Kst0c13I9vm580uXKxrjS6ZPD1luqjrHPiah ZGEB2tZwSRKWWFY3qBzBrIo7eI0c57S+sBc8IkmIz8hQn+eih75jJlmBk0qnFAwGQ36a zelQ== X-Gm-Message-State: AGi0PuYGdM6wM/R3kC4leBomk3xreY3tWDRwQ1j1OyD7nM3IS1DCum+j NjHbpUFPR1nKJRZBGFk7xIS/eQYh6jkS/TFmP9c1lajge16n1TH8JXuvx5m1BGPG2nOfK1oJnce qpmRAtDA9MZtvWLHwkQCPO+XoGxGOEwUR5RkcdO/qrVnszMRiDnQfP0ANzxH5jmkM9+eEtPo4k9 +Q/UnL9NU6d4F4 X-Google-Smtp-Source: APiQypJweP82VQB3J7E+aqGejvIAep37uz3nqCleBy34hPBOzfiO/mJT1tufHfGKNAwidM1XGaJrsg== X-Received: by 2002:a1c:5402:: with SMTP id i2mr14350587wmb.2.1588927903277; Fri, 08 May 2020 01:51:43 -0700 (PDT) Received: from it_dev_server1.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id p8sm8048387wma.45.2020.05.08.01.51.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 May 2020 01:51:42 -0700 (PDT) From: Chandrakanth Patil To: linux-scsi@vger.kernel.org Cc: kashyap.desai@broadcom.com, sumit.saxena@broadcom.com, kiran-kumar.kasturi@broadcom.com, sankar.patra@broadcom.com, sasikumar.pc@broadcom.com, shivasharan.srikanteshwara@broadcom.com, anand.lodnoor@broadcom.com, Chandrakanth Patil , "# v5 . 6+" Subject: [PATCH 3/5] megaraid_sas: Replace undefined MFI_BIG_ENDIAN macro with __BIG_ENDIAN_BITFIELD macro Date: Fri, 8 May 2020 14:21:30 +0530 Message-Id: <20200508085130.23339-1-chandrakanth.patil@broadcom.com> X-Mailer: git-send-email 2.9.5 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org MFI_BIG_ENDIAN macro used in drivers structure bitfield to check the CPU big endianness is undefined which would break the code on big endian machine. __BIG_ENDIAN_BITFIELD kernel macro should be used in places of MFI_BIG_ENDIAN macro. Fixes: a7faf81d7858 ("scsi: megaraid_sas: Set no_write_same only for Virtual Disk") Cc: # v5.6+ Signed-off-by: Shivasharan S Signed-off-by: Chandrakanth Patil Reviewed-by: Hannes Reinecke --- drivers/scsi/megaraid/megaraid_sas.h | 4 ++-- drivers/scsi/megaraid/megaraid_sas_fusion.h | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/megaraid/megaraid_sas.h b/drivers/scsi/megaraid/megaraid_sas.h index 83d8c4c..9882736 100644 --- a/drivers/scsi/megaraid/megaraid_sas.h +++ b/drivers/scsi/megaraid/megaraid_sas.h @@ -511,7 +511,7 @@ union MR_PROGRESS { */ struct MR_PD_PROGRESS { struct { -#ifndef MFI_BIG_ENDIAN +#ifndef __BIG_ENDIAN_BITFIELD u32 rbld:1; u32 patrol:1; u32 clear:1; @@ -537,7 +537,7 @@ struct MR_PD_PROGRESS { }; struct { -#ifndef MFI_BIG_ENDIAN +#ifndef __BIG_ENDIAN_BITFIELD u32 rbld:1; u32 patrol:1; u32 clear:1; diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.h b/drivers/scsi/megaraid/megaraid_sas_fusion.h index d57ecc7..30de4b0 100644 --- a/drivers/scsi/megaraid/megaraid_sas_fusion.h +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.h @@ -774,7 +774,7 @@ struct MR_SPAN_BLOCK_INFO { struct MR_CPU_AFFINITY_MASK { union { struct { -#ifndef MFI_BIG_ENDIAN +#ifndef __BIG_ENDIAN_BITFIELD u8 hw_path:1; u8 cpu0:1; u8 cpu1:1; @@ -866,7 +866,7 @@ struct MR_LD_RAID { __le16 seqNum; struct { -#ifndef MFI_BIG_ENDIAN +#ifndef __BIG_ENDIAN_BITFIELD u32 ldSyncRequired:1; u32 regTypeReqOnReadIsValid:1; u32 isEPD:1; @@ -889,7 +889,7 @@ struct { /* 0x30 - 0x33, Logical block size for the LD */ u32 logical_block_length; struct { -#ifndef MFI_BIG_ENDIAN +#ifndef __BIG_ENDIAN_BITFIELD /* 0x34, P_I_EXPONENT from READ CAPACITY 16 */ u32 ld_pi_exp:4; /* 0x34, LOGICAL BLOCKS PER PHYSICAL From patchwork Fri May 8 08:52:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chandrakanth Patil X-Patchwork-Id: 11536011 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 20BDC139F for ; Fri, 8 May 2020 08:52:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 09150207DD for ; Fri, 8 May 2020 08:52:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="a3M4eQ+W" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726817AbgEHIw6 (ORCPT ); Fri, 8 May 2020 04:52:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51960 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726746AbgEHIw6 (ORCPT ); Fri, 8 May 2020 04:52:58 -0400 Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F03C6C05BD09 for ; Fri, 8 May 2020 01:52:57 -0700 (PDT) Received: by mail-wm1-x343.google.com with SMTP id r26so9772665wmh.0 for ; Fri, 08 May 2020 01:52:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id; bh=XHtY22wdqoD6kwX3h4YQdHgh33drKh8dmMkZ3FUswro=; b=a3M4eQ+WWaAMgC3KWWxjz92/gjVJbQg54xYUI2IMUPV8vbLXBByqWMB616+NYou7hB g0MfI5H3o1UxEtWkyOp7WJ/p0V92jf/07aCuzVW6zZclHr8hlc4js0grL/UvLee76ET7 RKfEuIW0zS1x2pvxPGG/xk04NnL/eP5M7PX0g= 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; bh=XHtY22wdqoD6kwX3h4YQdHgh33drKh8dmMkZ3FUswro=; b=BcvyJgrRE02JFQpu58sSxyggcfV+RYqiXPJi/C+MGL8CUeunOYRrNErBs98KgZ8EI5 LC0A6lgIb8/41pBjrSIoNCFcfEaRLDSVMzQ20YSF0ULnhgTS0gmyz/9A9dRpaKVjbjZ0 DykHZhZPpL/lmrdGj0MxpzMbYmXu77KnSUa2+p7j2rrJYZbBs+fJlw1yjDTlN3eycERU NTuuwRQZW2Js7v7W5tmmrl4G5RDfvppAxnpdlx3neU99yfcjxIiN0JZumgDJ0ASu3tph uJCGWaFlpH76sKWM1WCoEPsnlMRy+wQ8iMh/EwU6W/rjZz3t9yPxrnfyaO2lrdJZit3l 68gQ== X-Gm-Message-State: AGi0PuYQupj+oXoZy8/yn96kPGAcZfiBUR5iBIs3erSfhh3vLAwvNpDs K0FF7QNlSiq6HRdiZRqt7WoGYEMyulqbUcHcJIdLxBhAhZ+1YU4j8dqrnjJjuNbkeMnmbmUsXAr n78SlK0pTEf/IiVCt7PZCv0Qcmz5WJlab6h6HEFt33DirPDwqvBToxbcHLWh2wbKA5ENFu3lmsc xswLsX2057d+O9 X-Google-Smtp-Source: APiQypKdriRs4YmjXWuUXd6zMQwRpYcVQtLFOq8GnpNc/A1T2Ibe50kATp5BITp4mlzmVAS0oN2d/w== X-Received: by 2002:a1c:6042:: with SMTP id u63mr854070wmb.65.1588927976290; Fri, 08 May 2020 01:52:56 -0700 (PDT) Received: from it_dev_server1.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id f26sm12132333wmj.11.2020.05.08.01.52.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 May 2020 01:52:55 -0700 (PDT) From: Chandrakanth Patil To: linux-scsi@vger.kernel.org Cc: kashyap.desai@broadcom.com, sumit.saxena@broadcom.com, kiran-kumar.kasturi@broadcom.com, sankar.patra@broadcom.com, sasikumar.pc@broadcom.com, shivasharan.srikanteshwara@broadcom.com, anand.lodnoor@broadcom.com, Chandrakanth Patil , stable@vger.kernel.org Subject: [PATCH 4/5] megaraid_sas: TM command refire leads to controller firmware crash Date: Fri, 8 May 2020 14:22:42 +0530 Message-Id: <20200508085242.23406-1-chandrakanth.patil@broadcom.com> X-Mailer: git-send-email 2.9.5 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Issue: When TM command times-out driver invokes the controller reset. Post reset, driver re-fires pended TM commands which leads to firmware crash. Fix: Post controller reset, return pended TM commands back to OS. Cc: stable@vger.kernel.org Signed-off-by: Sumit Saxena Signed-off-by: Chandrakanth Patil --- drivers/scsi/megaraid/megaraid_sas_fusion.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c index 87f91a38..319f241 100644 --- a/drivers/scsi/megaraid/megaraid_sas_fusion.c +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c @@ -4180,6 +4180,7 @@ static void megasas_refire_mgmt_cmd(struct megasas_instance *instance, struct fusion_context *fusion; struct megasas_cmd *cmd_mfi; union MEGASAS_REQUEST_DESCRIPTOR_UNION *req_desc; + struct MPI2_RAID_SCSI_IO_REQUEST *scsi_io_req; u16 smid; bool refire_cmd = false; u8 result; @@ -4247,6 +4248,11 @@ static void megasas_refire_mgmt_cmd(struct megasas_instance *instance, result = COMPLETE_CMD; } + scsi_io_req = (struct MPI2_RAID_SCSI_IO_REQUEST *) + cmd_fusion->io_request; + if (scsi_io_req->Function == MPI2_FUNCTION_SCSI_TASK_MGMT) + result = RETURN_CMD; + switch (result) { case REFIRE_CMD: megasas_fire_cmd_fusion(instance, req_desc); @@ -4475,7 +4481,6 @@ megasas_issue_tm(struct megasas_instance *instance, u16 device_handle, if (!timeleft) { dev_err(&instance->pdev->dev, "task mgmt type 0x%x timed out\n", type); - cmd_mfi->flags |= DRV_DCMD_SKIP_REFIRE; mutex_unlock(&instance->reset_mutex); rc = megasas_reset_fusion(instance->host, MFI_IO_TIMEOUT_OCR); mutex_lock(&instance->reset_mutex); From patchwork Fri May 8 08:53:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chandrakanth Patil X-Patchwork-Id: 11536013 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 26326139F for ; Fri, 8 May 2020 08:53:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 03C33207DD for ; Fri, 8 May 2020 08:53:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="KyATLOt1" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726519AbgEHIx1 (ORCPT ); Fri, 8 May 2020 04:53:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725710AbgEHIx1 (ORCPT ); Fri, 8 May 2020 04:53:27 -0400 Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A86DC05BD43 for ; Fri, 8 May 2020 01:53:27 -0700 (PDT) Received: by mail-pl1-x62d.google.com with SMTP id s20so448792plp.6 for ; Fri, 08 May 2020 01:53:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id; bh=vFDwSqhhUSXIeus3xaDeoXmEZLOoBo/F9r1fuq6y5nE=; b=KyATLOt1aGhbtdG/4AGe5Xr/lZPueGfVpYMRR3rGuzblH62BDVgAQN6+cbF9mhioTJ gtxisbWQnQWptqoYTN1idvskWUEuxC32/hQF2ejnvFQk+9VknK5d1rUQgMz5KeWy6EQV W8inm+NFAZ7JscSQgchkJpIJ9ZBM8g3/Wb7pM= 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; bh=vFDwSqhhUSXIeus3xaDeoXmEZLOoBo/F9r1fuq6y5nE=; b=c2i0x+OEt4dWX2NIiqjCQCjOd1BwWr+vxA0qFjm23dLPtPcsX9Ty1a4Ez8rboEHSnL sr6WsoisdIl6bs2BU8OWJCnH0dR879lFwXPyfgjVHoHfsEecX1JRg7X2Z3Nk2iaJHhJ9 ubDp8lknz3d4sXaPXM6nzw9NWfxQeSnhgoPfY6UhtwH78tlXsolpuc3Zx5iyxldzanTU VjAXWzqeptnOKdKLGsHClj5TbfhcdCVe7w5ZqpN7auOR6cwbNqBAAwD81BexqP423WM3 eevuuv8bysvP76cKJ6KoWdlsp7jD9zjhB/i2CtIM7hUVrl5vdLQ1tv8NAY/sWkuLiOBg IEIA== X-Gm-Message-State: AGi0PuY7E1fuKcB43LOz/hHubczFLaS/Tmn5LDPSfVa9gDeXxCQzk2wg 40eTRom7yrWLhryRvuvDb9KBM2dFzeiITGmdLOxx9zvxMh6Dtchnf1IoxM4bs8D/exXNpribLaK Om7I1LgL9ScvPC3pdbXIjZc8RP8d89i4QS8gt1IGjQsrmVqp3NFJMyAUnCzdLLdbWY4zinVEAtV juE2Zyqhu/fi5z X-Google-Smtp-Source: APiQypKtFuMb0Nz1xRL/OuzJGhynfmAMlMduOhdIvR94SW4ZihsCklCnw5z6SfNMrJTDwWOArYGoVg== X-Received: by 2002:a17:90a:734b:: with SMTP id j11mr4854129pjs.108.1588928005780; Fri, 08 May 2020 01:53:25 -0700 (PDT) Received: from it_dev_server1.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id z7sm1099731pff.47.2020.05.08.01.53.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 May 2020 01:53:25 -0700 (PDT) From: Chandrakanth Patil To: linux-scsi@vger.kernel.org Cc: kashyap.desai@broadcom.com, sumit.saxena@broadcom.com, kiran-kumar.kasturi@broadcom.com, sankar.patra@broadcom.com, sasikumar.pc@broadcom.com, shivasharan.srikanteshwara@broadcom.com, anand.lodnoor@broadcom.com, Chandrakanth Patil Subject: [PATCH 5/5] megaraid_sas: Update driver version to 07.714.04.00-rc1 Date: Fri, 8 May 2020 14:23:14 +0530 Message-Id: <20200508085314.23461-1-chandrakanth.patil@broadcom.com> X-Mailer: git-send-email 2.9.5 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Signed-off-by: Chandrakanth Patil --- drivers/scsi/megaraid/megaraid_sas.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/megaraid/megaraid_sas.h b/drivers/scsi/megaraid/megaraid_sas.h index 9882736..af2c7a2 100644 --- a/drivers/scsi/megaraid/megaraid_sas.h +++ b/drivers/scsi/megaraid/megaraid_sas.h @@ -21,8 +21,8 @@ /* * MegaRAID SAS Driver meta data */ -#define MEGASAS_VERSION "07.713.01.00-rc1" -#define MEGASAS_RELDATE "Dec 27, 2019" +#define MEGASAS_VERSION "07.714.04.00-rc1" +#define MEGASAS_RELDATE "Apr 14, 2020" #define MEGASAS_MSIX_NAME_LEN 32