LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [hare-scsi-devel:eh-rework.v2 38/51] drivers/scsi/fnic/fnic_scsi.c:2209:21: warning: variable 'fnic_stats' set but not used
@ 2021-08-17 15:49 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-08-17 15:49 UTC (permalink / raw)
  To: Hannes Reinecke; +Cc: kbuild-all, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 20496 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/hare/scsi-devel.git eh-rework.v2
head:   7603e2e1f37e470064b8c865b5d6470137baa79b
commit: 77600d1b52ae78c329d2df9921dd4c42304ecf87 [38/51] fnic: use dedicated device reset command
config: i386-allyesconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
        # https://git.kernel.org/pub/scm/linux/kernel/git/hare/scsi-devel.git/commit/?id=77600d1b52ae78c329d2df9921dd4c42304ecf87
        git remote add hare-scsi-devel https://git.kernel.org/pub/scm/linux/kernel/git/hare/scsi-devel.git
        git fetch --no-tags hare-scsi-devel eh-rework.v2
        git checkout 77600d1b52ae78c329d2df9921dd4c42304ecf87
        # save the attached .config to linux build tree
        make W=1 ARCH=i386 

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 >>):

   drivers/scsi/fnic/fnic_scsi.c: In function 'fnic_device_reset':
>> drivers/scsi/fnic/fnic_scsi.c:2209:21: warning: variable 'fnic_stats' set but not used [-Wunused-but-set-variable]
    2209 |  struct fnic_stats *fnic_stats;
         |                     ^~~~~~~~~~


vim +/fnic_stats +2209 drivers/scsi/fnic/fnic_scsi.c

