public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Meelis Roos <mroos@linux.ee>
To: Bart Van Assche <Bart.VanAssche@wdc.com>
Cc: "qla2xxx-upstream@qlogic.com" <qla2xxx-upstream@qlogic.com>,
	"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	"himanshu.madhani@cavium.com" <himanshu.madhani@cavium.com>
Subject: Re: qla2xxx UBSAN warning in 4.14-rc1
Date: Thu, 25 Jan 2018 00:18:17 +0200 (EET)	[thread overview]
Message-ID: <alpine.LRH.2.21.1801250012070.28967@math.ut.ee> (raw)
In-Reply-To: <1516828413.3987.18.camel@wdc.com>

> > Hello, I decided to widen the coverage of my kernel testbed and put some 
> > FC cards into servers. This one is a PCI-X QLA2340 in HP Proliant DL 380 
> > G4 (first 64-bit generation of Proliants). I got a UBSAN warning from 
> > qla2xxx before probing for the firmware.
> 
> Would it be possible for you to test the (completely untested) patch below?

It compiles without warnings and the driver loads without warnings.

Meanwhile I tried the following patch, also successfully.

However, the same problem is present in qla24xx_mbx_completion (and can 
also be trivially patched over).

I did not understand the logic of what's goind on with mailboxes - there 
seem to be up to 32 of them and for some reason, a bitmask is used for 
iterating over them, with mboxes = ha->mcp->in_mb filtering out some 
mailboxes, and in_mb bitmap value comes from firmware?

diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
index 2fd79129bb2a..7868930ae1c8 100644
--- a/drivers/scsi/qla2xxx/qla_isr.c
+++ b/drivers/scsi/qla2xxx/qla_isr.c
@@ -272,7 +272,7 @@ qla2x00_mbx_completion(scsi_qla_host_t *vha, uint16_t mb0)
 	struct device_reg_2xxx __iomem *reg = &ha->iobase->isp;
 
 	/* Read all mbox registers? */
-	mboxes = (1 << ha->mbx_count) - 1;
+	mboxes = (1ULL << ha->mbx_count) - 1;
 	if (!ha->mcp)
 		ql_dbg(ql_dbg_async, vha, 0x5001, "MBX pointer ERROR.\n");
 	else

-- 
Meelis Roos (mroos@linux.ee)

  reply	other threads:[~2018-01-24 22:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-18 10:49 qla2xxx UBSAN warning in 4.14-rc1 Meelis Roos
2017-09-26 21:36 ` Madhani, Himanshu
2017-11-09  8:59   ` Meelis Roos
2017-11-10  4:49     ` Himanshu Madhani
2018-01-24 20:35     ` Meelis Roos
2018-01-24 21:13 ` Bart Van Assche
2018-01-24 22:18   ` Meelis Roos [this message]
2018-01-25  7:25     ` 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=alpine.LRH.2.21.1801250012070.28967@math.ut.ee \
    --to=mroos@linux.ee \
    --cc=Bart.VanAssche@wdc.com \
    --cc=himanshu.madhani@cavium.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=qla2xxx-upstream@qlogic.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