All of lore.kernel.org
 help / color / mirror / Atom feed
* [peterz-queue:locking/kcsan 12/21] drivers/hwmon/xgene-hwmon.c:126:9: sparse: sparse: incorrect type in assignment (different base types)
@ 2020-05-24  7:34 kbuild test robot
  0 siblings, 0 replies; only message in thread
From: kbuild test robot @ 2020-05-24  7:34 UTC (permalink / raw)
  To: kbuild-all

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git locking/kcsan
head:   ffed638b6a2180da8fd002a46632d746af72b299
commit: bbfa112b46bdbbdfc2f5bfb9c2dcbef780ff6417 [12/21] READ_ONCE: Simplify implementations of {READ,WRITE}_ONCE()
config: x86_64-allmodconfig (attached as .config)
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.1-193-gb8fad4bc-dirty
        git checkout bbfa112b46bdbbdfc2f5bfb9c2dcbef780ff6417
        # save the attached .config to linux build tree
        make W=1 C=1 ARCH=x86_64 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>


sparse warnings: (new ones prefixed by >>)

   drivers/hwmon/xgene-hwmon.c:123:15: sparse: sparse: cast to restricted __le16
>> drivers/hwmon/xgene-hwmon.c:126:9: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned short volatile @@    got restrunsigned short volatile @@
   drivers/hwmon/xgene-hwmon.c:126:9: sparse:    expected unsigned short volatile
   drivers/hwmon/xgene-hwmon.c:126:9: sparse:    got restricted __le16 [usertype]
>> drivers/hwmon/xgene-hwmon.c:143:9: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned int volatile @@    got restricunsigned int volatile @@
   drivers/hwmon/xgene-hwmon.c:143:9: sparse:    expected unsigned int volatile
   drivers/hwmon/xgene-hwmon.c:143:9: sparse:    got restricted __le32 [usertype]
   drivers/hwmon/xgene-hwmon.c:147:9: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned short volatile @@    got restrunsigned short volatile @@
   drivers/hwmon/xgene-hwmon.c:147:9: sparse:    expected unsigned short volatile
   drivers/hwmon/xgene-hwmon.c:147:9: sparse:    got restricted __le16 [usertype]
   drivers/hwmon/xgene-hwmon.c:151:15: sparse: sparse: cast to restricted __le16
   drivers/hwmon/xgene-hwmon.c:153:9: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned short volatile @@    got restrunsigned short volatile @@
   drivers/hwmon/xgene-hwmon.c:153:9: sparse:    expected unsigned short volatile
   drivers/hwmon/xgene-hwmon.c:153:9: sparse:    got restricted __le16 [usertype]
   drivers/hwmon/xgene-hwmon.c:157:17: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned int volatile @@    got restricunsigned int volatile @@
   drivers/hwmon/xgene-hwmon.c:157:17: sparse:    expected unsigned int volatile
   drivers/hwmon/xgene-hwmon.c:157:17: sparse:    got restricted __le32 [usertype]
--
   drivers/dma/mediatek/mtk-hsdma.c:451:17: sparse: sparse: incorrect type in assignment (different base types) @@    expected restricted __le32 volatile @@    got unsrestricted __le32 volatile @@
   drivers/dma/mediatek/mtk-hsdma.c:451:17: sparse:    expected restricted __le32 volatile
   drivers/dma/mediatek/mtk-hsdma.c:451:17: sparse:    got unsigned long long [usertype] src
   drivers/dma/mediatek/mtk-hsdma.c:452:17: sparse: sparse: restricted __le32 degrades to integer
>> drivers/dma/mediatek/mtk-hsdma.c:452:17: sparse: sparse: incorrect type in assignment (different base types) @@    expected restricted __le32 volatile @@    got 32 volatile @@
   drivers/dma/mediatek/mtk-hsdma.c:452:17: sparse:    expected restricted __le32 volatile
   drivers/dma/mediatek/mtk-hsdma.c:452:17: sparse:    got unsigned int
   drivers/dma/mediatek/mtk-hsdma.c:456:17: sparse: sparse: incorrect type in assignment (different base types) @@    expected restricted __le32 volatile @@    got unsrestricted __le32 volatile @@
   drivers/dma/mediatek/mtk-hsdma.c:456:17: sparse:    expected restricted __le32 volatile
   drivers/dma/mediatek/mtk-hsdma.c:456:17: sparse:    got unsigned long long [usertype] dest