5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2190  
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2191  /*
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2192   * SCSI Eh thread issues a Lun Reset when one or more commands on a LUN
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2193   * fail to get aborted. It calls driver's eh_device_reset with a SCSI command
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2194   * on the LUN.
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2195   */
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2196  int fnic_device_reset(struct scsi_cmnd *sc)
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2197  {
77600d1b52ae78 Hannes Reinecke   2021-08-16  2198  	struct scsi_device *sdev = sc->device;
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2199  	struct fc_lport *lp;
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2200  	struct fnic *fnic;
4d7007b49d523d Hiral Patel       2013-02-12  2201  	struct fnic_io_req *io_req = NULL;
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2202  	struct fc_rport *rport;
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2203  	int status;
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2204  	int ret = FAILED;
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2205  	spinlock_t *io_lock;
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2206  	unsigned long flags;
14eb5d905d16ec Hiral Patel       2013-02-12  2207  	unsigned long start_time = 0;
03298552cba38f Hiral Patel       2013-02-12  2208  	struct scsi_lun fc_lun;
67125b0287a9e6 Hiral Patel       2013-09-12 @2209  	struct fnic_stats *fnic_stats;
67125b0287a9e6 Hiral Patel       2013-09-12  2210  	struct reset_stats *reset_stats;
4d7007b49d523d Hiral Patel       2013-02-12  2211  	int tag = 0;
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2212  	DECLARE_COMPLETION_ONSTACK(tm_done);
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2213  
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2214  	/* Wait for rport to unblock */
77600d1b52ae78 Hannes Reinecke   2021-08-16  2215  	rport = starget_to_rport(scsi_target(sdev));
77600d1b52ae78 Hannes Reinecke   2021-08-16  2216  	ret = fc_block_rport(rport);
77600d1b52ae78 Hannes Reinecke   2021-08-16  2217  	if (ret)
77600d1b52ae78 Hannes Reinecke   2021-08-16  2218  		return ret;
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2219  
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2220  	/* Get local-port, check ready and link up */
77600d1b52ae78 Hannes Reinecke   2021-08-16  2221  	lp = shost_priv(sdev->host);
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2222  
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2223  	fnic = lport_priv(lp);
67125b0287a9e6 Hiral Patel       2013-09-12  2224  	fnic_stats = &fnic->fnic_stats;
67125b0287a9e6 Hiral Patel       2013-09-12  2225  	reset_stats = &fnic->fnic_stats.reset_stats;
67125b0287a9e6 Hiral Patel       2013-09-12  2226  
67125b0287a9e6 Hiral Patel       2013-09-12  2227  	atomic64_inc(&reset_stats->device_resets);
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2228  
0db6f4353d68c0 Roel Kluin        2010-06-11  2229  	FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host,
77600d1b52ae78 Hannes Reinecke   2021-08-16  2230  		      "Device reset called FCID 0x%x, LUN 0x%llx\n",
77600d1b52ae78 Hannes Reinecke   2021-08-16  2231  		      rport->port_id, sdev->lun);
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2232  
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2233  	if (lp->state != LPORT_ST_READY || !(lp->link_up))
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2234  		goto fnic_device_reset_end;
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2235  
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2236  	/* Check if remote port up */
77600d1b52ae78 Hannes Reinecke   2021-08-16  2237  	if (rport->port_state != FC_PORTSTATE_ONLINE &&
77600d1b52ae78 Hannes Reinecke   2021-08-16  2238  	    rport->port_state != FC_PORTSTATE_MARGINAL) {
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2239  		goto fnic_device_reset_end;
67125b0287a9e6 Hiral Patel       2013-09-12  2240  	}
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2241  
14eb5d905d16ec Hiral Patel       2013-02-12  2242  	CMD_FLAGS(sc) = FNIC_DEVICE_RESET;
77600d1b52ae78 Hannes Reinecke   2021-08-16  2243  	/* The last tag is reserved for device reset */
77600d1b52ae78 Hannes Reinecke   2021-08-16  2244  	sc = scsi_host_find_tag(sdev->host, fnic->fnic_max_tag_id - 1);
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2245  	io_lock = fnic_io_lock_hash(fnic, sc);
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2246  	spin_lock_irqsave(io_lock, flags);
77600d1b52ae78 Hannes Reinecke   2021-08-16  2247  	if (CMD_SP(sc)) {
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2248  		/*
77600d1b52ae78 Hannes Reinecke   2021-08-16  2249  		 * Reset tag busy
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2250  		 */
77600d1b52ae78 Hannes Reinecke   2021-08-16  2251  		spin_unlock_irqrestore(io_lock, flags);
77600d1b52ae78 Hannes Reinecke   2021-08-16  2252  		goto fnic_device_reset_end;
77600d1b52ae78 Hannes Reinecke   2021-08-16  2253  	}
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2254  	io_req = mempool_alloc(fnic->io_req_pool, GFP_ATOMIC);
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2255  	if (!io_req) {
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2256  		spin_unlock_irqrestore(io_lock, flags);
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2257  		goto fnic_device_reset_end;
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2258  	}
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2259  	memset(io_req, 0, sizeof(*io_req));
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2260  	io_req->port_id = rport->port_id;
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2261  	CMD_SP(sc) = (char *)io_req;
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2262  	io_req->dr_done = &tm_done;
77600d1b52ae78 Hannes Reinecke   2021-08-16  2263  	CMD_FLAGS(sc) = FNIC_DEVICE_RESET;
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2264  	CMD_STATE(sc) = FNIC_IOREQ_CMD_PENDING;
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2265  	CMD_LR_STATUS(sc) = FCPIO_INVALID_CODE;
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2266  	spin_unlock_irqrestore(io_lock, flags);
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2267  
03298552cba38f Hiral Patel       2013-02-12  2268  	FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host, "TAG %x\n", tag);
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2269  
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2270  	/*
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2271  	 * issue the device reset, if enqueue failed, clean up the ioreq
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2272  	 * and break assoc with scsi cmd
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2273  	 */
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2274  	if (fnic_queue_dr_io_req(fnic, sc, io_req)) {
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2275  		spin_lock_irqsave(io_lock, flags);
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2276  		io_req = (struct fnic_io_req *)CMD_SP(sc);
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2277  		if (io_req)
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2278  			io_req->dr_done = NULL;
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2279  		goto fnic_device_reset_clean;
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2280  	}
03298552cba38f Hiral Patel       2013-02-12  2281  	spin_lock_irqsave(io_lock, flags);
14eb5d905d16ec Hiral Patel       2013-02-12  2282  	CMD_FLAGS(sc) |= FNIC_DEV_RST_ISSUED;
03298552cba38f Hiral Patel       2013-02-12  2283  	spin_unlock_irqrestore(io_lock, flags);
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2284  
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2285  	/*
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2286  	 * Wait on the local completion for LUN reset.  The io_req may be
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2287  	 * freed while we wait since we hold no lock.
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2288  	 */
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2289  	wait_for_completion_timeout(&tm_done,
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2290  				    msecs_to_jiffies(FNIC_LUN_RESET_TIMEOUT));
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2291  
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2292  	spin_lock_irqsave(io_lock, flags);
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2293  	io_req = (struct fnic_io_req *)CMD_SP(sc);
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2294  	if (!io_req) {
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2295  		spin_unlock_irqrestore(io_lock, flags);
03298552cba38f Hiral Patel       2013-02-12  2296  		FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host,
03298552cba38f Hiral Patel       2013-02-12  2297  				"io_req is null tag 0x%x sc 0x%p\n", tag, sc);
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2298  		goto fnic_device_reset_end;
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2299  	}
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2300  	io_req->dr_done = NULL;
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2301  
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2302  	status = CMD_LR_STATUS(sc);
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2303  
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2304  	/*
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2305  	 * If lun reset not completed, bail out with failed. io_req
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2306  	 * gets cleaned up during higher levels of EH
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2307  	 */
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2308  	if (status == FCPIO_INVALID_CODE) {
67125b0287a9e6 Hiral Patel       2013-09-12  2309  		atomic64_inc(&reset_stats->device_reset_timeouts);
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2310  		FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host,
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2311  			      "Device reset timed out\n");
03298552cba38f Hiral Patel       2013-02-12  2312  		CMD_FLAGS(sc) |= FNIC_DEV_RST_TIMED_OUT;
03298552cba38f Hiral Patel       2013-02-12  2313  		spin_unlock_irqrestore(io_lock, flags);
03298552cba38f Hiral Patel       2013-02-12  2314  		int_to_scsilun(sc->device->lun, &fc_lun);
03298552cba38f Hiral Patel       2013-02-12  2315  		/*
1259c5dc752474 Sesidhar Beddel   2013-09-09  2316  		 * Issue abort and terminate on device reset request.
1259c5dc752474 Sesidhar Beddel   2013-09-09  2317  		 * If q'ing of terminate fails, retry it after a delay.
03298552cba38f Hiral Patel       2013-02-12  2318  		 */
03298552cba38f Hiral Patel       2013-02-12  2319  		while (1) {
03298552cba38f Hiral Patel       2013-02-12  2320  			spin_lock_irqsave(io_lock, flags);
03298552cba38f Hiral Patel       2013-02-12  2321  			if (CMD_FLAGS(sc) & FNIC_DEV_RST_TERM_ISSUED) {
03298552cba38f Hiral Patel       2013-02-12  2322  				spin_unlock_irqrestore(io_lock, flags);
03298552cba38f Hiral Patel       2013-02-12  2323  				break;
03298552cba38f Hiral Patel       2013-02-12  2324  			}
03298552cba38f Hiral Patel       2013-02-12  2325  			spin_unlock_irqrestore(io_lock, flags);
03298552cba38f Hiral Patel       2013-02-12  2326  			if (fnic_queue_abort_io_req(fnic,
03298552cba38f Hiral Patel       2013-02-12  2327  				tag | FNIC_TAG_DEV_RST,
03298552cba38f Hiral Patel       2013-02-12  2328  				FCPIO_ITMF_ABT_TASK_TERM,
03298552cba38f Hiral Patel       2013-02-12  2329  				fc_lun.scsi_lun, io_req)) {
03298552cba38f Hiral Patel       2013-02-12  2330  				wait_for_completion_timeout(&tm_done,
03298552cba38f Hiral Patel       2013-02-12  2331  				msecs_to_jiffies(FNIC_ABT_TERM_DELAY_TIMEOUT));
03298552cba38f Hiral Patel       2013-02-12  2332  			} else {
03298552cba38f Hiral Patel       2013-02-12  2333  				spin_lock_irqsave(io_lock, flags);
03298552cba38f Hiral Patel       2013-02-12  2334  				CMD_FLAGS(sc) |= FNIC_DEV_RST_TERM_ISSUED;
03298552cba38f Hiral Patel       2013-02-12  2335  				CMD_STATE(sc) = FNIC_IOREQ_ABTS_PENDING;
03298552cba38f Hiral Patel       2013-02-12  2336  				io_req->abts_done = &tm_done;
03298552cba38f Hiral Patel       2013-02-12  2337  				spin_unlock_irqrestore(io_lock, flags);
03298552cba38f Hiral Patel       2013-02-12  2338  				FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host,
03298552cba38f Hiral Patel       2013-02-12  2339  				"Abort and terminate issued on Device reset "
03298552cba38f Hiral Patel       2013-02-12  2340  				"tag 0x%x sc 0x%p\n", tag, sc);
03298552cba38f Hiral Patel       2013-02-12  2341  				break;
03298552cba38f Hiral Patel       2013-02-12  2342  			}
03298552cba38f Hiral Patel       2013-02-12  2343  		}
03298552cba38f Hiral Patel       2013-02-12  2344  		while (1) {
03298552cba38f Hiral Patel       2013-02-12  2345  			spin_lock_irqsave(io_lock, flags);
03298552cba38f Hiral Patel       2013-02-12  2346  			if (!(CMD_FLAGS(sc) & FNIC_DEV_RST_DONE)) {
03298552cba38f Hiral Patel       2013-02-12  2347  				spin_unlock_irqrestore(io_lock, flags);
03298552cba38f Hiral Patel       2013-02-12  2348  				wait_for_completion_timeout(&tm_done,
03298552cba38f Hiral Patel       2013-02-12  2349  				msecs_to_jiffies(FNIC_LUN_RESET_TIMEOUT));
03298552cba38f Hiral Patel       2013-02-12  2350  				break;
03298552cba38f Hiral Patel       2013-02-12  2351  			} else {
03298552cba38f Hiral Patel       2013-02-12  2352  				io_req = (struct fnic_io_req *)CMD_SP(sc);
03298552cba38f Hiral Patel       2013-02-12  2353  				io_req->abts_done = NULL;
03298552cba38f Hiral Patel       2013-02-12  2354  				goto fnic_device_reset_clean;
03298552cba38f Hiral Patel       2013-02-12  2355  			}
03298552cba38f Hiral Patel       2013-02-12  2356  		}
03298552cba38f Hiral Patel       2013-02-12  2357  	} else {
03298552cba38f Hiral Patel       2013-02-12  2358  		spin_unlock_irqrestore(io_lock, flags);
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2359  	}
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2360  
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2361  	/* Completed, but not successful, clean up the io_req, return fail */
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2362  	if (status != FCPIO_SUCCESS) {
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2363  		spin_lock_irqsave(io_lock, flags);
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2364  		FNIC_SCSI_DBG(KERN_DEBUG,
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2365  			      fnic->lport->host,
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2366  			      "Device reset completed - failed\n");
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2367  		io_req = (struct fnic_io_req *)CMD_SP(sc);
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2368  		goto fnic_device_reset_clean;
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2369  	}
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2370  
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2371  	/*
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2372  	 * Clean up any aborts on this lun that have still not
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2373  	 * completed. If any of these fail, then LUN reset fails.
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2374  	 * clean_pending_aborts cleans all cmds on this lun except
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2375  	 * the lun reset cmd. If all cmds get cleaned, the lun reset
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2376  	 * succeeds
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2377  	 */
77600d1b52ae78 Hannes Reinecke   2021-08-16  2378  	if (fnic_clean_pending_aborts(fnic, sc)) {
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2379  		spin_lock_irqsave(io_lock, flags);
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2380  		io_req = (struct fnic_io_req *)CMD_SP(sc);
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2381  		FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host,
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2382  			      "Device reset failed"
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2383  			      " since could not abort all IOs\n");
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2384  		goto fnic_device_reset_clean;
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2385  	}
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2386  
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2387  	/* Clean lun reset command */
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2388  	spin_lock_irqsave(io_lock, flags);
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2389  	io_req = (struct fnic_io_req *)CMD_SP(sc);
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2390  	if (io_req)
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2391  		/* Completed, and successful */
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2392  		ret = SUCCESS;
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2393  
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2394  fnic_device_reset_clean:
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2395  	if (io_req)
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2396  		CMD_SP(sc) = NULL;
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2397  
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2398  	spin_unlock_irqrestore(io_lock, flags);
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2399  
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2400  	if (io_req) {
14eb5d905d16ec Hiral Patel       2013-02-12  2401  		start_time = io_req->start_time;
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2402  		fnic_release_ioreq_buf(fnic, io_req, sc);
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2403  		mempool_free(io_req, fnic->io_req_pool);
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2404  	}
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2405  
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2406  fnic_device_reset_end:
4d7007b49d523d Hiral Patel       2013-02-12  2407  	FNIC_TRACE(fnic_device_reset, sc->device->host->host_no,
4d7007b49d523d Hiral Patel       2013-02-12  2408  		  sc->request->tag, sc,
4d7007b49d523d Hiral Patel       2013-02-12  2409  		  jiffies_to_msecs(jiffies - start_time),
4d7007b49d523d Hiral Patel       2013-02-12  2410  		  0, ((u64)sc->cmnd[0] << 32 |
4d7007b49d523d Hiral Patel       2013-02-12  2411  		  (u64)sc->cmnd[2] << 24 | (u64)sc->cmnd[3] << 16 |
4d7007b49d523d Hiral Patel       2013-02-12  2412  		  (u64)sc->cmnd[4] << 8 | sc->cmnd[5]),
4d7007b49d523d Hiral Patel       2013-02-12  2413  		  (((u64)CMD_FLAGS(sc) << 32) | CMD_STATE(sc)));
4d7007b49d523d Hiral Patel       2013-02-12  2414  
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2415  	FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host,
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2416  		      "Returning from device reset %s\n",
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2417  		      (ret == SUCCESS) ?
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2418  		      "SUCCESS" : "FAILED");
67125b0287a9e6 Hiral Patel       2013-09-12  2419  
67125b0287a9e6 Hiral Patel       2013-09-12  2420  	if (ret == FAILED)
67125b0287a9e6 Hiral Patel       2013-09-12  2421  		atomic64_inc(&reset_stats->device_reset_failures);
67125b0287a9e6 Hiral Patel       2013-09-12  2422  
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2423  	return ret;
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2424  }
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17  2425  

:::::: The code at line 2209 was first introduced by commit
:::::: 67125b0287a9e6506c4f5afca7376667bf6dab5b [SCSI] fnic: Fnic Statistics Collection

:::::: TO: Hiral Patel <hiralpat@cisco.com>
:::::: CC: James Bottomley <JBottomley@Parallels.com>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 65167 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-08-17 15:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-17 15:49 [hare-scsi-devel:eh-rework.v2 38/51] drivers/scsi/fnic/fnic_scsi.c:2209:21: warning: variable 'fnic_stats' set but not used kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).