All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com
Subject: Re: [PATCH 6/9] bitfield: Update sanity checks
Date: Thu, 11 Dec 2025 22:03:25 +0800	[thread overview]
Message-ID: <202512112136.QAv8Vduf-lkp@intel.com> (raw)

:::::: 
:::::: Manual check reason: "low confidence static check first_new_problem: drivers/mmc/host/dw_mmc-rockchip.c:152:17: sparse: sparse: __auto_type on self-init var"
:::::: 

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
In-Reply-To: <20251209100313.2867-7-david.laight.linux@gmail.com>
References: <20251209100313.2867-7-david.laight.linux@gmail.com>
TO: david.laight.linux@gmail.com
TO: Yury Norov <yury.norov@gmail.com>
TO: Rasmus Villemoes <linux@rasmusvillemoes.dk>
TO: linux-kernel@vger.kernel.org
TO: linux-usb@vger.kernel.org
TO: Geert Uytterhoeven <geert+renesas@glider.be>
TO: Alexandre Belloni <alexandre.belloni@bootlin.com>
TO: Jonathan Cameron <Jonathan.Cameron@huawei.com>
TO: Crt Mori <cmo@melexis.com>
TO: Richard Genoud <richard.genoud@bootlin.com>
TO: Andy Shevchenko <andriy.shevchenko@intel.com>
TO: Luo Jie <quic_luoj@quicinc.com>
TO: Peter Zijlstra <peterz@infradead.org>
TO: Jakub Kicinski <kuba@kernel.org>
TO: netdev@vger.kernel.org
TO: "David S . Miller" <davem@davemloft.net>
TO: Simon Horman <simon.horman@netronome.com>
TO: Mika Westerberg <mika.westerberg@linux.intel.com>
TO: Andreas Noever <andreas.noever@gmail.com>
TO: Yehezkel Bernat <YehezkelShB@gmail.com>
TO: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
CC: David Laight <david.laight.linux@gmail.com>

Hi,

kernel test robot noticed the following build warnings:

