* [PATCH] scsi: qla1280: Fix dma firmware download, if dma address is 64bit
@ 2020-01-14 16:09 Thomas Bogendoerfer
2020-01-16 4:09 ` Martin K. Petersen
2020-01-16 10:44 ` kbuild test robot
0 siblings, 2 replies; 5+ messages in thread
From: Thomas Bogendoerfer @ 2020-01-14 16:09 UTC (permalink / raw)
To: Michael Reed, James E.J. Bottomley, Martin K. Petersen,
linux-scsi, linux-kernel
Do firmware download with 64bit LOAD_RAM command, if driver is using
64bit addressing.
Signed-off-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
---
drivers/scsi/qla1280.c | 20 ++++++++++++++------
drivers/scsi/qla1280.h | 2 ++
2 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/drivers/scsi/qla1280.c b/drivers/scsi/qla1280.c
index 832af4213046..607cbddcdd14 100644
--- a/drivers/scsi/qla1280.c
+++ b/drivers/scsi/qla1280.c
@@ -1699,6 +1699,16 @@ qla1280_load_firmware_pio(struct scsi_qla_host *ha)
return err;
}
+#if QLA_64BIT_PTR
+#define LOAD_CMD MBC_LOAD_RAM_A64_ROM
+#define DUMP_CMD MBC_DUMP_RAM_A64_ROM
+#define CMD_ARGS (BIT_7 | BIT_6 | BIT_4 | BIT_3 | BIT_2 | BIT_1 | BIT_0)
+#else
+#define LOAD_CMD MBC_LOAD_RAM
+#define DUMP_CMD MBC_DUMP_RAM
+#define CMD_ARGS (BIT_4 | BIT_3 | BIT_2 | BIT_1 | BIT_0)
+#endif
+
#define DUMP_IT_BACK 0 /* for debug of RISC loading */
static int
qla1280_load_firmware_dma(struct scsi_qla_host *ha)
@@ -1748,7 +1758,7 @@ qla1280_load_firmware_dma(struct scsi_qla_host *ha)
for(i = 0; i < cnt; i++)
((__le16 *)ha->request_ring)[i] = fw_data[i];
- mb[0] = MBC_LOAD_RAM;
+ mb[0] = LOAD_CMD;
mb[1] = risc_address;
mb[4] = cnt;
mb[3] = ha->request_dma & 0xffff;
@@ -1759,8 +1769,7 @@ qla1280_load_firmware_dma(struct scsi_qla_host *ha)
__func__, mb[0],
(void *)(long)ha->request_dma,
mb[6], mb[7], mb[2], mb[3]);
- err = qla1280_mailbox_command(ha, BIT_4 | BIT_3 | BIT_2 |
- BIT_1 | BIT_0, mb);
+ err = qla1280_mailbox_command(ha, CMD_ARGS, mb);
if (err) {
printk(KERN_ERR "scsi(%li): Failed to load partial "
"segment of f\n", ha->host_no);
@@ -1768,7 +1777,7 @@ qla1280_load_firmware_dma(struct scsi_qla_host *ha)
}
#if DUMP_IT_BACK
- mb[0] = MBC_DUMP_RAM;
+ mb[0] = DUMP_CMD;
mb[1] = risc_address;
mb[4] = cnt;
mb[3] = p_tbuf & 0xffff;
@@ -1776,8 +1785,7 @@ qla1280_load_firmware_dma(struct scsi_qla_host *ha)
mb[7] = upper_32_bits(p_tbuf) & 0xffff;
mb[6] = upper_32_bits(p_tbuf) >> 16;
- err = qla1280_mailbox_command(ha, BIT_4 | BIT_3 | BIT_2 |
- BIT_1 | BIT_0, mb);
+ err = qla1280_mailbox_command(ha, CMD_ARGS, mb);
if (err) {
printk(KERN_ERR
"Failed to dump partial segment of f/w\n");
diff --git a/drivers/scsi/qla1280.h b/drivers/scsi/qla1280.h
index a1a8aefc7cc3..e7820b5bca38 100644
--- a/drivers/scsi/qla1280.h
+++ b/drivers/scsi/qla1280.h
@@ -277,6 +277,8 @@ struct device_reg {
#define MBC_MAILBOX_REGISTER_TEST 6 /* Wrap incoming mailboxes */
#define MBC_VERIFY_CHECKSUM 7 /* Verify checksum */
#define MBC_ABOUT_FIRMWARE 8 /* Get firmware revision */
+#define MBC_LOAD_RAM_A64_ROM 9 /* Load RAM 64bit ROM version */
+#define MBC_DUMP_RAM_A64_ROM 0x0a /* Dump RAM 64bit ROM version */
#define MBC_INIT_REQUEST_QUEUE 0x10 /* Initialize request queue */
#define MBC_INIT_RESPONSE_QUEUE 0x11 /* Initialize response queue */
#define MBC_EXECUTE_IOCB 0x12 /* Execute IOCB command */
--
2.24.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] scsi: qla1280: Fix dma firmware download, if dma address is 64bit
2020-01-14 16:09 [PATCH] scsi: qla1280: Fix dma firmware download, if dma address is 64bit Thomas Bogendoerfer
@ 2020-01-16 4:09 ` Martin K. Petersen
2020-01-16 11:43 ` Thomas Bogendoerfer
2020-01-16 10:44 ` kbuild test robot
1 sibling, 1 reply; 5+ messages in thread
From: Martin K. Petersen @ 2020-01-16 4:09 UTC (permalink / raw)
To: Thomas Bogendoerfer
Cc: Michael Reed, James E.J. Bottomley, Martin K. Petersen,
linux-scsi, linux-kernel
Thomas,
> Do firmware download with 64bit LOAD_RAM command, if driver is using
> 64bit addressing.
Applied to 5.6/scsi-queue, thanks!
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] scsi: qla1280: Fix dma firmware download, if dma address is 64bit
2020-01-14 16:09 [PATCH] scsi: qla1280: Fix dma firmware download, if dma address is 64bit Thomas Bogendoerfer
2020-01-16 4:09 ` Martin K. Petersen
@ 2020-01-16 10:44 ` kbuild test robot
1 sibling, 0 replies; 5+ messages in thread
From: kbuild test robot @ 2020-01-16 10:44 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 1918 bytes --]
Hi Thomas,
I love your patch! Perhaps something to improve:
[auto build test WARNING on scsi/for-next]
[also build test WARNING on mkp-scsi/for-next v5.5-rc6 next-20200110]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Thomas-Bogendoerfer/scsi-qla1280-Fix-dma-firmware-download-if-dma-address-is-64bit/20200115-124123
base: https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
config: parisc-randconfig-a001-20200115 (attached as .config)
compiler: hppa-linux-gcc (GCC) 7.5.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
GCC_VERSION=7.5.0 make.cross ARCH=parisc
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
>> drivers//scsi/qla1280.c:1702:5: warning: "QLA_64BIT_PTR" is not defined, evaluates to 0 [-Wundef]
#if QLA_64BIT_PTR
^~~~~~~~~~~~~
vim +/QLA_64BIT_PTR +1702 drivers//scsi/qla1280.c
1701
> 1702 #if QLA_64BIT_PTR
1703 #define LOAD_CMD MBC_LOAD_RAM_A64_ROM
1704 #define DUMP_CMD MBC_DUMP_RAM_A64_ROM
1705 #define CMD_ARGS (BIT_7 | BIT_6 | BIT_4 | BIT_3 | BIT_2 | BIT_1 | BIT_0)
1706 #else
1707 #define LOAD_CMD MBC_LOAD_RAM
1708 #define DUMP_CMD MBC_DUMP_RAM
1709 #define CMD_ARGS (BIT_4 | BIT_3 | BIT_2 | BIT_1 | BIT_0)
1710 #endif
1711
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org Intel Corporation
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 30561 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] scsi: qla1280: Fix dma firmware download, if dma address is 64bit
2020-01-16 4:09 ` Martin K. Petersen
@ 2020-01-16 11:43 ` Thomas Bogendoerfer
2020-01-17 1:29 ` Martin K. Petersen
0 siblings, 1 reply; 5+ messages in thread
From: Thomas Bogendoerfer @ 2020-01-16 11:43 UTC (permalink / raw)
To: Martin K. Petersen
Cc: Michael Reed, James E.J. Bottomley, linux-scsi, linux-kernel
On Wed, 15 Jan 2020 23:09:34 -0500
"Martin K. Petersen" <martin.petersen@oracle.com> wrote:
> > Do firmware download with 64bit LOAD_RAM command, if driver is using
> > 64bit addressing.
>
> Applied to 5.6/scsi-queue, thanks!
kbuild robot found an issue in the patch. Do you want a new version of
the patch or an incremental patch ?
Thomas.
--
SUSE Software Solutions Germany GmbH
HRB 36809 (AG Nürnberg)
Geschäftsführer: Felix Imendörffer
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] scsi: qla1280: Fix dma firmware download, if dma address is 64bit
2020-01-16 11:43 ` Thomas Bogendoerfer
@ 2020-01-17 1:29 ` Martin K. Petersen
0 siblings, 0 replies; 5+ messages in thread
From: Martin K. Petersen @ 2020-01-17 1:29 UTC (permalink / raw)
To: Thomas Bogendoerfer
Cc: Martin K. Petersen, Michael Reed, James E.J. Bottomley,
linux-scsi, linux-kernel
Thomas,
> kbuild robot found an issue in the patch. Do you want a new version of
> the patch or an incremental patch ?
Incremental, please.
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-01-17 1:29 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-01-14 16:09 [PATCH] scsi: qla1280: Fix dma firmware download, if dma address is 64bit Thomas Bogendoerfer
2020-01-16 4:09 ` Martin K. Petersen
2020-01-16 11:43 ` Thomas Bogendoerfer
2020-01-17 1:29 ` Martin K. Petersen
2020-01-16 10:44 ` kbuild test robot
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.