All of lore.kernel.org
 help / color / mirror / Atom feed
From: Martin Wilck <Martin.Wilck@suse.com>
To: "Martin K. Petersen" <martin.petersen@oracle.com>,
	Himanshu Madhani <hmadhani@marvell.com>
Cc: Bart Van Assche <Bart.VanAssche@sandisk.com>,
	Joe Carnuccio <joe.carnuccio@cavium.com>,
	Quinn Tran <qutran@marvell.com>, Hannes Reinecke <hare@suse.de>,
	Martin Wilck <Martin.Wilck@suse.com>,
	"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	Bart Van Assche <bvanassche@acm.org>
Subject: [PATCH 3/3] scsi: qla2xxx: calculate dump size if EFT alloc fails
Date: Tue, 13 Aug 2019 20:31:11 +0000	[thread overview]
Message-ID: <20190813203034.7354-4-martin.wilck@suse.com> (raw)
In-Reply-To: <20190813203034.7354-1-martin.wilck@suse.com>

From: Martin Wilck <mwilck@suse.com>

It seems right to try and calculate the dump size properly
even in the error case, before allocating the dump buffers.

Cc: Joe Carnuccio <joe.carnuccio@cavium.com>
Cc: Quinn Tran <qutran@marvell.com>
Cc: Himanshu Madhani <hmadhani@marvell.com>
Cc: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin Wilck <mwilck@suse.com>
---
 drivers/scsi/qla2xxx/qla_init.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index ca9c3f3..8427436 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -3191,7 +3191,7 @@ qla2x00_alloc_fw_dump(scsi_qla_host_t *vha)
 			    EFT_SIZE / 1024);
 			ha->eft = NULL;
 			ha->eft_dma = 0;
-			goto allocate;
+			goto calc_dump_size;
 		}
 
 		rval = qla2x00_enable_eft_trace(vha, tc_dma, EFT_NUM_BUFFERS);
@@ -3202,7 +3202,7 @@ qla2x00_alloc_fw_dump(scsi_qla_host_t *vha)
 			    tc_dma);
 			ha->eft = NULL;
 			ha->eft_dma = 0;
-			goto allocate;
+			goto calc_dump_size;
 		}
 		ql_dbg(ql_dbg_init, vha, 0x00c3,
 		    "Allocated (%d KB) EFT ...\n", EFT_SIZE / 1024);
@@ -3211,6 +3211,7 @@ qla2x00_alloc_fw_dump(scsi_qla_host_t *vha)
 		ha->eft = tc;
 	}
 
+calc_dump_size:
 	if (IS_QLA27XX(ha) || IS_QLA28XX(ha)) {
 		struct fwdt *fwdt = ha->fwdt;
 		uint j;
-- 
2.22.0


  parent reply	other threads:[~2019-08-13 21:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-13 20:31 [PATCH 0/3] scsi: qla2xxx: fixes for FW trace/dump buffers Martin Wilck
2019-08-13 20:31 ` [PATCH 1/3] scsi: qla2xxx: qla2x00_alloc_fw_dump: set ha->eft Martin Wilck
2019-08-14  6:07   ` Hannes Reinecke
2019-08-13 20:31 ` [PATCH 2/3] scsi: qla2xxx: unset RCE/EFT fields in failure case Martin Wilck
2019-08-14  6:24   ` Hannes Reinecke
2019-08-14 11:14     ` Martin Wilck
2019-08-14 14:18       ` Himanshu Madhani
2019-08-13 20:31 ` Martin Wilck [this message]
2019-08-14  6:25   ` [PATCH 3/3] scsi: qla2xxx: calculate dump size if EFT alloc fails Hannes Reinecke

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=20190813203034.7354-4-martin.wilck@suse.com \
    --to=martin.wilck@suse.com \
    --cc=Bart.VanAssche@sandisk.com \
    --cc=bvanassche@acm.org \
    --cc=hare@suse.de \
    --cc=hmadhani@marvell.com \
    --cc=joe.carnuccio@cavium.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=qutran@marvell.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.