From: Bart Van Assche <bvanassche@acm.org>
To: Hannes Reinecke <hare@suse.de>,
"Martin K . Petersen" <martin.petersen@oracle.com>,
"James E . J . Bottomley" <jejb@linux.vnet.ibm.com>
Cc: linux-scsi@vger.kernel.org, Daniel Wagner <dwagner@suse.de>,
Himanshu Madhani <himanshu.madhani@oracle.com>,
Nilesh Javali <njavali@marvell.com>,
Quinn Tran <qutran@marvell.com>, Martin Wilck <mwilck@suse.com>,
Roman Bolshakov <r.bolshakov@yadro.com>
Subject: Re: [PATCH v5 10/15] qla2xxx: Fix the code that reads from mailbox registers
Date: Tue, 12 May 2020 08:55:50 -0700 [thread overview]
Message-ID: <a4c7cd79-d816-737e-2005-9f936d45150f@acm.org> (raw)
In-Reply-To: <3def1366-2e63-173e-2664-44229b6f79ec@suse.de>
On 2020-05-11 23:17, Hannes Reinecke wrote:
> On 5/11/20 10:09 PM, Bart Van Assche wrote:
>> diff --git a/drivers/scsi/qla2xxx/qla_iocb.c b/drivers/scsi/qla2xxx/qla_iocb.c
>> index 182bd68c79ac..4d8039fc02e7 100644
>> --- a/drivers/scsi/qla2xxx/qla_iocb.c
>> +++ b/drivers/scsi/qla2xxx/qla_iocb.c
>> @@ -2268,7 +2268,7 @@ __qla2x00_alloc_iocbs(struct qla_qpair *qpair, srb_t *sp)
>> IS_QLA28XX(ha))
>> cnt = RD_REG_DWORD(®->isp25mq.req_q_out);
>> else if (IS_P3P_TYPE(ha))
>> - cnt = RD_REG_DWORD(®->isp82.req_q_out);
>> + cnt = RD_REG_DWORD(reg->isp82.req_q_out);
>> else if (IS_FWI2_CAPABLE(ha))
>> cnt = RD_REG_DWORD(®->isp24.req_q_out);
>> else if (IS_QLAFX00(ha))
>
> WTF?
> Is 'isp82.req_q_out' a pointer, but the others are not?
> This really looks dodgy...
Hi Hannes,
This is what I found in the qla2xxx source code:
/* Request queue data structure */
struct req_que {
[ ... ]
uint32_t __iomem *req_q_in; /* FWI2-capable only. */
uint32_t __iomem *req_q_out;
[ ... ]
};
$ git grep -nHEw 'req_q_(out|in) = '
drivers/scsi/qla2xxx/qla_mid.c:770: req->req_q_in = ®->isp25mq.req_q_in;
drivers/scsi/qla2xxx/qla_mid.c:771: req->req_q_out = ®->isp25mq.req_q_out;
drivers/scsi/qla2xxx/qla_os.c:3217: req->req_q_in = &ha->iobase->isp24.req_q_in;
drivers/scsi/qla2xxx/qla_os.c:3218: req->req_q_out = &ha->iobase->isp24.req_q_out;
drivers/scsi/qla2xxx/qla_os.c:3223: req->req_q_in = &ha->mqiobase->isp25mq.req_q_in;
drivers/scsi/qla2xxx/qla_os.c:3224: req->req_q_out = &ha->mqiobase->isp25mq.req_q_out;
drivers/scsi/qla2xxx/qla_os.c:3230: req->req_q_in = &ha->iobase->ispfx00.req_q_in;
drivers/scsi/qla2xxx/qla_os.c:3231: req->req_q_out = &ha->iobase->ispfx00.req_q_out;
drivers/scsi/qla2xxx/qla_os.c:3237: req->req_q_out = &ha->iobase->isp82.req_q_out[0];
Bart.
next prev parent reply other threads:[~2020-05-12 15:55 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-11 20:09 [PATCH v5 00/15] Fix qla2xxx endianness annotations Bart Van Assche
2020-05-11 20:09 ` [PATCH v5 01/15] qla2xxx: Fix spelling of a variable name Bart Van Assche
2020-05-11 20:09 ` [PATCH v5 02/15] qla2xxx: Suppress two recently introduced compiler warnings Bart Van Assche
2020-05-11 20:09 ` [PATCH v5 03/15] qla2xxx: Simplify the functions for dumping firmware Bart Van Assche
2020-05-11 20:09 ` [PATCH v5 04/15] qla2xxx: Sort BUILD_BUG_ON() statements alphabetically Bart Van Assche
2020-05-11 20:09 ` [PATCH v5 05/15] qla2xxx: Add more BUILD_BUG_ON() statements Bart Van Assche
2020-05-11 20:09 ` [PATCH v5 06/15] qla2xxx: Make a gap in struct qla2xxx_offld_chain explicit Bart Van Assche
2020-05-11 20:09 ` [PATCH v5 07/15] qla2xxx: Increase the size of struct qla_fcp_prio_cfg to FCP_PRIO_CFG_SIZE Bart Van Assche
2020-05-11 20:09 ` [PATCH v5 08/15] qla2xxx: Change two hardcoded constants into offsetof() / sizeof() expressions Bart Van Assche
2020-05-11 20:09 ` [PATCH v5 09/15] qla2xxx: Use register names instead of register offsets Bart Van Assche
2020-05-12 6:11 ` Hannes Reinecke
2020-05-11 20:09 ` [PATCH v5 10/15] qla2xxx: Fix the code that reads from mailbox registers Bart Van Assche
2020-05-12 6:17 ` Hannes Reinecke
2020-05-12 15:55 ` Bart Van Assche [this message]
2020-05-11 20:09 ` [PATCH v5 11/15] qla2xxx: Change {RD,WRT}_REG_*() function names from upper case into lower case Bart Van Assche
2020-05-11 20:09 ` [PATCH v5 12/15] qla2xxx: Cast explicitly to uint16_t / uint32_t Bart Van Assche
2020-05-12 6:13 ` Hannes Reinecke
2020-05-11 20:09 ` [PATCH v5 13/15] qla2xxx: Use make_handle() instead of open-coding it Bart Van Assche
2020-05-11 20:09 ` [PATCH v5 14/15] qla2xxx: Fix endianness annotations in header files Bart Van Assche
2020-05-11 20:09 ` [PATCH v5 15/15] qla2xxx: Fix endianness annotations in source files Bart Van Assche
2020-05-12 16:44 ` [PATCH v5 00/15] Fix qla2xxx endianness annotations Martin K. Petersen
2020-05-13 1:29 ` Bart Van Assche
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=a4c7cd79-d816-737e-2005-9f936d45150f@acm.org \
--to=bvanassche@acm.org \
--cc=dwagner@suse.de \
--cc=hare@suse.de \
--cc=himanshu.madhani@oracle.com \
--cc=jejb@linux.vnet.ibm.com \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=mwilck@suse.com \
--cc=njavali@marvell.com \
--cc=qutran@marvell.com \
--cc=r.bolshakov@yadro.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