Re: [PATCH 09/14] qla2xxx: Update flash read/write routine

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Joe,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on scsi/for-next]
[also build test WARNING on next-20190306]
[cannot apply to v5.0]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Himanshu-Madhani/qla2xxx-Add-support-for-ISP28XX-Gen7-adapter/20190308-141231
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
config: xtensa-allyesconfig (attached as .config)
compiler: xtensa-linux-gcc (GCC) 8.2.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=8.2.0 make.cross ARCH=xtensa 

All warnings (new ones prefixed by >>):

   drivers/scsi/qla2xxx/qla_sup.c: In function 'qla24xx_write_flash_data':
>> drivers/scsi/qla2xxx/qla_sup.c:1306:42: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 7 has type 'dma_addr_t' {aka 'unsigned int'} [-Wformat=]
           "Failed burst-write at %x (%p/%#llx)....\n",
                                         ~~~~^
                                         %#x
   drivers/scsi/qla2xxx/qla_sup.c:1308:8:
           optrom_dma);
           ~~~~~~~~~~                         

vim +1306 drivers/scsi/qla2xxx/qla_sup.c

  1232	
  1233	static int
  1234	qla24xx_write_flash_data(scsi_qla_host_t *vha, uint32_t *dwptr, uint32_t faddr,
  1235	    uint32_t dwords)
  1236	{
  1237		int ret;
  1238		ulong liter;
  1239		ulong dburst = OPTROM_BURST_DWORDS; /* burst size in dwords */
  1240		uint32_t sec_mask, rest_addr, fdata;
  1241		dma_addr_t optrom_dma;
  1242		void *optrom = NULL;
  1243		struct qla_hw_data *ha = vha->hw;
  1244	
  1245		if (!IS_QLA25XX(ha) && !IS_QLA81XX(ha) && !IS_QLA83XX(ha) &&
  1246		    !IS_QLA27XX(ha) && !IS_QLA28XX(ha))
  1247			goto next;
  1248	
  1249		/* Allocate dma buffer for burst write */
  1250		optrom = dma_alloc_coherent(&ha->pdev->dev, OPTROM_BURST_SIZE,
  1251		    &optrom_dma, GFP_KERNEL);
  1252		if (!optrom) {
  1253			ql_log(ql_log_warn, vha, 0x7095,
  1254			    "Failed allocate burst (%x bytes)\n", OPTROM_BURST_SIZE);
  1255		}
  1256	
  1257	next:
  1258		ql_log(ql_log_warn + ql_dbg_verbose, vha, 0x7095,
  1259		    "Unprotect flash...\n");
  1260		ret = qla24xx_unprotect_flash(vha);
  1261		if (ret) {
  1262			ql_log(ql_log_warn, vha, 0x7096,
  1263			    "Failed to unprotect flash.\n");
  1264			goto done;
  1265		}
  1266	
  1267		rest_addr = (ha->fdt_block_size >> 2) - 1;
  1268		sec_mask = ~rest_addr;
  1269		for (liter = 0; liter < dwords; liter++, faddr++, dwptr++) {
  1270			fdata = (faddr & sec_mask) << 2;
  1271	
  1272			/* Are we at the beginning of a sector? */
  1273			if (!(faddr & rest_addr)) {
  1274				ql_log(ql_log_warn + ql_dbg_verbose, vha, 0x7095,
  1275				    "Erase sector %#x...\n", faddr);
  1276	
  1277				ret = qla24xx_erase_sector(vha, fdata);
  1278				if (ret) {
  1279					ql_dbg(ql_dbg_user, vha, 0x7007,
  1280					    "Failed to erase sector %x.\n", faddr);
  1281					break;
  1282				}
  1283			}
  1284	
  1285			if (optrom) {
  1286				/* If smaller than a burst remaining */
  1287				if (dwords - liter < dburst)
  1288					dburst = dwords - liter;
  1289	
  1290				/* Copy to dma buffer */
  1291				memcpy(optrom, dwptr, dburst << 2);
  1292	
  1293				/* Burst write */
  1294				ql_log(ql_log_warn + ql_dbg_verbose, vha, 0x7095,
  1295				    "Write burst (%#lx dwords)...\n", dburst);
  1296				ret = qla2x00_load_ram(vha, optrom_dma,
  1297				    flash_data_addr(ha, faddr), dburst);
  1298				if (!ret) {
  1299					liter += dburst - 1;
  1300					faddr += dburst - 1;
  1301					dwptr += dburst - 1;
  1302					continue;
  1303				}
  1304	
  1305				ql_log(ql_log_warn, vha, 0x7097,
> 1306				    "Failed burst-write at %x (%p/%#llx)....\n",
  1307				    flash_data_addr(ha, faddr), optrom,
  1308				    optrom_dma);
  1309	
  1310				dma_free_coherent(&ha->pdev->dev,
  1311				    OPTROM_BURST_SIZE, optrom, optrom_dma);
  1312				optrom = NULL;
  1313				if (IS_QLA27XX(ha) || IS_QLA28XX(ha))
  1314					break;
  1315				ql_log(ql_log_warn, vha, 0x7098,
  1316				    "Reverting to slow write...\n");
  1317			}
  1318	
  1319			/* Slow write */
  1320			ret = qla24xx_write_flash_dword(ha,
  1321			    flash_data_addr(ha, faddr), cpu_to_le32(*dwptr));
  1322			if (ret) {
  1323				ql_dbg(ql_dbg_user, vha, 0x7006,
  1324				    "Failed slopw write %x (%x)\n", faddr, *dwptr);
  1325				break;
  1326			}
  1327		}
  1328	
  1329		ql_log(ql_log_warn + ql_dbg_verbose, vha, 0x7095,
  1330		    "Protect flash...\n");
  1331		ret = qla24xx_protect_flash(vha);
  1332		if (ret)
  1333			ql_log(ql_log_warn, vha, 0x7099,
  1334			    "Failed to protect flash\n");
  1335	done:
  1336		if (optrom)
  1337			dma_free_coherent(&ha->pdev->dev,
  1338			    OPTROM_BURST_SIZE, optrom, optrom_dma);
  1339	
  1340		return ret;
  1341	}
  1342	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: application/gzip


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux