Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp405859pxb; Tue, 12 Apr 2022 04:49:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyf6ZcPPBrb6vVfMkW4Pge5ihwIIcU/kXryH78CI77+X635iZQGELluzafn7di1wbrwxcnj X-Received: by 2002:a05:6402:4315:b0:41d:2f5c:a4e4 with SMTP id m21-20020a056402431500b0041d2f5ca4e4mr21557470edc.230.1649764150211; Tue, 12 Apr 2022 04:49:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649764150; cv=none; d=google.com; s=arc-20160816; b=TiNk9c+scEJr10IEUid4aq/PDdHbizPqOktFz6cFFYSTeOZE6pmVxRy9T6xg1w1WWd JdE+d9FvfXUNyK67G5tX0CSUuos8iGB92r22FKGJCsro4SLJGX9pW4mTnVb3h3UpPGZ3 x7vCvJMLy1gF6gLLqMnLf7zrFZQFimEebgchzt0cUppNt7Y1AZHV+Wy6VVScXme4yp1V xOqjSBHjsMUNaHf3vpuDhsD8EsPhzDWi61d5ObJlrCv+lnevXCyhFF5dj3E3f/cwAn+v nq/JZNXa67QcwQiVMlvO/3P6EX4pkTp9Rwb339bB4p6IRtXAgFa4uBDm8lwRRo5KC2+a AXUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=nr5tUFDB7mU01fhGxOTMLQqiBaXIcffEcENEDrFy7hE=; b=aUy7GVNhrQ8pd6sdDgA+hwe6+JCdkQKKRIYgqO99tPsGYCFJirxVgQbBEJIQoqlYy7 Qlq3RfpjA/vd9AvRTL+xgXglNHtsQbnRfZ9IvLFKnYVFUK8ImKjcYEiVP1voeV8DgOvS mJ/qZ7goGXuKVrHGwl5jlWNGlspYo10Gz+uYnUkQI2xCG/I0wiUM6LBBtzu1l6fjFqj9 h1VsiDK0kz/KccLZXz6oIuP1g+Xwy170U5XDU/UPWqsMbTTW4srhpoSd9BuFvBLHEreW 0Zmi/q7fZ0lWu1u6ZfRKKIjpEpCC7o2SEfOHCwjGdpZWBAr9l0xurQzoR2kWr13y3+XA HliQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=bARGnJSJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id fm17-20020a1709072ad100b006e89f35bd27si2567881ejc.874.2022.04.12.04.48.42; Tue, 12 Apr 2022 04:49:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=bARGnJSJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347506AbiDLFE7 (ORCPT + 99 others); Tue, 12 Apr 2022 01:04:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51910 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231319AbiDLFEz (ORCPT ); Tue, 12 Apr 2022 01:04:55 -0400 Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E8B3E344EF for ; Mon, 11 Apr 2022 22:02:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1649739758; x=1681275758; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=15fDRfdM1HQDD3vhfb95CPUbHMkDSQ2QlfPPGarHgpc=; b=bARGnJSJuTDp4AdIHlgTPM/iY/b8Slqtxw+W7WsK16PH2i7d8/+pRsPn FDX7TVnFrZcRmrj5P4i+XFnYTk+3jgg1nMkhb/4xV2nyh+rC8L2O8eQul 2I5gkRtSLZkaQP06cJfN/zBOMlbb4XlzK7Y6Vk3p8td+CoYAbdjmjyWyJ KgwQuKgRcOTe3UuelkSCEB53vurfSawkhJHM6x3QNwGCBQI1nPi2jgfbu BS/g90jIQZuy7XH/EPSHaRZT7DMys00qDx8CTjkzCUkPzvbSUpo2p7D/H 8ImYutBXl+b+CInNo6tQmWtY+NMioaWCFAQaTASgXvzFYkTmrScB78iMt A==; X-IronPort-AV: E=McAfee;i="6400,9594,10314"; a="322721825" X-IronPort-AV: E=Sophos;i="5.90,252,1643702400"; d="scan'208";a="322721825" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Apr 2022 22:02:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,252,1643702400"; d="scan'208";a="623114876" Received: from lkp-server02.sh.intel.com (HELO d3fc50ef50de) ([10.239.97.151]) by fmsmga004.fm.intel.com with ESMTP; 11 Apr 2022 22:02:34 -0700 Received: from kbuild by d3fc50ef50de with local (Exim 4.95) (envelope-from ) id 1ne8fh-0002Wq-UY; Tue, 12 Apr 2022 05:02:33 +0000 Date: Tue, 12 Apr 2022 13:01:31 +0800 From: kernel test robot To: Miaoqian Lin , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Pratyush Yadav , Alexandre Belloni , Paul Cercueil , Guennadi Liakhovetski , Artem Bityutskiy , Bastian Hecht , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org Subject: Re: [PATCH] mtd: rawnand: Fix return value check of wait_for_completion_timeout Message-ID: <202204121253.NcZifMQi-lkp@intel.com> References: <20220412020834.7161-1-linmq006@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220412020834.7161-1-linmq006@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Miaoqian, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on mtd/nand/next] [also build test WARNING on linus/master linux/master v5.18-rc2 next-20220411] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch] url: https://github.com/intel-lab-lkp/linux/commits/Miaoqian-Lin/mtd-rawnand-Fix-return-value-check-of-wait_for_completion_timeout/20220412-101006 base: https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next config: hexagon-randconfig-r045-20220411 (https://download.01.org/0day-ci/archive/20220412/202204121253.NcZifMQi-lkp@intel.com/config) compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project fe2478d44e4f7f191c43fef629ac7a23d0251e72) reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://github.com/intel-lab-lkp/linux/commit/3de25b46a3f73a3e0031e5186eb4e2afa9098b46 git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Miaoqian-Lin/mtd-rawnand-Fix-return-value-check-of-wait_for_completion_timeout/20220412-101006 git checkout 3de25b46a3f73a3e0031e5186eb4e2afa9098b46 # save the config file to linux build tree mkdir build_dir COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash drivers/mtd/nand/raw/ If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot All warnings (new ones prefixed by >>): >> drivers/mtd/nand/raw/sh_flctl.c:433:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] if (time_left == 0) { ^~~~~~~~~~~~~~ drivers/mtd/nand/raw/sh_flctl.c:447:9: note: uninitialized use occurs here return ret; ^~~ drivers/mtd/nand/raw/sh_flctl.c:433:2: note: remove the 'if' if its condition is always true if (time_left == 0) { ^~~~~~~~~~~~~~~~~~~~ drivers/mtd/nand/raw/sh_flctl.c:387:9: note: initialize the variable 'ret' to silence this warning int ret; ^ = 0 1 warning generated. vim +433 drivers/mtd/nand/raw/sh_flctl.c 377 378 static int flctl_dma_fifo0_transfer(struct sh_flctl *flctl, unsigned long *buf, 379 int len, enum dma_data_direction dir) 380 { 381 struct dma_async_tx_descriptor *desc = NULL; 382 struct dma_chan *chan; 383 enum dma_transfer_direction tr_dir; 384 dma_addr_t dma_addr; 385 dma_cookie_t cookie; 386 uint32_t reg; 387 int ret; 388 unsigned long time_left; 389 390 if (dir == DMA_FROM_DEVICE) { 391 chan = flctl->chan_fifo0_rx; 392 tr_dir = DMA_DEV_TO_MEM; 393 } else { 394 chan = flctl->chan_fifo0_tx; 395 tr_dir = DMA_MEM_TO_DEV; 396 } 397 398 dma_addr = dma_map_single(chan->device->dev, buf, len, dir); 399 400 if (!dma_mapping_error(chan->device->dev, dma_addr)) 401 desc = dmaengine_prep_slave_single(chan, dma_addr, len, 402 tr_dir, DMA_PREP_INTERRUPT | DMA_CTRL_ACK); 403 404 if (desc) { 405 reg = readl(FLINTDMACR(flctl)); 406 reg |= DREQ0EN; 407 writel(reg, FLINTDMACR(flctl)); 408 409 desc->callback = flctl_dma_complete; 410 desc->callback_param = flctl; 411 cookie = dmaengine_submit(desc); 412 if (dma_submit_error(cookie)) { 413 ret = dma_submit_error(cookie); 414 dev_warn(&flctl->pdev->dev, 415 "DMA submit failed, falling back to PIO\n"); 416 goto out; 417 } 418 419 dma_async_issue_pending(chan); 420 } else { 421 /* DMA failed, fall back to PIO */ 422 flctl_release_dma(flctl); 423 dev_warn(&flctl->pdev->dev, 424 "DMA failed, falling back to PIO\n"); 425 ret = -EIO; 426 goto out; 427 } 428 429 time_left = 430 wait_for_completion_timeout(&flctl->dma_complete, 431 msecs_to_jiffies(3000)); 432 > 433 if (time_left == 0) { 434 dmaengine_terminate_all(chan); 435 dev_err(&flctl->pdev->dev, "wait_for_completion_timeout\n"); 436 ret = -ETIMEDOUT; 437 } 438 439 out: 440 reg = readl(FLINTDMACR(flctl)); 441 reg &= ~DREQ0EN; 442 writel(reg, FLINTDMACR(flctl)); 443 444 dma_unmap_single(chan->device->dev, dma_addr, len, dir); 445 446 /* ret > 0 is success */ 447 return ret; 448 } 449 -- 0-DAY CI Kernel Test Service https://01.org/lkp