From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-f53.google.com (mail-ed1-f53.google.com [209.85.208.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4E53A3E8C48 for ; Thu, 19 Mar 2026 15:51:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773935467; cv=none; b=ucJqxrZdU+0mlZkSLnJRPFfMfE/kKG5qWZleirsQdev0gwEfMqkmr3JA/9rkl7g8Z/T2hsqkIIrHNMGV22iYB0XWtud6SscRsqawc4exOESItNfw+9i6BqYLbCWNp0qU3hUfMQt7T4p1u7yqzkCWQGh0VtwD/4vBieUkm0DWopM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773935467; c=relaxed/simple; bh=htbKaCcPsqzgp0/d0xa0hAnmfuRE6MBP7rNT/fVsEJA=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; b=r5+HX3unA0dP5YYIrtXGWQoHkyM4Naj9dM5Z3ieIfpDzOfaAqWFn72/9QV/QMJUWPNsE6gu9dYSGfmelTwgCnkwlLa4vYeD95KBGCI3WBK2xLAeex3Qm6w68+n4ep6snjcMreDr6TPxU2IY1j4eCqDKLAEgsHOVD7SigtPsNGJQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=tpVtFitg; arc=none smtp.client-ip=209.85.208.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="tpVtFitg" Received: by mail-ed1-f53.google.com with SMTP id 4fb4d7f45d1cf-667acaeae82so1336826a12.3 for ; Thu, 19 Mar 2026 08:51:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1773935465; x=1774540265; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:message-id:subject:cc :to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=xF1PTk3vkRprEYqnuXa/M55cUPdQPeSRT5BOEVfLuaM=; b=tpVtFitgUcZSxDhtjADajQeOZRyahtjtEbxJv/fjQCOC4bCziyO6GJZl+xcioqO+wi nkdx2Bulsom51QfCWhlDn5jixnr/Q+hMk/GkPRt6lNVsJXjsjgWLloOhicdHQ2m2zJXJ Q9v2d8oafUQlnHMl1fXKoUX6bXsDkosrpDzhrE0O3QFwnFgoDstwbidHw3TO82jcvmjY JkkrBvqDPD1XcgpAIdWEPKlELHLpWpXyQJjbSumfPTgK55bfCWBWAR1Rx2BsoPl1WZq7 0Ut6tDGGiDlA29NuGza98P11rOKhqvBZzHLLGPQCxmiRxmMhWqKwedfUAbRJo105XS6p zXXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773935465; x=1774540265; h=in-reply-to:content-disposition:mime-version:message-id:subject:cc :to:from:date:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=xF1PTk3vkRprEYqnuXa/M55cUPdQPeSRT5BOEVfLuaM=; b=LkTlCon35FENrYCYBVl5rhH49thpXNX+tBso0+hoWmc6W9Y/0pbqnLh1XsAuwTKVOz +KjuOYww6S+Hy79HKVwXhwSgPJXeMLQsTk2peNNn+oKcRjbTe+Q92TCsMYM/W9GfIzPX V/gYsBV57PAn/49nwIjVUPxZEXY6/nNNV19JBi2+fIeKRDty5lPvGd8ft2kTbBJEHO62 88pFcb2Qb79vlmL8LzkahU6T72ZEKKQW3K5wau/Io9dEq/TJJfMNQlIyDyEOMQa0JT9j anQIW19WC7T1Rr4eIvlyjVRh1SWTqbp6J3xiMWv7VaxCscVgnRrTvzjDFsucoVyi5cTv Simw== X-Forwarded-Encrypted: i=1; AJvYcCUpzVafVj/GMH5LStci2ffWLe9yJf28DDBKZfrDsQcFmtTB2K2iY4rbmixH1ctqBaqLuYdPZPqMfg5vKAI=@vger.kernel.org X-Gm-Message-State: AOJu0Yys2YCFFvdbGqNG88a11z2aHSyyO/nbOXaLzsovgCt03nwR05Gm IjinybPEJKf+MZS5roPpuwsIegaMPlon8GrNLL1dQHdM2pBxI3VtxLczK08ZXXndwSw= X-Gm-Gg: ATEYQzzxatn6tmJJaVxMgHLTVYxQ+eaJBTrDCorvVzah1bwAHLek5on230Z4wZIuQkF G3C1AjKhlhwZxRRbm4UFEoKis+5ERso0V0TV3+gBJQHho/YmSRiMLK93GGmlCUekKHLAh64EA9H v6mq3NTHE7xmMIsbdEQ9NA3pUibQn7ua6NbEMnjIqBjWa6kb0Uutu4CmXNXrlzIG91/uzPjDxHT 3f43MS9AziDlUKZrTToveeVTVLnGBHJ5R37pw+ZghpgHplBW4KZDLZvDKKMBaM3N1HkX5ILFikw Ve1wnuc3aTv4HbBzpAQ/fqCSzAY12883OxJjFoWMd7BTJISCfVOPeizDNa7z9EenGf/RZHc1FkF oKuLg2XzpI0duA0Yvh7NWKGt5sOhwdibPTJULpqFZhkbrqii2t/0CehcZxiKyV7f+9b5eA2cDbp kHECdL+LI67zqgcKgh4GMFYEykucWT X-Received: by 2002:a05:6402:51c8:b0:662:ac7e:aac9 with SMTP id 4fb4d7f45d1cf-667b30fa581mr4994027a12.20.1773935464564; Thu, 19 Mar 2026 08:51:04 -0700 (PDT) Received: from localhost ([196.207.164.177]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-668621dde0esm1353353a12.24.2026.03.19.08.51.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Mar 2026 08:51:03 -0700 (PDT) Date: Thu, 19 Mar 2026 18:50:59 +0300 From: Dan Carpenter To: oe-kbuild@lists.linux.dev, Pei Xiao , shenyang39@huawei.com, broonie@kernel.org, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: lkp@intel.com, oe-kbuild-all@lists.linux.dev, Pei Xiao Subject: Re: [PATCH] spi: hisi-kunpeng: prevent infinite while() loop in hisi_spi_flush_fifo Message-ID: <202603192159.S0PIjhlg-lkp@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Hi Pei, kernel test robot noticed the following build warnings: https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Pei-Xiao/spi-hisi-kunpeng-prevent-infinite-while-loop-in-hisi_spi_flush_fifo/20260318-211321 base: https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next patch link: https://lore.kernel.org/r/d50f1f46b2ee2bba05de9e2d4199353b545194e3.1773820898.git.xiaopei01%40kylinos.cn patch subject: [PATCH] spi: hisi-kunpeng: prevent infinite while() loop in hisi_spi_flush_fifo config: s390-randconfig-r072-20260319 (https://download.01.org/0day-ci/archive/20260319/202603192159.S0PIjhlg-lkp@intel.com/config) compiler: clang version 23.0.0git (https://github.com/llvm/llvm-project 4abb927bacf37f18f6359a41639a6d1b3bffffb5) smatch: v0.5.0-9004-gb810ac53 If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot | Reported-by: Dan Carpenter | Closes: https://lore.kernel.org/r/202603192159.S0PIjhlg-lkp@intel.com/ smatch warnings: drivers/spi/spi-hisi-kunpeng.c:206 hisi_spi_flush_fifo() warn: should this be 'inner_limit == -1' vim +206 drivers/spi/spi-hisi-kunpeng.c c770d8631e1810 Jay Fang 2021-03-27 193 c770d8631e1810 Jay Fang 2021-03-27 194 static void hisi_spi_flush_fifo(struct hisi_spi *hs) c770d8631e1810 Jay Fang 2021-03-27 195 { c770d8631e1810 Jay Fang 2021-03-27 196 unsigned long limit = loops_per_jiffy << 1; c770d8631e1810 Jay Fang 2021-03-27 197 c770d8631e1810 Jay Fang 2021-03-27 198 do { e8821f559fed86 Pei Xiao 2026-03-18 199 unsigned long inner_limit = loops_per_jiffy; e8821f559fed86 Pei Xiao 2026-03-18 200 e8821f559fed86 Pei Xiao 2026-03-18 201 while (hisi_spi_rx_not_empty(hs) && inner_limit--) { c770d8631e1810 Jay Fang 2021-03-27 202 readl(hs->regs + HISI_SPI_DOUT); e8821f559fed86 Pei Xiao 2026-03-18 203 cpu_relax(); e8821f559fed86 Pei Xiao 2026-03-18 204 } e8821f559fed86 Pei Xiao 2026-03-18 205 e8821f559fed86 Pei Xiao 2026-03-18 @206 if (!inner_limit) { This test is wrong. Maybe change inner_limit-- to --inner_limit. e8821f559fed86 Pei Xiao 2026-03-18 207 dev_warn_ratelimited(hs->dev, "RX FIFO flush timeout\n"); e8821f559fed86 Pei Xiao 2026-03-18 208 break; e8821f559fed86 Pei Xiao 2026-03-18 209 } e8821f559fed86 Pei Xiao 2026-03-18 210 c770d8631e1810 Jay Fang 2021-03-27 211 } while (hisi_spi_busy(hs) && limit--); e8821f559fed86 Pei Xiao 2026-03-18 212 e8821f559fed86 Pei Xiao 2026-03-18 213 if (!limit) e8821f559fed86 Pei Xiao 2026-03-18 214 dev_warn_ratelimited(hs->dev, "SPI busy timeout\n"); c770d8631e1810 Jay Fang 2021-03-27 215 } -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki