From patchwork Thu Mar 2 10:53:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chandrakanth Patil X-Patchwork-Id: 658373 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 7622DC6FA8E for ; Thu, 2 Mar 2023 10:54:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229639AbjCBKyU (ORCPT ); Thu, 2 Mar 2023 05:54:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41532 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229509AbjCBKyT (ORCPT ); Thu, 2 Mar 2023 05:54:19 -0500 Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D55335BB for ; Thu, 2 Mar 2023 02:54:18 -0800 (PST) Received: by mail-pj1-x1031.google.com with SMTP id me6-20020a17090b17c600b0023816b0c7ceso2442993pjb.2 for ; Thu, 02 Mar 2023 02:54:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1677754457; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=LOwkywF6h6SWFidmVz2iOYUs6bH9fQEmT+sKTO9HyHc=; b=GUGYIcYMjwoUIn9FUaMyVfshKctAu0iNpMMJGQ7q0V5yTWXcmm0uJuhPYZEnSooswJ IadpmpDr5FoYIj2mJUu3qJ2d8mHXy1KQ77tc7CodtAYhUOwEuf3jteFC5LgWMopm12+2 6Lq5vYc/Ylod7kZHngaLdrsG7zEyza7XEkGnI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677754457; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=LOwkywF6h6SWFidmVz2iOYUs6bH9fQEmT+sKTO9HyHc=; b=2VBTt6NJcfFViwXM3FAccBz35u4xhmmeLR0L8B0r1vuDmdbo6Vs/U+8Ik+W8gQjkz8 uxX3MxACzBKxZpwKJOAi537yta5oYyXp3a1fVyl6EdjztoxdV5xdQZxDO35CFncZa5ru 7gI27aVKx7CAAoq6n0mb7Nn5CYI7OrzJS3Y4UmYGaeUeyjiABxEx875GycwIkvH7fflL C27A6x6iF7qZ+Tf1Fcg+0DAWicXmom6DIDwKNWWj5oTx/a+iSUc0fuUx2MJ6iBr/d50P +hDRrVIuMo6bHMANP43/jFWNVbwkWAxQZ+ALyxOPdlCIrQLPmCTLarigjBFBvQ7uAnJf dXwQ== X-Gm-Message-State: AO0yUKVbERMyp4PdavtPoMWSGLeGPDNNqQRGiBBnvIZmrGXoO3f/tDqy kK6YRtXh/LvRGdOWCVI9cXhgm3FU0jNopOeM1Zyt/gIWgMGSMTgLA1FDAsvylx0FQ8HCK1M0zyO UTt48nxJeu1occrGrLt84UgfypxnAtCDl9fFX7n7FL8XTJ/D/Rul1J40gKKx6aVCn3vLl4LfJIv jdHTxTvSHKt8SAGck= X-Google-Smtp-Source: AK7set+NnsOY7FxYLwSMgn2Ay33bswzj55nqcykfrzLmEKQCaB5ncxLE9D0R1h3Y6EP4wqTM4MbrZQ== X-Received: by 2002:a17:902:d4c5:b0:19c:d4c0:ce78 with SMTP id o5-20020a170902d4c500b0019cd4c0ce78mr1918509plg.29.1677754457364; Thu, 02 Mar 2023 02:54:17 -0800 (PST) Received: from dhcp-10-123-20-35.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id x14-20020a63170e000000b00502e1c50af3sm8865873pgl.45.2023.03.02.02.54.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Mar 2023 02:54:16 -0800 (PST) From: Chandrakanth Patil To: linux-scsi@vger.kernel.org Cc: sumit.saxena@broadcom.com, Chandrakanth Patil Subject: [PATCH 1/3] megaraid_sas: Update max supported LD IDs to 240 Date: Thu, 2 Mar 2023 16:23:40 +0530 Message-Id: <20230302105342.34933-2-chandrakanth.patil@broadcom.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230302105342.34933-1-chandrakanth.patil@broadcom.com> References: <20230302105342.34933-1-chandrakanth.patil@broadcom.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org As of now, The firmware only supports LD IDs up to 240, and LD ID 255 (0xFF) being reserved for deleted LDs. However, in some cases, firmware was assigning LD ID 254 (0xFE) to deleted LDs which was causing the driver to delete the wrong LD. To address this issue, the driver updated the LD ID check from 255 to 240, This ensures the deleted LD ID properly identifies and removed by the driver without accidently deleting the valid LDs. Signed-off-by: Chandrakanth Patil Signed-off-by: Sumit Saxena --- drivers/scsi/megaraid/megaraid_sas.h | 2 ++ drivers/scsi/megaraid/megaraid_sas_fp.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/megaraid/megaraid_sas.h b/drivers/scsi/megaraid/megaraid_sas.h index 4919ea54b827..2ef9d41fc6f4 100644 --- a/drivers/scsi/megaraid/megaraid_sas.h +++ b/drivers/scsi/megaraid/megaraid_sas.h @@ -1519,6 +1519,8 @@ struct megasas_ctrl_info { #define MEGASAS_MAX_LD_IDS (MEGASAS_MAX_LD_CHANNELS * \ MEGASAS_MAX_DEV_PER_CHANNEL) +#define MEGASAS_MAX_SUPPORTED_LD_IDS 240 + #define MEGASAS_MAX_SECTORS (2*1024) #define MEGASAS_MAX_SECTORS_IEEE (2*128) #define MEGASAS_DBG_LVL 1 diff --git a/drivers/scsi/megaraid/megaraid_sas_fp.c b/drivers/scsi/megaraid/megaraid_sas_fp.c index da1cad1ee123..4463a538102a 100644 --- a/drivers/scsi/megaraid/megaraid_sas_fp.c +++ b/drivers/scsi/megaraid/megaraid_sas_fp.c @@ -358,7 +358,7 @@ u8 MR_ValidateMapInfo(struct megasas_instance *instance, u64 map_id) ld = MR_TargetIdToLdGet(i, drv_map); /* For non existing VDs, iterate to next VD*/ - if (ld >= (MAX_LOGICAL_DRIVES_EXT - 1)) + if (ld >= MEGASAS_MAX_SUPPORTED_LD_IDS) continue; raid = MR_LdRaidGet(ld, drv_map);