>> drivers/dma/mediatek/mtk-hsdma.c:457:17: sparse: sparse: incorrect type in assignment (different base types) @@    expected restricted __le32 volatile @@    got le @@
   drivers/dma/mediatek/mtk-hsdma.c:457:17: sparse:    expected restricted __le32 volatile
   drivers/dma/mediatek/mtk-hsdma.c:457:17: sparse:    got int
   drivers/dma/mediatek/mtk-hsdma.c:580:33: sparse: sparse: restricted __le32 degrades to integer
   drivers/dma/mediatek/mtk-hsdma.c:604:26: sparse: sparse: Using plain integer as NULL pointer
   drivers/dma/mediatek/mtk-hsdma.c:878:18: sparse: sparse: incorrect type in initializer (different base types) @@    expected restricted __le32 [usertype] ddone @@    got 2 [usertype] ddone @@
   drivers/dma/mediatek/mtk-hsdma.c:878:18: sparse:    expected restricted __le32 [usertype] ddone
   drivers/dma/mediatek/mtk-hsdma.c:878:18: sparse:    got unsigned long
   drivers/dma/mediatek/mtk-hsdma.c:879:16: sparse: sparse: incorrect type in initializer (different base types) @@    expected restricted __le32 [usertype] ls0 @@    got 2 [usertype] ls0 @@
   drivers/dma/mediatek/mtk-hsdma.c:879:16: sparse:    expected restricted __le32 [usertype] ls0
   drivers/dma/mediatek/mtk-hsdma.c:879:16: sparse:    got unsigned long
   drivers/dma/mediatek/mtk-hsdma.c:883:18: sparse: sparse: incorrect type in initializer (different base types) @@    expected restricted __le32 [usertype] ddone @@    got 2 [usertype] ddone @@
   drivers/dma/mediatek/mtk-hsdma.c:883:18: sparse:    expected restricted __le32 [usertype] ddone
   drivers/dma/mediatek/mtk-hsdma.c:883:18: sparse:    got unsigned long
   drivers/dma/mediatek/mtk-hsdma.c:884:16: sparse: sparse: incorrect type in initializer (different base types) @@    expected restricted __le32 [usertype] ls0 @@    got 2 [usertype] ls0 @@
   drivers/dma/mediatek/mtk-hsdma.c:884:16: sparse:    expected restricted __le32 [usertype] ls0
   drivers/dma/mediatek/mtk-hsdma.c:884:16: sparse:    got unsigned long

vim +126 drivers/hwmon/xgene-hwmon.c

