lkml.org 
[lkml]   [2021]   [Feb]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectdrivers/scsi/gdth_proc.c:249:42: warning: conversion from 'long unsigned int' to 'u16' {aka 'short unsigned int'} changes value from '196608' to '0'
Hi Christophe,

First bad commit (maybe != root cause):

tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 61556703b610a104de324e4f061dc6cf7b218b46
commit: 03fd42d458fb9cb69e712600bd69ff77ff3a45a8 powerpc/fixmap: Fix FIX_EARLY_DEBUG_BASE when page size is 256k
date: 8 months ago
config: powerpc-randconfig-m031-20210204 (attached as .config)
compiler: powerpc-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=03fd42d458fb9cb69e712600bd69ff77ff3a45a8
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 03fd42d458fb9cb69e712600bd69ff77ff3a45a8
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=powerpc

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

In file included from drivers/scsi/gdth.c:266:
drivers/scsi/gdth_proc.c: In function 'gdth_show_info':
>> drivers/scsi/gdth_proc.c:249:42: warning: conversion from 'long unsigned int' to 'u16' {aka 'short unsigned int'} changes value from '196608' to '0' [-Woverflow]
249 | gdtcmd->u.ioctl.param_size = 3*GDTH_SCRATCH/4;
| ^
drivers/scsi/gdth.c: In function 'gdth_async_event':
drivers/scsi/gdth.c:3010:9: warning: variable 'cmd_index' set but not used [-Wunused-but-set-variable]
3010 | int cmd_index;
| ^~~~~~~~~
drivers/scsi/gdth.c: At top level:
drivers/scsi/gdth.c:3231:12: warning: no previous prototype for 'option_setup' [-Wmissing-prototypes]
3231 | int __init option_setup(char *str)
| ^~~~~~~~~~~~
--
In file included from arch/powerpc/include/asm/thread_info.h:13,
from include/linux/thread_info.h:38,
from include/asm-generic/preempt.h:5,
from ./arch/powerpc/include/generated/asm/preempt.h:1,
from include/linux/preempt.h:78,
from include/linux/spinlock.h:51,
from include/linux/seqlock.h:36,
from include/linux/time.h:6,
from include/linux/stat.h:19,
from include/linux/module.h:13,
from drivers/net/vmxnet3/vmxnet3_drv.c:27:
drivers/net/vmxnet3/vmxnet3_drv.c: In function 'vmxnet3_rq_init':
>> arch/powerpc/include/asm/page.h:24:20: warning: conversion from 'long unsigned int' to 'u16' {aka 'short unsigned int'} changes value from '262144' to '0' [-Woverflow]
24 | #define PAGE_SIZE (ASM_CONST(1) << PAGE_SHIFT)
| ^
drivers/net/vmxnet3/vmxnet3_drv.c:1785:29: note: in expansion of macro 'PAGE_SIZE'
1785 | rq->buf_info[0][i].len = PAGE_SIZE;
| ^~~~~~~~~
>> arch/powerpc/include/asm/page.h:24:20: warning: conversion from 'long unsigned int' to 'u16' {aka 'short unsigned int'} changes value from '262144' to '0' [-Woverflow]
24 | #define PAGE_SIZE (ASM_CONST(1) << PAGE_SHIFT)
| ^
drivers/net/vmxnet3/vmxnet3_drv.c:1790:28: note: in expansion of macro 'PAGE_SIZE'
1790 | rq->buf_info[1][i].len = PAGE_SIZE;
| ^~~~~~~~~


vim +249 drivers/scsi/gdth_proc.c

