linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bart Van Assche <Bart.VanAssche@sandisk.com>
To: "hch@infradead.org" <hch@infradead.org>,
	"himanshu.madhani@cavium.com" <himanshu.madhani@cavium.com>,
	"target-devel@vger.kernel.org" <target-devel@vger.kernel.org>,
	"nab@linux-iscsi.org" <nab@linux-iscsi.org>
Cc: "linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	"giridhar.malavali@cavium.com" <giridhar.malavali@cavium.com>
Subject: Re: [PATCH v2 04/10] qla2xxx: Reset reserved field in firmware options to 0.
Date: Fri, 23 Dec 2016 08:37:38 +0000	[thread overview]
Message-ID: <1482482240.3510.5.camel@sandisk.com> (raw)
In-Reply-To: <1482357459-31079-5-git-send-email-himanshu.madhani@cavium.com>

On Wed, 2016-12-21 at 13:57 -0800, Himanshu Madhani wrote:
> During NVRAM initialization in target mode, reset reserved
> fields in firmware options to Zero (BIT 15)
> 
> Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com>
> Signed-off-by: Giridhar Malavali <giridhar.malavali@cavium.com>
> ---
>  drivers/scsi/qla2xxx/qla_target.c | 17 ++++++++++++++++-
>  1 file changed, 16 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c
> index b9c559c..5037b51 100644
> --- a/drivers/scsi/qla2xxx/qla_target.c
> +++ b/drivers/scsi/qla2xxx/qla_target.c
> @@ -6539,6 +6539,14 @@ static void qlt_disable_vha(struct scsi_qla_host *vha)
>  
>  		/* Disable Full Login after LIP */
>  		nv->host_p &= cpu_to_le32(~BIT_10);
> +
> +		/*
> +		 * clear BIT 15 explicitly as we have seen at least
> +		 * a couple of instances where this was set and this
> +		 * was causing the firmware to not be initialized.
> +		 */
> +		nv->firmware_options_1 &=
> +		    __constant_cpu_to_le32(~BIT_15);
>  		/* Enable target PRLI control */
>  		nv->firmware_options_2 |= cpu_to_le32(BIT_14);
>  	} else {
> @@ -6623,11 +6631,18 @@ static void qlt_disable_vha(struct scsi_qla_host *vha)
>  		/* Disable ini mode, if requested */
>  		if (!qla_ini_mode_enabled(vha))
>  			nv->firmware_options_1 |= cpu_to_le32(BIT_5);
> -
>  		/* Disable Full Login after LIP */
>  		nv->firmware_options_1 &= cpu_to_le32(~BIT_13);
>  		/* Enable initial LIP */
>  		nv->firmware_options_1 &= cpu_to_le32(~BIT_9);
> +		/*
> +		 * clear BIT 15 explicitly as we have seen at
> +		 * least a couple of instances where this was set
> +		 * and this was causing the firmware to not be
> +		 * initialized.
> +		 */
> +		nv->firmware_options_1 &=
> +		    __constant_cpu_to_le32(~BIT_15);
>  		if (ql2xtgt_tape_enable)
>  			/* Enable FC tape support */
>  			nv->firmware_options_2 |= cpu_to_le32(BIT_12);

Hello Himanshu,

Please use cpu_to_le32() in new code instead of __constant_cpu_to_le32().
gcc generates the same code for both conversion functions but the former
function makes source code easier to read.

Bart.

  reply	other threads:[~2016-12-23  8:37 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-21 21:57 [PATCH v2 00/10] qla2xxx: Bug fixes for driver Himanshu Madhani
2016-12-21 21:57 ` [PATCH v2 01/10] qla2xxx: Fix wrong IOCB type assumption Himanshu Madhani
2016-12-21 21:57 ` [PATCH v2 02/10] qla2xxx: Include ATIO queue in firmware dump when in target mode Himanshu Madhani
2016-12-23  8:32   ` Bart Van Assche
2016-12-24  0:37     ` Madhani, Himanshu
2016-12-21 21:57 ` [PATCH v2 03/10] qla2xxx: Set tcm_qla2xxx version to automatically track qla2xxx version Himanshu Madhani
2016-12-21 21:57 ` [PATCH v2 04/10] qla2xxx: Reset reserved field in firmware options to 0 Himanshu Madhani
2016-12-23  8:37   ` Bart Van Assche [this message]
2016-12-24  0:07     ` Madhani, Himanshu
2016-12-21 21:57 ` [PATCH v2 05/10] qla2xxx: Collect additional information to debug fw dump Himanshu Madhani
2016-12-21 21:57 ` [PATCH v2 06/10] qla2xxx: Fix crash due to null pointer access Himanshu Madhani
2016-12-23  8:47   ` Bart Van Assche
2016-12-24  0:06     ` Madhani, Himanshu
2016-12-21 21:57 ` [PATCH v2 07/10] qla2xxx: Terminate exchange if corrputed Himanshu Madhani
2016-12-23  9:01   ` Bart Van Assche
2016-12-23 23:55     ` Madhani, Himanshu
2016-12-21 21:57 ` [PATCH v2 08/10] qla2xxx: Reduce exess wait during chip reset Himanshu Madhani
2016-12-21 21:57 ` [PATCH v2 09/10] qla2xxx: Fix invalid handle erroneous message Himanshu Madhani
2016-12-21 21:57 ` [PATCH v2 10/10] qla2xxx: Disable Out-of-order processing by default in Firmware Himanshu Madhani
2016-12-22  9:25 ` [PATCH v2 00/10] qla2xxx: Bug fixes for driver Christoph Hellwig
2016-12-22 16:44   ` Madhani, Himanshu
2016-12-22 17:02     ` Bart Van Assche
2016-12-22 17:27       ` Madhani, Himanshu

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=1482482240.3510.5.camel@sandisk.com \
    --to=bart.vanassche@sandisk.com \
    --cc=giridhar.malavali@cavium.com \
    --cc=hch@infradead.org \
    --cc=himanshu.madhani@cavium.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=nab@linux-iscsi.org \
    --cc=target-devel@vger.kernel.org \
    /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).