ed42cfa881e1d8d hotran        2016-07-21  115  
ed42cfa881e1d8d hotran        2016-07-21  116  /*
ed42cfa881e1d8d hotran        2016-07-21  117   * This function tests and clears a bitmask then returns its old value
ed42cfa881e1d8d hotran        2016-07-21  118   */
ed42cfa881e1d8d hotran        2016-07-21  119  static u16 xgene_word_tst_and_clr(u16 *addr, u16 mask)
ed42cfa881e1d8d hotran        2016-07-21  120  {
ed42cfa881e1d8d hotran        2016-07-21  121  	u16 ret, val;
ed42cfa881e1d8d hotran        2016-07-21  122  
c7cefce03e69127 Arnd Bergmann 2016-09-09  123  	val = le16_to_cpu(READ_ONCE(*addr));
ed42cfa881e1d8d hotran        2016-07-21  124  	ret = val & mask;
ed42cfa881e1d8d hotran        2016-07-21  125  	val &= ~mask;
c7cefce03e69127 Arnd Bergmann 2016-09-09 @126  	WRITE_ONCE(*addr, cpu_to_le16(val));
ed42cfa881e1d8d hotran        2016-07-21  127  
ed42cfa881e1d8d hotran        2016-07-21  128  	return ret;
ed42cfa881e1d8d hotran        2016-07-21  129  }
ed42cfa881e1d8d hotran        2016-07-21  130  
ed42cfa881e1d8d hotran        2016-07-21  131  static int xgene_hwmon_pcc_rd(struct xgene_hwmon_dev *ctx, u32 *msg)
ed42cfa881e1d8d hotran        2016-07-21  132  {
ed42cfa881e1d8d hotran        2016-07-21  133  	struct acpi_pcct_shared_memory *generic_comm_base = ctx->pcc_comm_addr;
c7cefce03e69127 Arnd Bergmann 2016-09-09  134  	u32 *ptr = (void *)(generic_comm_base + 1);
ed42cfa881e1d8d hotran        2016-07-21  135  	int rc, i;
ed42cfa881e1d8d hotran        2016-07-21  136  	u16 val;
ed42cfa881e1d8d hotran        2016-07-21  137  
ed42cfa881e1d8d hotran        2016-07-21  138  	mutex_lock(&ctx->rd_mutex);
ed42cfa881e1d8d hotran        2016-07-21  139  	init_completion(&ctx->rd_complete);
ed42cfa881e1d8d hotran        2016-07-21  140  	ctx->resp_pending = true;
ed42cfa881e1d8d hotran        2016-07-21  141  
ed42cfa881e1d8d hotran        2016-07-21  142  	/* Write signature for subspace */
c7cefce03e69127 Arnd Bergmann 2016-09-09 @143  	WRITE_ONCE(generic_comm_base->signature,
c7cefce03e69127 Arnd Bergmann 2016-09-09  144  		   cpu_to_le32(PCC_SIGNATURE_MASK | ctx->mbox_idx));
ed42cfa881e1d8d hotran        2016-07-21  145  
ed42cfa881e1d8d hotran        2016-07-21  146  	/* Write to the shared command region */
c7cefce03e69127 Arnd Bergmann 2016-09-09  147  	WRITE_ONCE(generic_comm_base->command,
c7cefce03e69127 Arnd Bergmann 2016-09-09  148  		   cpu_to_le16(MSG_TYPE(msg[0]) | PCCC_GENERATE_DB_INT));
ed42cfa881e1d8d hotran        2016-07-21  149  
ed42cfa881e1d8d hotran        2016-07-21  150  	/* Flip CMD COMPLETE bit */
c7cefce03e69127 Arnd Bergmann 2016-09-09  151  	val = le16_to_cpu(READ_ONCE(generic_comm_base->status));
ed42cfa881e1d8d hotran        2016-07-21  152  	val &= ~PCCS_CMD_COMPLETE;
c7cefce03e69127 Arnd Bergmann 2016-09-09  153  	WRITE_ONCE(generic_comm_base->status, cpu_to_le16(val));
ed42cfa881e1d8d hotran        2016-07-21  154  
ed42cfa881e1d8d hotran        2016-07-21  155  	/* Copy the message to the PCC comm space */
ed42cfa881e1d8d hotran        2016-07-21  156  	for (i = 0; i < sizeof(struct slimpro_resp_msg) / 4; i++)
c7cefce03e69127 Arnd Bergmann 2016-09-09  157  		WRITE_ONCE(ptr[i], cpu_to_le32(msg[i]));
ed42cfa881e1d8d hotran        2016-07-21  158  
ed42cfa881e1d8d hotran        2016-07-21  159  	/* Ring the doorbell */
ed42cfa881e1d8d hotran        2016-07-21  160  	rc = mbox_send_message(ctx->mbox_chan, msg);
ed42cfa881e1d8d hotran        2016-07-21  161  	if (rc < 0) {
ed42cfa881e1d8d hotran        2016-07-21  162  		dev_err(ctx->dev, "Mailbox send error %d\n", rc);
ed42cfa881e1d8d hotran        2016-07-21  163  		goto err;
ed42cfa881e1d8d hotran        2016-07-21  164  	}
ed42cfa881e1d8d hotran        2016-07-21  165  	if (!wait_for_completion_timeout(&ctx->rd_complete,
ed42cfa881e1d8d hotran        2016-07-21  166  					 usecs_to_jiffies(ctx->usecs_lat))) {
ed42cfa881e1d8d hotran        2016-07-21  167  		dev_err(ctx->dev, "Mailbox operation timed out\n");
ed42cfa881e1d8d hotran        2016-07-21  168  		rc = -ETIMEDOUT;
ed42cfa881e1d8d hotran        2016-07-21  169  		goto err;
ed42cfa881e1d8d hotran        2016-07-21  170  	}
ed42cfa881e1d8d hotran        2016-07-21  171  
ed42cfa881e1d8d hotran        2016-07-21  172  	/* Check for error message */
ed42cfa881e1d8d hotran        2016-07-21  173  	if (MSG_TYPE(ctx->sync_msg.msg) == MSG_TYPE_ERR) {
ed42cfa881e1d8d hotran        2016-07-21  174  		rc = -EINVAL;
ed42cfa881e1d8d hotran        2016-07-21  175  		goto err;
ed42cfa881e1d8d hotran        2016-07-21  176  	}
ed42cfa881e1d8d hotran        2016-07-21  177  
ed42cfa881e1d8d hotran        2016-07-21  178  	msg[0] = ctx->sync_msg.msg;
ed42cfa881e1d8d hotran        2016-07-21  179  	msg[1] = ctx->sync_msg.param1;
ed42cfa881e1d8d hotran        2016-07-21  180  	msg[2] = ctx->sync_msg.param2;
ed42cfa881e1d8d hotran        2016-07-21  181  
ed42cfa881e1d8d hotran        2016-07-21  182  err:
ed42cfa881e1d8d hotran        2016-07-21  183  	mbox_chan_txdone(ctx->mbox_chan, 0);
ed42cfa881e1d8d hotran        2016-07-21  184  	ctx->resp_pending = false;
ed42cfa881e1d8d hotran        2016-07-21  185  	mutex_unlock(&ctx->rd_mutex);
ed42cfa881e1d8d hotran        2016-07-21  186  	return rc;
ed42cfa881e1d8d hotran        2016-07-21  187  }
ed42cfa881e1d8d hotran        2016-07-21  188  

:::::: The code at line 126 was first introduced by commit
:::::: c7cefce03e691270c0e5e117248e14661e9c9cad hwmon: (xgene) access mailbox as RAM

:::::: TO: Arnd Bergmann <arnd@arndb.de>
:::::: CC: Guenter Roeck <linux@roeck-us.net>

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

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

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

only message in thread, other threads:[~2020-05-24  7:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-24  7:34 [peterz-queue:locking/kcsan 12/21] drivers/hwmon/xgene-hwmon.c:126:9: sparse: sparse: incorrect type in assignment (different base types) kbuild test robot

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.