^1da177e4c3f41 Linus Torvalds 2005-04-16 150
3e0552eebdf621 Al Viro 2013-03-31 151 int gdth_show_info(struct seq_file *m, struct Scsi_Host *host)
^1da177e4c3f41 Linus Torvalds 2005-04-16 152 {
3e0552eebdf621 Al Viro 2013-03-31 153 gdth_ha_str *ha = shost_priv(host);
238ddbb98c327a Alan Cox 2009-06-09 154 int hlen;
^1da177e4c3f41 Linus Torvalds 2005-04-16 155 int id, i, j, k, sec, flag;
^1da177e4c3f41 Linus Torvalds 2005-04-16 156 int no_mdrv = 0, drv_no, is_mirr;
1fe6dbf4d0afba Dave Jones 2010-01-04 157 u32 cnt;
463563fa745ac7 Christoph Hellwig 2018-12-12 158 dma_addr_t paddr;
^1da177e4c3f41 Linus Torvalds 2005-04-16 159 int rc = -ENOMEM;
^1da177e4c3f41 Linus Torvalds 2005-04-16 160
^1da177e4c3f41 Linus Torvalds 2005-04-16 161 gdth_cmd_str *gdtcmd;
^1da177e4c3f41 Linus Torvalds 2005-04-16 162 gdth_evt_str *estr;
345ebae7d0586d Arnd Bergmann 2017-07-14 163 char hrec[277];
^1da177e4c3f41 Linus Torvalds 2005-04-16 164
^1da177e4c3f41 Linus Torvalds 2005-04-16 165 char *buf;
^1da177e4c3f41 Linus Torvalds 2005-04-16 166 gdth_dskstat_str *pds;
^1da177e4c3f41 Linus Torvalds 2005-04-16 167 gdth_diskinfo_str *pdi;
^1da177e4c3f41 Linus Torvalds 2005-04-16 168 gdth_arrayinf_str *pai;
^1da177e4c3f41 Linus Torvalds 2005-04-16 169 gdth_defcnt_str *pdef;
^1da177e4c3f41 Linus Torvalds 2005-04-16 170 gdth_cdrinfo_str *pcdi;
^1da177e4c3f41 Linus Torvalds 2005-04-16 171 gdth_hget_str *phg;
^1da177e4c3f41 Linus Torvalds 2005-04-16 172 char cmnd[MAX_COMMAND_SIZE];
^1da177e4c3f41 Linus Torvalds 2005-04-16 173
^1da177e4c3f41 Linus Torvalds 2005-04-16 174 gdtcmd = kmalloc(sizeof(*gdtcmd), GFP_KERNEL);
^1da177e4c3f41 Linus Torvalds 2005-04-16 175 estr = kmalloc(sizeof(*estr), GFP_KERNEL);
^1da177e4c3f41 Linus Torvalds 2005-04-16 176 if (!gdtcmd || !estr)
^1da177e4c3f41 Linus Torvalds 2005-04-16 177 goto free_fail;
^1da177e4c3f41 Linus Torvalds 2005-04-16 178
^1da177e4c3f41 Linus Torvalds 2005-04-16 179 memset(cmnd, 0xff, 12);
^1da177e4c3f41 Linus Torvalds 2005-04-16 180 memset(gdtcmd, 0, sizeof(gdth_cmd_str));
^1da177e4c3f41 Linus Torvalds 2005-04-16 181
45f1a41b2b2e02 Boaz Harrosh 2007-10-02 182 TRACE2(("gdth_get_info() ha %d\n",ha->hanum));
^1da177e4c3f41 Linus Torvalds 2005-04-16 183
^1da177e4c3f41 Linus Torvalds 2005-04-16 184
^1da177e4c3f41 Linus Torvalds 2005-04-16 185 /* request is i.e. "cat /proc/scsi/gdth/0" */
^1da177e4c3f41 Linus Torvalds 2005-04-16 186 /* format: %-15s\t%-10s\t%-15s\t%s */
^1da177e4c3f41 Linus Torvalds 2005-04-16 187 /* driver parameters */
91c40f24faadd9 Rasmus Villemoes 2014-12-03 188 seq_puts(m, "Driver Parameters:\n");
^1da177e4c3f41 Linus Torvalds 2005-04-16 189 if (reserve_list[0] == 0xff)
^1da177e4c3f41 Linus Torvalds 2005-04-16 190 strcpy(hrec, "--");
^1da177e4c3f41 Linus Torvalds 2005-04-16 191 else {
238ddbb98c327a Alan Cox 2009-06-09 192 hlen = sprintf(hrec, "%d", reserve_list[0]);
^1da177e4c3f41 Linus Torvalds 2005-04-16 193 for (i = 1; i < MAX_RES_ARGS; i++) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 194 if (reserve_list[i] == 0xff)
^1da177e4c3f41 Linus Torvalds 2005-04-16 195 break;
473e554d656eb6 Takashi Iwai 2020-03-15 196 hlen += scnprintf(hrec + hlen, 161 - hlen, ",%d", reserve_list[i]);
^1da177e4c3f41 Linus Torvalds 2005-04-16 197 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 198 }
3e0552eebdf621 Al Viro 2013-03-31 199 seq_printf(m,
^1da177e4c3f41 Linus Torvalds 2005-04-16 200 " reserve_mode: \t%d \treserve_list: \t%s\n",
^1da177e4c3f41 Linus Torvalds 2005-04-16 201 reserve_mode, hrec);
3e0552eebdf621 Al Viro 2013-03-31 202 seq_printf(m,
^1da177e4c3f41 Linus Torvalds 2005-04-16 203 " max_ids: \t%-3d \thdr_channel: \t%d\n",
^1da177e4c3f41 Linus Torvalds 2005-04-16 204 max_ids, hdr_channel);
^1da177e4c3f41 Linus Torvalds 2005-04-16 205
^1da177e4c3f41 Linus Torvalds 2005-04-16 206 /* controller information */
91c40f24faadd9 Rasmus Villemoes 2014-12-03 207 seq_puts(m, "\nDisk Array Controller Information:\n");
3e0552eebdf621 Al Viro 2013-03-31 208 seq_printf(m,
^1da177e4c3f41 Linus Torvalds 2005-04-16 209 " Number: \t%d \tName: \t%s\n",
3e0552eebdf621 Al Viro 2013-03-31 210 ha->hanum, ha->binfo.type_string);
^1da177e4c3f41 Linus Torvalds 2005-04-16 211
3e0552eebdf621 Al Viro 2013-03-31 212 seq_printf(m,
3e0552eebdf621 Al Viro 2013-03-31 213 " Driver Ver.: \t%-10s\tFirmware Ver.: \t",
3e0552eebdf621 Al Viro 2013-03-31 214 GDTH_VERSION_STR);
^1da177e4c3f41 Linus Torvalds 2005-04-16 215 if (ha->more_proc)
3e0552eebdf621 Al Viro 2013-03-31 216 seq_printf(m, "%d.%02d.%02d-%c%03X\n",
1fe6dbf4d0afba Dave Jones 2010-01-04 217 (u8)(ha->binfo.upd_fw_ver>>24),
1fe6dbf4d0afba Dave Jones 2010-01-04 218 (u8)(ha->binfo.upd_fw_ver>>16),
1fe6dbf4d0afba Dave Jones 2010-01-04 219 (u8)(ha->binfo.upd_fw_ver),
^1da177e4c3f41 Linus Torvalds 2005-04-16 220 ha->bfeat.raid ? 'R':'N',
^1da177e4c3f41 Linus Torvalds 2005-04-16 221 ha->binfo.upd_revision);
^1da177e4c3f41 Linus Torvalds 2005-04-16 222 else
3e0552eebdf621 Al Viro 2013-03-31 223 seq_printf(m, "%d.%02d\n", (u8)(ha->cpar.version>>8),
1fe6dbf4d0afba Dave Jones 2010-01-04 224 (u8)(ha->cpar.version));
^1da177e4c3f41 Linus Torvalds 2005-04-16 225
3e0552eebdf621 Al Viro 2013-03-31 226 if (ha->more_proc)
^1da177e4c3f41 Linus Torvalds 2005-04-16 227 /* more information: 1. about controller */
3e0552eebdf621 Al Viro 2013-03-31 228 seq_printf(m,
^1da177e4c3f41 Linus Torvalds 2005-04-16 229 " Serial No.: \t0x%8X\tCache RAM size:\t%d KB\n",
^1da177e4c3f41 Linus Torvalds 2005-04-16 230 ha->binfo.ser_no, ha->binfo.memsize / 1024);
^1da177e4c3f41 Linus Torvalds 2005-04-16 231
^1da177e4c3f41 Linus Torvalds 2005-04-16 232 if (ha->more_proc) {
8d22022c3a5631 Christoph Hellwig 2018-12-12 233 size_t size = max_t(size_t, GDTH_SCRATCH, sizeof(gdth_hget_str));
8d22022c3a5631 Christoph Hellwig 2018-12-12 234
^1da177e4c3f41 Linus Torvalds 2005-04-16 235 /* more information: 2. about physical devices */
91c40f24faadd9 Rasmus Villemoes 2014-12-03 236 seq_puts(m, "\nPhysical Devices:");
^1da177e4c3f41 Linus Torvalds 2005-04-16 237 flag = FALSE;
^1da177e4c3f41 Linus Torvalds 2005-04-16 238
bb327df8326eff Christoph Hellwig 2018-12-12 239 buf = dma_alloc_coherent(&ha->pdev->dev, size, &paddr, GFP_KERNEL);
^1da177e4c3f41 Linus Torvalds 2005-04-16 240 if (!buf)
^1da177e4c3f41 Linus Torvalds 2005-04-16 241 goto stop_output;
^1da177e4c3f41 Linus Torvalds 2005-04-16 242 for (i = 0; i < ha->bus_cnt; ++i) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 243 /* 2.a statistics (and retries/reassigns) */
^1da177e4c3f41 Linus Torvalds 2005-04-16 244 TRACE2(("pdr_statistics() chn %d\n",i));
^1da177e4c3f41 Linus Torvalds 2005-04-16 245 pds = (gdth_dskstat_str *)(buf + GDTH_SCRATCH/4);
^1da177e4c3f41 Linus Torvalds 2005-04-16 246 gdtcmd->Service = CACHESERVICE;
^1da177e4c3f41 Linus Torvalds 2005-04-16 247 gdtcmd->OpCode = GDT_IOCTL;
^1da177e4c3f41 Linus Torvalds 2005-04-16 248 gdtcmd->u.ioctl.p_param = paddr + GDTH_SCRATCH/4;
^1da177e4c3f41 Linus Torvalds 2005-04-16 @249 gdtcmd->u.ioctl.param_size = 3*GDTH_SCRATCH/4;
^1da177e4c3f41 Linus Torvalds 2005-04-16 250 gdtcmd->u.ioctl.subfunc = DSK_STATISTICS | L_CTRL_PATTERN;
^1da177e4c3f41 Linus Torvalds 2005-04-16 251 gdtcmd->u.ioctl.channel = ha->raw[i].address | INVALID_CHANNEL;
^1da177e4c3f41 Linus Torvalds 2005-04-16 252 pds->bid = ha->raw[i].local_no;
^1da177e4c3f41 Linus Torvalds 2005-04-16 253 pds->first = 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16 254 pds->entries = ha->raw[i].pdev_cnt;
1fe6dbf4d0afba Dave Jones 2010-01-04 255 cnt = (3*GDTH_SCRATCH/4 - 5 * sizeof(u32)) /
^1da177e4c3f41 Linus Torvalds 2005-04-16 256 sizeof(pds->list[0]);
^1da177e4c3f41 Linus Torvalds 2005-04-16 257 if (pds->entries > cnt)
^1da177e4c3f41 Linus Torvalds 2005-04-16 258 pds->entries = cnt;
cbd5f69b98bb5d Leubner, Achim 2006-06-09 259
cbd5f69b98bb5d Leubner, Achim 2006-06-09 260 if (gdth_execute(host, gdtcmd, cmnd, 30, NULL) != S_OK)
^1da177e4c3f41 Linus Torvalds 2005-04-16 261 pds->count = 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16 262
^1da177e4c3f41 Linus Torvalds 2005-04-16 263 /* other IOCTLs must fit into area GDTH_SCRATCH/4 */
^1da177e4c3f41 Linus Torvalds 2005-04-16 264 for (j = 0; j < ha->raw[i].pdev_cnt; ++j) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 265 /* 2.b drive info */
^1da177e4c3f41 Linus Torvalds 2005-04-16 266 TRACE2(("scsi_drv_info() chn %d dev %d\n",
^1da177e4c3f41 Linus Torvalds 2005-04-16 267 i, ha->raw[i].id_list[j]));
^1da177e4c3f41 Linus Torvalds 2005-04-16 268 pdi = (gdth_diskinfo_str *)buf;
^1da177e4c3f41 Linus Torvalds 2005-04-16 269 gdtcmd->Service = CACHESERVICE;
^1da177e4c3f41 Linus Torvalds 2005-04-16 270 gdtcmd->OpCode = GDT_IOCTL;
^1da177e4c3f41 Linus Torvalds 2005-04-16 271 gdtcmd->u.ioctl.p_param = paddr;
^1da177e4c3f41 Linus Torvalds 2005-04-16 272 gdtcmd->u.ioctl.param_size = sizeof(gdth_diskinfo_str);
^1da177e4c3f41 Linus Torvalds 2005-04-16 273 gdtcmd->u.ioctl.subfunc = SCSI_DR_INFO | L_CTRL_PATTERN;
^1da177e4c3f41 Linus Torvalds 2005-04-16 274 gdtcmd->u.ioctl.channel =
^1da177e4c3f41 Linus Torvalds 2005-04-16 275 ha->raw[i].address | ha->raw[i].id_list[j];
cbd5f69b98bb5d Leubner, Achim 2006-06-09 276
cbd5f69b98bb5d Leubner, Achim 2006-06-09 277 if (gdth_execute(host, gdtcmd, cmnd, 30, NULL) == S_OK) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 278 strncpy(hrec,pdi->vendor,8);
^1da177e4c3f41 Linus Torvalds 2005-04-16 279 strncpy(hrec+8,pdi->product,16);
^1da177e4c3f41 Linus Torvalds 2005-04-16 280 strncpy(hrec+24,pdi->revision,4);
^1da177e4c3f41 Linus Torvalds 2005-04-16 281 hrec[28] = 0;
3e0552eebdf621 Al Viro 2013-03-31 282 seq_printf(m,
^1da177e4c3f41 Linus Torvalds 2005-04-16 283 "\n Chn/ID/LUN: \t%c/%02d/%d \tName: \t%s\n",
^1da177e4c3f41 Linus Torvalds 2005-04-16 284 'A'+i,pdi->target_id,pdi->lun,hrec);
^1da177e4c3f41 Linus Torvalds 2005-04-16 285 flag = TRUE;
^1da177e4c3f41 Linus Torvalds 2005-04-16 286 pdi->no_ldrive &= 0xffff;
^1da177e4c3f41 Linus Torvalds 2005-04-16 287 if (pdi->no_ldrive == 0xffff)
^1da177e4c3f41 Linus Torvalds 2005-04-16 288 strcpy(hrec,"--");
^1da177e4c3f41 Linus Torvalds 2005-04-16 289 else
^1da177e4c3f41 Linus Torvalds 2005-04-16 290 sprintf(hrec,"%d",pdi->no_ldrive);
3e0552eebdf621 Al Viro 2013-03-31 291 seq_printf(m,
^1da177e4c3f41 Linus Torvalds 2005-04-16 292 " Capacity [MB]:\t%-6d \tTo Log. Drive: \t%s\n",
^1da177e4c3f41 Linus Torvalds 2005-04-16 293 pdi->blkcnt/(1024*1024/pdi->blksize),
^1da177e4c3f41 Linus Torvalds 2005-04-16 294 hrec);
^1da177e4c3f41 Linus Torvalds 2005-04-16 295 } else {
^1da177e4c3f41 Linus Torvalds 2005-04-16 296 pdi->devtype = 0xff;
^1da177e4c3f41 Linus Torvalds 2005-04-16 297 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 298
^1da177e4c3f41 Linus Torvalds 2005-04-16 299 if (pdi->devtype == 0) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 300 /* search retries/reassigns */
^1da177e4c3f41 Linus Torvalds 2005-04-16 301 for (k = 0; k < pds->count; ++k) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 302 if (pds->list[k].tid == pdi->target_id &&
^1da177e4c3f41 Linus Torvalds 2005-04-16 303 pds->list[k].lun == pdi->lun) {
3e0552eebdf621 Al Viro 2013-03-31 304 seq_printf(m,
^1da177e4c3f41 Linus Torvalds 2005-04-16 305 " Retries: \t%-6d \tReassigns: \t%d\n",
^1da177e4c3f41 Linus Torvalds 2005-04-16 306 pds->list[k].retries,
^1da177e4c3f41 Linus Torvalds 2005-04-16 307 pds->list[k].reassigns);
^1da177e4c3f41 Linus Torvalds 2005-04-16 308 break;
^1da177e4c3f41 Linus Torvalds 2005-04-16 309 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 310 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 311 /* 2.c grown defects */
^1da177e4c3f41 Linus Torvalds 2005-04-16 312 TRACE2(("scsi_drv_defcnt() chn %d dev %d\n",
^1da177e4c3f41 Linus Torvalds 2005-04-16 313 i, ha->raw[i].id_list[j]));
^1da177e4c3f41 Linus Torvalds 2005-04-16 314 pdef = (gdth_defcnt_str *)buf;
^1da177e4c3f41 Linus Torvalds 2005-04-16 315 gdtcmd->Service = CACHESERVICE;
^1da177e4c3f41 Linus Torvalds 2005-04-16 316 gdtcmd->OpCode = GDT_IOCTL;
^1da177e4c3f41 Linus Torvalds 2005-04-16 317 gdtcmd->u.ioctl.p_param = paddr;
^1da177e4c3f41 Linus Torvalds 2005-04-16 318 gdtcmd->u.ioctl.param_size = sizeof(gdth_defcnt_str);
^1da177e4c3f41 Linus Torvalds 2005-04-16 319 gdtcmd->u.ioctl.subfunc = SCSI_DEF_CNT | L_CTRL_PATTERN;
^1da177e4c3f41 Linus Torvalds 2005-04-16 320 gdtcmd->u.ioctl.channel =
^1da177e4c3f41 Linus Torvalds 2005-04-16 321 ha->raw[i].address | ha->raw[i].id_list[j];
^1da177e4c3f41 Linus Torvalds 2005-04-16 322 pdef->sddc_type = 0x08;
cbd5f69b98bb5d Leubner, Achim 2006-06-09 323
cbd5f69b98bb5d Leubner, Achim 2006-06-09 324 if (gdth_execute(host, gdtcmd, cmnd, 30, NULL) == S_OK) {
3e0552eebdf621 Al Viro 2013-03-31 325 seq_printf(m,
^1da177e4c3f41 Linus Torvalds 2005-04-16 326 " Grown Defects:\t%d\n",
^1da177e4c3f41 Linus Torvalds 2005-04-16 327 pdef->sddc_cnt);
^1da177e4c3f41 Linus Torvalds 2005-04-16 328 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 329 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 330 }
5c10007560589a Julia Lawall 2010-12-29 331 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 332
3e0552eebdf621 Al Viro 2013-03-31 333 if (!flag)
91c40f24faadd9 Rasmus Villemoes 2014-12-03 334 seq_puts(m, "\n --\n");
^1da177e4c3f41 Linus Torvalds 2005-04-16 335
^1da177e4c3f41 Linus Torvalds 2005-04-16 336 /* 3. about logical drives */
91c40f24faadd9 Rasmus Villemoes 2014-12-03 337 seq_puts(m, "\nLogical Drives:");
^1da177e4c3f41 Linus Torvalds 2005-04-16 338 flag = FALSE;
^1da177e4c3f41 Linus Torvalds 2005-04-16 339
^1da177e4c3f41 Linus Torvalds 2005-04-16 340 for (i = 0; i < MAX_LDRIVES; ++i) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 341 if (!ha->hdr[i].is_logdrv)
^1da177e4c3f41 Linus Torvalds 2005-04-16 342 continue;
^1da177e4c3f41 Linus Torvalds 2005-04-16 343 drv_no = i;
^1da177e4c3f41 Linus Torvalds 2005-04-16 344 j = k = 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16 345 is_mirr = FALSE;
^1da177e4c3f41 Linus Torvalds 2005-04-16 346 do {
^1da177e4c3f41 Linus Torvalds 2005-04-16 347 /* 3.a log. drive info */
^1da177e4c3f41 Linus Torvalds 2005-04-16 348 TRACE2(("cache_drv_info() drive no %d\n",drv_no));
^1da177e4c3f41 Linus Torvalds 2005-04-16 349 pcdi = (gdth_cdrinfo_str *)buf;
^1da177e4c3f41 Linus Torvalds 2005-04-16 350 gdtcmd->Service = CACHESERVICE;
^1da177e4c3f41 Linus Torvalds 2005-04-16 351 gdtcmd->OpCode = GDT_IOCTL;
^1da177e4c3f41 Linus Torvalds 2005-04-16 352 gdtcmd->u.ioctl.p_param = paddr;
^1da177e4c3f41 Linus Torvalds 2005-04-16 353 gdtcmd->u.ioctl.param_size = sizeof(gdth_cdrinfo_str);
^1da177e4c3f41 Linus Torvalds 2005-04-16 354 gdtcmd->u.ioctl.subfunc = CACHE_DRV_INFO;
^1da177e4c3f41 Linus Torvalds 2005-04-16 355 gdtcmd->u.ioctl.channel = drv_no;
cbd5f69b98bb5d Leubner, Achim 2006-06-09 356 if (gdth_execute(host, gdtcmd, cmnd, 30, NULL) != S_OK)
^1da177e4c3f41 Linus Torvalds 2005-04-16 357 break;
^1da177e4c3f41 Linus Torvalds 2005-04-16 358 pcdi->ld_dtype >>= 16;
^1da177e4c3f41 Linus Torvalds 2005-04-16 359 j++;
^1da177e4c3f41 Linus Torvalds 2005-04-16 360 if (pcdi->ld_dtype > 2) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 361 strcpy(hrec, "missing");
^1da177e4c3f41 Linus Torvalds 2005-04-16 362 } else if (pcdi->ld_error & 1) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 363 strcpy(hrec, "fault");
^1da177e4c3f41 Linus Torvalds 2005-04-16 364 } else if (pcdi->ld_error & 2) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 365 strcpy(hrec, "invalid");
^1da177e4c3f41 Linus Torvalds 2005-04-16 366 k++; j--;
^1da177e4c3f41 Linus Torvalds 2005-04-16 367 } else {
^1da177e4c3f41 Linus Torvalds 2005-04-16 368 strcpy(hrec, "ok");
^1da177e4c3f41 Linus Torvalds 2005-04-16 369 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 370
^1da177e4c3f41 Linus Torvalds 2005-04-16 371 if (drv_no == i) {
3e0552eebdf621 Al Viro 2013-03-31 372 seq_printf(m,
^1da177e4c3f41 Linus Torvalds 2005-04-16 373 "\n Number: \t%-2d \tStatus: \t%s\n",
^1da177e4c3f41 Linus Torvalds 2005-04-16 374 drv_no, hrec);
^1da177e4c3f41 Linus Torvalds 2005-04-16 375 flag = TRUE;
^1da177e4c3f41 Linus Torvalds 2005-04-16 376 no_mdrv = pcdi->cd_ldcnt;
^1da177e4c3f41 Linus Torvalds 2005-04-16 377 if (no_mdrv > 1 || pcdi->ld_slave != -1) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 378 is_mirr = TRUE;
^1da177e4c3f41 Linus Torvalds 2005-04-16 379 strcpy(hrec, "RAID-1");
^1da177e4c3f41 Linus Torvalds 2005-04-16 380 } else if (pcdi->ld_dtype == 0) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 381 strcpy(hrec, "Disk");
^1da177e4c3f41 Linus Torvalds 2005-04-16 382 } else if (pcdi->ld_dtype == 1) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 383 strcpy(hrec, "RAID-0");
^1da177e4c3f41 Linus Torvalds 2005-04-16 384 } else if (pcdi->ld_dtype == 2) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 385 strcpy(hrec, "Chain");
^1da177e4c3f41 Linus Torvalds 2005-04-16 386 } else {
^1da177e4c3f41 Linus Torvalds 2005-04-16 387 strcpy(hrec, "???");
^1da177e4c3f41 Linus Torvalds 2005-04-16 388 }
3e0552eebdf621 Al Viro 2013-03-31 389 seq_printf(m,
^1da177e4c3f41 Linus Torvalds 2005-04-16 390 " Capacity [MB]:\t%-6d \tType: \t%s\n",
^1da177e4c3f41 Linus Torvalds 2005-04-16 391 pcdi->ld_blkcnt/(1024*1024/pcdi->ld_blksize),
^1da177e4c3f41 Linus Torvalds 2005-04-16 392 hrec);
^1da177e4c3f41 Linus Torvalds 2005-04-16 393 } else {
3e0552eebdf621 Al Viro 2013-03-31 394 seq_printf(m,
^1da177e4c3f41 Linus Torvalds 2005-04-16 395 " Slave Number: \t%-2d \tStatus: \t%s\n",
^1da177e4c3f41 Linus Torvalds 2005-04-16 396 drv_no & 0x7fff, hrec);
^1da177e4c3f41 Linus Torvalds 2005-04-16 397 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 398 drv_no = pcdi->ld_slave;
^1da177e4c3f41 Linus Torvalds 2005-04-16 399 } while (drv_no != -1);
^1da177e4c3f41 Linus Torvalds 2005-04-16 400
3e0552eebdf621 Al Viro 2013-03-31 401 if (is_mirr)
3e0552eebdf621 Al Viro 2013-03-31 402 seq_printf(m,
^1da177e4c3f41 Linus Torvalds 2005-04-16 403 " Missing Drv.: \t%-2d \tInvalid Drv.: \t%d\n",
^1da177e4c3f41 Linus Torvalds 2005-04-16 404 no_mdrv - j - k, k);
^1da177e4c3f41 Linus Torvalds 2005-04-16 405
^1da177e4c3f41 Linus Torvalds 2005-04-16 406 if (!ha->hdr[i].is_arraydrv)
^1da177e4c3f41 Linus Torvalds 2005-04-16 407 strcpy(hrec, "--");
^1da177e4c3f41 Linus Torvalds 2005-04-16 408 else
^1da177e4c3f41 Linus Torvalds 2005-04-16 409 sprintf(hrec, "%d", ha->hdr[i].master_no);
3e0552eebdf621 Al Viro 2013-03-31 410 seq_printf(m,
^1da177e4c3f41 Linus Torvalds 2005-04-16 411 " To Array Drv.:\t%s\n", hrec);
5c10007560589a Julia Lawall 2010-12-29 412 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 413
3e0552eebdf621 Al Viro 2013-03-31 414 if (!flag)
91c40f24faadd9 Rasmus Villemoes 2014-12-03 415 seq_puts(m, "\n --\n");
^1da177e4c3f41 Linus Torvalds 2005-04-16 416
^1da177e4c3f41 Linus Torvalds 2005-04-16 417 /* 4. about array drives */
91c40f24faadd9 Rasmus Villemoes 2014-12-03 418 seq_puts(m, "\nArray Drives:");
^1da177e4c3f41 Linus Torvalds 2005-04-16 419 flag = FALSE;
^1da177e4c3f41 Linus Torvalds 2005-04-16 420
^1da177e4c3f41 Linus Torvalds 2005-04-16 421 for (i = 0; i < MAX_LDRIVES; ++i) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 422 if (!(ha->hdr[i].is_arraydrv && ha->hdr[i].is_master))
^1da177e4c3f41 Linus Torvalds 2005-04-16 423 continue;
^1da177e4c3f41 Linus Torvalds 2005-04-16 424 /* 4.a array drive info */
^1da177e4c3f41 Linus Torvalds 2005-04-16 425 TRACE2(("array_info() drive no %d\n",i));
^1da177e4c3f41 Linus Torvalds 2005-04-16 426 pai = (gdth_arrayinf_str *)buf;
^1da177e4c3f41 Linus Torvalds 2005-04-16 427 gdtcmd->Service = CACHESERVICE;
^1da177e4c3f41 Linus Torvalds 2005-04-16 428 gdtcmd->OpCode = GDT_IOCTL;
^1da177e4c3f41 Linus Torvalds 2005-04-16 429 gdtcmd->u.ioctl.p_param = paddr;
^1da177e4c3f41 Linus Torvalds 2005-04-16 430 gdtcmd->u.ioctl.param_size = sizeof(gdth_arrayinf_str);
^1da177e4c3f41 Linus Torvalds 2005-04-16 431 gdtcmd->u.ioctl.subfunc = ARRAY_INFO | LA_CTRL_PATTERN;
^1da177e4c3f41 Linus Torvalds 2005-04-16 432 gdtcmd->u.ioctl.channel = i;
cbd5f69b98bb5d Leubner, Achim 2006-06-09 433 if (gdth_execute(host, gdtcmd, cmnd, 30, NULL) == S_OK) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 434 if (pai->ai_state == 0)
^1da177e4c3f41 Linus Torvalds 2005-04-16 435 strcpy(hrec, "idle");
^1da177e4c3f41 Linus Torvalds 2005-04-16 436 else if (pai->ai_state == 2)
^1da177e4c3f41 Linus Torvalds 2005-04-16 437 strcpy(hrec, "build");
^1da177e4c3f41 Linus Torvalds 2005-04-16 438 else if (pai->ai_state == 4)
^1da177e4c3f41 Linus Torvalds 2005-04-16 439 strcpy(hrec, "ready");
^1da177e4c3f41 Linus Torvalds 2005-04-16 440 else if (pai->ai_state == 6)
^1da177e4c3f41 Linus Torvalds 2005-04-16 441 strcpy(hrec, "fail");
^1da177e4c3f41 Linus Torvalds 2005-04-16 442 else if (pai->ai_state == 8 || pai->ai_state == 10)
^1da177e4c3f41 Linus Torvalds 2005-04-16 443 strcpy(hrec, "rebuild");
^1da177e4c3f41 Linus Torvalds 2005-04-16 444 else
^1da177e4c3f41 Linus Torvalds 2005-04-16 445 strcpy(hrec, "error");
^1da177e4c3f41 Linus Torvalds 2005-04-16 446 if (pai->ai_ext_state & 0x10)
^1da177e4c3f41 Linus Torvalds 2005-04-16 447 strcat(hrec, "/expand");
^1da177e4c3f41 Linus Torvalds 2005-04-16 448 else if (pai->ai_ext_state & 0x1)
^1da177e4c3f41 Linus Torvalds 2005-04-16 449 strcat(hrec, "/patch");
3e0552eebdf621 Al Viro 2013-03-31 450 seq_printf(m,
^1da177e4c3f41 Linus Torvalds 2005-04-16 451 "\n Number: \t%-2d \tStatus: \t%s\n",
^1da177e4c3f41 Linus Torvalds 2005-04-16 452 i,hrec);
^1da177e4c3f41 Linus Torvalds 2005-04-16 453 flag = TRUE;
^1da177e4c3f41 Linus Torvalds 2005-04-16 454
^1da177e4c3f41 Linus Torvalds 2005-04-16 455 if (pai->ai_type == 0)
^1da177e4c3f41 Linus Torvalds 2005-04-16 456 strcpy(hrec, "RAID-0");
^1da177e4c3f41 Linus Torvalds 2005-04-16 457 else if (pai->ai_type == 4)
^1da177e4c3f41 Linus Torvalds 2005-04-16 458 strcpy(hrec, "RAID-4");
^1da177e4c3f41 Linus Torvalds 2005-04-16 459 else if (pai->ai_type == 5)
^1da177e4c3f41 Linus Torvalds 2005-04-16 460 strcpy(hrec, "RAID-5");
^1da177e4c3f41 Linus Torvalds 2005-04-16 461 else
^1da177e4c3f41 Linus Torvalds 2005-04-16 462 strcpy(hrec, "RAID-10");
3e0552eebdf621 Al Viro 2013-03-31 463 seq_printf(m,
^1da177e4c3f41 Linus Torvalds 2005-04-16 464 " Capacity [MB]:\t%-6d \tType: \t%s\n",
^1da177e4c3f41 Linus Torvalds 2005-04-16 465 pai->ai_size/(1024*1024/pai->ai_secsize),
^1da177e4c3f41 Linus Torvalds 2005-04-16 466 hrec);
^1da177e4c3f41 Linus Torvalds 2005-04-16 467 }
5c10007560589a Julia Lawall 2010-12-29 468 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 469
3e0552eebdf621 Al Viro 2013-03-31 470 if (!flag)
91c40f24faadd9 Rasmus Villemoes 2014-12-03 471 seq_puts(m, "\n --\n");
^1da177e4c3f41 Linus Torvalds 2005-04-16 472
^1da177e4c3f41 Linus Torvalds 2005-04-16 473 /* 5. about host drives */
91c40f24faadd9 Rasmus Villemoes 2014-12-03 474 seq_puts(m, "\nHost Drives:");
^1da177e4c3f41 Linus Torvalds 2005-04-16 475 flag = FALSE;
^1da177e4c3f41 Linus Torvalds 2005-04-16 476
^1da177e4c3f41 Linus Torvalds 2005-04-16 477 for (i = 0; i < MAX_LDRIVES; ++i) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 478 if (!ha->hdr[i].is_logdrv ||
^1da177e4c3f41 Linus Torvalds 2005-04-16 479 (ha->hdr[i].is_arraydrv && !ha->hdr[i].is_master))
^1da177e4c3f41 Linus Torvalds 2005-04-16 480 continue;
^1da177e4c3f41 Linus Torvalds 2005-04-16 481 /* 5.a get host drive list */
^1da177e4c3f41 Linus Torvalds 2005-04-16 482 TRACE2(("host_get() drv_no %d\n",i));
^1da177e4c3f41 Linus Torvalds 2005-04-16 483 phg = (gdth_hget_str *)buf;
^1da177e4c3f41 Linus Torvalds 2005-04-16 484 gdtcmd->Service = CACHESERVICE;
^1da177e4c3f41 Linus Torvalds 2005-04-16 485 gdtcmd->OpCode = GDT_IOCTL;
^1da177e4c3f41 Linus Torvalds 2005-04-16 486 gdtcmd->u.ioctl.p_param = paddr;
^1da177e4c3f41 Linus Torvalds 2005-04-16 487 gdtcmd->u.ioctl.param_size = sizeof(gdth_hget_str);
^1da177e4c3f41 Linus Torvalds 2005-04-16 488 gdtcmd->u.ioctl.subfunc = HOST_GET | LA_CTRL_PATTERN;
^1da177e4c3f41 Linus Torvalds 2005-04-16 489 gdtcmd->u.ioctl.channel = i;
^1da177e4c3f41 Linus Torvalds 2005-04-16 490 phg->entries = MAX_HDRIVES;
^1da177e4c3f41 Linus Torvalds 2005-04-16 491 phg->offset = GDTOFFSOF(gdth_hget_str, entry[0]);
cbd5f69b98bb5d Leubner, Achim 2006-06-09 492 if (gdth_execute(host, gdtcmd, cmnd, 30, NULL) == S_OK) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 493 ha->hdr[i].ldr_no = i;
^1da177e4c3f41 Linus Torvalds 2005-04-16 494 ha->hdr[i].rw_attribs = 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16 495 ha->hdr[i].start_sec = 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16 496 } else {
^1da177e4c3f41 Linus Torvalds 2005-04-16 497 for (j = 0; j < phg->entries; ++j) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 498 k = phg->entry[j].host_drive;
^1da177e4c3f41 Linus Torvalds 2005-04-16 499 if (k >= MAX_LDRIVES)
^1da177e4c3f41 Linus Torvalds 2005-04-16 500 continue;
^1da177e4c3f41 Linus Torvalds 2005-04-16 501 ha->hdr[k].ldr_no = phg->entry[j].log_drive;
^1da177e4c3f41 Linus Torvalds 2005-04-16 502 ha->hdr[k].rw_attribs = phg->entry[j].rw_attribs;
^1da177e4c3f41 Linus Torvalds 2005-04-16 503 ha->hdr[k].start_sec = phg->entry[j].start_sec;
^1da177e4c3f41 Linus Torvalds 2005-04-16 504 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 505 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 506 }
bb327df8326eff Christoph Hellwig 2018-12-12 507 dma_free_coherent(&ha->pdev->dev, size, buf, paddr);
^1da177e4c3f41 Linus Torvalds 2005-04-16 508
^1da177e4c3f41 Linus Torvalds 2005-04-16 509 for (i = 0; i < MAX_HDRIVES; ++i) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 510 if (!(ha->hdr[i].present))
^1da177e4c3f41 Linus Torvalds 2005-04-16 511 continue;
^1da177e4c3f41 Linus Torvalds 2005-04-16 512
3e0552eebdf621 Al Viro 2013-03-31 513 seq_printf(m,
^1da177e4c3f41 Linus Torvalds 2005-04-16 514 "\n Number: \t%-2d \tArr/Log. Drive:\t%d\n",
^1da177e4c3f41 Linus Torvalds 2005-04-16 515 i, ha->hdr[i].ldr_no);
^1da177e4c3f41 Linus Torvalds 2005-04-16 516 flag = TRUE;
^1da177e4c3f41 Linus Torvalds 2005-04-16 517
3e0552eebdf621 Al Viro 2013-03-31 518 seq_printf(m,
^1da177e4c3f41 Linus Torvalds 2005-04-16 519 " Capacity [MB]:\t%-6d \tStart Sector: \t%d\n",
1fe6dbf4d0afba Dave Jones 2010-01-04 520 (u32)(ha->hdr[i].size/2048), ha->hdr[i].start_sec);
^1da177e4c3f41 Linus Torvalds 2005-04-16 521 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 522
3e0552eebdf621 Al Viro 2013-03-31 523 if (!flag)
91c40f24faadd9 Rasmus Villemoes 2014-12-03 524 seq_puts(m, "\n --\n");
^1da177e4c3f41 Linus Torvalds 2005-04-16 525 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 526
^1da177e4c3f41 Linus Torvalds 2005-04-16 527 /* controller events */
91c40f24faadd9 Rasmus Villemoes 2014-12-03 528 seq_puts(m, "\nController Events:\n");
^1da177e4c3f41 Linus Torvalds 2005-04-16 529
^1da177e4c3f41 Linus Torvalds 2005-04-16 530 for (id = -1;;) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 531 id = gdth_read_event(ha, id, estr);
^1da177e4c3f41 Linus Torvalds 2005-04-16 532 if (estr->event_source == 0)
^1da177e4c3f41 Linus Torvalds 2005-04-16 533 break;
45f1a41b2b2e02 Boaz Harrosh 2007-10-02 534 if (estr->event_data.eu.driver.ionode == ha->hanum &&
^1da177e4c3f41 Linus Torvalds 2005-04-16 535 estr->event_source == ES_ASYNC) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 536 gdth_log_event(&estr->event_data, hrec);
5a412c38bb5bb6 Alison Schofield 2016-02-17 537
5a412c38bb5bb6 Alison Schofield 2016-02-17 538 /*
5a412c38bb5bb6 Alison Schofield 2016-02-17 539 * Elapsed seconds subtraction with unsigned operands is
5a412c38bb5bb6 Alison Schofield 2016-02-17 540 * safe from wrap around in year 2106. Executes as:
5a412c38bb5bb6 Alison Schofield 2016-02-17 541 * operand a + (2's complement operand b) + 1
5a412c38bb5bb6 Alison Schofield 2016-02-17 542 */
5a412c38bb5bb6 Alison Schofield 2016-02-17 543
5a412c38bb5bb6 Alison Schofield 2016-02-17 544 sec = (int)((u32)ktime_get_real_seconds() - estr->first_stamp);
^1da177e4c3f41 Linus Torvalds 2005-04-16 545 if (sec < 0) sec = 0;
3e0552eebdf621 Al Viro 2013-03-31 546 seq_printf(m," date- %02d:%02d:%02d\t%s\n",
^1da177e4c3f41 Linus Torvalds 2005-04-16 547 sec/3600, sec%3600/60, sec%60, hrec);
^1da177e4c3f41 Linus Torvalds 2005-04-16 548 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 549 if (id == -1)
^1da177e4c3f41 Linus Torvalds 2005-04-16 550 break;
^1da177e4c3f41 Linus Torvalds 2005-04-16 551 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 552 stop_output:
3e0552eebdf621 Al Viro 2013-03-31 553 rc = 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16 554 free_fail:
^1da177e4c3f41 Linus Torvalds 2005-04-16 555 kfree(gdtcmd);
^1da177e4c3f41 Linus Torvalds 2005-04-16 556 kfree(estr);
^1da177e4c3f41 Linus Torvalds 2005-04-16 557 return rc;
^1da177e4c3f41 Linus Torvalds 2005-04-16 558 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 559

:::::: The code at line 249 was first introduced by commit
:::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2

:::::: TO: Linus Torvalds <torvalds@ppc970.osdl.org>
:::::: CC: Linus Torvalds <torvalds@ppc970.osdl.org>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[unhandled content-type:application/gzip]
\
 
 \ /
  Last update: 2021-02-04 12:03    [W:0.049 / U:4.688 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site