linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Ranjan Kumar <ranjan.kumar@broadcom.com>,
	Sreekanth Reddy <sreekanth.reddy@broadcom.com>,
	"Martin K . Petersen" <martin.petersen@oracle.com>,
	Sasha Levin <sashal@kernel.org>,
	sathya.prakash@broadcom.com, kashyap.desai@broadcom.com,
	sumit.saxena@broadcom.com, jejb@linux.ibm.com,
	mpi3mr-linuxdrv.pdl@broadcom.com, linux-scsi@vger.kernel.org
Subject: [PATCH AUTOSEL 6.2 19/30] scsi: mpi3mr: Return proper values for failures in firmware init path
Date: Sun, 19 Mar 2023 20:52:44 -0400	[thread overview]
Message-ID: <20230320005258.1428043-19-sashal@kernel.org> (raw)
In-Reply-To: <20230320005258.1428043-1-sashal@kernel.org>

From: Ranjan Kumar <ranjan.kumar@broadcom.com>

[ Upstream commit ba8a9ba41fbde250fd8b0ed1e5dad0dc9318df46 ]

Return proper non-zero return values for all the cases when the controller
initialization and re-initialization fails.

Signed-off-by: Ranjan Kumar <ranjan.kumar@broadcom.com>
Signed-off-by: Sreekanth Reddy <sreekanth.reddy@broadcom.com>
Link: https://lore.kernel.org/r/20230228140835.4075-5-ranjan.kumar@broadcom.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/scsi/mpi3mr/mpi3mr_fw.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/mpi3mr/mpi3mr_fw.c b/drivers/scsi/mpi3mr/mpi3mr_fw.c
index fa903a70baac8..29acf6111db30 100644
--- a/drivers/scsi/mpi3mr/mpi3mr_fw.c
+++ b/drivers/scsi/mpi3mr/mpi3mr_fw.c
@@ -3840,8 +3840,10 @@ int mpi3mr_init_ioc(struct mpi3mr_ioc *mrioc)
 	dprint_init(mrioc, "allocating config page buffers\n");
 	mrioc->cfg_page = dma_alloc_coherent(&mrioc->pdev->dev,
 	    MPI3MR_DEFAULT_CFG_PAGE_SZ, &mrioc->cfg_page_dma, GFP_KERNEL);
-	if (!mrioc->cfg_page)
+	if (!mrioc->cfg_page) {
+		retval = -1;
 		goto out_failed_noretry;
+	}
 
 	mrioc->cfg_page_sz = MPI3MR_DEFAULT_CFG_PAGE_SZ;
 
@@ -3903,8 +3905,10 @@ int mpi3mr_init_ioc(struct mpi3mr_ioc *mrioc)
 		dprint_init(mrioc, "allocating memory for throttle groups\n");
 		sz = sizeof(struct mpi3mr_throttle_group_info);
 		mrioc->throttle_groups = kcalloc(mrioc->num_io_throttle_group, sz, GFP_KERNEL);
-		if (!mrioc->throttle_groups)
+		if (!mrioc->throttle_groups) {
+			retval = -1;
 			goto out_failed_noretry;
+		}
 	}
 
 	retval = mpi3mr_enable_events(mrioc);
@@ -3924,6 +3928,7 @@ int mpi3mr_init_ioc(struct mpi3mr_ioc *mrioc)
 		mpi3mr_memset_buffers(mrioc);
 		goto retry_init;
 	}
+	retval = -1;
 out_failed_noretry:
 	ioc_err(mrioc, "controller initialization failed\n");
 	mpi3mr_issue_reset(mrioc, MPI3_SYSIF_HOST_DIAG_RESET_ACTION_DIAG_FAULT,
@@ -4036,6 +4041,7 @@ int mpi3mr_reinit_ioc(struct mpi3mr_ioc *mrioc, u8 is_resume)
 		ioc_err(mrioc,
 		    "cannot create minimum number of operational queues expected:%d created:%d\n",
 		    mrioc->shost->nr_hw_queues, mrioc->num_op_reply_q);
+		retval = -1;
 		goto out_failed_noretry;
 	}
 
@@ -4102,6 +4108,7 @@ int mpi3mr_reinit_ioc(struct mpi3mr_ioc *mrioc, u8 is_resume)
 		mpi3mr_memset_buffers(mrioc);
 		goto retry_init;
 	}
+	retval = -1;
 out_failed_noretry:
 	ioc_err(mrioc, "controller %s is failed\n",
 	    (is_resume)?"resume":"re-initialization");
-- 
2.39.2


  parent reply	other threads:[~2023-03-20  0:55 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20230320005258.1428043-1-sashal@kernel.org>
2023-03-20  0:52 ` [PATCH AUTOSEL 6.2 09/30] cpumask: fix incorrect cpumask scanning result checks Sasha Levin
2023-03-20  1:59   ` Linus Torvalds
2023-03-20  0:52 ` [PATCH AUTOSEL 6.2 10/30] scsi: target: iscsi: Fix an error message in iscsi_check_key() Sasha Levin
2023-03-20  0:52 ` [PATCH AUTOSEL 6.2 11/30] scsi: qla2xxx: Add option to disable FC2 Target support Sasha Levin
2023-03-20  0:52 ` [PATCH AUTOSEL 6.2 12/30] scsi: hisi_sas: Check devm_add_action() return value Sasha Levin
2023-03-20  0:52 ` [PATCH AUTOSEL 6.2 13/30] scsi: ufs: core: Add soft dependency on governor_simpleondemand Sasha Levin
2023-03-20  0:52 ` [PATCH AUTOSEL 6.2 14/30] scsi: lpfc: Check kzalloc() in lpfc_sli4_cgn_params_read() Sasha Levin
2023-03-20  0:52 ` [PATCH AUTOSEL 6.2 15/30] scsi: lpfc: Avoid usage of list iterator variable after loop Sasha Levin
2023-03-20  0:52 ` [PATCH AUTOSEL 6.2 16/30] scsi: mpi3mr: ioctl timeout when disabling/enabling interrupt Sasha Levin
2023-03-20  0:52 ` [PATCH AUTOSEL 6.2 17/30] scsi: mpi3mr: Driver unload crashes host when enhanced logging is enabled Sasha Levin
2023-03-20  0:52 ` [PATCH AUTOSEL 6.2 18/30] scsi: mpi3mr: Wait for diagnostic save during controller init Sasha Levin
2023-03-20  0:52 ` Sasha Levin [this message]
2023-03-20  0:52 ` [PATCH AUTOSEL 6.2 20/30] scsi: mpi3mr: NVMe command size greater than 8K fails Sasha Levin
2023-03-20  0:52 ` [PATCH AUTOSEL 6.2 21/30] scsi: mpi3mr: Bad drive in topology results kernel crash Sasha Levin
2023-03-20  0:52 ` [PATCH AUTOSEL 6.2 22/30] scsi: storvsc: Handle BlockSize change in Hyper-V VHD/VHDX file Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230320005258.1428043-19-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=jejb@linux.ibm.com \
    --cc=kashyap.desai@broadcom.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=mpi3mr-linuxdrv.pdl@broadcom.com \
    --cc=ranjan.kumar@broadcom.com \
    --cc=sathya.prakash@broadcom.com \
    --cc=sreekanth.reddy@broadcom.com \
    --cc=stable@vger.kernel.org \
    --cc=sumit.saxena@broadcom.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).