[auto build test WARNING on linus/master]
[also build test WARNING on next-20251211]
[cannot apply to westeri-thunderbolt/next v6.18]
[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#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/david-laight-linux-gmail-com/nfp-Call-FIELD_PREP-in-NFP_ETH_SET_BIT_CONFIG-wrapper/20251209-181248
base:   linus/master
patch link:    https://lore.kernel.org/r/20251209100313.2867-7-david.laight.linux%40gmail.com
patch subject: [PATCH 6/9] bitfield: Update sanity checks
:::::: branch date: 2 days ago
:::::: commit date: 2 days ago
config: nios2-randconfig-r133-20251211 (https://download.01.org/0day-ci/archive/20251211/202512112136.QAv8Vduf-lkp@intel.com/config)
compiler: nios2-linux-gcc (GCC) 8.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251211/202512112136.QAv8Vduf-lkp@intel.com/reproduce)

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 <lkp@intel.com>
| Closes: https://lore.kernel.org/r/202512112136.QAv8Vduf-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
>> drivers/mmc/host/dw_mmc-rockchip.c:152:17: sparse: sparse: __auto_type on self-init var
   drivers/mmc/host/dw_mmc-rockchip.c:155:17: sparse: sparse: __auto_type on self-init var
   drivers/mmc/host/dw_mmc-rockchip.c:595:1: sparse: sparse: bad integer constant expression
   drivers/mmc/host/dw_mmc-rockchip.c:595:1: sparse: sparse: static assertion failed: "MODULE_INFO(author, ...) contains embedded NUL byte"
   drivers/mmc/host/dw_mmc-rockchip.c:596:1: sparse: sparse: bad integer constant expression
   drivers/mmc/host/dw_mmc-rockchip.c:596:1: sparse: sparse: static assertion failed: "MODULE_INFO(description, ...) contains embedded NUL byte"
   drivers/mmc/host/dw_mmc-rockchip.c:597:1: sparse: sparse: bad integer constant expression
   drivers/mmc/host/dw_mmc-rockchip.c:597:1: sparse: sparse: static assertion failed: "MODULE_INFO(alias, ...) contains embedded NUL byte"
   drivers/mmc/host/dw_mmc-rockchip.c:598:1: sparse: sparse: bad integer constant expression
   drivers/mmc/host/dw_mmc-rockchip.c:598:1: sparse: sparse: static assertion failed: "MODULE_INFO(file, ...) contains embedded NUL byte"
   drivers/mmc/host/dw_mmc-rockchip.c:598:1: sparse: sparse: bad integer constant expression
   drivers/mmc/host/dw_mmc-rockchip.c:598:1: sparse: sparse: static assertion failed: "MODULE_INFO(license, ...) contains embedded NUL byte"
>> drivers/mmc/host/dw_mmc-rockchip.c:152:17: sparse: sparse: incompatible types in conditional expression (different base types):
   drivers/mmc/host/dw_mmc-rockchip.c:152:17: sparse:    unsigned int
   drivers/mmc/host/dw_mmc-rockchip.c:152:17: sparse:    bad type
>> drivers/mmc/host/dw_mmc-rockchip.c:152:17: sparse: sparse: incompatible type for operation (-):
   drivers/mmc/host/dw_mmc-rockchip.c:152:17: sparse:    bad type _mask
>> drivers/mmc/host/dw_mmc-rockchip.c:152:17: sparse: sparse: incompatible types for operation (>>):
   drivers/mmc/host/dw_mmc-rockchip.c:152:17: sparse:    bad type _mask
   drivers/mmc/host/dw_mmc-rockchip.c:152:17: sparse:    int
   drivers/mmc/host/dw_mmc-rockchip.c:152:17: sparse: sparse: incompatible types for operation (<<):
   drivers/mmc/host/dw_mmc-rockchip.c:152:17: sparse:    bad type _val
   drivers/mmc/host/dw_mmc-rockchip.c:152:17: sparse:    int
   drivers/mmc/host/dw_mmc-rockchip.c:155:17: sparse: sparse: incompatible types in conditional expression (different base types):
   drivers/mmc/host/dw_mmc-rockchip.c:155:17: sparse:    unsigned int
   drivers/mmc/host/dw_mmc-rockchip.c:155:17: sparse:    bad type
   drivers/mmc/host/dw_mmc-rockchip.c:155:17: sparse: sparse: incompatible type for operation (-):
   drivers/mmc/host/dw_mmc-rockchip.c:155:17: sparse:    bad type _mask
   drivers/mmc/host/dw_mmc-rockchip.c:155:17: sparse: sparse: incompatible types for operation (>>):
   drivers/mmc/host/dw_mmc-rockchip.c:155:17: sparse:    bad type _mask
   drivers/mmc/host/dw_mmc-rockchip.c:155:17: sparse:    int
   drivers/mmc/host/dw_mmc-rockchip.c:155:17: sparse: sparse: incompatible types for operation (<<):
   drivers/mmc/host/dw_mmc-rockchip.c:155:17: sparse:    bad type _val
   drivers/mmc/host/dw_mmc-rockchip.c:155:17: sparse:    int

vim +152 drivers/mmc/host/dw_mmc-rockchip.c

59903441f5e49d Shawn Lin          2024-08-28   87  
59903441f5e49d Shawn Lin          2024-08-28   88  static int rockchip_mmc_set_internal_phase(struct dw_mci *host, bool sample, int degrees)
59903441f5e49d Shawn Lin          2024-08-28   89  {
739f04f4a46237 Shawn Lin          2025-11-04   90  	unsigned long rate = clk_get_rate(host->ciu_clk) / RK3288_CLKGEN_DIV;
59903441f5e49d Shawn Lin          2024-08-28   91  	u8 nineties, remainder;
59903441f5e49d Shawn Lin          2024-08-28   92  	u8 delay_num;
59903441f5e49d Shawn Lin          2024-08-28   93  	u32 raw_value;
59903441f5e49d Shawn Lin          2024-08-28   94  	u32 delay;
59903441f5e49d Shawn Lin          2024-08-28   95  
59903441f5e49d Shawn Lin          2024-08-28   96  	/*
59903441f5e49d Shawn Lin          2024-08-28   97  	 * The below calculation is based on the output clock from
59903441f5e49d Shawn Lin          2024-08-28   98  	 * MMC host to the card, which expects the phase clock inherits
59903441f5e49d Shawn Lin          2024-08-28   99  	 * the clock rate from its parent, namely the output clock
59903441f5e49d Shawn Lin          2024-08-28  100  	 * provider of MMC host. However, things may go wrong if
59903441f5e49d Shawn Lin          2024-08-28  101  	 * (1) It is orphan.
59903441f5e49d Shawn Lin          2024-08-28  102  	 * (2) It is assigned to the wrong parent.
59903441f5e49d Shawn Lin          2024-08-28  103  	 *
59903441f5e49d Shawn Lin          2024-08-28  104  	 * This check help debug the case (1), which seems to be the
59903441f5e49d Shawn Lin          2024-08-28  105  	 * most likely problem we often face and which makes it difficult
59903441f5e49d Shawn Lin          2024-08-28  106  	 * for people to debug unstable mmc tuning results.
59903441f5e49d Shawn Lin          2024-08-28  107  	 */
59903441f5e49d Shawn Lin          2024-08-28  108  	if (!rate) {
59903441f5e49d Shawn Lin          2024-08-28  109  		dev_err(host->dev, "%s: invalid clk rate\n", __func__);
59903441f5e49d Shawn Lin          2024-08-28  110  		return -EINVAL;
59903441f5e49d Shawn Lin          2024-08-28  111  	}
59903441f5e49d Shawn Lin          2024-08-28  112  
59903441f5e49d Shawn Lin          2024-08-28  113  	nineties = degrees / 90;
59903441f5e49d Shawn Lin          2024-08-28  114  	remainder = (degrees % 90);
59903441f5e49d Shawn Lin          2024-08-28  115  
59903441f5e49d Shawn Lin          2024-08-28  116  	/*
59903441f5e49d Shawn Lin          2024-08-28  117  	 * Due to the inexact nature of the "fine" delay, we might
59903441f5e49d Shawn Lin          2024-08-28  118  	 * actually go non-monotonic.  We don't go _too_ monotonic
59903441f5e49d Shawn Lin          2024-08-28  119  	 * though, so we should be OK.  Here are options of how we may
59903441f5e49d Shawn Lin          2024-08-28  120  	 * work:
59903441f5e49d Shawn Lin          2024-08-28  121  	 *
59903441f5e49d Shawn Lin          2024-08-28  122  	 * Ideally we end up with:
59903441f5e49d Shawn Lin          2024-08-28  123  	 *   1.0, 2.0, ..., 69.0, 70.0, ...,  89.0, 90.0
59903441f5e49d Shawn Lin          2024-08-28  124  	 *
59903441f5e49d Shawn Lin          2024-08-28  125  	 * On one extreme (if delay is actually 44ps):
59903441f5e49d Shawn Lin          2024-08-28  126  	 *   .73, 1.5, ..., 50.6, 51.3, ...,  65.3, 90.0
59903441f5e49d Shawn Lin          2024-08-28  127  	 * The other (if delay is actually 77ps):
59903441f5e49d Shawn Lin          2024-08-28  128  	 *   1.3, 2.6, ..., 88.6. 89.8, ..., 114.0, 90
59903441f5e49d Shawn Lin          2024-08-28  129  	 *
59903441f5e49d Shawn Lin          2024-08-28  130  	 * It's possible we might make a delay that is up to 25
59903441f5e49d Shawn Lin          2024-08-28  131  	 * degrees off from what we think we're making.  That's OK
59903441f5e49d Shawn Lin          2024-08-28  132  	 * though because we should be REALLY far from any bad range.
59903441f5e49d Shawn Lin          2024-08-28  133  	 */
59903441f5e49d Shawn Lin          2024-08-28  134  
59903441f5e49d Shawn Lin          2024-08-28  135  	/*
59903441f5e49d Shawn Lin          2024-08-28  136  	 * Convert to delay; do a little extra work to make sure we
59903441f5e49d Shawn Lin          2024-08-28  137  	 * don't overflow 32-bit / 64-bit numbers.
59903441f5e49d Shawn Lin          2024-08-28  138  	 */
59903441f5e49d Shawn Lin          2024-08-28  139  	delay = 10000000; /* PSECS_PER_SEC / 10000 / 10 */
59903441f5e49d Shawn Lin          2024-08-28  140  	delay *= remainder;
59903441f5e49d Shawn Lin          2024-08-28  141  	delay = DIV_ROUND_CLOSEST(delay,
59903441f5e49d Shawn Lin          2024-08-28  142  			(rate / 1000) * 36 *
59903441f5e49d Shawn Lin          2024-08-28  143  				(ROCKCHIP_MMC_DELAY_ELEMENT_PSEC / 10));
59903441f5e49d Shawn Lin          2024-08-28  144  
59903441f5e49d Shawn Lin          2024-08-28  145  	delay_num = (u8) min_t(u32, delay, 255);
59903441f5e49d Shawn Lin          2024-08-28  146  
59903441f5e49d Shawn Lin          2024-08-28  147  	raw_value = delay_num ? ROCKCHIP_MMC_DELAY_SEL : 0;
59903441f5e49d Shawn Lin          2024-08-28  148  	raw_value |= delay_num << ROCKCHIP_MMC_DELAYNUM_OFFSET;
59903441f5e49d Shawn Lin          2024-08-28  149  	raw_value |= nineties;
59903441f5e49d Shawn Lin          2024-08-28  150  
59903441f5e49d Shawn Lin          2024-08-28  151  	if (sample)
47975a878c0669 Nicolas Frattaroli 2025-08-25 @152  		mci_writel(host, TIMING_CON1,
47975a878c0669 Nicolas Frattaroli 2025-08-25  153  			   FIELD_PREP_WM16(GENMASK(11, 1), raw_value));
59903441f5e49d Shawn Lin          2024-08-28  154  	else
47975a878c0669 Nicolas Frattaroli 2025-08-25  155  		mci_writel(host, TIMING_CON0,
47975a878c0669 Nicolas Frattaroli 2025-08-25  156  			   FIELD_PREP_WM16(GENMASK(11, 1), raw_value));
59903441f5e49d Shawn Lin          2024-08-28  157  
59903441f5e49d Shawn Lin          2024-08-28  158  	dev_dbg(host->dev, "set %s_phase(%d) delay_nums=%u actual_degrees=%d\n",
59903441f5e49d Shawn Lin          2024-08-28  159  		sample ? "sample" : "drv", degrees, delay_num,
59903441f5e49d Shawn Lin          2024-08-28  160  		rockchip_mmc_get_phase(host, sample)
59903441f5e49d Shawn Lin          2024-08-28  161  	);
59903441f5e49d Shawn Lin          2024-08-28  162  
59903441f5e49d Shawn Lin          2024-08-28  163  	return 0;
59903441f5e49d Shawn Lin          2024-08-28  164  }
59903441f5e49d Shawn Lin          2024-08-28  165  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

             reply	other threads:[~2025-12-11 14:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-11 14:03 kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-12-12 20:28 [PATCH 6/9] bitfield: Update sanity checks kernel test robot
2025-12-12  4:48 kernel test robot
2025-12-09 10:03 [PATCH 0/9] bitfield: tidy up bitfield.h david.laight.linux
2025-12-09 10:03 ` [PATCH 6/9] bitfield: Update sanity checks david.laight.linux
2025-12-08 22:42 [PATCH 0/9] bitfield: tidy up bitfield.h david.laight.linux
2025-12-08 22:42 ` [PATCH 6/9] bitfield: Update sanity checks david.laight.linux

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202512112136.QAv8Vduf-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=oe-kbuild@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.