From patchwork Thu Sep 5 10:27:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ranjan Kumar X-Patchwork-Id: 826423 Received: from mail-pf1-f172.google.com (mail-pf1-f172.google.com [209.85.210.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 60D77194090 for ; Thu, 5 Sep 2024 10:31:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725532296; cv=none; b=EbwgkuEz2VcGAYNiiJ64UHHN31VE9YOAdVPNkh+9pJWrJhvQQeSPCx7cYR7pY5vo6F0bQ03qnMrNc9pm4nCupYiBRxxNWq9IrZleG+0yQ9Hmml230fj8ZZG+LxBXPccpNjFubawpUrJ2z5WVkaUB/QgwZvghPiD5diERjPeThR0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725532296; c=relaxed/simple; bh=yfUjy0ZxJpybyv3bk4GDJOxYrralC9OeB84jT9zIpCc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=X2IFgM6oZLetBaQPE/Es/EqK55peXIe0gNAchQjEfoBDD4QFTMtXMVfHLyTQzMP2b8VPXkWxomqb/OiDrT+pDtVMPBOKaCFRhaJ4A/IyAFRLpeHmlETdfxNa2palD4Qq4Tibp9lkPJZU5+Ls7Ek0otJEX1AcQRKceUzcPGrubjo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com; spf=fail smtp.mailfrom=broadcom.com; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b=UJNIT6Y0; arc=none smtp.client-ip=209.85.210.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=broadcom.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="UJNIT6Y0" Received: by mail-pf1-f172.google.com with SMTP id d2e1a72fcca58-7143165f23fso478975b3a.1 for ; Thu, 05 Sep 2024 03:31:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1725532293; x=1726137093; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=CsdGn7hnTjj9m3H87AUmTjwWM5re6oA7jczc7FE8CZY=; b=UJNIT6Y04+EdAbQhygS0xTfkPvb6y8XiitDviQrinf5w/656bHBvJcu7F2ohKWGA1J N47X4dcWxPSA7gg3v5J7O6pDjSi/veohCuc4SUbCUyhrDFIIAfIOFnUGZ5Q28KB8U9kv VCCX4TRN1oL/i/4i2HWlZrfy1SFIqiTsUkmx0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725532293; x=1726137093; h=content-transfer-encoding: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=CsdGn7hnTjj9m3H87AUmTjwWM5re6oA7jczc7FE8CZY=; b=J/kbLCC11RM7AkAWe+NgCdnjHGq/WwDsao5qgjMLsFUJY96Bhrpa3q86Ry7qKu6siM St83VOh9FJJ5nRaF5MAtQhPuP0u/uyg/ApIh9rE2teqf25jOtxxzCVqfMyLt3g7UZpag IkXlMDHxq0f2B5PEnPBDc03DVqLILK28AEhQaS/ghG4D/GMv/5Z2gwK4IFZAOUKhOQoz NCGSjmn5YiWPtok/OCfTag7v3wW1F0u6JhVdWVrkgVZx2Uqqvv8DETBMI67m+asAENUS p8DHDQj2nMHQo71DgwpEw0vg9ZC37rM6iB1gvez9UJImqiXI4kvndgDMWJaem/McLwBM lL3g== X-Gm-Message-State: AOJu0YxppESITq/XEKMm3FmnX5S0wQAreMVTI9oLe2Rk6mWZZAxMFvCZ JHkOZcCe5mu46jWD+vZR4yzfKDPvXBDhO8lMxGWCeXHlTH7TF5w5kYR5yV0wtt1Sa0Rc7PyJIbm ztsGPqyG/Nd2roKFmr1i9PA0MV/E6APpztzofDPXkzbTAeKZMero0x1oAgeRgY93ZknX2Px4Cj9 Rqqf972eyOikvUQ6Hllc9KoP4DsvNbtdm+HPHS2WZW884N7A== X-Google-Smtp-Source: AGHT+IGAF9mcl1fBosEntRUNHrkwSRbG5yitdVAdB6UNk9GSXN6Jn7b+B8LO8gYuJHaYjs9256EjuA== X-Received: by 2002:a05:6a00:1a93:b0:70b:1b51:b8af with SMTP id d2e1a72fcca58-7173c589968mr19924518b3a.19.1725532293308; Thu, 05 Sep 2024 03:31:33 -0700 (PDT) Received: from localhost.localdomain ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-717785364f9sm2960177b3a.87.2024.09.05.03.31.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Sep 2024 03:31:32 -0700 (PDT) From: Ranjan Kumar To: linux-scsi@vger.kernel.org, martin.petersen@oracle.com Cc: rajsekhar.chundru@broadcom.com, sathya.prakash@broadcom.com, sumit.saxena@broadcom.com, prayas.patel@broadcom.com, Ranjan Kumar Subject: [PATCH v1 1/5] mpi3mr: Enhance the Enable Controller retry logic Date: Thu, 5 Sep 2024 15:57:49 +0530 Message-Id: <20240905102753.105310-2-ranjan.kumar@broadcom.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20240905102753.105310-1-ranjan.kumar@broadcom.com> References: <20240905102753.105310-1-ranjan.kumar@broadcom.com> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 When enabling the IOC request and polling for controller ready status, poll for controller fault and reset history bit. If the controller is faulted or the reset history bit is set, retry the initialization a maximum of three times (2 retries) or if the cumulative time taken for all retries exceeds 510 seconds. Signed-off-by: Prayas Patel Signed-off-by: Ranjan Kumar --- drivers/scsi/mpi3mr/mpi3mr_fw.c | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/mpi3mr/mpi3mr_fw.c b/drivers/scsi/mpi3mr/mpi3mr_fw.c index 6eb5bcd8e757..39d7082f2305 100644 --- a/drivers/scsi/mpi3mr/mpi3mr_fw.c +++ b/drivers/scsi/mpi3mr/mpi3mr_fw.c @@ -1362,6 +1362,10 @@ static int mpi3mr_bring_ioc_ready(struct mpi3mr_ioc *mrioc) int retval = 0; enum mpi3mr_iocstate ioc_state; u64 base_info; + u8 retry = 0; + u64 start_time, elapsed_time_sec; + +retry_bring_ioc_ready: ioc_status = readl(&mrioc->sysif_regs->ioc_status); ioc_config = readl(&mrioc->sysif_regs->ioc_configuration); @@ -1460,6 +1464,9 @@ static int mpi3mr_bring_ioc_ready(struct mpi3mr_ioc *mrioc) ioc_config |= MPI3_SYSIF_IOC_CONFIG_ENABLE_IOC; writel(ioc_config, &mrioc->sysif_regs->ioc_configuration); + if (retry == 0) + start_time = jiffies; + timeout = mrioc->ready_timeout * 10; do { ioc_state = mpi3mr_get_iocstate(mrioc); @@ -1469,6 +1476,12 @@ static int mpi3mr_bring_ioc_ready(struct mpi3mr_ioc *mrioc) mpi3mr_iocstate_name(ioc_state)); return 0; } + ioc_status = readl(&mrioc->sysif_regs->ioc_status); + if ((ioc_status & MPI3_SYSIF_IOC_STATUS_RESET_HISTORY) || + (ioc_status & MPI3_SYSIF_IOC_STATUS_FAULT)) { + mpi3mr_print_fault_info(mrioc); + goto out_failed; + } if (!pci_device_is_present(mrioc->pdev)) { mrioc->unrecoverable = 1; ioc_err(mrioc, @@ -1477,9 +1490,19 @@ static int mpi3mr_bring_ioc_ready(struct mpi3mr_ioc *mrioc) goto out_device_not_present; } msleep(100); - } while (--timeout); + elapsed_time_sec = jiffies_to_msecs(jiffies - start_time)/1000; + } while (elapsed_time_sec < mrioc->ready_timeout); out_failed: + elapsed_time_sec = jiffies_to_msecs(jiffies - start_time)/1000; + if ((retry < 2) && (elapsed_time_sec < (mrioc->ready_timeout - 60))) { + retry++; + + ioc_warn(mrioc, "retrying to bring IOC ready, retry_count:%d\n" + " elapsed time =%llu\n", retry, elapsed_time_sec); + + goto retry_bring_ioc_ready; + } ioc_state = mpi3mr_get_iocstate(mrioc); ioc_err(mrioc, "failed to bring to ready state, current state: %s\n", From patchwork Thu Sep 5 10:27:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ranjan Kumar X-Patchwork-Id: 825829 Received: from mail-pf1-f173.google.com (mail-pf1-f173.google.com [209.85.210.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C34E0198E9B for ; Thu, 5 Sep 2024 10:31:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725532299; cv=none; b=egqFQYXcZ9FqBC7XRhBN1UTArDswQ3LbcpYP1/+gCW/VpEs+GdAEzI2u3lPTZgSml6Bg+bloVjuiUqxgRgFeS5Fl5kuhk5mTo6A/DLoW2+F9xpSw+x4514jUFbKEacJyAG7dckERgoCNGDefmARlql5gTBWh+zUrQocMbqoQzsQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725532299; c=relaxed/simple; bh=oMGAg8Sq+FQIfDWIQzkuJXuNgyPxgPPVTG7cib208Xs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=DBMWvs13b6wtKnHfeWkrKRVivZOiGV4terplO8SB7yRjH0X6J5vJXTFHUozQbpgJ21GCKiAgvbhcNShMtLkUt4swysa1Ep27+Q1OuEXMwzhIFeQ1FQ4raBaBr4zSuL2ztECxsc5pq/zJf29PqxscpAy0l/7hSaXczxHw8qQKnPM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com; spf=fail smtp.mailfrom=broadcom.com; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b=E9WgHeM1; arc=none smtp.client-ip=209.85.210.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=broadcom.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="E9WgHeM1" Received: by mail-pf1-f173.google.com with SMTP id d2e1a72fcca58-714226888dfso477750b3a.1 for ; Thu, 05 Sep 2024 03:31:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1725532296; x=1726137096; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=20LJLdc3ZfnQysenExTF4DcnDtFUWuo5Ky+Jkv7GR50=; b=E9WgHeM1Ar1EpYye0zBS9VlpCBl+MYFrn41P6mZKEDs/GAfQuWkMKC8i7+mrM6Gubh lD05RYtCoxPawSfLdZRdd5dNmkZxbarWS4c15k+TKNjXQU58dP1+3IV6lSJmirJdhTX6 PDE6vNtLJOuN04aP9QCfrFxICziZh9L55O5Sg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725532296; x=1726137096; h=content-transfer-encoding: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=20LJLdc3ZfnQysenExTF4DcnDtFUWuo5Ky+Jkv7GR50=; b=pxhVOk9g739XBxxZXjAvPenI4a6KPYrCLESVoRi68IrxKzbXe69nduOTiTsqN1brT5 kfnqYiqwO4ZKIKKuckYpzK35cex8hE5ZKl4sx4eU8uTulK1Av8/udirp2tO7Lir1i3of dir5dTS4FCMf37pHQ1Do5FSYflIXPMsAFITV8HuOHVex30Ot5x5CY4ZZ6pTNktMAHBEl DAJqdnrbR4AAGjyMGl3c43Pyo/D9jnJWgX4b6TNwMpdoJcGffznBdR8/VNwin0X8+HNX vrzr06yjyPHHdlBKMtlVHzLc1NHg8WM3ELa6x3UXV9j4mjhSBQaITyz6FAXJoKY5p4mz OX4w== X-Gm-Message-State: AOJu0YzAVPoBEfaWVUax1mUMNcKvr2GllCnF9BqwU8dZ+N01dJxpTCku 2qT7HZexCkQfgUUhm7ECZfA0TRlKSbMZObtzMJqUkd+x5zgsfifWz2o+RdQFBNZEjI8TcGtb0oR G9r183H0i67zsX8qbiVOpGwidgLbGlOxxfItQ3b6EPzSuIUX+ohZ9lVaTX4l7KPZQN0D2wLYIQX aq2mcmCu3epYdavUdhrVnYXdrtGhlR8IqDJ2kjWbTBXtGBiA== X-Google-Smtp-Source: AGHT+IEFuYfTaAE0D254atniZ4cbS7UJ0mKrJMjNijYsckFhC+3N+L38UiOKRSHEQYBIzocuSjcxCQ== X-Received: by 2002:a05:6a00:8a89:b0:717:90cd:7943 with SMTP id d2e1a72fcca58-71790cd7e90mr794945b3a.28.1725532296343; Thu, 05 Sep 2024 03:31:36 -0700 (PDT) Received: from localhost.localdomain ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-717785364f9sm2960177b3a.87.2024.09.05.03.31.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Sep 2024 03:31:35 -0700 (PDT) From: Ranjan Kumar To: linux-scsi@vger.kernel.org, martin.petersen@oracle.com Cc: rajsekhar.chundru@broadcom.com, sathya.prakash@broadcom.com, sumit.saxena@broadcom.com, prayas.patel@broadcom.com, Ranjan Kumar Subject: [PATCH v1 2/5] mpi3mr: use firmware provided timestamp update interval Date: Thu, 5 Sep 2024 15:57:50 +0530 Message-Id: <20240905102753.105310-3-ranjan.kumar@broadcom.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20240905102753.105310-1-ranjan.kumar@broadcom.com> References: <20240905102753.105310-1-ranjan.kumar@broadcom.com> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Driver will use the timestamp update interval value provided by firmware in the driver page 1. If firmware fails to provide non-zero value, then the driver will fall back to the driver defined macro. Signed-off-by: Prayas Patel Signed-off-by: Ranjan Kumar --- drivers/scsi/mpi3mr/mpi/mpi30_cnfg.h | 1 + drivers/scsi/mpi3mr/mpi3mr.h | 4 +++- drivers/scsi/mpi3mr/mpi3mr_fw.c | 27 ++++++++++++++++++++++++++- 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/mpi3mr/mpi/mpi30_cnfg.h b/drivers/scsi/mpi3mr/mpi/mpi30_cnfg.h index 4b7a8f6314a3..b46bd08eac99 100644 --- a/drivers/scsi/mpi3mr/mpi/mpi30_cnfg.h +++ b/drivers/scsi/mpi3mr/mpi/mpi30_cnfg.h @@ -1327,6 +1327,7 @@ struct mpi3_driver_page0 { struct mpi3_driver_page1 { struct mpi3_config_page_header header; __le32 flags; + u8 time_stamp_update; __le32 reserved0c; __le16 host_diag_trace_max_size; __le16 host_diag_trace_min_size; diff --git a/drivers/scsi/mpi3mr/mpi3mr.h b/drivers/scsi/mpi3mr/mpi3mr.h index 875bad7538f2..9c1d10ba24be 100644 --- a/drivers/scsi/mpi3mr/mpi3mr.h +++ b/drivers/scsi/mpi3mr/mpi3mr.h @@ -1091,6 +1091,7 @@ struct scmd_priv { * @evtack_cmds_bitmap: Event Ack bitmap * @delayed_evtack_cmds_list: Delayed event acknowledgment list * @ts_update_counter: Timestamp update counter + * @ts_update_interval: Timestamp update interval * @reset_in_progress: Reset in progress flag * @unrecoverable: Controller unrecoverable flag * @prev_reset_result: Result of previous reset @@ -1279,7 +1280,8 @@ struct mpi3mr_ioc { unsigned long *evtack_cmds_bitmap; struct list_head delayed_evtack_cmds_list; - u32 ts_update_counter; + u16 ts_update_counter; + u16 ts_update_interval; u8 reset_in_progress; u8 unrecoverable; int prev_reset_result; diff --git a/drivers/scsi/mpi3mr/mpi3mr_fw.c b/drivers/scsi/mpi3mr/mpi3mr_fw.c index 39d7082f2305..0eaf30b6c251 100644 --- a/drivers/scsi/mpi3mr/mpi3mr_fw.c +++ b/drivers/scsi/mpi3mr/mpi3mr_fw.c @@ -2694,7 +2694,7 @@ static void mpi3mr_watchdog_work(struct work_struct *work) return; } - if (mrioc->ts_update_counter++ >= MPI3MR_TSUPDATE_INTERVAL) { + if (mrioc->ts_update_counter++ >= mrioc->ts_update_interval) { mrioc->ts_update_counter = 0; mpi3mr_sync_timestamp(mrioc); } @@ -3867,6 +3867,29 @@ static int mpi3mr_repost_diag_bufs(struct mpi3mr_ioc *mrioc) return retval; } +/** + * mpi3mr_read_tsu_interval - Update time stamp interval + * @mrioc: Adapter instance reference + * + * Update time stamp interval if its defined in driver page 1, + * otherwise use default value. + * + * Return: Nothing + */ +static void +mpi3mr_read_tsu_interval(struct mpi3mr_ioc *mrioc) +{ + struct mpi3_driver_page1 driver_pg1; + u16 pg_sz = sizeof(driver_pg1); + int retval = 0; + + mrioc->ts_update_interval = MPI3MR_TSUPDATE_INTERVAL; + + retval = mpi3mr_cfg_get_driver_pg1(mrioc, &driver_pg1, pg_sz); + if (!retval && driver_pg1.time_stamp_update) + mrioc->ts_update_interval = (driver_pg1.time_stamp_update * 60); +} + /** * mpi3mr_print_ioc_info - Display controller information * @mrioc: Adapter instance reference @@ -4163,6 +4186,7 @@ int mpi3mr_init_ioc(struct mpi3mr_ioc *mrioc) goto out_failed_noretry; } + mpi3mr_read_tsu_interval(mrioc); mpi3mr_print_ioc_info(mrioc); if (!mrioc->cfg_page) { @@ -4344,6 +4368,7 @@ int mpi3mr_reinit_ioc(struct mpi3mr_ioc *mrioc, u8 is_resume) goto out_failed_noretry; } + mpi3mr_read_tsu_interval(mrioc); mpi3mr_print_ioc_info(mrioc); if (is_resume) { From patchwork Thu Sep 5 10:27:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ranjan Kumar X-Patchwork-Id: 826422 Received: from mail-pf1-f171.google.com (mail-pf1-f171.google.com [209.85.210.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ADCB2194A64 for ; Thu, 5 Sep 2024 10:31:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725532302; cv=none; b=K6bGOlSJbs9tpbCDqy0tgFd0CtpmJMFKpotTL4O7+ltAMSbyrbA1glK5qypmLFLWTCezg1F0OGGpYSa2H7tbKSZoJpCGnzLm6jgmZHP7knmsgy6nzalovSnmSYy36z1j4dmSnjvWtSaGkMeNhS9NHbICIxpW7a0Zi7dLxODdxNw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725532302; c=relaxed/simple; bh=pQL2n6T4m2nvPtQZd6+6qbNSTgyhwGqQfuFwDSCml+E=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=uc8tZf8IO0UJj0/2GjFXmnH3JcJn92z2YqjweWB97cvQop1+ZskdHvgEvS+3RrGatBcXQfY07lhmE+xnyVO9+c03ReTCyx2e7q7VcoBBdE/vWfskFw9akf+Fi4ysMuPy4u0wmTJGrnpkGeNE2xpI1GQ1924Jl5RyPzY1FS7J38I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com; spf=fail smtp.mailfrom=broadcom.com; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b=OzyDqM33; arc=none smtp.client-ip=209.85.210.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=broadcom.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="OzyDqM33" Received: by mail-pf1-f171.google.com with SMTP id d2e1a72fcca58-7141d7b270dso531814b3a.2 for ; Thu, 05 Sep 2024 03:31:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1725532299; x=1726137099; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=HJXaR9VxtTmDYnacUWCCn2NFx7ZwbE/6QsrIqQl6FUE=; b=OzyDqM336rfl9D/QmPtSOk0ZkuolxXmWtg9mjLYYuW9/7FWL2MPyRc3OVMR84kyrOY F8so/Q+4L0Nco8RVNnzj2b5fqMFa+d1WZzrk+8xihTfMaJHZZXCBSGGhbR8Pu++BEAWf dIfCSUOpV2pR5f5PDi1oxVB3EXytaocP7tDCI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725532299; x=1726137099; h=content-transfer-encoding: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=HJXaR9VxtTmDYnacUWCCn2NFx7ZwbE/6QsrIqQl6FUE=; b=bGgO9PFqrKEnFGTHZ0bLDaDTN6uKS224RWEwGlRw4qV84Sk37tkkpRlrpjPYrdec+Y n7W72aYRZRQXRltdYbjJdWQ/igVTkOfkjBWlPYjb1Vh7FjSbHkudmKrgMqO7q8JS3jDQ kL56fAIyuwt8Qmqq0dH51KH6b4Ub0sNEe1hvSI0/yGcja0GaMBhltrTcp1YzjUw7XmRE HpycFENap0thIltrX7TW+a2wS7MDhmZy1xmGOlee/8ZjU2tWHshDQWELdn93tvKLXUx+ jWSgncFlC7ogiiO7EAAh0Bz2z6siXW1JWj57OAhK6wu7xxwo6EH8sCRLYMupjpafzaW4 djSA== X-Gm-Message-State: AOJu0YxAEWLN58tETBN1XGXSkI5wRDWkmu0zNcZl0hiGtNqHSSiTnYKd 92os+MwRR7FqPeB6p6dz9oiK97kAprP80T1gn7+hElagP8qxkc6ivfBbuAaDiiRhAvOlwwIb8dX RvcdRSHQKPm/YEYpafl/Xs1TQZDieFBrRNrdNrLGa/DumQbwGaeTxvuYn8chZYGOII9uh92b26R W84u4i0QI4fm12NGDWl38B22SgI55ESj+fKQYIyHgzmrZQNw== X-Google-Smtp-Source: AGHT+IEspeP0HVOCD09Y7FvKc/ojyxRApAhvsq083oaHL5tw3rAlauVcTDHWKsarfsBih9PTudO+0w== X-Received: by 2002:a05:6a00:21d5:b0:714:19f8:f135 with SMTP id d2e1a72fcca58-717449b1a76mr15811107b3a.21.1725532299184; Thu, 05 Sep 2024 03:31:39 -0700 (PDT) Received: from localhost.localdomain ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-717785364f9sm2960177b3a.87.2024.09.05.03.31.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Sep 2024 03:31:38 -0700 (PDT) From: Ranjan Kumar To: linux-scsi@vger.kernel.org, martin.petersen@oracle.com Cc: rajsekhar.chundru@broadcom.com, sathya.prakash@broadcom.com, sumit.saxena@broadcom.com, prayas.patel@broadcom.com, Ranjan Kumar Subject: [PATCH v1 3/5] mpi3mr: Update MPI Headers to revision 34 Date: Thu, 5 Sep 2024 15:57:51 +0530 Message-Id: <20240905102753.105310-4-ranjan.kumar@broadcom.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20240905102753.105310-1-ranjan.kumar@broadcom.com> References: <20240905102753.105310-1-ranjan.kumar@broadcom.com> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Update MPI Headers to revision 34. Signed-off-by: Prayas Patel Signed-off-by: Ranjan Kumar --- drivers/scsi/mpi3mr/mpi/mpi30_cnfg.h | 34 +++++++++++++++++++++-- drivers/scsi/mpi3mr/mpi/mpi30_image.h | 13 +++++++-- drivers/scsi/mpi3mr/mpi/mpi30_ioc.h | 8 ++++++ drivers/scsi/mpi3mr/mpi/mpi30_transport.h | 4 ++- 4 files changed, 52 insertions(+), 7 deletions(-) diff --git a/drivers/scsi/mpi3mr/mpi/mpi30_cnfg.h b/drivers/scsi/mpi3mr/mpi/mpi30_cnfg.h index b46bd08eac99..00cd18edfad6 100644 --- a/drivers/scsi/mpi3mr/mpi/mpi30_cnfg.h +++ b/drivers/scsi/mpi3mr/mpi/mpi30_cnfg.h @@ -67,6 +67,7 @@ #define MPI3_SECURITY_PGAD_SLOT_GROUP_MASK (0x0000ff00) #define MPI3_SECURITY_PGAD_SLOT_GROUP_SHIFT (8) #define MPI3_SECURITY_PGAD_SLOT_MASK (0x000000ff) +#define MPI3_INSTANCE_PGAD_INSTANCE_MASK (0x0000ffff) struct mpi3_config_request { __le16 host_tag; u8 ioc_use_only02; @@ -75,7 +76,8 @@ struct mpi3_config_request { u8 ioc_use_only06; u8 msg_flags; __le16 change_count; - __le16 reserved0a; + u8 proxy_ioc_number; + u8 reserved0b; u8 page_version; u8 page_number; u8 page_type; @@ -206,6 +208,9 @@ struct mpi3_config_page_header { #define MPI3_MFGPAGE_DEVID_SAS5116_MPI_MGMT (0x00b5) #define MPI3_MFGPAGE_DEVID_SAS5116_NVME_MGMT (0x00b6) #define MPI3_MFGPAGE_DEVID_SAS5116_PCIE_SWITCH (0x00b8) +#define MPI3_MFGPAGE_DEVID_SAS5248_MPI (0x00f0) +#define MPI3_MFGPAGE_DEVID_SAS5248_MPI_NS (0x00f1) +#define MPI3_MFGPAGE_DEVID_SAS5248_PCIE_SWITCH (0x00f2) struct mpi3_man_page0 { struct mpi3_config_page_header header; u8 chip_revision[8]; @@ -1074,6 +1079,8 @@ struct mpi3_io_unit_page8 { #define MPI3_IOUNIT8_SBSTATE_SVN_UPDATE_PENDING (0x04) #define MPI3_IOUNIT8_SBSTATE_KEY_UPDATE_PENDING (0x02) #define MPI3_IOUNIT8_SBSTATE_SECURE_BOOT_ENABLED (0x01) +#define MPI3_IOUNIT8_SBMODE_CURRENT_KEY_IOUNIT17 (0x10) +#define MPI3_IOUNIT8_SBMODE_HARD_SECURE_RECERTIFIED (0x08) struct mpi3_io_unit_page9 { struct mpi3_config_page_header header; __le32 flags; @@ -1089,6 +1096,8 @@ struct mpi3_io_unit_page9 { #define MPI3_IOUNIT9_FLAGS_UBM_ENCLOSURE_ORDER_BACKPLANE_TYPE (0x00000004) #define MPI3_IOUNIT9_FLAGS_VDFIRST_ENABLED (0x00000001) #define MPI3_IOUNIT9_FIRSTDEVICE_UNKNOWN (0xffff) +#define MPI3_IOUNIT9_FIRSTDEVICE_IN_DRIVER_PAGE_0 (0xfffe) + struct mpi3_io_unit_page10 { struct mpi3_config_page_header header; u8 flags; @@ -1224,6 +1233,19 @@ struct mpi3_io_unit_page15 { #define MPI3_IOUNIT15_FLAGS_EPRSUPPORT_WITHOUT_POWER_BRAKE_GPIO (0x01) #define MPI3_IOUNIT15_FLAGS_EPRSUPPORT_WITH_POWER_BRAKE_GPIO (0x02) #define MPI3_IOUNIT15_NUMPOWERBUDGETDATA_POWER_BUDGETING_DISABLED (0x00) + +struct mpi3_io_unit_page17 { + struct mpi3_config_page_header header; + u8 num_instances; + u8 instance; + __le16 reserved0a; + __le32 reserved0c[4]; + __le16 key_length; + u8 encryption_algorithm; + u8 reserved1f; + __le32 current_key[]; +}; +#define MPI3_IOUNIT17_PAGEVERSION (0x00) struct mpi3_ioc_page0 { struct mpi3_config_page_header header; __le32 reserved08; @@ -1311,7 +1333,7 @@ struct mpi3_driver_page0 { u8 tur_interval; u8 reserved10; u8 security_key_timeout; - __le16 reserved12; + __le16 first_device; __le32 reserved14; __le32 reserved18; }; @@ -1324,11 +1346,13 @@ struct mpi3_driver_page0 { #define MPI3_DRIVER0_BSDOPTS_REGISTRATION_IOC_AND_DEVS (0x00000000) #define MPI3_DRIVER0_BSDOPTS_REGISTRATION_IOC_ONLY (0x00000001) #define MPI3_DRIVER0_BSDOPTS_REGISTRATION_IOC_AND_INTERNAL_DEVS (0x00000002) +#define MPI3_DRIVER0_FIRSTDEVICE_IGNORE1 (0x0000) +#define MPI3_DRIVER0_FIRSTDEVICE_IGNORE2 (0xffff) struct mpi3_driver_page1 { struct mpi3_config_page_header header; __le32 flags; u8 time_stamp_update; - __le32 reserved0c; + u8 reserved0d[3]; __le16 host_diag_trace_max_size; __le16 host_diag_trace_min_size; __le16 host_diag_trace_decrement_size; @@ -2348,6 +2372,10 @@ struct mpi3_device0_vd_format { #define MPI3_DEVICE0_VD_DEVICE_INFO_SAS (0x0001) #define MPI3_DEVICE0_VD_FLAGS_IO_THROTTLE_GROUP_QD_MASK (0xf000) #define MPI3_DEVICE0_VD_FLAGS_IO_THROTTLE_GROUP_QD_SHIFT (12) +#define MPI3_DEVICE0_VD_FLAGS_OSEXPOSURE_MASK (0x0003) +#define MPI3_DEVICE0_VD_FLAGS_OSEXPOSURE_HDD (0x0000) +#define MPI3_DEVICE0_VD_FLAGS_OSEXPOSURE_SSD (0x0001) +#define MPI3_DEVICE0_VD_FLAGS_OSEXPOSURE_NO_GUIDANCE (0x0002) union mpi3_device0_dev_spec_format { struct mpi3_device0_sas_sata_format sas_sata_format; struct mpi3_device0_pcie_format pcie_format; diff --git a/drivers/scsi/mpi3mr/mpi/mpi30_image.h b/drivers/scsi/mpi3mr/mpi/mpi30_image.h index 7df242190135..2c6e548cbd0f 100644 --- a/drivers/scsi/mpi3mr/mpi/mpi30_image.h +++ b/drivers/scsi/mpi3mr/mpi/mpi30_image.h @@ -205,13 +205,14 @@ struct mpi3_encrypted_hash_entry { u8 hash_image_type; u8 hash_algorithm; u8 encryption_algorithm; - u8 reserved03; + u8 flags; __le16 public_key_size; __le16 signature_size; __le32 public_key[MPI3_PUBLIC_KEY_MAX]; }; - -#define MPI3_HASH_IMAGE_TYPE_KEY_WITH_SIGNATURE (0x03) +#define MPI3_HASH_IMAGE_TYPE_KEY_WITH_HASH (0x03) +#define MPI3_HASH_IMAGE_TYPE_KEY_WITH_HASH_1_OF_2 (0x04) +#define MPI3_HASH_IMAGE_TYPE_KEY_WITH_HASH_2_OF_2 (0x05) #define MPI3_HASH_ALGORITHM_VERSION_MASK (0xe0) #define MPI3_HASH_ALGORITHM_VERSION_NONE (0x00) #define MPI3_HASH_ALGORITHM_VERSION_SHA1 (0x20) @@ -230,6 +231,12 @@ struct mpi3_encrypted_hash_entry { #define MPI3_ENCRYPTION_ALGORITHM_RSA4096 (0x05) #define MPI3_ENCRYPTION_ALGORITHM_RSA3072 (0x06) +/* hierarchical signature system (hss) */ +#define MPI3_ENCRYPTION_ALGORITHM_ML_DSA_87 (0x0b) +#define MPI3_ENCRYPTION_ALGORITHM_ML_DSA_65 (0x0c) +#define MPI3_ENCRYPTION_ALGORITHM_ML_DSA_44 (0x0d) +#define MPI3_ENCRYPTED_HASH_ENTRY_FLAGS_PAIRED_KEY_MASK (0x0f) + #ifndef MPI3_ENCRYPTED_HASH_ENTRY_MAX #define MPI3_ENCRYPTED_HASH_ENTRY_MAX (1) #endif diff --git a/drivers/scsi/mpi3mr/mpi/mpi30_ioc.h b/drivers/scsi/mpi3mr/mpi/mpi30_ioc.h index c9fa0d69b75f..c374867f9ba0 100644 --- a/drivers/scsi/mpi3mr/mpi/mpi30_ioc.h +++ b/drivers/scsi/mpi3mr/mpi/mpi30_ioc.h @@ -39,6 +39,12 @@ struct mpi3_ioc_init_request { #define MPI3_WHOINIT_HOST_DRIVER (0x03) #define MPI3_WHOINIT_MANUFACTURER (0x04) +#define MPI3_IOCINIT_DRIVERCAP_OSEXPOSURE_MASK (0x00000003) +#define MPI3_IOCINIT_DRIVERCAP_OSEXPOSURE_NO_GUIDANCE (0x00000000) +#define MPI3_IOCINIT_DRIVERCAP_OSEXPOSURE_NO_SPECIAL (0x00000001) +#define MPI3_IOCINIT_DRIVERCAP_OSEXPOSURE_REPORT_AS_HDD (0x00000002) +#define MPI3_IOCINIT_DRIVERCAP_OSEXPOSURE_REPORT_AS_SSD (0x00000003) + struct mpi3_ioc_facts_request { __le16 host_tag; u8 ioc_use_only02; @@ -140,6 +146,8 @@ struct mpi3_ioc_facts_data { #define MPI3_IOCFACTS_EXCEPT_MANUFACT_CHECKSUM_FAIL (0x0020) #define MPI3_IOCFACTS_EXCEPT_FW_CHECKSUM_FAIL (0x0010) #define MPI3_IOCFACTS_EXCEPT_CONFIG_CHECKSUM_FAIL (0x0008) +#define MPI3_IOCFACTS_EXCEPT_BLOCKING_BOOT_EVENT (0x0004) +#define MPI3_IOCFACTS_EXCEPT_SECURITY_SELFTEST_FAILURE (0x0002) #define MPI3_IOCFACTS_EXCEPT_BOOTSTAT_MASK (0x0001) #define MPI3_IOCFACTS_EXCEPT_BOOTSTAT_PRIMARY (0x0000) #define MPI3_IOCFACTS_EXCEPT_BOOTSTAT_SECONDARY (0x0001) diff --git a/drivers/scsi/mpi3mr/mpi/mpi30_transport.h b/drivers/scsi/mpi3mr/mpi/mpi30_transport.h index fdc3d1968e43..b2ab25a1cfeb 100644 --- a/drivers/scsi/mpi3mr/mpi/mpi30_transport.h +++ b/drivers/scsi/mpi3mr/mpi/mpi30_transport.h @@ -18,7 +18,7 @@ union mpi3_version_union { #define MPI3_VERSION_MAJOR (3) #define MPI3_VERSION_MINOR (0) -#define MPI3_VERSION_UNIT (31) +#define MPI3_VERSION_UNIT (34) #define MPI3_VERSION_DEV (0) #define MPI3_DEVHANDLE_INVALID (0xffff) struct mpi3_sysif_oper_queue_indexes { @@ -158,6 +158,7 @@ struct mpi3_sysif_registers { #define MPI3_SYSIF_FAULT_CODE_SOFT_RESET_NEEDED (0x0000f004) #define MPI3_SYSIF_FAULT_CODE_POWER_CYCLE_REQUIRED (0x0000f005) #define MPI3_SYSIF_FAULT_CODE_TEMP_THRESHOLD_EXCEEDED (0x0000f006) +#define MPI3_SYSIF_FAULT_CODE_INSUFFICIENT_PCI_SLOT_POWER (0x0000f007) #define MPI3_SYSIF_FAULT_INFO0_OFFSET (0x00001c14) #define MPI3_SYSIF_FAULT_INFO1_OFFSET (0x00001c18) #define MPI3_SYSIF_FAULT_INFO2_OFFSET (0x00001c1c) @@ -410,6 +411,7 @@ struct mpi3_default_reply { #define MPI3_IOCSTATUS_INSUFFICIENT_RESOURCES (0x0006) #define MPI3_IOCSTATUS_INVALID_FIELD (0x0007) #define MPI3_IOCSTATUS_INVALID_STATE (0x0008) +#define MPI3_IOCSTATUS_SHUTDOWN_ACTIVE (0x0009) #define MPI3_IOCSTATUS_INSUFFICIENT_POWER (0x000a) #define MPI3_IOCSTATUS_INVALID_CHANGE_COUNT (0x000b) #define MPI3_IOCSTATUS_ALLOWED_CMD_BLOCK (0x000c) From patchwork Thu Sep 5 10:27:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ranjan Kumar X-Patchwork-Id: 825828 Received: from mail-pf1-f177.google.com (mail-pf1-f177.google.com [209.85.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AC750194A64 for ; Thu, 5 Sep 2024 10:31:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725532305; cv=none; b=laIXpRWEGbvCWsGe6r8m3aM3K/W0c0BxAwDBvYoHI82wg0+0+BWZt8P8arqg0tA/khbN4Q/ZyX3Xd86Ax+5IGuRw/8cGquEQBwctZiS91tRXF1z0v5iSvGzawzuepLiy8iSI1uzte/e4WDRzSRWY8DYK9i2xgd0bYR3hztT0YZg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725532305; c=relaxed/simple; bh=agnSYWK8590hWfAhH/B5uV76+bv+SptTdki0p3nYCKw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=gsIcCez1ZmnaYq0c0mg6+x9eZN3Eve1ujgUIcaseR04dG2BYVglKPNOEWUMZN0CVU2aOqMPOlp0KGmB5sw2Gdu5k9yHusOurOxW5lksF9zha6uiw1uGH8Nrwf4sSAWgGqExtxg6AvV2HZ379jHpz4Y8QU5qYbDLsTGiYNAvXMQ8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com; spf=fail smtp.mailfrom=broadcom.com; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b=WkbDYBNO; arc=none smtp.client-ip=209.85.210.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=broadcom.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="WkbDYBNO" Received: by mail-pf1-f177.google.com with SMTP id d2e1a72fcca58-7179129a13cso265487b3a.3 for ; Thu, 05 Sep 2024 03:31:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1725532302; x=1726137102; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=achv4njG20wuSV34efpTU9+cSk1eBCa0tkJZWsiy60o=; b=WkbDYBNOukDuJXINakKiRIxKSn6Ug1ymAN/H69TJ0TKTfu3tyT3fDtlbaAPpVsC10K jKo+dAmaNNVwRhOS13UJ+1yGWteAddU36OJsqse00y6L1asFKBUialtl5p/AW13QmNNn um6wt9/xO+nQCoyig6U3BTIYMVESkpbubPMRQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725532302; x=1726137102; h=content-transfer-encoding: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=achv4njG20wuSV34efpTU9+cSk1eBCa0tkJZWsiy60o=; b=giWh8+dW1XtFoPgkns+zAucdHPfv/nl11vtI1O9kYxb9NjaENaX6U/Zz6RyTk2fTdT T70kQEK2wi8weOUjeff2ciwAfDq74aT9Mumlc6EbClr/rR0lC2EEu57SqI3XG4UhwSvj S1+VwrWKJZjmkaAu5gV7iMArip7EawyRmVsqUteGgJ3NFMvIKvCANCRUi9QVkj04+0ej s84WwAexuHf55KS0AacfqKgNQ/qd0t7N4UnRjBQ7Kc1WF6YEvv4NtLEyV0OO8uxkyab+ btQ8in9EkeIufX110n0wkEdUSXhvz8yHOJj09aqbzu9Go5zpcIUYzxEllLOLXVwa4fV+ dcqw== X-Gm-Message-State: AOJu0Yzgr4JQ5tatanLiHTzuL2XSMe0AhwLFZjce/2uVc9xpwlRdaQRf BOPFBfseBXeEprcH+3IbfuMoJpsUYpa+6UhetGlIu9HX+r2Wt+nS50jKq6GRZhF9JZUWIKXUnIt S5BScHs085uoOBZ2Zvkk1TdyMK6PRtELRH41j4qOBiZEBe0C3Suv1iqTahKAzhal3HWrFKhrDms q1orGVY0b9VHZ65OOES04qWguovEdNGi9Hvi1ajZKcQANNLw== X-Google-Smtp-Source: AGHT+IHRFx8FiOg1kd/i50+pKGRhH9U6qeeMVrQus9qmR7DiXE8Fj72Fk0xZMcyU9HkYdFHC3JZ31w== X-Received: by 2002:a05:6a20:d48c:b0:1be:c929:e269 with SMTP id adf61e73a8af0-1cce10ab242mr29240755637.34.1725532302245; Thu, 05 Sep 2024 03:31:42 -0700 (PDT) Received: from localhost.localdomain ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-717785364f9sm2960177b3a.87.2024.09.05.03.31.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Sep 2024 03:31:41 -0700 (PDT) From: Ranjan Kumar To: linux-scsi@vger.kernel.org, martin.petersen@oracle.com Cc: rajsekhar.chundru@broadcom.com, sathya.prakash@broadcom.com, sumit.saxena@broadcom.com, prayas.patel@broadcom.com, Ranjan Kumar Subject: [PATCH v1 4/5] mpi3mr: improve wait logic while controller transitions to READY state Date: Thu, 5 Sep 2024 15:57:52 +0530 Message-Id: <20240905102753.105310-5-ranjan.kumar@broadcom.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20240905102753.105310-1-ranjan.kumar@broadcom.com> References: <20240905102753.105310-1-ranjan.kumar@broadcom.com> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 During controller transitioning to READY state, if the controller is found in transient states ("becoming ready" or "reset requested"), driver waits for 510 secs even if the controller transitions out of these states early. It causes an unnecessary delay of 510 secs in the overall firmware initialization sequence. Poll the controller state periodically (every 100 milliseconds) while waiting for the controller to come out of the mentioned transient states. Once the controller transits out of the transient states, come out of the wait loop. Signed-off-by: Sumit Saxena Signed-off-by: Ranjan Kumar --- drivers/scsi/mpi3mr/mpi3mr_fw.c | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/drivers/scsi/mpi3mr/mpi3mr_fw.c b/drivers/scsi/mpi3mr/mpi3mr_fw.c index 0eaf30b6c251..ad20da90a924 100644 --- a/drivers/scsi/mpi3mr/mpi3mr_fw.c +++ b/drivers/scsi/mpi3mr/mpi3mr_fw.c @@ -1384,26 +1384,23 @@ static int mpi3mr_bring_ioc_ready(struct mpi3mr_ioc *mrioc) ioc_info(mrioc, "controller is in %s state during detection\n", mpi3mr_iocstate_name(ioc_state)); - if (ioc_state == MRIOC_STATE_BECOMING_READY || - ioc_state == MRIOC_STATE_RESET_REQUESTED) { - timeout = mrioc->ready_timeout * 10; - do { - msleep(100); - } while (--timeout); + timeout = mrioc->ready_timeout * 10; + + do { + ioc_state = mpi3mr_get_iocstate(mrioc); + + if (ioc_state != MRIOC_STATE_BECOMING_READY && + ioc_state != MRIOC_STATE_RESET_REQUESTED) + break; if (!pci_device_is_present(mrioc->pdev)) { mrioc->unrecoverable = 1; - ioc_err(mrioc, - "controller is not present while waiting to reset\n"); - retval = -1; + ioc_err(mrioc, "controller is not present while waiting to reset\n"); goto out_device_not_present; } - ioc_state = mpi3mr_get_iocstate(mrioc); - ioc_info(mrioc, - "controller is in %s state after waiting to reset\n", - mpi3mr_iocstate_name(ioc_state)); - } + msleep(100); + } while (--timeout); if (ioc_state == MRIOC_STATE_READY) { ioc_info(mrioc, "issuing message unit reset (MUR) to bring to reset state\n"); From patchwork Thu Sep 5 10:27:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ranjan Kumar X-Patchwork-Id: 826421 Received: from mail-oo1-f46.google.com (mail-oo1-f46.google.com [209.85.161.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AB512194090 for ; Thu, 5 Sep 2024 10:31:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725532308; cv=none; b=rj5L/EcWZKjBZsBPMNc4ri/ZOGDl7heMTd7oYpiQHH31IASd0P8DoZ3MQHaVdl4wU7RCK/2XX+yuU/XCfgdQ+om+EKTsi8sOGemcZ/jVZ5gLQRfUS06DOwVwLR/pzj5LB50OReiwH0ds1TnlTEvB0LQCZWc9/JFRacH0drDzGoU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725532308; c=relaxed/simple; bh=itIIGZd+KvG2Bh9eLDqCdHxwDoyF+sOdyjwdth4ukUU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=RJzGsJMy54EjWYlAPPCL8aDLHRguA328Wao55o+hs6gQnPGiULA8f9XsvVtk6mjaUYBDH64UZGo6YuxQrSk+Qv969kOLdv50BDmAle2+NFKe4yVOqIcsxBEgHsC/Qe7k2nGEPqvSaG/+DXdiDgreKFtSSJSNoXNf5aNHqQ/0QiU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com; spf=fail smtp.mailfrom=broadcom.com; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b=K6GAKzoP; arc=none smtp.client-ip=209.85.161.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=broadcom.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="K6GAKzoP" Received: by mail-oo1-f46.google.com with SMTP id 006d021491bc7-5daa93677e1so341758eaf.3 for ; Thu, 05 Sep 2024 03:31:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1725532305; x=1726137105; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=SmI/7v8dAGJcvAoIs+PKF3uYtbsH1rDI4Dzop6dUNwo=; b=K6GAKzoPvoECAyX4tjGGScJDUp4UZe3TGiilfTaM3HXMqlJ/Gn+ISYnFqQCjcY6K3y M4An97P6MG1RBVE2xwj7NkRJvHgNGGk8vUcB1v7w3DzF+dBbpcGrjxQkB9+6rlNK8YJb 7f6pzdQSruz6skcB33W5jJUDUfwvQb8b58hXw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725532305; x=1726137105; h=content-transfer-encoding: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=SmI/7v8dAGJcvAoIs+PKF3uYtbsH1rDI4Dzop6dUNwo=; b=ft4+esKl3JnjgvLhs+vekWSHErUGOsclehF4cizBH2Urqaq4DxcKuComlWCHOAW7hc qgfyzG710Nf4LjJrmLGII4pSZaptiBR0vA3Kuj3lzY+EbY1dN685xPhdN7iYWB4eUGVp v7vuOnW/+njKaQS+GaL77nejZzL5gQnCI1t1If/Eflq8vLBUTmGPUKbLdcbrLGkxHdJN 1C55tuLxEUzaxLo+PTOce4Xz3ArNWfwk4RNgKBITP83M/jsjj65nVAmKZZ0EAXWBxsTA VpfmNE40bgchJCCcNWUgmqKNM565EDq2tATCV/M5j/dq6B+V7P5Bxc+nmksRlhOxetsv 68TQ== X-Gm-Message-State: AOJu0Yz5VENY0BjlLwIeqTeO2TrqWM2Lpan4bjK8TGXTQe99LO/OQSVC EKIO6Albf/bVI7aSff5fnhcPXFWuh9cshc0lwr96e1iUvqLG2iXv8+ocXa6KyOA1iSn+qj9CGG0 clcvbNe8HaisKCEdyaNAbZ10RDU/UYdT9Q0xjYa1tc0LhfE5PQddm5PA8Mh0nuL491fA0WxcWUr yDzf+p0meruE4YZKjIFLggJfQ/Lncr3JvZZoGO7A8Ear+zpQ== X-Google-Smtp-Source: AGHT+IFYB99DgC8GWnEDIu7GASvyxLJwSWAsK7rKZxcr1r/hOMHuz0YBxJ2jsn8X2M4w9rYBRL1F9A== X-Received: by 2002:a05:6870:eca9:b0:278:c6bf:fd34 with SMTP id 586e51a60fabf-278c6bfff00mr6229367fac.27.1725532305072; Thu, 05 Sep 2024 03:31:45 -0700 (PDT) Received: from localhost.localdomain ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-717785364f9sm2960177b3a.87.2024.09.05.03.31.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Sep 2024 03:31:44 -0700 (PDT) From: Ranjan Kumar To: linux-scsi@vger.kernel.org, martin.petersen@oracle.com Cc: rajsekhar.chundru@broadcom.com, sathya.prakash@broadcom.com, sumit.saxena@broadcom.com, prayas.patel@broadcom.com, Ranjan Kumar Subject: [PATCH v1 5/5] mpi3mr: Update driver version to 8.12.0.0.50 Date: Thu, 5 Sep 2024 15:57:53 +0530 Message-Id: <20240905102753.105310-6-ranjan.kumar@broadcom.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20240905102753.105310-1-ranjan.kumar@broadcom.com> References: <20240905102753.105310-1-ranjan.kumar@broadcom.com> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Update driver version to 8.12.0.0.50 Signed-off-by: Ranjan Kumar --- drivers/scsi/mpi3mr/mpi3mr.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/mpi3mr/mpi3mr.h b/drivers/scsi/mpi3mr/mpi3mr.h index 9c1d10ba24be..d937505d2691 100644 --- a/drivers/scsi/mpi3mr/mpi3mr.h +++ b/drivers/scsi/mpi3mr/mpi3mr.h @@ -57,8 +57,8 @@ extern struct list_head mrioc_list; extern int prot_mask; extern atomic64_t event_counter; -#define MPI3MR_DRIVER_VERSION "8.10.0.5.50" -#define MPI3MR_DRIVER_RELDATE "08-Aug-2024" +#define MPI3MR_DRIVER_VERSION "8.12.0.0.50" +#define MPI3MR_DRIVER_RELDATE "05-Sept-2024" #define MPI3MR_DRIVER_NAME "mpi3mr" #define MPI3MR_DRIVER_LICENSE "GPL"