[hare-scsi-devel:reserved-tags.v4 4/22] drivers/scsi/fnic/fnic_scsi.c:2500 fnic_device_reset() error: we previously assumed 'reset_sc' could be null (see line 2336)
by kernel test robot
CC: kbuild-all(a)lists.01.org
TO: Hannes Reinecke <hare(a)suse.de>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/hare/scsi-devel.git reserved-tags.v4
head: 2a2c3155f8291828f41350cf90a0c8a37cdd263c
commit: 3b695cc5f04ad6099906a94408410af8078704bf [4/22] fnic: use internal commands
:::::: branch date: 10 days ago
:::::: commit date: 2 weeks ago
config: i386-randconfig-m021-20200705 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-14) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
smatch warnings:
drivers/scsi/fnic/fnic_scsi.c:2500 fnic_device_reset() error: we previously assumed 'reset_sc' could be null (see line 2336)
# https://git.kernel.org/pub/scm/linux/kernel/git/hare/scsi-devel.git/commi...
git remote add hare-scsi-devel https://git.kernel.org/pub/scm/linux/kernel/git/hare/scsi-devel.git
git remote update hare-scsi-devel
git checkout 3b695cc5f04ad6099906a94408410af8078704bf
vim +/reset_sc +2500 drivers/scsi/fnic/fnic_scsi.c
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2284
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2285 /*
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2286 * SCSI Eh thread issues a Lun Reset when one or more commands on a LUN
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2287 * fail to get aborted. It calls driver's eh_device_reset with a SCSI command
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2288 * on the LUN.
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2289 */
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2290 int fnic_device_reset(struct scsi_cmnd *sc)
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2291 {
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2292 struct fc_lport *lp;
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2293 struct fnic *fnic;
4d7007b49d523d Hiral Patel 2013-02-12 2294 struct fnic_io_req *io_req = NULL;
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2295 struct fc_rport *rport;
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2296 int status;
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2297 int ret = FAILED;
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2298 spinlock_t *io_lock;
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2299 unsigned long flags;
14eb5d905d16ec Hiral Patel 2013-02-12 2300 unsigned long start_time = 0;
3b695cc5f04ad6 Hannes Reinecke 2020-03-11 2301 struct scsi_device *sdev = sc->device;
03298552cba38f Hiral Patel 2013-02-12 2302 struct scsi_lun fc_lun;
67125b0287a9e6 Hiral Patel 2013-09-12 2303 struct fnic_stats *fnic_stats;
67125b0287a9e6 Hiral Patel 2013-09-12 2304 struct reset_stats *reset_stats;
4d7007b49d523d Hiral Patel 2013-02-12 2305 int tag = 0;
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2306 DECLARE_COMPLETION_ONSTACK(tm_done);
3b695cc5f04ad6 Hannes Reinecke 2020-03-11 2307 struct scsi_cmnd *reset_sc = NULL;
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2308
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2309 /* Wait for rport to unblock */
65d430fa99cbd0 Christof Schmitt 2009-10-30 2310 fc_block_scsi_eh(sc);
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2311
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2312 /* Get local-port, check ready and link up */
3b695cc5f04ad6 Hannes Reinecke 2020-03-11 2313 lp = shost_priv(sdev->host);
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2314
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2315 fnic = lport_priv(lp);
67125b0287a9e6 Hiral Patel 2013-09-12 2316 fnic_stats = &fnic->fnic_stats;
67125b0287a9e6 Hiral Patel 2013-09-12 2317 reset_stats = &fnic->fnic_stats.reset_stats;
67125b0287a9e6 Hiral Patel 2013-09-12 2318
67125b0287a9e6 Hiral Patel 2013-09-12 2319 atomic64_inc(&reset_stats->device_resets);
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2320
3b695cc5f04ad6 Hannes Reinecke 2020-03-11 2321 rport = starget_to_rport(scsi_target(sdev));
0db6f4353d68c0 Roel Kluin 2010-06-11 2322 FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host,
9cb78c16f5dade Hannes Reinecke 2014-06-25 2323 "Device reset called FCID 0x%x, LUN 0x%llx sc 0x%p\n",
3b695cc5f04ad6 Hannes Reinecke 2020-03-11 2324 rport->port_id, sdev->lun, sc);
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2325
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2326 if (lp->state != LPORT_ST_READY || !(lp->link_up))
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2327 goto fnic_device_reset_end;
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2328
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2329 /* Check if remote port up */
67125b0287a9e6 Hiral Patel 2013-09-12 2330 if (fc_remote_port_chkready(rport)) {
67125b0287a9e6 Hiral Patel 2013-09-12 2331 atomic64_inc(&fnic_stats->misc_stats.rport_not_ready);
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2332 goto fnic_device_reset_end;
67125b0287a9e6 Hiral Patel 2013-09-12 2333 }
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2334
3b695cc5f04ad6 Hannes Reinecke 2020-03-11 2335 reset_sc = scsi_get_internal_cmd(sdev, DMA_NONE, REQ_NOWAIT);
3b695cc5f04ad6 Hannes Reinecke 2020-03-11 @2336 if (unlikely(!reset_sc))
03298552cba38f Hiral Patel 2013-02-12 2337 goto fnic_device_reset_end;
3b695cc5f04ad6 Hannes Reinecke 2020-03-11 2338
3b695cc5f04ad6 Hannes Reinecke 2020-03-11 2339 CMD_FLAGS(reset_sc) = FNIC_DEVICE_RESET;
3b695cc5f04ad6 Hannes Reinecke 2020-03-11 2340 tag = reset_sc->request->tag;
3b695cc5f04ad6 Hannes Reinecke 2020-03-11 2341 io_lock = fnic_io_lock_hash(fnic, reset_sc);
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2342 spin_lock_irqsave(io_lock, flags);
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2343
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2344 /*
3b695cc5f04ad6 Hannes Reinecke 2020-03-11 2345 * Allocate a new io_req.
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2346 */
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2347 io_req = mempool_alloc(fnic->io_req_pool, GFP_ATOMIC);
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2348 if (!io_req) {
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2349 spin_unlock_irqrestore(io_lock, flags);
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2350 goto fnic_device_reset_end;
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2351 }
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2352 memset(io_req, 0, sizeof(*io_req));
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2353 io_req->port_id = rport->port_id;
3b695cc5f04ad6 Hannes Reinecke 2020-03-11 2354 CMD_SP(reset_sc) = (char *)io_req;
3b695cc5f04ad6 Hannes Reinecke 2020-03-11 2355
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2356 io_req->dr_done = &tm_done;
3b695cc5f04ad6 Hannes Reinecke 2020-03-11 2357 CMD_STATE(reset_sc) = FNIC_IOREQ_CMD_PENDING;
3b695cc5f04ad6 Hannes Reinecke 2020-03-11 2358 CMD_LR_STATUS(reset_sc) = FCPIO_INVALID_CODE;
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2359 spin_unlock_irqrestore(io_lock, flags);
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2360
03298552cba38f Hiral Patel 2013-02-12 2361 FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host, "TAG %x\n", tag);
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2362
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2363 /*
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2364 * issue the device reset, if enqueue failed, clean up the ioreq
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2365 * and break assoc with scsi cmd
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2366 */
3b695cc5f04ad6 Hannes Reinecke 2020-03-11 2367 if (fnic_queue_dr_io_req(fnic, reset_sc, io_req)) {
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2368 spin_lock_irqsave(io_lock, flags);
3b695cc5f04ad6 Hannes Reinecke 2020-03-11 2369 io_req = (struct fnic_io_req *)CMD_SP(reset_sc);
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2370 if (io_req)
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2371 io_req->dr_done = NULL;
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2372 goto fnic_device_reset_clean;
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2373 }
03298552cba38f Hiral Patel 2013-02-12 2374 spin_lock_irqsave(io_lock, flags);
3b695cc5f04ad6 Hannes Reinecke 2020-03-11 2375 CMD_FLAGS(reset_sc) |= FNIC_DEV_RST_ISSUED;
03298552cba38f Hiral Patel 2013-02-12 2376 spin_unlock_irqrestore(io_lock, flags);
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2377
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2378 /*
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2379 * Wait on the local completion for LUN reset. The io_req may be
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2380 * freed while we wait since we hold no lock.
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2381 */
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2382 wait_for_completion_timeout(&tm_done,
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2383 msecs_to_jiffies(FNIC_LUN_RESET_TIMEOUT));
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2384
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2385 spin_lock_irqsave(io_lock, flags);
3b695cc5f04ad6 Hannes Reinecke 2020-03-11 2386 io_req = (struct fnic_io_req *)CMD_SP(reset_sc);
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2387 if (!io_req) {
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2388 spin_unlock_irqrestore(io_lock, flags);
03298552cba38f Hiral Patel 2013-02-12 2389 FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host,
3b695cc5f04ad6 Hannes Reinecke 2020-03-11 2390 "io_req is null tag 0x%x sc 0x%p\n", tag, reset_sc);
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2391 goto fnic_device_reset_end;
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2392 }
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2393 io_req->dr_done = NULL;
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2394
3b695cc5f04ad6 Hannes Reinecke 2020-03-11 2395 status = CMD_LR_STATUS(reset_sc);
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2396
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2397 /*
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2398 * If lun reset not completed, bail out with failed. io_req
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2399 * gets cleaned up during higher levels of EH
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2400 */
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2401 if (status == FCPIO_INVALID_CODE) {
67125b0287a9e6 Hiral Patel 2013-09-12 2402 atomic64_inc(&reset_stats->device_reset_timeouts);
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2403 FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host,
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2404 "Device reset timed out\n");
3b695cc5f04ad6 Hannes Reinecke 2020-03-11 2405 CMD_FLAGS(reset_sc) |= FNIC_DEV_RST_TIMED_OUT;
03298552cba38f Hiral Patel 2013-02-12 2406 spin_unlock_irqrestore(io_lock, flags);
3b695cc5f04ad6 Hannes Reinecke 2020-03-11 2407 int_to_scsilun(sdev->lun, &fc_lun);
03298552cba38f Hiral Patel 2013-02-12 2408 /*
1259c5dc752474 Sesidhar Beddel 2013-09-09 2409 * Issue abort and terminate on device reset request.
1259c5dc752474 Sesidhar Beddel 2013-09-09 2410 * If q'ing of terminate fails, retry it after a delay.
03298552cba38f Hiral Patel 2013-02-12 2411 */
03298552cba38f Hiral Patel 2013-02-12 2412 while (1) {
03298552cba38f Hiral Patel 2013-02-12 2413 spin_lock_irqsave(io_lock, flags);
3b695cc5f04ad6 Hannes Reinecke 2020-03-11 2414 if (CMD_FLAGS(reset_sc) & FNIC_DEV_RST_TERM_ISSUED) {
03298552cba38f Hiral Patel 2013-02-12 2415 spin_unlock_irqrestore(io_lock, flags);
03298552cba38f Hiral Patel 2013-02-12 2416 break;
03298552cba38f Hiral Patel 2013-02-12 2417 }
03298552cba38f Hiral Patel 2013-02-12 2418 spin_unlock_irqrestore(io_lock, flags);
03298552cba38f Hiral Patel 2013-02-12 2419 if (fnic_queue_abort_io_req(fnic,
03298552cba38f Hiral Patel 2013-02-12 2420 tag | FNIC_TAG_DEV_RST,
03298552cba38f Hiral Patel 2013-02-12 2421 FCPIO_ITMF_ABT_TASK_TERM,
03298552cba38f Hiral Patel 2013-02-12 2422 fc_lun.scsi_lun, io_req)) {
03298552cba38f Hiral Patel 2013-02-12 2423 wait_for_completion_timeout(&tm_done,
03298552cba38f Hiral Patel 2013-02-12 2424 msecs_to_jiffies(FNIC_ABT_TERM_DELAY_TIMEOUT));
03298552cba38f Hiral Patel 2013-02-12 2425 } else {
03298552cba38f Hiral Patel 2013-02-12 2426 spin_lock_irqsave(io_lock, flags);
3b695cc5f04ad6 Hannes Reinecke 2020-03-11 2427 CMD_FLAGS(reset_sc) |= FNIC_DEV_RST_TERM_ISSUED;
3b695cc5f04ad6 Hannes Reinecke 2020-03-11 2428 CMD_STATE(reset_sc) = FNIC_IOREQ_ABTS_PENDING;
03298552cba38f Hiral Patel 2013-02-12 2429 io_req->abts_done = &tm_done;
03298552cba38f Hiral Patel 2013-02-12 2430 spin_unlock_irqrestore(io_lock, flags);
03298552cba38f Hiral Patel 2013-02-12 2431 FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host,
03298552cba38f Hiral Patel 2013-02-12 2432 "Abort and terminate issued on Device reset "
3b695cc5f04ad6 Hannes Reinecke 2020-03-11 2433 "tag 0x%x sc 0x%p\n", tag, reset_sc);
03298552cba38f Hiral Patel 2013-02-12 2434 break;
03298552cba38f Hiral Patel 2013-02-12 2435 }
03298552cba38f Hiral Patel 2013-02-12 2436 }
03298552cba38f Hiral Patel 2013-02-12 2437 while (1) {
03298552cba38f Hiral Patel 2013-02-12 2438 spin_lock_irqsave(io_lock, flags);
03298552cba38f Hiral Patel 2013-02-12 2439 if (!(CMD_FLAGS(sc) & FNIC_DEV_RST_DONE)) {
03298552cba38f Hiral Patel 2013-02-12 2440 spin_unlock_irqrestore(io_lock, flags);
03298552cba38f Hiral Patel 2013-02-12 2441 wait_for_completion_timeout(&tm_done,
03298552cba38f Hiral Patel 2013-02-12 2442 msecs_to_jiffies(FNIC_LUN_RESET_TIMEOUT));
03298552cba38f Hiral Patel 2013-02-12 2443 break;
03298552cba38f Hiral Patel 2013-02-12 2444 } else {
3b695cc5f04ad6 Hannes Reinecke 2020-03-11 2445 io_req = (struct fnic_io_req *)CMD_SP(reset_sc);
03298552cba38f Hiral Patel 2013-02-12 2446 io_req->abts_done = NULL;
03298552cba38f Hiral Patel 2013-02-12 2447 goto fnic_device_reset_clean;
03298552cba38f Hiral Patel 2013-02-12 2448 }
03298552cba38f Hiral Patel 2013-02-12 2449 }
03298552cba38f Hiral Patel 2013-02-12 2450 } else {
03298552cba38f Hiral Patel 2013-02-12 2451 spin_unlock_irqrestore(io_lock, flags);
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2452 }
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2453
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2454 /* Completed, but not successful, clean up the io_req, return fail */
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2455 if (status != FCPIO_SUCCESS) {
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2456 spin_lock_irqsave(io_lock, flags);
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2457 FNIC_SCSI_DBG(KERN_DEBUG,
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2458 fnic->lport->host,
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2459 "Device reset completed - failed\n");
3b695cc5f04ad6 Hannes Reinecke 2020-03-11 2460 io_req = (struct fnic_io_req *)CMD_SP(reset_sc);
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2461 goto fnic_device_reset_clean;
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2462 }
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2463
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2464 /*
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2465 * Clean up any aborts on this lun that have still not
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2466 * completed. If any of these fail, then LUN reset fails.
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2467 * clean_pending_aborts cleans all cmds on this lun except
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2468 * the lun reset cmd. If all cmds get cleaned, the lun reset
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2469 * succeeds
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2470 */
3b695cc5f04ad6 Hannes Reinecke 2020-03-11 2471 if (fnic_clean_pending_aborts(fnic, reset_sc)) {
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2472 spin_lock_irqsave(io_lock, flags);
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2473 io_req = (struct fnic_io_req *)CMD_SP(sc);
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2474 FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host,
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2475 "Device reset failed"
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2476 " since could not abort all IOs\n");
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2477 goto fnic_device_reset_clean;
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2478 }
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2479
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2480 /* Clean lun reset command */
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2481 spin_lock_irqsave(io_lock, flags);
3b695cc5f04ad6 Hannes Reinecke 2020-03-11 2482 io_req = (struct fnic_io_req *)CMD_SP(reset_sc);
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2483 if (io_req)
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2484 /* Completed, and successful */
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2485 ret = SUCCESS;
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2486
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2487 fnic_device_reset_clean:
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2488 if (io_req)
3b695cc5f04ad6 Hannes Reinecke 2020-03-11 2489 CMD_SP(reset_sc) = NULL;
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2490
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2491 spin_unlock_irqrestore(io_lock, flags);
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2492
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2493 if (io_req) {
14eb5d905d16ec Hiral Patel 2013-02-12 2494 start_time = io_req->start_time;
3b695cc5f04ad6 Hannes Reinecke 2020-03-11 2495 fnic_release_ioreq_buf(fnic, io_req, reset_sc);
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2496 mempool_free(io_req, fnic->io_req_pool);
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2497 }
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2498
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2499 fnic_device_reset_end:
3b695cc5f04ad6 Hannes Reinecke 2020-03-11 @2500 FNIC_TRACE(fnic_device_reset, sdev->host->host_no,
3b695cc5f04ad6 Hannes Reinecke 2020-03-11 2501 reset_sc->request->tag, reset_sc,
4d7007b49d523d Hiral Patel 2013-02-12 2502 jiffies_to_msecs(jiffies - start_time),
3b695cc5f04ad6 Hannes Reinecke 2020-03-11 2503 0, ((u64)reset_sc->cmnd[0] << 32 |
4d7007b49d523d Hiral Patel 2013-02-12 2504 (u64)sc->cmnd[2] << 24 | (u64)sc->cmnd[3] << 16 |
4d7007b49d523d Hiral Patel 2013-02-12 2505 (u64)sc->cmnd[4] << 8 | sc->cmnd[5]),
4d7007b49d523d Hiral Patel 2013-02-12 2506 (((u64)CMD_FLAGS(sc) << 32) | CMD_STATE(sc)));
4d7007b49d523d Hiral Patel 2013-02-12 2507
3b695cc5f04ad6 Hannes Reinecke 2020-03-11 2508 /* free internal command if it is allocated */
3b695cc5f04ad6 Hannes Reinecke 2020-03-11 2509 if (reset_sc)
3b695cc5f04ad6 Hannes Reinecke 2020-03-11 2510 scsi_put_internal_cmd(reset_sc);
03298552cba38f Hiral Patel 2013-02-12 2511
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2512 FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host,
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2513 "Returning from device reset %s\n",
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2514 (ret == SUCCESS) ?
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2515 "SUCCESS" : "FAILED");
67125b0287a9e6 Hiral Patel 2013-09-12 2516
67125b0287a9e6 Hiral Patel 2013-09-12 2517 if (ret == FAILED)
67125b0287a9e6 Hiral Patel 2013-09-12 2518 atomic64_inc(&reset_stats->device_reset_failures);
67125b0287a9e6 Hiral Patel 2013-09-12 2519
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2520 return ret;
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2521 }
5df6d737dd4b0f Abhijeet Joglekar 2009-04-17 2522
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 10 months
drivers/gpio/gpio-mlxbf2.c:126:12: sparse: sparse: context imbalance in 'mlxbf2_gpio_lock_acquire' - different lock contexts for basic block
by kernel test robot
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Asmaa Mnebhi <Asmaa(a)mellanox.com>
CC: Linus Walleij <linus.walleij(a)linaro.org>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 35e884f89df4c48566d745dc5a97a0d058d04263
commit: bc0ae0e737f5167348579612493e2754e2122dfb gpio: add driver for Mellanox BlueField 2 GPIO controller
date: 4 months ago
:::::: branch date: 20 hours ago
:::::: commit date: 4 months ago
config: ia64-randconfig-s031-20200705 (attached as .config)
compiler: ia64-linux-gcc (GCC) 9.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.2-3-gfa153962-dirty
git checkout bc0ae0e737f5167348579612493e2754e2122dfb
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=ia64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:225:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@
include/asm-generic/io.h:225:22: sparse: expected unsigned int [usertype] value
include/asm-generic/io.h:225:22: sparse: got restricted __le32 [usertype]
>> drivers/gpio/gpio-mlxbf2.c:126:12: sparse: sparse: context imbalance in 'mlxbf2_gpio_lock_acquire' - different lock contexts for basic block
include/asm-generic/io.h:225:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@
include/asm-generic/io.h:225:22: sparse: expected unsigned int [usertype] value
include/asm-generic/io.h:225:22: sparse: got restricted __le32 [usertype]
>> drivers/gpio/gpio-mlxbf2.c:152:13: sparse: sparse: context imbalance in 'mlxbf2_gpio_lock_release' - unexpected unlock
include/asm-generic/io.h:225:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@
include/asm-generic/io.h:225:22: sparse: expected unsigned int [usertype] value
include/asm-generic/io.h:225:22: sparse: got restricted __le32 [usertype]
include/asm-generic/io.h:225:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@
include/asm-generic/io.h:225:22: sparse: expected unsigned int [usertype] value
include/asm-generic/io.h:225:22: sparse: got restricted __le32 [usertype]
include/asm-generic/io.h:225:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@
include/asm-generic/io.h:225:22: sparse: expected unsigned int [usertype] value
include/asm-generic/io.h:225:22: sparse: got restricted __le32 [usertype]
include/asm-generic/io.h:225:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@
include/asm-generic/io.h:225:22: sparse: expected unsigned int [usertype] value
include/asm-generic/io.h:225:22: sparse: got restricted __le32 [usertype]
include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:225:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@
include/asm-generic/io.h:225:22: sparse: expected unsigned int [usertype] value
include/asm-generic/io.h:225:22: sparse: got restricted __le32 [usertype]
include/asm-generic/io.h:225:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@
include/asm-generic/io.h:225:22: sparse: expected unsigned int [usertype] value
include/asm-generic/io.h:225:22: sparse: got restricted __le32 [usertype]
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git remote update linus
git checkout bc0ae0e737f5167348579612493e2754e2122dfb
vim +/mlxbf2_gpio_lock_acquire +126 drivers/gpio/gpio-mlxbf2.c
bc0ae0e737f516 Asmaa Mnebhi 2020-03-02 121
bc0ae0e737f516 Asmaa Mnebhi 2020-03-02 122 /*
bc0ae0e737f516 Asmaa Mnebhi 2020-03-02 123 * Acquire the YU arm_gpio_lock to be able to change the direction
bc0ae0e737f516 Asmaa Mnebhi 2020-03-02 124 * mode. If the lock_active bit is already set, return an error.
bc0ae0e737f516 Asmaa Mnebhi 2020-03-02 125 */
bc0ae0e737f516 Asmaa Mnebhi 2020-03-02 @126 static int mlxbf2_gpio_lock_acquire(struct mlxbf2_gpio_context *gs)
bc0ae0e737f516 Asmaa Mnebhi 2020-03-02 127 {
bc0ae0e737f516 Asmaa Mnebhi 2020-03-02 128 u32 arm_gpio_lock_val;
bc0ae0e737f516 Asmaa Mnebhi 2020-03-02 129
bc0ae0e737f516 Asmaa Mnebhi 2020-03-02 130 spin_lock(&gs->gc.bgpio_lock);
bc0ae0e737f516 Asmaa Mnebhi 2020-03-02 131 mutex_lock(yu_arm_gpio_lock_param.lock);
bc0ae0e737f516 Asmaa Mnebhi 2020-03-02 132
bc0ae0e737f516 Asmaa Mnebhi 2020-03-02 133 arm_gpio_lock_val = readl(yu_arm_gpio_lock_param.io);
bc0ae0e737f516 Asmaa Mnebhi 2020-03-02 134
bc0ae0e737f516 Asmaa Mnebhi 2020-03-02 135 /*
bc0ae0e737f516 Asmaa Mnebhi 2020-03-02 136 * When lock active bit[31] is set, ModeX is write enabled
bc0ae0e737f516 Asmaa Mnebhi 2020-03-02 137 */
bc0ae0e737f516 Asmaa Mnebhi 2020-03-02 138 if (YU_LOCK_ACTIVE_BIT(arm_gpio_lock_val)) {
bc0ae0e737f516 Asmaa Mnebhi 2020-03-02 139 mutex_unlock(yu_arm_gpio_lock_param.lock);
bc0ae0e737f516 Asmaa Mnebhi 2020-03-02 140 spin_unlock(&gs->gc.bgpio_lock);
bc0ae0e737f516 Asmaa Mnebhi 2020-03-02 141 return -EINVAL;
bc0ae0e737f516 Asmaa Mnebhi 2020-03-02 142 }
bc0ae0e737f516 Asmaa Mnebhi 2020-03-02 143
bc0ae0e737f516 Asmaa Mnebhi 2020-03-02 144 writel(YU_ARM_GPIO_LOCK_ACQUIRE, yu_arm_gpio_lock_param.io);
bc0ae0e737f516 Asmaa Mnebhi 2020-03-02 145
bc0ae0e737f516 Asmaa Mnebhi 2020-03-02 146 return 0;
bc0ae0e737f516 Asmaa Mnebhi 2020-03-02 147 }
bc0ae0e737f516 Asmaa Mnebhi 2020-03-02 148
bc0ae0e737f516 Asmaa Mnebhi 2020-03-02 149 /*
bc0ae0e737f516 Asmaa Mnebhi 2020-03-02 150 * Release the YU arm_gpio_lock after changing the direction mode.
bc0ae0e737f516 Asmaa Mnebhi 2020-03-02 151 */
bc0ae0e737f516 Asmaa Mnebhi 2020-03-02 @152 static void mlxbf2_gpio_lock_release(struct mlxbf2_gpio_context *gs)
bc0ae0e737f516 Asmaa Mnebhi 2020-03-02 153 {
bc0ae0e737f516 Asmaa Mnebhi 2020-03-02 154 writel(YU_ARM_GPIO_LOCK_RELEASE, yu_arm_gpio_lock_param.io);
bc0ae0e737f516 Asmaa Mnebhi 2020-03-02 155 mutex_unlock(yu_arm_gpio_lock_param.lock);
bc0ae0e737f516 Asmaa Mnebhi 2020-03-02 156 spin_unlock(&gs->gc.bgpio_lock);
bc0ae0e737f516 Asmaa Mnebhi 2020-03-02 157 }
bc0ae0e737f516 Asmaa Mnebhi 2020-03-02 158
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 10 months
Re: [Intel-gfx] [PATCH 04/23] drm/i915: Add an implementation for i915_gem_ww_ctx locking, v2.
by kernel test robot
CC: kbuild-all(a)lists.01.org
In-Reply-To: <20200703122221.591656-5-maarten.lankhorst(a)linux.intel.com>
References: <20200703122221.591656-5-maarten.lankhorst(a)linux.intel.com>
TO: Maarten Lankhorst <maarten.lankhorst(a)linux.intel.com>
Hi Maarten,
I love your patch! Perhaps something to improve:
[auto build test WARNING on 7faedc4873dd257f4ed064ab4e0a28407690ea73]
url: https://github.com/0day-ci/linux/commits/Maarten-Lankhorst/drm-i915-Use-w...
base: 7faedc4873dd257f4ed064ab4e0a28407690ea73
:::::: branch date: 2 days ago
:::::: commit date: 2 days ago
config: i386-randconfig-m021-20200701 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-14) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
New smatch warnings:
drivers/gpu/drm/i915/gem/i915_gem_object.h:130 __i915_gem_object_lock() error: we previously assumed 'ww' could be null (see line 122)
drivers/gpu/drm/i915/gem/i915_gem_object.h:130 __i915_gem_object_lock() error: we previously assumed 'ww' could be null (see line 122)
drivers/gpu/drm/i915/gem/i915_gem_object.h:130 __i915_gem_object_lock() error: we previously assumed 'ww' could be null (see line 122)
drivers/gpu/drm/i915/gem/i915_gem_object.h:130 __i915_gem_object_lock() error: we previously assumed 'ww' could be null (see line 122)
Old smatch warnings:
drivers/gpu/drm/i915/gem/i915_gem_context.h:205 i915_gem_context_get_engine() warn: inconsistent indenting
drivers/gpu/drm/i915/gem/i915_gem_context.h:207 i915_gem_context_get_engine() warn: inconsistent indenting
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c:1172 reloc_move_to_gpu() warn: maybe use && instead of &
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c:1343 vma_phys_addr() warn: right shifting more than type allows 32 vs 32
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c:1988 eb_move_to_gpu() warn: maybe use && instead of &
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c:2215 eb_parse_pipeline() error: double unlocked '*pw->batch->resv' (orig line 2197)
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c:2226 eb_parse_pipeline() error: double unlocked '*pw->batch->resv' (orig line 2197)
drivers/gpu/drm/i915/gt/intel_context.h:152 intel_context_timeline_lock() warn: inconsistent returns 'tl->mutex'.
drivers/gpu/drm/i915/gem/i915_gem_context.h:205 i915_gem_context_get_engine() warn: inconsistent indenting
drivers/gpu/drm/i915/gem/i915_gem_context.h:207 i915_gem_context_get_engine() warn: inconsistent indenting
drivers/gpu/drm/i915/display/intel_display.c:6182 skl_update_scaler_plane() error: we previously assumed 'fb' could be null (see line 6166)
drivers/gpu/drm/i915/display/intel_display.c:16635 intel_crtc_init() warn: passing a valid pointer to 'PTR_ERR'
# https://github.com/0day-ci/linux/commit/4ab860710ee5623e34f1058b550a610fd...
git remote add linux-review https://github.com/0day-ci/linux
git remote update linux-review
git checkout 4ab860710ee5623e34f1058b550a610fda44d3ca
vim +/ww +130 drivers/gpu/drm/i915/gem/i915_gem_object.h
6951e5893b4821 drivers/gpu/drm/i915/gem/i915_gem_object.h Chris Wilson 2019-05-28 112
4ab860710ee562 drivers/gpu/drm/i915/gem/i915_gem_object.h Maarten Lankhorst 2020-07-03 113 static inline int __i915_gem_object_lock(struct drm_i915_gem_object *obj,
4ab860710ee562 drivers/gpu/drm/i915/gem/i915_gem_object.h Maarten Lankhorst 2020-07-03 114 struct i915_gem_ww_ctx *ww,
4ab860710ee562 drivers/gpu/drm/i915/gem/i915_gem_object.h Maarten Lankhorst 2020-07-03 115 bool intr)
dd689287b97759 drivers/gpu/drm/i915/i915_gem_object.h Chris Wilson 2017-03-01 116 {
4ab860710ee562 drivers/gpu/drm/i915/gem/i915_gem_object.h Maarten Lankhorst 2020-07-03 117 int ret;
4ab860710ee562 drivers/gpu/drm/i915/gem/i915_gem_object.h Maarten Lankhorst 2020-07-03 118
4ab860710ee562 drivers/gpu/drm/i915/gem/i915_gem_object.h Maarten Lankhorst 2020-07-03 119 if (intr)
4ab860710ee562 drivers/gpu/drm/i915/gem/i915_gem_object.h Maarten Lankhorst 2020-07-03 120 ret = dma_resv_lock_interruptible(obj->base.resv, ww ? &ww->ctx : NULL);
4ab860710ee562 drivers/gpu/drm/i915/gem/i915_gem_object.h Maarten Lankhorst 2020-07-03 121 else
4ab860710ee562 drivers/gpu/drm/i915/gem/i915_gem_object.h Maarten Lankhorst 2020-07-03 @122 ret = dma_resv_lock(obj->base.resv, ww ? &ww->ctx : NULL);
4ab860710ee562 drivers/gpu/drm/i915/gem/i915_gem_object.h Maarten Lankhorst 2020-07-03 123
4ab860710ee562 drivers/gpu/drm/i915/gem/i915_gem_object.h Maarten Lankhorst 2020-07-03 124 if (!ret && ww)
4ab860710ee562 drivers/gpu/drm/i915/gem/i915_gem_object.h Maarten Lankhorst 2020-07-03 125 list_add_tail(&obj->obj_link, &ww->obj_list);
4ab860710ee562 drivers/gpu/drm/i915/gem/i915_gem_object.h Maarten Lankhorst 2020-07-03 126 if (ret == -EALREADY)
4ab860710ee562 drivers/gpu/drm/i915/gem/i915_gem_object.h Maarten Lankhorst 2020-07-03 127 ret = 0;
4ab860710ee562 drivers/gpu/drm/i915/gem/i915_gem_object.h Maarten Lankhorst 2020-07-03 128
4ab860710ee562 drivers/gpu/drm/i915/gem/i915_gem_object.h Maarten Lankhorst 2020-07-03 129 if (ret == -EDEADLK)
4ab860710ee562 drivers/gpu/drm/i915/gem/i915_gem_object.h Maarten Lankhorst 2020-07-03 @130 ww->contended = obj;
4ab860710ee562 drivers/gpu/drm/i915/gem/i915_gem_object.h Maarten Lankhorst 2020-07-03 131
4ab860710ee562 drivers/gpu/drm/i915/gem/i915_gem_object.h Maarten Lankhorst 2020-07-03 132 return ret;
dd689287b97759 drivers/gpu/drm/i915/i915_gem_object.h Chris Wilson 2017-03-01 133 }
dd689287b97759 drivers/gpu/drm/i915/i915_gem_object.h Chris Wilson 2017-03-01 134
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 10 months
drivers/infiniband/hw/mlx5/mr.c:234:25: sparse: sparse: context imbalance in 'resize_available_mrs' - unexpected unlock
by kernel test robot
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Jason Gunthorpe <jgg(a)mellanox.com>
CC: Leon Romanovsky <leonro(a)mellanox.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 35e884f89df4c48566d745dc5a97a0d058d04263
commit: a1d8854aae4ee19df6161a276a99d3c9c2abc4f3 RDMA/mlx5: Fix MR cache size and limit debugfs
date: 4 months ago
:::::: branch date: 16 hours ago
:::::: commit date: 4 months ago
config: i386-randconfig-s001-20200705 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-14) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.2-3-gfa153962-dirty
git checkout a1d8854aae4ee19df6161a276a99d3c9c2abc4f3
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
>> drivers/infiniband/hw/mlx5/mr.c:234:25: sparse: sparse: context imbalance in 'resize_available_mrs' - unexpected unlock
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git remote update linus
git checkout a1d8854aae4ee19df6161a276a99d3c9c2abc4f3
vim +/resize_available_mrs +234 drivers/infiniband/hw/mlx5/mr.c
65edd0e758b8a2 Daniel Jurgens 2018-03-13 220
a1d8854aae4ee1 Jason Gunthorpe 2020-03-10 221 static int resize_available_mrs(struct mlx5_cache_ent *ent, unsigned int target,
a1d8854aae4ee1 Jason Gunthorpe 2020-03-10 222 bool limit_fill)
a1d8854aae4ee1 Jason Gunthorpe 2020-03-10 223 {
a1d8854aae4ee1 Jason Gunthorpe 2020-03-10 224 int err;
a1d8854aae4ee1 Jason Gunthorpe 2020-03-10 225
a1d8854aae4ee1 Jason Gunthorpe 2020-03-10 226 lockdep_assert_held(&ent->lock);
a1d8854aae4ee1 Jason Gunthorpe 2020-03-10 227
a1d8854aae4ee1 Jason Gunthorpe 2020-03-10 228 while (true) {
a1d8854aae4ee1 Jason Gunthorpe 2020-03-10 229 if (limit_fill)
a1d8854aae4ee1 Jason Gunthorpe 2020-03-10 230 target = ent->limit * 2;
a1d8854aae4ee1 Jason Gunthorpe 2020-03-10 231 if (target == ent->available_mrs + ent->pending)
a1d8854aae4ee1 Jason Gunthorpe 2020-03-10 232 return 0;
a1d8854aae4ee1 Jason Gunthorpe 2020-03-10 233 if (target > ent->available_mrs + ent->pending) {
a1d8854aae4ee1 Jason Gunthorpe 2020-03-10 @234 u32 todo = target - (ent->available_mrs + ent->pending);
a1d8854aae4ee1 Jason Gunthorpe 2020-03-10 235
a1d8854aae4ee1 Jason Gunthorpe 2020-03-10 236 spin_unlock_irq(&ent->lock);
a1d8854aae4ee1 Jason Gunthorpe 2020-03-10 237 err = add_keys(ent, todo);
a1d8854aae4ee1 Jason Gunthorpe 2020-03-10 238 if (err == -EAGAIN)
a1d8854aae4ee1 Jason Gunthorpe 2020-03-10 239 usleep_range(3000, 5000);
a1d8854aae4ee1 Jason Gunthorpe 2020-03-10 240 spin_lock_irq(&ent->lock);
a1d8854aae4ee1 Jason Gunthorpe 2020-03-10 241 if (err) {
a1d8854aae4ee1 Jason Gunthorpe 2020-03-10 242 if (err != -EAGAIN)
a1d8854aae4ee1 Jason Gunthorpe 2020-03-10 243 return err;
a1d8854aae4ee1 Jason Gunthorpe 2020-03-10 244 } else
a1d8854aae4ee1 Jason Gunthorpe 2020-03-10 245 return 0;
a1d8854aae4ee1 Jason Gunthorpe 2020-03-10 246 } else {
a1d8854aae4ee1 Jason Gunthorpe 2020-03-10 247 spin_unlock_irq(&ent->lock);
a1d8854aae4ee1 Jason Gunthorpe 2020-03-10 248 remove_cache_mr(ent);
a1d8854aae4ee1 Jason Gunthorpe 2020-03-10 249 spin_lock_irq(&ent->lock);
a1d8854aae4ee1 Jason Gunthorpe 2020-03-10 250 }
e126ba97dba9ed Eli Cohen 2013-07-07 251 }
e126ba97dba9ed Eli Cohen 2013-07-07 252 }
e126ba97dba9ed Eli Cohen 2013-07-07 253
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 10 months
Re: [PATCH for-5.8 v2] usb: dwc2: Add missing cleanups when usb_add_gadget_udc() fails
by kernel test robot
CC: kbuild-all(a)lists.01.org
In-Reply-To: <20200703225043.387769-1-martin.blumenstingl(a)googlemail.com>
References: <20200703225043.387769-1-martin.blumenstingl(a)googlemail.com>
TO: Martin Blumenstingl <martin.blumenstingl(a)googlemail.com>
TO: hminas(a)synopsys.com
TO: gregkh(a)linuxfoundation.org
TO: linux-usb(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org
CC: marex(a)denx.de
CC: stable(a)vger.kernel.org
CC: Martin Blumenstingl <martin.blumenstingl(a)googlemail.com>
Hi Martin,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on usb/usb-testing]
[also build test WARNING on v5.8-rc3 next-20200703]
[cannot apply to balbi-usb/testing/next peter.chen-usb/ci-for-usb-next]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Martin-Blumenstingl/usb-dwc2-Add...
base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing
:::::: branch date: 7 hours ago
:::::: commit date: 7 hours ago
config: x86_64-randconfig-s022-20200702 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-14) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.2-3-gfa153962-dirty
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
>> drivers/usb/dwc2/platform.c:591:1: sparse: sparse: unused label 'error_debugfs'
# https://github.com/0day-ci/linux/commit/67a20d5fad7c28a1e955244ff3712266b...
git remote add linux-review https://github.com/0day-ci/linux
git remote update linux-review
git checkout 67a20d5fad7c28a1e955244ff3712266b0a4bc76
vim +/error_debugfs +591 drivers/usb/dwc2/platform.c
65dc2e72528610 drivers/usb/dwc2/platform.c Minas Harutyunyan 2020-05-21 395
5b9974b13e3648 drivers/staging/dwc2/platform.c Matthijs Kooijman 2013-04-22 396 /**
5b9974b13e3648 drivers/staging/dwc2/platform.c Matthijs Kooijman 2013-04-22 397 * dwc2_driver_probe() - Called when the DWC_otg core is bound to the DWC_otg
5b9974b13e3648 drivers/staging/dwc2/platform.c Matthijs Kooijman 2013-04-22 398 * driver
5b9974b13e3648 drivers/staging/dwc2/platform.c Matthijs Kooijman 2013-04-22 399 *
5b9974b13e3648 drivers/staging/dwc2/platform.c Matthijs Kooijman 2013-04-22 400 * @dev: Platform device
5b9974b13e3648 drivers/staging/dwc2/platform.c Matthijs Kooijman 2013-04-22 401 *
5b9974b13e3648 drivers/staging/dwc2/platform.c Matthijs Kooijman 2013-04-22 402 * This routine creates the driver components required to control the device
5b9974b13e3648 drivers/staging/dwc2/platform.c Matthijs Kooijman 2013-04-22 403 * (core, HCD, and PCD) and initializes the device. The driver components are
5b9974b13e3648 drivers/staging/dwc2/platform.c Matthijs Kooijman 2013-04-22 404 * stored in a dwc2_hsotg structure. A reference to the dwc2_hsotg is saved
5b9974b13e3648 drivers/staging/dwc2/platform.c Matthijs Kooijman 2013-04-22 405 * in the device private data. This allows the driver to access the dwc2_hsotg
5b9974b13e3648 drivers/staging/dwc2/platform.c Matthijs Kooijman 2013-04-22 406 * structure on subsequent calls to driver methods for this device.
5b9974b13e3648 drivers/staging/dwc2/platform.c Matthijs Kooijman 2013-04-22 407 */
5b9974b13e3648 drivers/staging/dwc2/platform.c Matthijs Kooijman 2013-04-22 408 static int dwc2_driver_probe(struct platform_device *dev)
5b9974b13e3648 drivers/staging/dwc2/platform.c Matthijs Kooijman 2013-04-22 409 {
5b9974b13e3648 drivers/staging/dwc2/platform.c Matthijs Kooijman 2013-04-22 410 struct dwc2_hsotg *hsotg;
5b9974b13e3648 drivers/staging/dwc2/platform.c Matthijs Kooijman 2013-04-22 411 struct resource *res;
5b9974b13e3648 drivers/staging/dwc2/platform.c Matthijs Kooijman 2013-04-22 412 int retval;
5b9974b13e3648 drivers/staging/dwc2/platform.c Matthijs Kooijman 2013-04-22 413
5b9974b13e3648 drivers/staging/dwc2/platform.c Matthijs Kooijman 2013-04-22 414 hsotg = devm_kzalloc(&dev->dev, sizeof(*hsotg), GFP_KERNEL);
5b9974b13e3648 drivers/staging/dwc2/platform.c Matthijs Kooijman 2013-04-22 415 if (!hsotg)
5b9974b13e3648 drivers/staging/dwc2/platform.c Matthijs Kooijman 2013-04-22 416 return -ENOMEM;
5b9974b13e3648 drivers/staging/dwc2/platform.c Matthijs Kooijman 2013-04-22 417
5b9974b13e3648 drivers/staging/dwc2/platform.c Matthijs Kooijman 2013-04-22 418 hsotg->dev = &dev->dev;
5b9974b13e3648 drivers/staging/dwc2/platform.c Matthijs Kooijman 2013-04-22 419
642f2ecc092f4d drivers/staging/dwc2/platform.c Matthijs Kooijman 2013-05-17 420 /*
642f2ecc092f4d drivers/staging/dwc2/platform.c Matthijs Kooijman 2013-05-17 421 * Use reasonable defaults so platforms don't have to provide these.
642f2ecc092f4d drivers/staging/dwc2/platform.c Matthijs Kooijman 2013-05-17 422 */
642f2ecc092f4d drivers/staging/dwc2/platform.c Matthijs Kooijman 2013-05-17 423 if (!dev->dev.dma_mask)
642f2ecc092f4d drivers/staging/dwc2/platform.c Matthijs Kooijman 2013-05-17 424 dev->dev.dma_mask = &dev->dev.coherent_dma_mask;
4cdbb4ff7fe456 drivers/staging/dwc2/platform.c Russell King 2013-06-10 425 retval = dma_set_coherent_mask(&dev->dev, DMA_BIT_MASK(32));
42c6a25235677a drivers/usb/dwc2/platform.c Stefan Wahren 2018-02-12 426 if (retval) {
42c6a25235677a drivers/usb/dwc2/platform.c Stefan Wahren 2018-02-12 427 dev_err(&dev->dev, "can't set coherent DMA mask: %d\n", retval);
4cdbb4ff7fe456 drivers/staging/dwc2/platform.c Russell King 2013-06-10 428 return retval;
42c6a25235677a drivers/usb/dwc2/platform.c Stefan Wahren 2018-02-12 429 }
642f2ecc092f4d drivers/staging/dwc2/platform.c Matthijs Kooijman 2013-05-17 430
5bf7e2883f1242 drivers/usb/dwc2/platform.c Dejin Zheng 2020-03-24 431 hsotg->regs = devm_platform_get_and_ioremap_resource(dev, 0, &res);
5b9974b13e3648 drivers/staging/dwc2/platform.c Matthijs Kooijman 2013-04-22 432 if (IS_ERR(hsotg->regs))
5b9974b13e3648 drivers/staging/dwc2/platform.c Matthijs Kooijman 2013-04-22 433 return PTR_ERR(hsotg->regs);
5b9974b13e3648 drivers/staging/dwc2/platform.c Matthijs Kooijman 2013-04-22 434
5b9974b13e3648 drivers/staging/dwc2/platform.c Matthijs Kooijman 2013-04-22 435 dev_dbg(&dev->dev, "mapped PA %08lx to VA %p\n",
5b9974b13e3648 drivers/staging/dwc2/platform.c Matthijs Kooijman 2013-04-22 436 (unsigned long)res->start, hsotg->regs);
5b9974b13e3648 drivers/staging/dwc2/platform.c Matthijs Kooijman 2013-04-22 437
09a75e85779014 drivers/usb/dwc2/platform.c Marek Szyprowski 2015-10-14 438 retval = dwc2_lowlevel_hw_init(hsotg);
ecb176c63ac49d drivers/usb/dwc2/platform.c Mian Yousaf Kaukab 2015-04-29 439 if (retval)
ecb176c63ac49d drivers/usb/dwc2/platform.c Mian Yousaf Kaukab 2015-04-29 440 return retval;
ecb176c63ac49d drivers/usb/dwc2/platform.c Mian Yousaf Kaukab 2015-04-29 441
09a75e85779014 drivers/usb/dwc2/platform.c Marek Szyprowski 2015-10-14 442 spin_lock_init(&hsotg->lock);
09a75e85779014 drivers/usb/dwc2/platform.c Marek Szyprowski 2015-10-14 443
a40a00318c7fcd drivers/usb/dwc2/platform.c Heiko Stübner 2015-12-18 444 hsotg->irq = platform_get_irq(dev, 0);
b33f37064b743d drivers/usb/dwc2/platform.c Stephen Boyd 2019-07-30 445 if (hsotg->irq < 0)
a40a00318c7fcd drivers/usb/dwc2/platform.c Heiko Stübner 2015-12-18 446 return hsotg->irq;
f74875dc36135e drivers/usb/dwc2/platform.c Stefan Wahren 2015-11-12 447
f74875dc36135e drivers/usb/dwc2/platform.c Stefan Wahren 2015-11-12 448 dev_dbg(hsotg->dev, "registering common handler for irq%d\n",
a40a00318c7fcd drivers/usb/dwc2/platform.c Heiko Stübner 2015-12-18 449 hsotg->irq);
a40a00318c7fcd drivers/usb/dwc2/platform.c Heiko Stübner 2015-12-18 450 retval = devm_request_irq(hsotg->dev, hsotg->irq,
f74875dc36135e drivers/usb/dwc2/platform.c Stefan Wahren 2015-11-12 451 dwc2_handle_common_intr, IRQF_SHARED,
f74875dc36135e drivers/usb/dwc2/platform.c Stefan Wahren 2015-11-12 452 dev_name(hsotg->dev), hsotg);
f74875dc36135e drivers/usb/dwc2/platform.c Stefan Wahren 2015-11-12 453 if (retval)
f74875dc36135e drivers/usb/dwc2/platform.c Stefan Wahren 2015-11-12 454 return retval;
f74875dc36135e drivers/usb/dwc2/platform.c Stefan Wahren 2015-11-12 455
e0f681c2c11a25 drivers/usb/dwc2/platform.c Fabrice Gasnier 2018-09-05 456 hsotg->vbus_supply = devm_regulator_get_optional(hsotg->dev, "vbus");
e0f681c2c11a25 drivers/usb/dwc2/platform.c Fabrice Gasnier 2018-09-05 457 if (IS_ERR(hsotg->vbus_supply)) {
e0f681c2c11a25 drivers/usb/dwc2/platform.c Fabrice Gasnier 2018-09-05 458 retval = PTR_ERR(hsotg->vbus_supply);
e0f681c2c11a25 drivers/usb/dwc2/platform.c Fabrice Gasnier 2018-09-05 459 hsotg->vbus_supply = NULL;
e0f681c2c11a25 drivers/usb/dwc2/platform.c Fabrice Gasnier 2018-09-05 460 if (retval != -ENODEV)
e0f681c2c11a25 drivers/usb/dwc2/platform.c Fabrice Gasnier 2018-09-05 461 return retval;
e0f681c2c11a25 drivers/usb/dwc2/platform.c Fabrice Gasnier 2018-09-05 462 }
e0f681c2c11a25 drivers/usb/dwc2/platform.c Fabrice Gasnier 2018-09-05 463
09a75e85779014 drivers/usb/dwc2/platform.c Marek Szyprowski 2015-10-14 464 retval = dwc2_lowlevel_hw_enable(hsotg);
09a75e85779014 drivers/usb/dwc2/platform.c Marek Szyprowski 2015-10-14 465 if (retval)
09a75e85779014 drivers/usb/dwc2/platform.c Marek Szyprowski 2015-10-14 466 return retval;
09a75e85779014 drivers/usb/dwc2/platform.c Marek Szyprowski 2015-10-14 467
d9707490077bee drivers/usb/dwc2/platform.c Bruno Meirelles Herrera 2018-08-27 468 hsotg->needs_byte_swap = dwc2_check_core_endianness(hsotg);
d9707490077bee drivers/usb/dwc2/platform.c Bruno Meirelles Herrera 2018-08-27 469
5268ed9d2e3b52 drivers/usb/dwc2/platform.c John Youn 2015-12-17 470 retval = dwc2_get_dr_mode(hsotg);
5268ed9d2e3b52 drivers/usb/dwc2/platform.c John Youn 2015-12-17 471 if (retval)
a6ef3e02542a33 drivers/usb/dwc2/platform.c John Youn 2016-04-27 472 goto error;
5268ed9d2e3b52 drivers/usb/dwc2/platform.c John Youn 2015-12-17 473
c846b03ff76714 drivers/usb/dwc2/platform.c Douglas Anderson 2019-05-20 474 hsotg->need_phy_for_wake =
c846b03ff76714 drivers/usb/dwc2/platform.c Douglas Anderson 2019-05-20 475 of_property_read_bool(dev->dev.of_node,
c846b03ff76714 drivers/usb/dwc2/platform.c Douglas Anderson 2019-05-20 476 "snps,need-phy-for-wake");
c846b03ff76714 drivers/usb/dwc2/platform.c Douglas Anderson 2019-05-20 477
65dc2e72528610 drivers/usb/dwc2/platform.c Minas Harutyunyan 2020-05-21 478 /*
65dc2e72528610 drivers/usb/dwc2/platform.c Minas Harutyunyan 2020-05-21 479 * Before performing any core related operations
65dc2e72528610 drivers/usb/dwc2/platform.c Minas Harutyunyan 2020-05-21 480 * check core version.
65dc2e72528610 drivers/usb/dwc2/platform.c Minas Harutyunyan 2020-05-21 481 */
65dc2e72528610 drivers/usb/dwc2/platform.c Minas Harutyunyan 2020-05-21 482 retval = dwc2_check_core_version(hsotg);
65dc2e72528610 drivers/usb/dwc2/platform.c Minas Harutyunyan 2020-05-21 483 if (retval)
65dc2e72528610 drivers/usb/dwc2/platform.c Minas Harutyunyan 2020-05-21 484 goto error;
65dc2e72528610 drivers/usb/dwc2/platform.c Minas Harutyunyan 2020-05-21 485
03b32e4c9bd1b5 drivers/usb/dwc2/platform.c John Youn 2016-01-11 486 /*
03b32e4c9bd1b5 drivers/usb/dwc2/platform.c John Youn 2016-01-11 487 * Reset before dwc2_get_hwparams() then it could get power-on real
03b32e4c9bd1b5 drivers/usb/dwc2/platform.c John Youn 2016-01-11 488 * reset value form registers.
03b32e4c9bd1b5 drivers/usb/dwc2/platform.c John Youn 2016-01-11 489 */
13b1f8e25bfd1d drivers/usb/dwc2/platform.c Vardan Mikayelyan 2018-02-16 490 retval = dwc2_core_reset(hsotg, false);
13b1f8e25bfd1d drivers/usb/dwc2/platform.c Vardan Mikayelyan 2018-02-16 491 if (retval)
13b1f8e25bfd1d drivers/usb/dwc2/platform.c Vardan Mikayelyan 2018-02-16 492 goto error;
03b32e4c9bd1b5 drivers/usb/dwc2/platform.c John Youn 2016-01-11 493
03b32e4c9bd1b5 drivers/usb/dwc2/platform.c John Youn 2016-01-11 494 /* Detect config values from hardware */
09a75e85779014 drivers/usb/dwc2/platform.c Marek Szyprowski 2015-10-14 495 retval = dwc2_get_hwparams(hsotg);
09a75e85779014 drivers/usb/dwc2/platform.c Marek Szyprowski 2015-10-14 496 if (retval)
09a75e85779014 drivers/usb/dwc2/platform.c Marek Szyprowski 2015-10-14 497 goto error;
09a75e85779014 drivers/usb/dwc2/platform.c Marek Szyprowski 2015-10-14 498
13b1f8e25bfd1d drivers/usb/dwc2/platform.c Vardan Mikayelyan 2018-02-16 499 /*
13b1f8e25bfd1d drivers/usb/dwc2/platform.c Vardan Mikayelyan 2018-02-16 500 * For OTG cores, set the force mode bits to reflect the value
13b1f8e25bfd1d drivers/usb/dwc2/platform.c Vardan Mikayelyan 2018-02-16 501 * of dr_mode. Force mode bits should not be touched at any
13b1f8e25bfd1d drivers/usb/dwc2/platform.c Vardan Mikayelyan 2018-02-16 502 * other time after this.
13b1f8e25bfd1d drivers/usb/dwc2/platform.c Vardan Mikayelyan 2018-02-16 503 */
25362d318371e1 drivers/usb/dwc2/platform.c John Youn 2015-12-17 504 dwc2_force_dr_mode(hsotg);
263b7fb557f797 drivers/usb/dwc2/platform.c John Youn 2015-12-17 505
334bbd4ebe1b34 drivers/usb/dwc2/platform.c John Youn 2016-11-03 506 retval = dwc2_init_params(hsotg);
334bbd4ebe1b34 drivers/usb/dwc2/platform.c John Youn 2016-11-03 507 if (retval)
334bbd4ebe1b34 drivers/usb/dwc2/platform.c John Youn 2016-11-03 508 goto error;
334bbd4ebe1b34 drivers/usb/dwc2/platform.c John Youn 2016-11-03 509
a415083a11cc76 drivers/usb/dwc2/platform.c Amelie Delaunay 2020-01-24 510 if (hsotg->params.activate_stm_id_vb_detection) {
a415083a11cc76 drivers/usb/dwc2/platform.c Amelie Delaunay 2020-01-24 511 u32 ggpio;
a415083a11cc76 drivers/usb/dwc2/platform.c Amelie Delaunay 2020-01-24 512
a415083a11cc76 drivers/usb/dwc2/platform.c Amelie Delaunay 2020-01-24 513 hsotg->usb33d = devm_regulator_get(hsotg->dev, "usb33d");
a415083a11cc76 drivers/usb/dwc2/platform.c Amelie Delaunay 2020-01-24 514 if (IS_ERR(hsotg->usb33d)) {
a415083a11cc76 drivers/usb/dwc2/platform.c Amelie Delaunay 2020-01-24 515 retval = PTR_ERR(hsotg->usb33d);
a415083a11cc76 drivers/usb/dwc2/platform.c Amelie Delaunay 2020-01-24 516 if (retval != -EPROBE_DEFER)
a415083a11cc76 drivers/usb/dwc2/platform.c Amelie Delaunay 2020-01-24 517 dev_err(hsotg->dev,
a415083a11cc76 drivers/usb/dwc2/platform.c Amelie Delaunay 2020-01-24 518 "failed to request usb33d supply: %d\n",
a415083a11cc76 drivers/usb/dwc2/platform.c Amelie Delaunay 2020-01-24 519 retval);
a415083a11cc76 drivers/usb/dwc2/platform.c Amelie Delaunay 2020-01-24 520 goto error;
a415083a11cc76 drivers/usb/dwc2/platform.c Amelie Delaunay 2020-01-24 521 }
a415083a11cc76 drivers/usb/dwc2/platform.c Amelie Delaunay 2020-01-24 522 retval = regulator_enable(hsotg->usb33d);
a415083a11cc76 drivers/usb/dwc2/platform.c Amelie Delaunay 2020-01-24 523 if (retval) {
a415083a11cc76 drivers/usb/dwc2/platform.c Amelie Delaunay 2020-01-24 524 dev_err(hsotg->dev,
a415083a11cc76 drivers/usb/dwc2/platform.c Amelie Delaunay 2020-01-24 525 "failed to enable usb33d supply: %d\n", retval);
a415083a11cc76 drivers/usb/dwc2/platform.c Amelie Delaunay 2020-01-24 526 goto error;
a415083a11cc76 drivers/usb/dwc2/platform.c Amelie Delaunay 2020-01-24 527 }
a415083a11cc76 drivers/usb/dwc2/platform.c Amelie Delaunay 2020-01-24 528
a415083a11cc76 drivers/usb/dwc2/platform.c Amelie Delaunay 2020-01-24 529 ggpio = dwc2_readl(hsotg, GGPIO);
a415083a11cc76 drivers/usb/dwc2/platform.c Amelie Delaunay 2020-01-24 530 ggpio |= GGPIO_STM32_OTG_GCCFG_IDEN;
a415083a11cc76 drivers/usb/dwc2/platform.c Amelie Delaunay 2020-01-24 531 ggpio |= GGPIO_STM32_OTG_GCCFG_VBDEN;
a415083a11cc76 drivers/usb/dwc2/platform.c Amelie Delaunay 2020-01-24 532 dwc2_writel(hsotg, ggpio, GGPIO);
a415083a11cc76 drivers/usb/dwc2/platform.c Amelie Delaunay 2020-01-24 533 }
a415083a11cc76 drivers/usb/dwc2/platform.c Amelie Delaunay 2020-01-24 534
e39af88f18dfe9 drivers/usb/dwc2/platform.c Marek Szyprowski 2015-03-10 535 if (hsotg->dr_mode != USB_DR_MODE_HOST) {
f3768997013e1c drivers/usb/dwc2/platform.c Vardan Mikayelyan 2017-12-25 536 retval = dwc2_gadget_init(hsotg);
117777b2c3bb96 drivers/usb/dwc2/platform.c Dinh Nguyen 2014-11-11 537 if (retval)
a415083a11cc76 drivers/usb/dwc2/platform.c Amelie Delaunay 2020-01-24 538 goto error_init;
e39af88f18dfe9 drivers/usb/dwc2/platform.c Marek Szyprowski 2015-03-10 539 hsotg->gadget_enabled = 1;
e39af88f18dfe9 drivers/usb/dwc2/platform.c Marek Szyprowski 2015-03-10 540 }
e39af88f18dfe9 drivers/usb/dwc2/platform.c Marek Szyprowski 2015-03-10 541
c846b03ff76714 drivers/usb/dwc2/platform.c Douglas Anderson 2019-05-20 542 /*
c846b03ff76714 drivers/usb/dwc2/platform.c Douglas Anderson 2019-05-20 543 * If we need PHY for wakeup we must be wakeup capable.
c846b03ff76714 drivers/usb/dwc2/platform.c Douglas Anderson 2019-05-20 544 * When we have a device that can wake without the PHY we
c846b03ff76714 drivers/usb/dwc2/platform.c Douglas Anderson 2019-05-20 545 * can adjust this condition.
c846b03ff76714 drivers/usb/dwc2/platform.c Douglas Anderson 2019-05-20 546 */
c846b03ff76714 drivers/usb/dwc2/platform.c Douglas Anderson 2019-05-20 547 if (hsotg->need_phy_for_wake)
c846b03ff76714 drivers/usb/dwc2/platform.c Douglas Anderson 2019-05-20 548 device_set_wakeup_capable(&dev->dev, true);
c846b03ff76714 drivers/usb/dwc2/platform.c Douglas Anderson 2019-05-20 549
c40cf7705e13d2 drivers/usb/dwc2/platform.c Douglas Anderson 2019-04-16 550 hsotg->reset_phy_on_wake =
c40cf7705e13d2 drivers/usb/dwc2/platform.c Douglas Anderson 2019-04-16 551 of_property_read_bool(dev->dev.of_node,
c40cf7705e13d2 drivers/usb/dwc2/platform.c Douglas Anderson 2019-04-16 552 "snps,reset-phy-on-wake");
c40cf7705e13d2 drivers/usb/dwc2/platform.c Douglas Anderson 2019-04-16 553 if (hsotg->reset_phy_on_wake && !hsotg->phy) {
c40cf7705e13d2 drivers/usb/dwc2/platform.c Douglas Anderson 2019-04-16 554 dev_warn(hsotg->dev,
c40cf7705e13d2 drivers/usb/dwc2/platform.c Douglas Anderson 2019-04-16 555 "Quirk reset-phy-on-wake only supports generic PHYs\n");
c40cf7705e13d2 drivers/usb/dwc2/platform.c Douglas Anderson 2019-04-16 556 hsotg->reset_phy_on_wake = false;
c40cf7705e13d2 drivers/usb/dwc2/platform.c Douglas Anderson 2019-04-16 557 }
c40cf7705e13d2 drivers/usb/dwc2/platform.c Douglas Anderson 2019-04-16 558
e39af88f18dfe9 drivers/usb/dwc2/platform.c Marek Szyprowski 2015-03-10 559 if (hsotg->dr_mode != USB_DR_MODE_PERIPHERAL) {
4fe160d51e4226 drivers/usb/dwc2/platform.c Heiner Kallweit 2017-01-25 560 retval = dwc2_hcd_init(hsotg);
e39af88f18dfe9 drivers/usb/dwc2/platform.c Marek Szyprowski 2015-03-10 561 if (retval) {
e39af88f18dfe9 drivers/usb/dwc2/platform.c Marek Szyprowski 2015-03-10 562 if (hsotg->gadget_enabled)
1f91b4cc03556b drivers/usb/dwc2/platform.c Felipe Balbi 2015-08-06 563 dwc2_hsotg_remove(hsotg);
a415083a11cc76 drivers/usb/dwc2/platform.c Amelie Delaunay 2020-01-24 564 goto error_init;
e39af88f18dfe9 drivers/usb/dwc2/platform.c Marek Szyprowski 2015-03-10 565 }
e39af88f18dfe9 drivers/usb/dwc2/platform.c Marek Szyprowski 2015-03-10 566 hsotg->hcd_enabled = 1;
e39af88f18dfe9 drivers/usb/dwc2/platform.c Marek Szyprowski 2015-03-10 567 }
5b9974b13e3648 drivers/staging/dwc2/platform.c Matthijs Kooijman 2013-04-22 568
5b9974b13e3648 drivers/staging/dwc2/platform.c Matthijs Kooijman 2013-04-22 569 platform_set_drvdata(dev, hsotg);
20fe440982e72d drivers/usb/dwc2/platform.c Vardan Mikayelyan 2018-02-16 570 hsotg->hibernated = 0;
5b9974b13e3648 drivers/staging/dwc2/platform.c Matthijs Kooijman 2013-04-22 571
f91eea447ac32d drivers/usb/dwc2/platform.c Mian Yousaf Kaukab 2015-04-29 572 dwc2_debugfs_init(hsotg);
f91eea447ac32d drivers/usb/dwc2/platform.c Mian Yousaf Kaukab 2015-04-29 573
09a75e85779014 drivers/usb/dwc2/platform.c Marek Szyprowski 2015-10-14 574 /* Gadget code manages lowlevel hw on its own */
09a75e85779014 drivers/usb/dwc2/platform.c Marek Szyprowski 2015-10-14 575 if (hsotg->dr_mode == USB_DR_MODE_PERIPHERAL)
09a75e85779014 drivers/usb/dwc2/platform.c Marek Szyprowski 2015-10-14 576 dwc2_lowlevel_hw_disable(hsotg);
09a75e85779014 drivers/usb/dwc2/platform.c Marek Szyprowski 2015-10-14 577
207324a321a866 drivers/usb/dwc2/platform.c Minas Harutyunyan 2020-06-09 578 #if IS_ENABLED(CONFIG_USB_DWC2_PERIPHERAL) || \
207324a321a866 drivers/usb/dwc2/platform.c Minas Harutyunyan 2020-06-09 579 IS_ENABLED(CONFIG_USB_DWC2_DUAL_ROLE)
207324a321a866 drivers/usb/dwc2/platform.c Minas Harutyunyan 2020-06-09 580 /* Postponed adding a new gadget to the udc class driver list */
207324a321a866 drivers/usb/dwc2/platform.c Minas Harutyunyan 2020-06-09 581 if (hsotg->gadget_enabled) {
207324a321a866 drivers/usb/dwc2/platform.c Minas Harutyunyan 2020-06-09 582 retval = usb_add_gadget_udc(hsotg->dev, &hsotg->gadget);
207324a321a866 drivers/usb/dwc2/platform.c Minas Harutyunyan 2020-06-09 583 if (retval) {
207324a321a866 drivers/usb/dwc2/platform.c Minas Harutyunyan 2020-06-09 584 dwc2_hsotg_remove(hsotg);
67a20d5fad7c28 drivers/usb/dwc2/platform.c Martin Blumenstingl 2020-07-04 585 goto error_debugfs;
207324a321a866 drivers/usb/dwc2/platform.c Minas Harutyunyan 2020-06-09 586 }
207324a321a866 drivers/usb/dwc2/platform.c Minas Harutyunyan 2020-06-09 587 }
207324a321a866 drivers/usb/dwc2/platform.c Minas Harutyunyan 2020-06-09 588 #endif /* CONFIG_USB_DWC2_PERIPHERAL || CONFIG_USB_DWC2_DUAL_ROLE */
09a75e85779014 drivers/usb/dwc2/platform.c Marek Szyprowski 2015-10-14 589 return 0;
09a75e85779014 drivers/usb/dwc2/platform.c Marek Szyprowski 2015-10-14 590
67a20d5fad7c28 drivers/usb/dwc2/platform.c Martin Blumenstingl 2020-07-04 @591 error_debugfs:
67a20d5fad7c28 drivers/usb/dwc2/platform.c Martin Blumenstingl 2020-07-04 592 dwc2_debugfs_exit(hsotg);
67a20d5fad7c28 drivers/usb/dwc2/platform.c Martin Blumenstingl 2020-07-04 593 if (hsotg->hcd_enabled)
67a20d5fad7c28 drivers/usb/dwc2/platform.c Martin Blumenstingl 2020-07-04 594 dwc2_hcd_remove(hsotg);
a415083a11cc76 drivers/usb/dwc2/platform.c Amelie Delaunay 2020-01-24 595 error_init:
a415083a11cc76 drivers/usb/dwc2/platform.c Amelie Delaunay 2020-01-24 596 if (hsotg->params.activate_stm_id_vb_detection)
a415083a11cc76 drivers/usb/dwc2/platform.c Amelie Delaunay 2020-01-24 597 regulator_disable(hsotg->usb33d);
09a75e85779014 drivers/usb/dwc2/platform.c Marek Szyprowski 2015-10-14 598 error:
09a75e85779014 drivers/usb/dwc2/platform.c Marek Szyprowski 2015-10-14 599 dwc2_lowlevel_hw_disable(hsotg);
5b9974b13e3648 drivers/staging/dwc2/platform.c Matthijs Kooijman 2013-04-22 600 return retval;
5b9974b13e3648 drivers/staging/dwc2/platform.c Matthijs Kooijman 2013-04-22 601 }
5b9974b13e3648 drivers/staging/dwc2/platform.c Matthijs Kooijman 2013-04-22 602
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 10 months
Re: [Intel-gfx] [PATCH 23/23] drm/i915/gem: Pull execbuf dma resv under a single critical section
by kernel test robot
CC: kbuild-all(a)lists.01.org
In-Reply-To: <20200702083225.20044-23-chris(a)chris-wilson.co.uk>
References: <20200702083225.20044-23-chris(a)chris-wilson.co.uk>
TO: Chris Wilson <chris(a)chris-wilson.co.uk>
TO: intel-gfx(a)lists.freedesktop.org
CC: Chris Wilson <chris(a)chris-wilson.co.uk>
Hi Chris,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on drm-intel/for-linux-next]
[cannot apply to drm-tip/drm-tip linus/master v5.8-rc3 next-20200703]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Chris-Wilson/drm-i915-Drop-vm-re...
base: git://anongit.freedesktop.org/drm-intel for-linux-next
:::::: branch date: 2 days ago
:::::: commit date: 2 days ago
config: i386-randconfig-m021-20200701 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-14) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
New smatch warnings:
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c:2238 eb_relocs_copy_user() error: uninitialized symbol 'err'.
Old smatch warnings:
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c:1955 reloc_move_to_gpu() warn: maybe use && instead of &
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c:1975 vma_phys_addr() warn: right shifting more than type allows 32 vs 32
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c:2473 eb_move_to_gpu() warn: maybe use && instead of &
drivers/gpu/drm/i915/gt/intel_context.h:152 intel_context_timeline_lock() warn: inconsistent returns 'tl->mutex'.
drivers/gpu/drm/i915/gem/i915_gem_context.h:211 i915_gem_context_get_engine() warn: inconsistent indenting
drivers/gpu/drm/i915/gem/i915_gem_context.h:213 i915_gem_context_get_engine() warn: inconsistent indenting
# https://github.com/0day-ci/linux/commit/a37917d9f2adc558f53a428c079ebfe3c...
git remote add linux-review https://github.com/0day-ci/linux
git remote update linux-review
git checkout a37917d9f2adc558f53a428c079ebfe3caad14e5
vim +/err +2238 drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
c475f0c0a32f56 Chris Wilson 2020-07-02 2217
c475f0c0a32f56 Chris Wilson 2020-07-02 2218 static int eb_relocs_copy_user(struct i915_execbuffer *eb)
c475f0c0a32f56 Chris Wilson 2020-07-02 2219 {
c475f0c0a32f56 Chris Wilson 2020-07-02 2220 struct eb_vma *ev;
c475f0c0a32f56 Chris Wilson 2020-07-02 2221 int err;
c475f0c0a32f56 Chris Wilson 2020-07-02 2222
c475f0c0a32f56 Chris Wilson 2020-07-02 2223 /* Drop everything before we copy_from_user */
c475f0c0a32f56 Chris Wilson 2020-07-02 2224 list_for_each_entry(ev, &eb->bind_list, bind_link)
c475f0c0a32f56 Chris Wilson 2020-07-02 2225 eb_unreserve_vma(ev);
a37917d9f2adc5 Chris Wilson 2020-07-02 2226 i915_acquire_ctx_fini(&eb->acquire);
c475f0c0a32f56 Chris Wilson 2020-07-02 2227
c475f0c0a32f56 Chris Wilson 2020-07-02 2228 eb->reloc_cache.head.vma = NULL;
c475f0c0a32f56 Chris Wilson 2020-07-02 2229 eb->reloc_cache.pos = N_RELOC;
c475f0c0a32f56 Chris Wilson 2020-07-02 2230
c475f0c0a32f56 Chris Wilson 2020-07-02 2231 list_for_each_entry(ev, &eb->relocs, reloc_link) {
c475f0c0a32f56 Chris Wilson 2020-07-02 2232 err = eb_relocs_copy_vma(eb, ev);
c475f0c0a32f56 Chris Wilson 2020-07-02 2233 if (err)
a37917d9f2adc5 Chris Wilson 2020-07-02 2234 break;
c475f0c0a32f56 Chris Wilson 2020-07-02 2235 }
c475f0c0a32f56 Chris Wilson 2020-07-02 2236
a37917d9f2adc5 Chris Wilson 2020-07-02 2237 i915_acquire_ctx_init(&eb->acquire);
a37917d9f2adc5 Chris Wilson 2020-07-02 @2238 if (err)
a37917d9f2adc5 Chris Wilson 2020-07-02 2239 return err;
a37917d9f2adc5 Chris Wilson 2020-07-02 2240
c475f0c0a32f56 Chris Wilson 2020-07-02 2241 /* Now reacquire everything, including the extra reloc bo */
c475f0c0a32f56 Chris Wilson 2020-07-02 2242 return eb_reserve_vm(eb);
c475f0c0a32f56 Chris Wilson 2020-07-02 2243 }
c475f0c0a32f56 Chris Wilson 2020-07-02 2244
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 10 months
[android-common:android-5.4-stable 1/2] fs/ext4/namei.c:3221 ext4_rmdir() error: uninitialized symbol 'lblk'.
by kernel test robot
CC: kbuild-all(a)lists.01.org
TO: cros-kernel-buildreports(a)googlegroups.com
tree: https://android.googlesource.com/kernel/common android-5.4-stable
head: 954d16b089d175848669949bc0f501686042a6a8
commit: 268041d71e8b87d5db75dfe6a12a6cdfdbd0c9a0 [1/2] ANDROID: ext4: Handle casefolding with encryption
:::::: branch date: 9 days ago
:::::: commit date: 9 days ago
config: x86_64-randconfig-m001-20200701 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-14) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
New smatch warnings:
fs/ext4/namei.c:3221 ext4_rmdir() error: uninitialized symbol 'lblk'.
fs/ext4/namei.c:3306 ext4_unlink() error: uninitialized symbol 'lblk'.
fs/ext4/namei.c:3662 ext4_find_delete_entry() error: uninitialized symbol 'lblk'.
Old smatch warnings:
fs/ext4/namei.c:1766 ext4_lookup() error: potentially dereferencing uninitialized 'de'.
fs/ext4/namei.c:1821 ext4_get_parent() error: potentially dereferencing uninitialized 'de'.
fs/ext4/namei.c:3203 ext4_rmdir() error: potentially dereferencing uninitialized 'de'.
fs/ext4/namei.c:3292 ext4_unlink() error: potentially dereferencing uninitialized 'de'.
fs/ext4/namei.c:3662 ext4_find_delete_entry() error: uninitialized symbol 'de'.
git remote add android-common https://android.googlesource.com/kernel/common
git remote update android-common
git checkout 268041d71e8b87d5db75dfe6a12a6cdfdbd0c9a0
vim +/lblk +3221 fs/ext4/namei.c
ac27a0ec112a08 Dave Kleikamp 2006-10-11 3170
617ba13b31fbf5 Mingming Cao 2006-10-11 3171 static int ext4_rmdir(struct inode *dir, struct dentry *dentry)
ac27a0ec112a08 Dave Kleikamp 2006-10-11 3172 {
ac27a0ec112a08 Dave Kleikamp 2006-10-11 3173 int retval;
ac27a0ec112a08 Dave Kleikamp 2006-10-11 3174 struct inode *inode;
ac27a0ec112a08 Dave Kleikamp 2006-10-11 3175 struct buffer_head *bh;
617ba13b31fbf5 Mingming Cao 2006-10-11 3176 struct ext4_dir_entry_2 *de;
8dcfaad244cdfa Theodore Ts'o 2013-02-09 3177 handle_t *handle = NULL;
268041d71e8b87 Daniel Rosenberg 2019-10-07 3178 ext4_lblk_t lblk;
268041d71e8b87 Daniel Rosenberg 2019-10-07 3179
ac27a0ec112a08 Dave Kleikamp 2006-10-11 3180
0db1ff222d40f1 Theodore Ts'o 2017-02-05 3181 if (unlikely(ext4_forced_shutdown(EXT4_SB(dir->i_sb))))
0db1ff222d40f1 Theodore Ts'o 2017-02-05 3182 return -EIO;
0db1ff222d40f1 Theodore Ts'o 2017-02-05 3183
ac27a0ec112a08 Dave Kleikamp 2006-10-11 3184 /* Initialize quotas before so that eventual writes go in
ac27a0ec112a08 Dave Kleikamp 2006-10-11 3185 * separate transaction */
a7cdadee0e8948 Jan Kara 2015-06-29 3186 retval = dquot_initialize(dir);
a7cdadee0e8948 Jan Kara 2015-06-29 3187 if (retval)
a7cdadee0e8948 Jan Kara 2015-06-29 3188 return retval;
a7cdadee0e8948 Jan Kara 2015-06-29 3189 retval = dquot_initialize(d_inode(dentry));
a7cdadee0e8948 Jan Kara 2015-06-29 3190 if (retval)
a7cdadee0e8948 Jan Kara 2015-06-29 3191 return retval;
907f4554e2521c Christoph Hellwig 2010-03-03 3192
ac27a0ec112a08 Dave Kleikamp 2006-10-11 3193 retval = -ENOENT;
268041d71e8b87 Daniel Rosenberg 2019-10-07 3194 bh = ext4_find_entry(dir, &dentry->d_name, &de, NULL, &lblk);
36de928641ee48 Theodore Ts'o 2014-08-23 3195 if (IS_ERR(bh))
36de928641ee48 Theodore Ts'o 2014-08-23 3196 return PTR_ERR(bh);
ac27a0ec112a08 Dave Kleikamp 2006-10-11 3197 if (!bh)
ac27a0ec112a08 Dave Kleikamp 2006-10-11 3198 goto end_rmdir;
ac27a0ec112a08 Dave Kleikamp 2006-10-11 3199
2b0143b5c986be David Howells 2015-03-17 3200 inode = d_inode(dentry);
ac27a0ec112a08 Dave Kleikamp 2006-10-11 3201
6a797d27378389 Darrick J. Wong 2015-10-17 3202 retval = -EFSCORRUPTED;
ac27a0ec112a08 Dave Kleikamp 2006-10-11 3203 if (le32_to_cpu(de->inode) != inode->i_ino)
ac27a0ec112a08 Dave Kleikamp 2006-10-11 3204 goto end_rmdir;
ac27a0ec112a08 Dave Kleikamp 2006-10-11 3205
ac27a0ec112a08 Dave Kleikamp 2006-10-11 3206 retval = -ENOTEMPTY;
e875a2ddba06ff Michael Halcrow 2015-04-11 3207 if (!ext4_empty_dir(inode))
ac27a0ec112a08 Dave Kleikamp 2006-10-11 3208 goto end_rmdir;
ac27a0ec112a08 Dave Kleikamp 2006-10-11 3209
8dcfaad244cdfa Theodore Ts'o 2013-02-09 3210 handle = ext4_journal_start(dir, EXT4_HT_DIR,
64044abf05d084 Theodore Ts'o 2013-02-09 3211 EXT4_DATA_TRANS_BLOCKS(dir->i_sb));
8dcfaad244cdfa Theodore Ts'o 2013-02-09 3212 if (IS_ERR(handle)) {
8dcfaad244cdfa Theodore Ts'o 2013-02-09 3213 retval = PTR_ERR(handle);
8dcfaad244cdfa Theodore Ts'o 2013-02-09 3214 handle = NULL;
8dcfaad244cdfa Theodore Ts'o 2013-02-09 3215 goto end_rmdir;
8dcfaad244cdfa Theodore Ts'o 2013-02-09 3216 }
8dcfaad244cdfa Theodore Ts'o 2013-02-09 3217
8dcfaad244cdfa Theodore Ts'o 2013-02-09 3218 if (IS_DIRSYNC(dir))
8dcfaad244cdfa Theodore Ts'o 2013-02-09 3219 ext4_handle_sync(handle);
8dcfaad244cdfa Theodore Ts'o 2013-02-09 3220
268041d71e8b87 Daniel Rosenberg 2019-10-07 @3221 retval = ext4_delete_entry(handle, dir, de, lblk, bh);
ac27a0ec112a08 Dave Kleikamp 2006-10-11 3222 if (retval)
ac27a0ec112a08 Dave Kleikamp 2006-10-11 3223 goto end_rmdir;
f8628a14a27eb4 Andreas Dilger 2007-07-18 3224 if (!EXT4_DIR_LINK_EMPTY(inode))
b03a2f7eb21cc0 Andreas Dilger 2015-06-15 3225 ext4_warning_inode(inode,
b03a2f7eb21cc0 Andreas Dilger 2015-06-15 3226 "empty directory '%.*s' has too many links (%u)",
b03a2f7eb21cc0 Andreas Dilger 2015-06-15 3227 dentry->d_name.len, dentry->d_name.name,
ac27a0ec112a08 Dave Kleikamp 2006-10-11 3228 inode->i_nlink);
ee73f9a52a3437 Jeff Layton 2018-01-09 3229 inode_inc_iversion(inode);
ac27a0ec112a08 Dave Kleikamp 2006-10-11 3230 clear_nlink(inode);
ac27a0ec112a08 Dave Kleikamp 2006-10-11 3231 /* There's no need to set i_disksize: the fact that i_nlink is
ac27a0ec112a08 Dave Kleikamp 2006-10-11 3232 * zero will ensure that the right thing happens during any
ac27a0ec112a08 Dave Kleikamp 2006-10-11 3233 * recovery. */
ac27a0ec112a08 Dave Kleikamp 2006-10-11 3234 inode->i_size = 0;
617ba13b31fbf5 Mingming Cao 2006-10-11 3235 ext4_orphan_add(handle, inode);
eeca7ea1baa939 Deepa Dinamani 2016-11-14 3236 inode->i_ctime = dir->i_ctime = dir->i_mtime = current_time(inode);
617ba13b31fbf5 Mingming Cao 2006-10-11 3237 ext4_mark_inode_dirty(handle, inode);
f8628a14a27eb4 Andreas Dilger 2007-07-18 3238 ext4_dec_count(handle, dir);
617ba13b31fbf5 Mingming Cao 2006-10-11 3239 ext4_update_dx_flag(dir);
617ba13b31fbf5 Mingming Cao 2006-10-11 3240 ext4_mark_inode_dirty(handle, dir);
ac27a0ec112a08 Dave Kleikamp 2006-10-11 3241
b886ee3e778ec2 Gabriel Krisman Bertazi 2019-04-25 3242 #ifdef CONFIG_UNICODE
b886ee3e778ec2 Gabriel Krisman Bertazi 2019-04-25 3243 /* VFS negative dentries are incompatible with Encoding and
b886ee3e778ec2 Gabriel Krisman Bertazi 2019-04-25 3244 * Case-insensitiveness. Eventually we'll want avoid
b886ee3e778ec2 Gabriel Krisman Bertazi 2019-04-25 3245 * invalidating the dentries here, alongside with returning the
b886ee3e778ec2 Gabriel Krisman Bertazi 2019-04-25 3246 * negative dentries at ext4_lookup(), when it is better
b886ee3e778ec2 Gabriel Krisman Bertazi 2019-04-25 3247 * supported by the VFS for the CI case.
b886ee3e778ec2 Gabriel Krisman Bertazi 2019-04-25 3248 */
b886ee3e778ec2 Gabriel Krisman Bertazi 2019-04-25 3249 if (IS_CASEFOLDED(dir))
b886ee3e778ec2 Gabriel Krisman Bertazi 2019-04-25 3250 d_invalidate(dentry);
b886ee3e778ec2 Gabriel Krisman Bertazi 2019-04-25 3251 #endif
b886ee3e778ec2 Gabriel Krisman Bertazi 2019-04-25 3252
ac27a0ec112a08 Dave Kleikamp 2006-10-11 3253 end_rmdir:
ac27a0ec112a08 Dave Kleikamp 2006-10-11 3254 brelse(bh);
8dcfaad244cdfa Theodore Ts'o 2013-02-09 3255 if (handle)
8dcfaad244cdfa Theodore Ts'o 2013-02-09 3256 ext4_journal_stop(handle);
ac27a0ec112a08 Dave Kleikamp 2006-10-11 3257 return retval;
ac27a0ec112a08 Dave Kleikamp 2006-10-11 3258 }
ac27a0ec112a08 Dave Kleikamp 2006-10-11 3259
617ba13b31fbf5 Mingming Cao 2006-10-11 3260 static int ext4_unlink(struct inode *dir, struct dentry *dentry)
ac27a0ec112a08 Dave Kleikamp 2006-10-11 3261 {
ac27a0ec112a08 Dave Kleikamp 2006-10-11 3262 int retval;
ac27a0ec112a08 Dave Kleikamp 2006-10-11 3263 struct inode *inode;
ac27a0ec112a08 Dave Kleikamp 2006-10-11 3264 struct buffer_head *bh;
617ba13b31fbf5 Mingming Cao 2006-10-11 3265 struct ext4_dir_entry_2 *de;
931b68649d31b6 Theodore Ts'o 2013-02-09 3266 handle_t *handle = NULL;
268041d71e8b87 Daniel Rosenberg 2019-10-07 3267 ext4_lblk_t lblk;
ac27a0ec112a08 Dave Kleikamp 2006-10-11 3268
0db1ff222d40f1 Theodore Ts'o 2017-02-05 3269 if (unlikely(ext4_forced_shutdown(EXT4_SB(dir->i_sb))))
0db1ff222d40f1 Theodore Ts'o 2017-02-05 3270 return -EIO;
0db1ff222d40f1 Theodore Ts'o 2017-02-05 3271
0562e0bad483d1 Jiaying Zhang 2011-03-21 3272 trace_ext4_unlink_enter(dir, dentry);
ac27a0ec112a08 Dave Kleikamp 2006-10-11 3273 /* Initialize quotas before so that eventual writes go
ac27a0ec112a08 Dave Kleikamp 2006-10-11 3274 * in separate transaction */
a7cdadee0e8948 Jan Kara 2015-06-29 3275 retval = dquot_initialize(dir);
a7cdadee0e8948 Jan Kara 2015-06-29 3276 if (retval)
a7cdadee0e8948 Jan Kara 2015-06-29 3277 return retval;
a7cdadee0e8948 Jan Kara 2015-06-29 3278 retval = dquot_initialize(d_inode(dentry));
a7cdadee0e8948 Jan Kara 2015-06-29 3279 if (retval)
a7cdadee0e8948 Jan Kara 2015-06-29 3280 return retval;
907f4554e2521c Christoph Hellwig 2010-03-03 3281
ac27a0ec112a08 Dave Kleikamp 2006-10-11 3282 retval = -ENOENT;
268041d71e8b87 Daniel Rosenberg 2019-10-07 3283 bh = ext4_find_entry(dir, &dentry->d_name, &de, NULL, &lblk);
36de928641ee48 Theodore Ts'o 2014-08-23 3284 if (IS_ERR(bh))
36de928641ee48 Theodore Ts'o 2014-08-23 3285 return PTR_ERR(bh);
ac27a0ec112a08 Dave Kleikamp 2006-10-11 3286 if (!bh)
ac27a0ec112a08 Dave Kleikamp 2006-10-11 3287 goto end_unlink;
ac27a0ec112a08 Dave Kleikamp 2006-10-11 3288
2b0143b5c986be David Howells 2015-03-17 3289 inode = d_inode(dentry);
ac27a0ec112a08 Dave Kleikamp 2006-10-11 3290
6a797d27378389 Darrick J. Wong 2015-10-17 3291 retval = -EFSCORRUPTED;
ac27a0ec112a08 Dave Kleikamp 2006-10-11 3292 if (le32_to_cpu(de->inode) != inode->i_ino)
ac27a0ec112a08 Dave Kleikamp 2006-10-11 3293 goto end_unlink;
ac27a0ec112a08 Dave Kleikamp 2006-10-11 3294
931b68649d31b6 Theodore Ts'o 2013-02-09 3295 handle = ext4_journal_start(dir, EXT4_HT_DIR,
64044abf05d084 Theodore Ts'o 2013-02-09 3296 EXT4_DATA_TRANS_BLOCKS(dir->i_sb));
931b68649d31b6 Theodore Ts'o 2013-02-09 3297 if (IS_ERR(handle)) {
931b68649d31b6 Theodore Ts'o 2013-02-09 3298 retval = PTR_ERR(handle);
931b68649d31b6 Theodore Ts'o 2013-02-09 3299 handle = NULL;
931b68649d31b6 Theodore Ts'o 2013-02-09 3300 goto end_unlink;
931b68649d31b6 Theodore Ts'o 2013-02-09 3301 }
931b68649d31b6 Theodore Ts'o 2013-02-09 3302
931b68649d31b6 Theodore Ts'o 2013-02-09 3303 if (IS_DIRSYNC(dir))
931b68649d31b6 Theodore Ts'o 2013-02-09 3304 ext4_handle_sync(handle);
931b68649d31b6 Theodore Ts'o 2013-02-09 3305
268041d71e8b87 Daniel Rosenberg 2019-10-07 @3306 retval = ext4_delete_entry(handle, dir, de, lblk, bh);
ac27a0ec112a08 Dave Kleikamp 2006-10-11 3307 if (retval)
ac27a0ec112a08 Dave Kleikamp 2006-10-11 3308 goto end_unlink;
eeca7ea1baa939 Deepa Dinamani 2016-11-14 3309 dir->i_ctime = dir->i_mtime = current_time(dir);
617ba13b31fbf5 Mingming Cao 2006-10-11 3310 ext4_update_dx_flag(dir);
617ba13b31fbf5 Mingming Cao 2006-10-11 3311 ext4_mark_inode_dirty(handle, dir);
a44a5939a4097c Theodore Ts'o 2019-11-11 3312 if (inode->i_nlink == 0)
a44a5939a4097c Theodore Ts'o 2019-11-11 3313 ext4_warning_inode(inode, "Deleting file '%.*s' with no links",
a44a5939a4097c Theodore Ts'o 2019-11-11 3314 dentry->d_name.len, dentry->d_name.name);
a44a5939a4097c Theodore Ts'o 2019-11-11 3315 else
825f1481ead4ce Theodore Ts'o 2008-02-15 3316 drop_nlink(inode);
ac27a0ec112a08 Dave Kleikamp 2006-10-11 3317 if (!inode->i_nlink)
617ba13b31fbf5 Mingming Cao 2006-10-11 3318 ext4_orphan_add(handle, inode);
eeca7ea1baa939 Deepa Dinamani 2016-11-14 3319 inode->i_ctime = current_time(inode);
617ba13b31fbf5 Mingming Cao 2006-10-11 3320 ext4_mark_inode_dirty(handle, inode);
ac27a0ec112a08 Dave Kleikamp 2006-10-11 3321
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 10 months
Re: [Intel-gfx] [PATCH 07/23] drm/i915: Switch to object allocations for page directories
by kernel test robot
CC: kbuild-all(a)lists.01.org
In-Reply-To: <20200702083225.20044-7-chris(a)chris-wilson.co.uk>
References: <20200702083225.20044-7-chris(a)chris-wilson.co.uk>
TO: Chris Wilson <chris(a)chris-wilson.co.uk>
TO: intel-gfx(a)lists.freedesktop.org
CC: Chris Wilson <chris(a)chris-wilson.co.uk>
Hi Chris,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on drm-intel/for-linux-next]
[cannot apply to drm-tip/drm-tip linus/master v5.8-rc3 next-20200703]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Chris-Wilson/drm-i915-Drop-vm-re...
base: git://anongit.freedesktop.org/drm-intel for-linux-next
:::::: branch date: 2 days ago
:::::: commit date: 2 days ago
config: i386-randconfig-m021-20200701 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-14) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
New smatch warnings:
drivers/gpu/drm/i915/gt/intel_ppgtt.c:210 i915_vm_alloc_pt_stash() warn: passing a valid pointer to 'PTR_ERR'
Old smatch warnings:
drivers/gpu/drm/i915/gt/intel_ppgtt.c:226 i915_vm_alloc_pt_stash() warn: passing a valid pointer to 'PTR_ERR'
# https://github.com/0day-ci/linux/commit/1571ff000725fd4ad0d04542dba12d14f...
git remote add linux-review https://github.com/0day-ci/linux
git remote update linux-review
git checkout 1571ff000725fd4ad0d04542dba12d14f845292c
vim +/PTR_ERR +210 drivers/gpu/drm/i915/gt/intel_ppgtt.c
b05beb6b7751f9 Chris Wilson 2020-07-02 194
b05beb6b7751f9 Chris Wilson 2020-07-02 195 int i915_vm_alloc_pt_stash(struct i915_address_space *vm,
b05beb6b7751f9 Chris Wilson 2020-07-02 196 struct i915_vm_pt_stash *stash,
b05beb6b7751f9 Chris Wilson 2020-07-02 197 u64 size)
b05beb6b7751f9 Chris Wilson 2020-07-02 198 {
b05beb6b7751f9 Chris Wilson 2020-07-02 199 unsigned long count;
b05beb6b7751f9 Chris Wilson 2020-07-02 200 int shift = 21;
b05beb6b7751f9 Chris Wilson 2020-07-02 201 int n;
b05beb6b7751f9 Chris Wilson 2020-07-02 202
b05beb6b7751f9 Chris Wilson 2020-07-02 203 count = pd_count(size, shift);
b05beb6b7751f9 Chris Wilson 2020-07-02 204 while (count--) {
b05beb6b7751f9 Chris Wilson 2020-07-02 205 struct i915_page_table *pt;
b05beb6b7751f9 Chris Wilson 2020-07-02 206
b05beb6b7751f9 Chris Wilson 2020-07-02 207 pt = alloc_pt(vm);
b05beb6b7751f9 Chris Wilson 2020-07-02 208 if (IS_ERR(pt)) {
b05beb6b7751f9 Chris Wilson 2020-07-02 209 i915_vm_free_pt_stash(vm, stash);
b05beb6b7751f9 Chris Wilson 2020-07-02 @210 return PTR_ERR(pt);
b05beb6b7751f9 Chris Wilson 2020-07-02 211 }
b05beb6b7751f9 Chris Wilson 2020-07-02 212
b05beb6b7751f9 Chris Wilson 2020-07-02 213 pt->stash = stash->pt[0];
b05beb6b7751f9 Chris Wilson 2020-07-02 214 stash->pt[0] = pt;
b05beb6b7751f9 Chris Wilson 2020-07-02 215 }
b05beb6b7751f9 Chris Wilson 2020-07-02 216
b05beb6b7751f9 Chris Wilson 2020-07-02 217 for (n = 1; n < vm->top; n++) {
b05beb6b7751f9 Chris Wilson 2020-07-02 218 shift += 9;
b05beb6b7751f9 Chris Wilson 2020-07-02 219 count = pd_count(size, shift);
b05beb6b7751f9 Chris Wilson 2020-07-02 220 while (count--) {
b05beb6b7751f9 Chris Wilson 2020-07-02 221 struct i915_page_directory *pd;
b05beb6b7751f9 Chris Wilson 2020-07-02 222
b05beb6b7751f9 Chris Wilson 2020-07-02 223 pd = alloc_pd(vm);
b05beb6b7751f9 Chris Wilson 2020-07-02 224 if (IS_ERR(pd)) {
b05beb6b7751f9 Chris Wilson 2020-07-02 225 i915_vm_free_pt_stash(vm, stash);
b05beb6b7751f9 Chris Wilson 2020-07-02 226 return PTR_ERR(pd);
b05beb6b7751f9 Chris Wilson 2020-07-02 227 }
b05beb6b7751f9 Chris Wilson 2020-07-02 228
b05beb6b7751f9 Chris Wilson 2020-07-02 229 pd->pt.stash = stash->pt[1];
b05beb6b7751f9 Chris Wilson 2020-07-02 230 stash->pt[1] = &pd->pt;
b05beb6b7751f9 Chris Wilson 2020-07-02 231 }
b05beb6b7751f9 Chris Wilson 2020-07-02 232 }
b05beb6b7751f9 Chris Wilson 2020-07-02 233
b05beb6b7751f9 Chris Wilson 2020-07-02 234 return 0;
b05beb6b7751f9 Chris Wilson 2020-07-02 235 }
b05beb6b7751f9 Chris Wilson 2020-07-02 236
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 10 months
[linux-next:master 2982/5403] drivers/net/wireless/microchip/wilc1000/cfg80211.c:1096:9: warning: Identical condition 'ret', second condition is always false
by kernel test robot
CC: kbuild-all(a)lists.01.org
TO: Ajay Singh <ajay.kathat(a)microchip.com>
CC: Kalle Valo <kvalo(a)codeaurora.org>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 9e50b94b3eb0d859a2586b5a40d7fd6e5afd9210
commit: 5625f965d7644b4dc6a71d74021cfe093ad34eea [2982/5403] wilc1000: move wilc driver out of staging
:::::: branch date: 12 hours ago
:::::: commit date: 8 days ago
compiler: gcc-9 (Debian 9.3.0-14) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
cppcheck warnings: (new ones prefixed by >>)
>> drivers/net/wireless/microchip/wilc1000/cfg80211.c:1096:9: warning: Identical condition 'ret', second condition is always false [identicalConditionAfterEarlyExit]
return ret;
^
drivers/net/wireless/microchip/wilc1000/cfg80211.c:1081:6: note: first condition
if (ret)
^
drivers/net/wireless/microchip/wilc1000/cfg80211.c:1096:9: note: second condition
return ret;
^
>> drivers/net/wireless/microchip/wilc1000/cfg80211.c:844:6: warning: Variable 'ret' is reassigned a value before the old one has been used. [redundantAssignment]
ret = wilc_hif_set_cfg(vif, &cfg_param_val);
^
drivers/net/wireless/microchip/wilc1000/cfg80211.c:787:0: note: Variable 'ret' is reassigned a value before the old one has been used.
int ret = -EINVAL;
^
drivers/net/wireless/microchip/wilc1000/cfg80211.c:844:6: note: Variable 'ret' is reassigned a value before the old one has been used.
ret = wilc_hif_set_cfg(vif, &cfg_param_val);
^
drivers/net/wireless/microchip/wilc1000/cfg80211.c:1427:6: warning: Variable 'ret' is reassigned a value before the old one has been used. [redundantAssignment]
ret = wilc_del_station(vif, mac);
^
drivers/net/wireless/microchip/wilc1000/cfg80211.c:1425:7: note: Variable 'ret' is reassigned a value before the old one has been used.
ret = wilc_del_allstation(vif, info->sta_associated_bss);
^
drivers/net/wireless/microchip/wilc1000/cfg80211.c:1427:6: note: Variable 'ret' is reassigned a value before the old one has been used.
ret = wilc_del_station(vif, mac);
^
>> drivers/net/wireless/microchip/wilc1000/cfg80211.c:953:29: warning: Local variable e shadows outer variable [shadowVar]
struct wilc_ch_list_elem *e;
^
drivers/net/wireless/microchip/wilc1000/cfg80211.c:930:26: note: Shadowed declaration
struct wilc_attr_entry *e;
^
drivers/net/wireless/microchip/wilc1000/cfg80211.c:953:29: note: Shadow variable
struct wilc_ch_list_elem *e;
^
--
>> drivers/net/wireless/microchip/wilc1000/netdev.c:703:20: warning: Local variable vif shadows outer variable [shadowVar]
struct wilc_vif *vif;
^
drivers/net/wireless/microchip/wilc1000/netdev.c:674:19: note: Shadowed declaration
struct wilc_vif *vif = netdev_priv(ndev);
^
drivers/net/wireless/microchip/wilc1000/netdev.c:703:20: note: Shadow variable
struct wilc_vif *vif;
^
--
>> drivers/net/wireless/microchip/wilc1000/sdio.c:901:7: warning: Local variable reg shadows outer variable [shadowVar]
u32 reg;
^
drivers/net/wireless/microchip/wilc1000/sdio.c:879:6: note: Shadowed declaration
u32 reg;
^
drivers/net/wireless/microchip/wilc1000/sdio.c:901:7: note: Shadow variable
u32 reg;
^
# https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commi...
git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
git remote update linux-next
git checkout 5625f965d7644b4dc6a71d74021cfe093ad34eea
vim +/ret +1096 drivers/net/wireless/microchip/wilc1000/cfg80211.c
c5c77ba18ea66a drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Johnny Kim 2015-05-11 927
4fb8b5aa2a1126 drivers/staging/wilc1000/cfg80211.c Ajay Singh 2020-02-12 928 static inline void wilc_wfi_cfg_parse_ch_attr(u8 *buf, u32 len, u8 sta_ch)
0a0dac38d4060d drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Ajay Singh 2018-03-07 929 {
4fb8b5aa2a1126 drivers/staging/wilc1000/cfg80211.c Ajay Singh 2020-02-12 930 struct wilc_attr_entry *e;
4fb8b5aa2a1126 drivers/staging/wilc1000/cfg80211.c Ajay Singh 2020-02-12 931 struct wilc_attr_ch_list *ch_list;
4fb8b5aa2a1126 drivers/staging/wilc1000/cfg80211.c Ajay Singh 2020-02-12 932 struct wilc_attr_oper_ch *op_ch;
4fb8b5aa2a1126 drivers/staging/wilc1000/cfg80211.c Ajay Singh 2020-02-12 933 u32 index = 0;
4fb8b5aa2a1126 drivers/staging/wilc1000/cfg80211.c Ajay Singh 2020-02-12 934 u8 ch_list_idx = 0;
4fb8b5aa2a1126 drivers/staging/wilc1000/cfg80211.c Ajay Singh 2020-02-12 935 u8 op_ch_idx = 0;
0a0dac38d4060d drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Ajay Singh 2018-03-07 936
4fb8b5aa2a1126 drivers/staging/wilc1000/cfg80211.c Ajay Singh 2020-02-12 937 if (sta_ch == WILC_INVALID_CHANNEL)
4fb8b5aa2a1126 drivers/staging/wilc1000/cfg80211.c Ajay Singh 2020-02-12 938 return;
0a0dac38d4060d drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Ajay Singh 2018-03-07 939
4fb8b5aa2a1126 drivers/staging/wilc1000/cfg80211.c Ajay Singh 2020-02-12 940 while (index + sizeof(*e) <= len) {
4fb8b5aa2a1126 drivers/staging/wilc1000/cfg80211.c Ajay Singh 2020-02-12 941 e = (struct wilc_attr_entry *)&buf[index];
4fb8b5aa2a1126 drivers/staging/wilc1000/cfg80211.c Ajay Singh 2020-02-12 942 if (e->attr_type == IEEE80211_P2P_ATTR_CHANNEL_LIST)
4fb8b5aa2a1126 drivers/staging/wilc1000/cfg80211.c Ajay Singh 2020-02-12 943 ch_list_idx = index;
4fb8b5aa2a1126 drivers/staging/wilc1000/cfg80211.c Ajay Singh 2020-02-12 944 else if (e->attr_type == IEEE80211_P2P_ATTR_OPER_CHANNEL)
4fb8b5aa2a1126 drivers/staging/wilc1000/cfg80211.c Ajay Singh 2020-02-12 945 op_ch_idx = index;
4fb8b5aa2a1126 drivers/staging/wilc1000/cfg80211.c Ajay Singh 2020-02-12 946 if (ch_list_idx && op_ch_idx)
0a0dac38d4060d drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Ajay Singh 2018-03-07 947 break;
4fb8b5aa2a1126 drivers/staging/wilc1000/cfg80211.c Ajay Singh 2020-02-12 948 index += le16_to_cpu(e->attr_len) + sizeof(*e);
0a0dac38d4060d drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Ajay Singh 2018-03-07 949 }
0a0dac38d4060d drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Ajay Singh 2018-03-07 950
4fb8b5aa2a1126 drivers/staging/wilc1000/cfg80211.c Ajay Singh 2020-02-12 951 if (ch_list_idx) {
4fb8b5aa2a1126 drivers/staging/wilc1000/cfg80211.c Ajay Singh 2020-02-12 952 u16 attr_size;
4fb8b5aa2a1126 drivers/staging/wilc1000/cfg80211.c Ajay Singh 2020-02-12 @953 struct wilc_ch_list_elem *e;
4fb8b5aa2a1126 drivers/staging/wilc1000/cfg80211.c Ajay Singh 2020-02-12 954 int i;
c5c77ba18ea66a drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Johnny Kim 2015-05-11 955
4fb8b5aa2a1126 drivers/staging/wilc1000/cfg80211.c Ajay Singh 2020-02-12 956 ch_list = (struct wilc_attr_ch_list *)&buf[ch_list_idx];
4fb8b5aa2a1126 drivers/staging/wilc1000/cfg80211.c Ajay Singh 2020-02-12 957 attr_size = le16_to_cpu(ch_list->attr_len);
4fb8b5aa2a1126 drivers/staging/wilc1000/cfg80211.c Ajay Singh 2020-02-12 958 for (i = 0; i < attr_size;) {
4fb8b5aa2a1126 drivers/staging/wilc1000/cfg80211.c Ajay Singh 2020-02-12 959 e = (struct wilc_ch_list_elem *)(ch_list->elem + i);
4fb8b5aa2a1126 drivers/staging/wilc1000/cfg80211.c Ajay Singh 2020-02-12 960 if (e->op_class == WILC_WLAN_OPERATING_CLASS_2_4GHZ) {
4fb8b5aa2a1126 drivers/staging/wilc1000/cfg80211.c Ajay Singh 2020-02-12 961 memset(e->ch_list, sta_ch, e->no_of_channels);
4fb8b5aa2a1126 drivers/staging/wilc1000/cfg80211.c Ajay Singh 2020-02-12 962 break;
c5c77ba18ea66a drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Johnny Kim 2015-05-11 963 }
4fb8b5aa2a1126 drivers/staging/wilc1000/cfg80211.c Ajay Singh 2020-02-12 964 i += e->no_of_channels;
c5c77ba18ea66a drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Johnny Kim 2015-05-11 965 }
c5c77ba18ea66a drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Johnny Kim 2015-05-11 966 }
c5c77ba18ea66a drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Johnny Kim 2015-05-11 967
4fb8b5aa2a1126 drivers/staging/wilc1000/cfg80211.c Ajay Singh 2020-02-12 968 if (op_ch_idx) {
4fb8b5aa2a1126 drivers/staging/wilc1000/cfg80211.c Ajay Singh 2020-02-12 969 op_ch = (struct wilc_attr_oper_ch *)&buf[op_ch_idx];
4fb8b5aa2a1126 drivers/staging/wilc1000/cfg80211.c Ajay Singh 2020-02-12 970 op_ch->op_class = WILC_WLAN_OPERATING_CLASS_2_4GHZ;
4fb8b5aa2a1126 drivers/staging/wilc1000/cfg80211.c Ajay Singh 2020-02-12 971 op_ch->op_channel = sta_ch;
7868ee3b73e773 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Ajay Singh 2018-04-23 972 }
7868ee3b73e773 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Ajay Singh 2018-04-23 973 }
7868ee3b73e773 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Ajay Singh 2018-04-23 974
9bc061e8805487 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Ajay Singh 2019-06-26 975 void wilc_wfi_p2p_rx(struct wilc_vif *vif, u8 *buff, u32 size)
c5c77ba18ea66a drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Johnny Kim 2015-05-11 976 {
0d0f0b06a13e44 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Ajay Singh 2019-02-05 977 struct wilc *wl = vif->wilc;
9bc061e8805487 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Ajay Singh 2019-06-26 978 struct wilc_priv *priv = &vif->priv;
9bc061e8805487 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Ajay Singh 2019-06-26 979 struct host_if_drv *wfi_drv = priv->hif_drv;
4fb8b5aa2a1126 drivers/staging/wilc1000/cfg80211.c Ajay Singh 2020-02-12 980 struct ieee80211_mgmt *mgmt;
4fb8b5aa2a1126 drivers/staging/wilc1000/cfg80211.c Ajay Singh 2020-02-12 981 struct wilc_vendor_specific_ie *p;
4fb8b5aa2a1126 drivers/staging/wilc1000/cfg80211.c Ajay Singh 2020-02-12 982 struct wilc_p2p_pub_act_frame *d;
4fb8b5aa2a1126 drivers/staging/wilc1000/cfg80211.c Ajay Singh 2020-02-12 983 int ie_offset = offsetof(struct ieee80211_mgmt, u) + sizeof(*d);
4fb8b5aa2a1126 drivers/staging/wilc1000/cfg80211.c Ajay Singh 2020-02-12 984 const u8 *vendor_ie;
4e4467fdd6e89f drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Chaehyun Lim 2015-06-11 985 u32 header, pkt_offset;
34db1aac17ff8f drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Ajay Singh 2018-04-23 986 s32 freq;
8dfaafd6398ec4 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Chaehyun Lim 2015-08-18 987
7a047abbb6ef8a drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Chuhong Yuan 2019-07-25 988 header = get_unaligned_le32(buff - HOST_HDR_OFFSET);
38f193dff5cc8e drivers/staging/wilc1000/cfg80211.c Ajay Singh 2020-02-14 989 pkt_offset = FIELD_GET(WILC_PKT_HDR_OFFSET_FIELD, header);
c5c77ba18ea66a drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Johnny Kim 2015-05-11 990
c5c77ba18ea66a drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Johnny Kim 2015-05-11 991 if (pkt_offset & IS_MANAGMEMENT_CALLBACK) {
7868ee3b73e773 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Ajay Singh 2018-04-23 992 bool ack = false;
4fb8b5aa2a1126 drivers/staging/wilc1000/cfg80211.c Ajay Singh 2020-02-12 993 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)buff;
7868ee3b73e773 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Ajay Singh 2018-04-23 994
4fb8b5aa2a1126 drivers/staging/wilc1000/cfg80211.c Ajay Singh 2020-02-12 995 if (ieee80211_is_probe_resp(hdr->frame_control) ||
7868ee3b73e773 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Ajay Singh 2018-04-23 996 pkt_offset & IS_MGMT_STATUS_SUCCES)
7868ee3b73e773 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Ajay Singh 2018-04-23 997 ack = true;
7868ee3b73e773 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Ajay Singh 2018-04-23 998
9bc061e8805487 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Ajay Singh 2019-06-26 999 cfg80211_mgmt_tx_status(&priv->wdev, priv->tx_cookie, buff,
9bc061e8805487 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Ajay Singh 2019-06-26 1000 size, ack, GFP_KERNEL);
c5c77ba18ea66a drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Johnny Kim 2015-05-11 1001 return;
c5c77ba18ea66a drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Johnny Kim 2015-05-11 1002 }
7868ee3b73e773 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Ajay Singh 2018-04-23 1003
0d0f0b06a13e44 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Ajay Singh 2019-02-05 1004 freq = ieee80211_channel_to_frequency(wl->op_ch, NL80211_BAND_2GHZ);
c5c77ba18ea66a drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Johnny Kim 2015-05-11 1005
4fb8b5aa2a1126 drivers/staging/wilc1000/cfg80211.c Ajay Singh 2020-02-12 1006 mgmt = (struct ieee80211_mgmt *)buff;
4fb8b5aa2a1126 drivers/staging/wilc1000/cfg80211.c Ajay Singh 2020-02-12 1007 if (!ieee80211_is_action(mgmt->frame_control))
4fb8b5aa2a1126 drivers/staging/wilc1000/cfg80211.c Ajay Singh 2020-02-12 1008 goto out_rx_mgmt;
7868ee3b73e773 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Ajay Singh 2018-04-23 1009
7868ee3b73e773 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Ajay Singh 2018-04-23 1010 if (priv->cfg_scanning &&
7868ee3b73e773 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Ajay Singh 2018-04-23 1011 time_after_eq(jiffies, (unsigned long)wfi_drv->p2p_timeout)) {
9bc061e8805487 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Ajay Singh 2019-06-26 1012 netdev_dbg(vif->ndev, "Receiving action wrong ch\n");
c5c77ba18ea66a drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Johnny Kim 2015-05-11 1013 return;
c5c77ba18ea66a drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Johnny Kim 2015-05-11 1014 }
c5c77ba18ea66a drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Johnny Kim 2015-05-11 1015
4fb8b5aa2a1126 drivers/staging/wilc1000/cfg80211.c Ajay Singh 2020-02-12 1016 if (!ieee80211_is_public_action((struct ieee80211_hdr *)buff, size))
4fb8b5aa2a1126 drivers/staging/wilc1000/cfg80211.c Ajay Singh 2020-02-12 1017 goto out_rx_mgmt;
7868ee3b73e773 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Ajay Singh 2018-04-23 1018
4fb8b5aa2a1126 drivers/staging/wilc1000/cfg80211.c Ajay Singh 2020-02-12 1019 d = (struct wilc_p2p_pub_act_frame *)(&mgmt->u.action);
4fb8b5aa2a1126 drivers/staging/wilc1000/cfg80211.c Ajay Singh 2020-02-12 1020 if (d->oui_subtype != GO_NEG_REQ && d->oui_subtype != GO_NEG_RSP &&
4fb8b5aa2a1126 drivers/staging/wilc1000/cfg80211.c Ajay Singh 2020-02-12 1021 d->oui_subtype != P2P_INV_REQ && d->oui_subtype != P2P_INV_RSP)
4fb8b5aa2a1126 drivers/staging/wilc1000/cfg80211.c Ajay Singh 2020-02-12 1022 goto out_rx_mgmt;
c5c77ba18ea66a drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Johnny Kim 2015-05-11 1023
4fb8b5aa2a1126 drivers/staging/wilc1000/cfg80211.c Ajay Singh 2020-02-12 1024 vendor_ie = cfg80211_find_vendor_ie(WLAN_OUI_WFA, WLAN_OUI_TYPE_WFA_P2P,
4fb8b5aa2a1126 drivers/staging/wilc1000/cfg80211.c Ajay Singh 2020-02-12 1025 buff + ie_offset, size - ie_offset);
4fb8b5aa2a1126 drivers/staging/wilc1000/cfg80211.c Ajay Singh 2020-02-12 1026 if (!vendor_ie)
4fb8b5aa2a1126 drivers/staging/wilc1000/cfg80211.c Ajay Singh 2020-02-12 1027 goto out_rx_mgmt;
4fb8b5aa2a1126 drivers/staging/wilc1000/cfg80211.c Ajay Singh 2020-02-12 1028
4fb8b5aa2a1126 drivers/staging/wilc1000/cfg80211.c Ajay Singh 2020-02-12 1029 p = (struct wilc_vendor_specific_ie *)vendor_ie;
4fb8b5aa2a1126 drivers/staging/wilc1000/cfg80211.c Ajay Singh 2020-02-12 1030 wilc_wfi_cfg_parse_ch_attr(p->attr, p->tag_len - 4, vif->wilc->sta_ch);
c5c77ba18ea66a drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Johnny Kim 2015-05-11 1031
4fb8b5aa2a1126 drivers/staging/wilc1000/cfg80211.c Ajay Singh 2020-02-12 1032 out_rx_mgmt:
9bc061e8805487 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Ajay Singh 2019-06-26 1033 cfg80211_rx_mgmt(&priv->wdev, freq, 0, buff, size, 0);
c5c77ba18ea66a drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Johnny Kim 2015-05-11 1034 }
c5c77ba18ea66a drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Johnny Kim 2015-05-11 1035
8c9fee22470452 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Ajay Singh 2018-01-16 1036 static void wilc_wfi_mgmt_tx_complete(void *priv, int status)
c5c77ba18ea66a drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Johnny Kim 2015-05-11 1037 {
f5436edeedfbd1 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Ajay Singh 2019-02-07 1038 struct wilc_p2p_mgmt_data *pv_data = priv;
c5c77ba18ea66a drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Johnny Kim 2015-05-11 1039
c5c77ba18ea66a drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Johnny Kim 2015-05-11 1040 kfree(pv_data->buff);
c5c77ba18ea66a drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Johnny Kim 2015-05-11 1041 kfree(pv_data);
c5c77ba18ea66a drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Johnny Kim 2015-05-11 1042 }
c5c77ba18ea66a drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Johnny Kim 2015-05-11 1043
b6c6cd11c7a633 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Ajay Singh 2019-02-05 1044 static void wilc_wfi_remain_on_channel_expired(void *data, u64 cookie)
c5c77ba18ea66a drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Johnny Kim 2015-05-11 1045 {
9bc061e8805487 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Ajay Singh 2019-06-26 1046 struct wilc_vif *vif = data;
9bc061e8805487 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Ajay Singh 2019-06-26 1047 struct wilc_priv *priv = &vif->priv;
4d03c3d51bbfe2 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Ajay Singh 2018-05-11 1048 struct wilc_wfi_p2p_listen_params *params = &priv->remain_on_ch_params;
8dfaafd6398ec4 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Chaehyun Lim 2015-08-18 1049
b6c6cd11c7a633 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Ajay Singh 2019-02-05 1050 if (cookie != params->listen_cookie)
4d03c3d51bbfe2 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Ajay Singh 2018-05-11 1051 return;
c5c77ba18ea66a drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Johnny Kim 2015-05-11 1052
3b127bd9b7a3d9 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Ajay Singh 2018-01-16 1053 priv->p2p_listen_state = false;
c5c77ba18ea66a drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Johnny Kim 2015-05-11 1054
9bc061e8805487 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Ajay Singh 2019-06-26 1055 cfg80211_remain_on_channel_expired(&priv->wdev, params->listen_cookie,
4d03c3d51bbfe2 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Ajay Singh 2018-05-11 1056 params->listen_ch, GFP_KERNEL);
c5c77ba18ea66a drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Johnny Kim 2015-05-11 1057 }
c5c77ba18ea66a drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Johnny Kim 2015-05-11 1058
6d19d695e091c2 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Chaehyun Lim 2015-09-14 1059 static int remain_on_channel(struct wiphy *wiphy,
c5c77ba18ea66a drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Johnny Kim 2015-05-11 1060 struct wireless_dev *wdev,
c5c77ba18ea66a drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Johnny Kim 2015-05-11 1061 struct ieee80211_channel *chan,
c5c77ba18ea66a drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Johnny Kim 2015-05-11 1062 unsigned int duration, u64 *cookie)
c5c77ba18ea66a drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Johnny Kim 2015-05-11 1063 {
82120ec7afc3d6 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Ajay Singh 2018-07-19 1064 int ret = 0;
9bc061e8805487 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Ajay Singh 2019-06-26 1065 struct wilc_vif *vif = netdev_priv(wdev->netdev);
9bc061e8805487 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Ajay Singh 2019-06-26 1066 struct wilc_priv *priv = &vif->priv;
b6c6cd11c7a633 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Ajay Singh 2019-02-05 1067 u64 id;
c5c77ba18ea66a drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Johnny Kim 2015-05-11 1068
c5c77ba18ea66a drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Johnny Kim 2015-05-11 1069 if (wdev->iftype == NL80211_IFTYPE_AP) {
e3f16965c9d473 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Chris Park 2016-02-04 1070 netdev_dbg(vif->ndev, "Required while in AP mode\n");
ffde26700840c7 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Ajay Singh 2018-01-16 1071 return ret;
c5c77ba18ea66a drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Johnny Kim 2015-05-11 1072 }
c5c77ba18ea66a drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Johnny Kim 2015-05-11 1073
b6c6cd11c7a633 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Ajay Singh 2019-02-05 1074 id = ++priv->inc_roc_cookie;
b6c6cd11c7a633 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Ajay Singh 2019-02-05 1075 if (id == 0)
b6c6cd11c7a633 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Ajay Singh 2019-02-05 1076 id = ++priv->inc_roc_cookie;
b6c6cd11c7a633 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Ajay Singh 2019-02-05 1077
b6c6cd11c7a633 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Ajay Singh 2019-02-05 1078 ret = wilc_remain_on_channel(vif, id, duration, chan->hw_value,
b6c6cd11c7a633 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Ajay Singh 2019-02-05 1079 wilc_wfi_remain_on_channel_expired,
9bc061e8805487 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Ajay Singh 2019-06-26 1080 (void *)vif);
b6c6cd11c7a633 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Ajay Singh 2019-02-05 1081 if (ret)
b6c6cd11c7a633 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Ajay Singh 2019-02-05 1082 return ret;
b6c6cd11c7a633 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Ajay Singh 2019-02-05 1083
0d0f0b06a13e44 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Ajay Singh 2019-02-05 1084 vif->wilc->op_ch = chan->hw_value;
c5c77ba18ea66a drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Johnny Kim 2015-05-11 1085
3378860c12a0f0 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Ajay Singh 2018-01-16 1086 priv->remain_on_ch_params.listen_ch = chan;
b6c6cd11c7a633 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Ajay Singh 2019-02-05 1087 priv->remain_on_ch_params.listen_cookie = id;
b6c6cd11c7a633 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Ajay Singh 2019-02-05 1088 *cookie = id;
b6c6cd11c7a633 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Ajay Singh 2019-02-05 1089 priv->p2p_listen_state = true;
3378860c12a0f0 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Ajay Singh 2018-01-16 1090 priv->remain_on_ch_params.listen_duration = duration;
c5c77ba18ea66a drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Johnny Kim 2015-05-11 1091
b6c6cd11c7a633 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Ajay Singh 2019-02-05 1092 cfg80211_ready_on_channel(wdev, *cookie, chan, duration, GFP_KERNEL);
b6c6cd11c7a633 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Ajay Singh 2019-02-05 1093 mod_timer(&vif->hif_drv->remain_on_ch_timer,
3a4cffe67f2fae drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Ajay Singh 2019-10-18 1094 jiffies + msecs_to_jiffies(duration + 1000));
b6c6cd11c7a633 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Ajay Singh 2019-02-05 1095
b6c6cd11c7a633 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Ajay Singh 2019-02-05 @1096 return ret;
c5c77ba18ea66a drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Johnny Kim 2015-05-11 1097 }
c5c77ba18ea66a drivers/staging/wilc1000/wilc_wfi_cfgoperations.c Johnny Kim 2015-05-11 1098
:::::: The code at line 1096 was first introduced by commit
:::::: b6c6cd11c7a633a1194fd23f07322579da79d4ee staging: wilc1000: refactor code to use cookie information
:::::: TO: Ajay Singh <ajay.kathat(a)microchip.com>
:::::: CC: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 10 months
Re: [RFC PATCH 1/2] PM / devfreq: Add support delayed timer for polling mode
by kernel test robot
CC: kbuild-all(a)lists.01.org
In-Reply-To: <20200703062622.11773-2-cw00.choi(a)samsung.com>
References: <20200703062622.11773-2-cw00.choi(a)samsung.com>
TO: Chanwoo Choi <cw00.choi(a)samsung.com>
Hi Chanwoo,
[FYI, it's a private test report for your RFC patch.]
[auto build test WARNING on linus/master]
[also build test WARNING on v5.8-rc3 next-20200703]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Chanwoo-Choi/PM-devfreq-Add-dela...
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 7cc2a8ea104820dd9e702202621e8fd4d9f6c8cf
:::::: branch date: 11 hours ago
:::::: commit date: 11 hours ago
config: x86_64-randconfig-m001-20200703 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-14) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
smatch warnings:
drivers/devfreq/devfreq.c:910 devfreq_add_device() warn: passing zero to 'ERR_PTR'
# https://github.com/0day-ci/linux/commit/c7e29acd5781b7d5ae02d4cdaa825aa1b...
git remote add linux-review https://github.com/0day-ci/linux
git remote update linux-review
git checkout c7e29acd5781b7d5ae02d4cdaa825aa1ba89e33e
vim +/ERR_PTR +910 drivers/devfreq/devfreq.c
7e6fdd4bad033f Rajagopal Venkat 2012-10-26 737
a3c98b8b2ede1f MyungJoo Ham 2011-10-02 738 /**
a3c98b8b2ede1f MyungJoo Ham 2011-10-02 739 * devfreq_add_device() - Add devfreq feature to the device
a3c98b8b2ede1f MyungJoo Ham 2011-10-02 740 * @dev: the device to add devfreq feature.
a3c98b8b2ede1f MyungJoo Ham 2011-10-02 741 * @profile: device-specific profile to run devfreq.
1b5c1be2c88e84 Nishanth Menon 2012-10-29 742 * @governor_name: name of the policy to choose frequency.
a3c98b8b2ede1f MyungJoo Ham 2011-10-02 743 * @data: private data for the governor. The devfreq framework does not
a3c98b8b2ede1f MyungJoo Ham 2011-10-02 744 * touch this value.
a3c98b8b2ede1f MyungJoo Ham 2011-10-02 745 */
a3c98b8b2ede1f MyungJoo Ham 2011-10-02 746 struct devfreq *devfreq_add_device(struct device *dev,
a3c98b8b2ede1f MyungJoo Ham 2011-10-02 747 struct devfreq_dev_profile *profile,
1b5c1be2c88e84 Nishanth Menon 2012-10-29 748 const char *governor_name,
a3c98b8b2ede1f MyungJoo Ham 2011-10-02 749 void *data)
a3c98b8b2ede1f MyungJoo Ham 2011-10-02 750 {
a3c98b8b2ede1f MyungJoo Ham 2011-10-02 751 struct devfreq *devfreq;
1b5c1be2c88e84 Nishanth Menon 2012-10-29 752 struct devfreq_governor *governor;
a3c98b8b2ede1f MyungJoo Ham 2011-10-02 753 int err = 0;
a3c98b8b2ede1f MyungJoo Ham 2011-10-02 754
1b5c1be2c88e84 Nishanth Menon 2012-10-29 755 if (!dev || !profile || !governor_name) {
a3c98b8b2ede1f MyungJoo Ham 2011-10-02 756 dev_err(dev, "%s: Invalid parameters.\n", __func__);
a3c98b8b2ede1f MyungJoo Ham 2011-10-02 757 return ERR_PTR(-EINVAL);
a3c98b8b2ede1f MyungJoo Ham 2011-10-02 758 }
a3c98b8b2ede1f MyungJoo Ham 2011-10-02 759
a3c98b8b2ede1f MyungJoo Ham 2011-10-02 760 mutex_lock(&devfreq_list_lock);
a3c98b8b2ede1f MyungJoo Ham 2011-10-02 761 devfreq = find_device_devfreq(dev);
a3c98b8b2ede1f MyungJoo Ham 2011-10-02 762 mutex_unlock(&devfreq_list_lock);
a3c98b8b2ede1f MyungJoo Ham 2011-10-02 763 if (!IS_ERR(devfreq)) {
df4d7b1451bf51 Matthias Kaehlcke 2019-09-18 764 dev_err(dev, "%s: devfreq device already exists!\n",
9d0109be482cf7 Chanwoo Choi 2016-11-19 765 __func__);
a3c98b8b2ede1f MyungJoo Ham 2011-10-02 766 err = -EINVAL;
3f19f08a7ec74c Axel Lin 2011-11-15 767 goto err_out;
a3c98b8b2ede1f MyungJoo Ham 2011-10-02 768 }
a3c98b8b2ede1f MyungJoo Ham 2011-10-02 769
a3c98b8b2ede1f MyungJoo Ham 2011-10-02 770 devfreq = kzalloc(sizeof(struct devfreq), GFP_KERNEL);
a3c98b8b2ede1f MyungJoo Ham 2011-10-02 771 if (!devfreq) {
a3c98b8b2ede1f MyungJoo Ham 2011-10-02 772 err = -ENOMEM;
3f19f08a7ec74c Axel Lin 2011-11-15 773 goto err_out;
a3c98b8b2ede1f MyungJoo Ham 2011-10-02 774 }
a3c98b8b2ede1f MyungJoo Ham 2011-10-02 775
a3c98b8b2ede1f MyungJoo Ham 2011-10-02 776 mutex_init(&devfreq->lock);
a3c98b8b2ede1f MyungJoo Ham 2011-10-02 777 mutex_lock(&devfreq->lock);
a3c98b8b2ede1f MyungJoo Ham 2011-10-02 778 devfreq->dev.parent = dev;
a3c98b8b2ede1f MyungJoo Ham 2011-10-02 779 devfreq->dev.class = devfreq_class;
a3c98b8b2ede1f MyungJoo Ham 2011-10-02 780 devfreq->dev.release = devfreq_dev_release;
42a6b25e67df6e Leonard Crestez 2019-11-14 781 INIT_LIST_HEAD(&devfreq->node);
a3c98b8b2ede1f MyungJoo Ham 2011-10-02 782 devfreq->profile = profile;
a316b5ca9ead80 Dmitry Osipenko 2020-02-27 783 strscpy(devfreq->governor_name, governor_name, DEVFREQ_NAME_LEN);
a3c98b8b2ede1f MyungJoo Ham 2011-10-02 784 devfreq->previous_freq = profile->initial_freq;
8d39fc085d268a Lukasz Luba 2016-05-31 785 devfreq->last_status.current_frequency = profile->initial_freq;
a3c98b8b2ede1f MyungJoo Ham 2011-10-02 786 devfreq->data = data;
a3c98b8b2ede1f MyungJoo Ham 2011-10-02 787 devfreq->nb.notifier_call = devfreq_notifier_call;
a3c98b8b2ede1f MyungJoo Ham 2011-10-02 788
c7e29acd5781b7 Chanwoo Choi 2020-07-03 789 if (devfreq->profile->timer < 0
c7e29acd5781b7 Chanwoo Choi 2020-07-03 790 || devfreq->profile->timer >= DEVFREQ_TIMER_NUM) {
c7e29acd5781b7 Chanwoo Choi 2020-07-03 791 goto err_out;
c7e29acd5781b7 Chanwoo Choi 2020-07-03 792 }
c7e29acd5781b7 Chanwoo Choi 2020-07-03 793
0ec09ac2cebe97 Chanwoo Choi 2015-11-18 794 if (!devfreq->profile->max_state && !devfreq->profile->freq_table) {
0ec09ac2cebe97 Chanwoo Choi 2015-11-18 795 mutex_unlock(&devfreq->lock);
ea572f816032be Chanwoo Choi 2017-10-23 796 err = set_freq_table(devfreq);
ea572f816032be Chanwoo Choi 2017-10-23 797 if (err < 0)
a9487917ba6728 Yangtao Li 2019-01-19 798 goto err_dev;
0ec09ac2cebe97 Chanwoo Choi 2015-11-18 799 mutex_lock(&devfreq->lock);
0ec09ac2cebe97 Chanwoo Choi 2015-11-18 800 }
0ec09ac2cebe97 Chanwoo Choi 2015-11-18 801
2c2cb1e6b05b90 Matthias Kaehlcke 2018-05-25 802 devfreq->scaling_min_freq = find_available_min_freq(devfreq);
2c2cb1e6b05b90 Matthias Kaehlcke 2018-05-25 803 if (!devfreq->scaling_min_freq) {
ab8f58ad72c4d1 Chanwoo Choi 2017-10-23 804 mutex_unlock(&devfreq->lock);
ab8f58ad72c4d1 Chanwoo Choi 2017-10-23 805 err = -EINVAL;
ab8f58ad72c4d1 Chanwoo Choi 2017-10-23 806 goto err_dev;
ab8f58ad72c4d1 Chanwoo Choi 2017-10-23 807 }
ab8f58ad72c4d1 Chanwoo Choi 2017-10-23 808
2c2cb1e6b05b90 Matthias Kaehlcke 2018-05-25 809 devfreq->scaling_max_freq = find_available_max_freq(devfreq);
2c2cb1e6b05b90 Matthias Kaehlcke 2018-05-25 810 if (!devfreq->scaling_max_freq) {
ab8f58ad72c4d1 Chanwoo Choi 2017-10-23 811 mutex_unlock(&devfreq->lock);
ab8f58ad72c4d1 Chanwoo Choi 2017-10-23 812 err = -EINVAL;
ab8f58ad72c4d1 Chanwoo Choi 2017-10-23 813 goto err_dev;
ab8f58ad72c4d1 Chanwoo Choi 2017-10-23 814 }
ab8f58ad72c4d1 Chanwoo Choi 2017-10-23 815
83f8ca45afbf04 Lukasz Luba 2018-12-05 816 devfreq->suspend_freq = dev_pm_opp_get_suspend_opp_freq(dev);
83f8ca45afbf04 Lukasz Luba 2018-12-05 817 atomic_set(&devfreq->suspend_count, 0);
83f8ca45afbf04 Lukasz Luba 2018-12-05 818
66d0e797bf095d Orson Zhai 2020-02-21 819 dev_set_name(&devfreq->dev, "%s", dev_name(dev));
a3c98b8b2ede1f MyungJoo Ham 2011-10-02 820 err = device_register(&devfreq->dev);
a3c98b8b2ede1f MyungJoo Ham 2011-10-02 821 if (err) {
7e6fdd4bad033f Rajagopal Venkat 2012-10-26 822 mutex_unlock(&devfreq->lock);
2d803dc8f7a5f6 Arvind Yadav 2018-03-30 823 put_device(&devfreq->dev);
2d803dc8f7a5f6 Arvind Yadav 2018-03-30 824 goto err_out;
a3c98b8b2ede1f MyungJoo Ham 2011-10-02 825 }
a3c98b8b2ede1f MyungJoo Ham 2011-10-02 826
1ebd0bc0e8adbf Kamil Konieczny 2019-12-06 827 devfreq->stats.trans_table = devm_kzalloc(&devfreq->dev,
a86854d0c599b3 Kees Cook 2018-06-12 828 array3_size(sizeof(unsigned int),
3e1d7fb0d279fe MyungJoo Ham 2015-10-02 829 devfreq->profile->max_state,
a86854d0c599b3 Kees Cook 2018-06-12 830 devfreq->profile->max_state),
3e1d7fb0d279fe MyungJoo Ham 2015-10-02 831 GFP_KERNEL);
1ebd0bc0e8adbf Kamil Konieczny 2019-12-06 832 if (!devfreq->stats.trans_table) {
25846fa1cedada Yangtao Li 2019-01-19 833 mutex_unlock(&devfreq->lock);
25846fa1cedada Yangtao Li 2019-01-19 834 err = -ENOMEM;
25846fa1cedada Yangtao Li 2019-01-19 835 goto err_devfreq;
25846fa1cedada Yangtao Li 2019-01-19 836 }
25846fa1cedada Yangtao Li 2019-01-19 837
1ebd0bc0e8adbf Kamil Konieczny 2019-12-06 838 devfreq->stats.time_in_state = devm_kcalloc(&devfreq->dev,
3e1d7fb0d279fe MyungJoo Ham 2015-10-02 839 devfreq->profile->max_state,
1ebd0bc0e8adbf Kamil Konieczny 2019-12-06 840 sizeof(*devfreq->stats.time_in_state),
3e1d7fb0d279fe MyungJoo Ham 2015-10-02 841 GFP_KERNEL);
1ebd0bc0e8adbf Kamil Konieczny 2019-12-06 842 if (!devfreq->stats.time_in_state) {
25846fa1cedada Yangtao Li 2019-01-19 843 mutex_unlock(&devfreq->lock);
25846fa1cedada Yangtao Li 2019-01-19 844 err = -ENOMEM;
25846fa1cedada Yangtao Li 2019-01-19 845 goto err_devfreq;
25846fa1cedada Yangtao Li 2019-01-19 846 }
25846fa1cedada Yangtao Li 2019-01-19 847
1ebd0bc0e8adbf Kamil Konieczny 2019-12-06 848 devfreq->stats.total_trans = 0;
1ebd0bc0e8adbf Kamil Konieczny 2019-12-06 849 devfreq->stats.last_update = get_jiffies_64();
3e1d7fb0d279fe MyungJoo Ham 2015-10-02 850
0fe3a66410a3ba Chanwoo Choi 2016-01-26 851 srcu_init_notifier_head(&devfreq->transition_notifier_list);
0fe3a66410a3ba Chanwoo Choi 2016-01-26 852
a3c98b8b2ede1f MyungJoo Ham 2011-10-02 853 mutex_unlock(&devfreq->lock);
a3c98b8b2ede1f MyungJoo Ham 2011-10-02 854
27dbc542f651ed Leonard Crestez 2019-12-05 855 err = dev_pm_qos_add_request(dev, &devfreq->user_min_freq_req,
27dbc542f651ed Leonard Crestez 2019-12-05 856 DEV_PM_QOS_MIN_FREQUENCY, 0);
27dbc542f651ed Leonard Crestez 2019-12-05 857 if (err < 0)
27dbc542f651ed Leonard Crestez 2019-12-05 858 goto err_devfreq;
27dbc542f651ed Leonard Crestez 2019-12-05 859 err = dev_pm_qos_add_request(dev, &devfreq->user_max_freq_req,
27dbc542f651ed Leonard Crestez 2019-12-05 860 DEV_PM_QOS_MAX_FREQUENCY,
27dbc542f651ed Leonard Crestez 2019-12-05 861 PM_QOS_MAX_FREQUENCY_DEFAULT_VALUE);
27dbc542f651ed Leonard Crestez 2019-12-05 862 if (err < 0)
27dbc542f651ed Leonard Crestez 2019-12-05 863 goto err_devfreq;
27dbc542f651ed Leonard Crestez 2019-12-05 864
05d7ae15cfb18f Leonard Crestez 2019-12-05 865 devfreq->nb_min.notifier_call = qos_min_notifier_call;
05d7ae15cfb18f Leonard Crestez 2019-12-05 866 err = dev_pm_qos_add_notifier(devfreq->dev.parent, &devfreq->nb_min,
05d7ae15cfb18f Leonard Crestez 2019-12-05 867 DEV_PM_QOS_MIN_FREQUENCY);
05d7ae15cfb18f Leonard Crestez 2019-12-05 868 if (err)
05d7ae15cfb18f Leonard Crestez 2019-12-05 869 goto err_devfreq;
05d7ae15cfb18f Leonard Crestez 2019-12-05 870
05d7ae15cfb18f Leonard Crestez 2019-12-05 871 devfreq->nb_max.notifier_call = qos_max_notifier_call;
05d7ae15cfb18f Leonard Crestez 2019-12-05 872 err = dev_pm_qos_add_notifier(devfreq->dev.parent, &devfreq->nb_max,
05d7ae15cfb18f Leonard Crestez 2019-12-05 873 DEV_PM_QOS_MAX_FREQUENCY);
05d7ae15cfb18f Leonard Crestez 2019-12-05 874 if (err)
05d7ae15cfb18f Leonard Crestez 2019-12-05 875 goto err_devfreq;
05d7ae15cfb18f Leonard Crestez 2019-12-05 876
a3c98b8b2ede1f MyungJoo Ham 2011-10-02 877 mutex_lock(&devfreq_list_lock);
a3c98b8b2ede1f MyungJoo Ham 2011-10-02 878
23c7b54ca1cd17 Enric Balletbo i Serra 2018-07-04 879 governor = try_then_request_governor(devfreq->governor_name);
73613b16cb5c5d Chanwoo Choi 2016-12-28 880 if (IS_ERR(governor)) {
73613b16cb5c5d Chanwoo Choi 2016-12-28 881 dev_err(dev, "%s: Unable to find governor for the device\n",
73613b16cb5c5d Chanwoo Choi 2016-12-28 882 __func__);
73613b16cb5c5d Chanwoo Choi 2016-12-28 883 err = PTR_ERR(governor);
73613b16cb5c5d Chanwoo Choi 2016-12-28 884 goto err_init;
73613b16cb5c5d Chanwoo Choi 2016-12-28 885 }
73613b16cb5c5d Chanwoo Choi 2016-12-28 886
1b5c1be2c88e84 Nishanth Menon 2012-10-29 887 devfreq->governor = governor;
73613b16cb5c5d Chanwoo Choi 2016-12-28 888 err = devfreq->governor->event_handler(devfreq, DEVFREQ_GOV_START,
73613b16cb5c5d Chanwoo Choi 2016-12-28 889 NULL);
7e6fdd4bad033f Rajagopal Venkat 2012-10-26 890 if (err) {
7e6fdd4bad033f Rajagopal Venkat 2012-10-26 891 dev_err(dev, "%s: Unable to start governor for the device\n",
7e6fdd4bad033f Rajagopal Venkat 2012-10-26 892 __func__);
7e6fdd4bad033f Rajagopal Venkat 2012-10-26 893 goto err_init;
a3c98b8b2ede1f MyungJoo Ham 2011-10-02 894 }
23c7b54ca1cd17 Enric Balletbo i Serra 2018-07-04 895
23c7b54ca1cd17 Enric Balletbo i Serra 2018-07-04 896 list_add(&devfreq->node, &devfreq_list);
23c7b54ca1cd17 Enric Balletbo i Serra 2018-07-04 897
0f376c9cd86c23 Axel Lin 2016-09-29 898 mutex_unlock(&devfreq_list_lock);
7e6fdd4bad033f Rajagopal Venkat 2012-10-26 899
3f19f08a7ec74c Axel Lin 2011-11-15 900 return devfreq;
3f19f08a7ec74c Axel Lin 2011-11-15 901
a3c98b8b2ede1f MyungJoo Ham 2011-10-02 902 err_init:
0f376c9cd86c23 Axel Lin 2016-09-29 903 mutex_unlock(&devfreq_list_lock);
25846fa1cedada Yangtao Li 2019-01-19 904 err_devfreq:
2f061fd0c2d852 Vincent Donnefort 2018-09-03 905 devfreq_remove_device(devfreq);
2d803dc8f7a5f6 Arvind Yadav 2018-03-30 906 devfreq = NULL;
9e14de1077e9c3 Chanwoo Choi 2017-08-24 907 err_dev:
9e14de1077e9c3 Chanwoo Choi 2017-08-24 908 kfree(devfreq);
3f19f08a7ec74c Axel Lin 2011-11-15 909 err_out:
a3c98b8b2ede1f MyungJoo Ham 2011-10-02 @910 return ERR_PTR(err);
a3c98b8b2ede1f MyungJoo Ham 2011-10-02 911 }
7e6fdd4bad033f Rajagopal Venkat 2012-10-26 912 EXPORT_SYMBOL(devfreq_add_device);
a3c98b8b2ede1f MyungJoo Ham 2011-10-02 913
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 10 months