All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Manisha Chinthapally <manisha.chinthapally@intel.com>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
	Faycal Benmlih <faycal.benmlih@intel.com>
Subject: drivers/platform/x86/socperf/soc_uncore.c:756:47: sparse: sparse: cast removes address space '__iomem' of expression
Date: Tue, 26 Jul 2022 22:55:16 +0800	[thread overview]
Message-ID: <202207262235.TSKOSTSL-lkp@intel.com> (raw)

tree:   https://github.com/mchinth/linux sep_socwatch_linux_5_10
head:   c55df4a2b60fc7c6c4d00fd9f9fb447087833513
commit: 4a8adda8065c4c6944ffedd3025605c845c262a5 SEP/SOCWATCH resolve build errors after rebasing to linux v5.6-rc3
date:   1 year, 10 months ago
config: x86_64-randconfig-s022 (https://download.01.org/0day-ci/archive/20220726/202207262235.TSKOSTSL-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.3.0-3) 11.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.4-39-gce1a6720-dirty
        # https://github.com/mchinth/linux/commit/4a8adda8065c4c6944ffedd3025605c845c262a5
        git remote add mchinth https://github.com/mchinth/linux
        git fetch --no-tags mchinth sep_socwatch_linux_5_10
        git checkout 4a8adda8065c4c6944ffedd3025605c845c262a5
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=x86_64 SHELL=/bin/bash

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>

sparse warnings: (new ones prefixed by >>)
>> drivers/platform/x86/socperf/soc_uncore.c:756:47: sparse: sparse: cast removes address space '__iomem' of expression
   drivers/platform/x86/socperf/soc_uncore.c:889:10: sparse: sparse: Initializer entry defined twice
   drivers/platform/x86/socperf/soc_uncore.c:893:10: sparse:   also defined here
--
>> drivers/platform/x86/socperf/haswellunc_sa.c:203:39: sparse: sparse: cast removes address space '__iomem' of expression
   drivers/platform/x86/socperf/haswellunc_sa.c:395:10: sparse: sparse: Initializer entry defined twice
   drivers/platform/x86/socperf/haswellunc_sa.c:399:10: sparse:   also defined here
--
>> drivers/platform/x86/socperf/npk_uncore.c:292:39: sparse: sparse: cast removes address space '__iomem' of expression
   drivers/platform/x86/socperf/npk_uncore.c:492:10: sparse: sparse: Initializer entry defined twice
   drivers/platform/x86/socperf/npk_uncore.c:496:10: sparse:   also defined here
--
>> drivers/platform/x86/socwatch/sw_telem.c:239:33: sparse: sparse: cast removes address space '__iomem' of expression
   drivers/platform/x86/socwatch/sw_telem.c:242:28: sparse: sparse: cast removes address space '__iomem' of expression
   drivers/platform/x86/socwatch/sw_telem.c:245:58: sparse: sparse: cast removes address space '__iomem' of expression
>> drivers/platform/x86/socwatch/sw_telem.c:260:25: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void volatile [noderef] __iomem *addr @@     got unsigned long long volatile [usertype] *static [assigned] [toplevel] s_punitInterfaceAddr @@
   drivers/platform/x86/socwatch/sw_telem.c:260:25: sparse:     expected void volatile [noderef] __iomem *addr
   drivers/platform/x86/socwatch/sw_telem.c:260:25: sparse:     got unsigned long long volatile [usertype] *static [assigned] [toplevel] s_punitInterfaceAddr
   drivers/platform/x86/socwatch/sw_telem.c:264:25: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void volatile [noderef] __iomem *addr @@     got unsigned long long volatile [usertype] *static [assigned] [toplevel] s_punitDataAddr @@
   drivers/platform/x86/socwatch/sw_telem.c:264:25: sparse:     expected void volatile [noderef] __iomem *addr
   drivers/platform/x86/socwatch/sw_telem.c:264:25: sparse:     got unsigned long long volatile [usertype] *static [assigned] [toplevel] s_punitDataAddr
>> drivers/platform/x86/socwatch/sw_telem.c:268:54: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void volatile [noderef] __iomem *addr @@     got unsigned long long volatile [usertype] *ssram_virt_addr @@
   drivers/platform/x86/socwatch/sw_telem.c:268:54: sparse:     expected void volatile [noderef] __iomem *addr
   drivers/platform/x86/socwatch/sw_telem.c:268:54: sparse:     got unsigned long long volatile [usertype] *ssram_virt_addr
   drivers/platform/x86/socwatch/sw_telem.c:280:28: sparse: sparse: cast removes address space '__iomem' of expression
   drivers/platform/x86/socwatch/sw_telem.c:283:28: sparse: sparse: cast removes address space '__iomem' of expression
   drivers/platform/x86/socwatch/sw_telem.c:286:29: sparse: sparse: cast removes address space '__iomem' of expression
   drivers/platform/x86/socwatch/sw_telem.c:289:29: sparse: sparse: cast removes address space '__iomem' of expression
   drivers/platform/x86/socwatch/sw_telem.c:292:56: sparse: sparse: cast removes address space '__iomem' of expression
   drivers/platform/x86/socwatch/sw_telem.c:307:25: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void volatile [noderef] __iomem *addr @@     got unsigned long long volatile [usertype] *static [assigned] [toplevel] s_pmcIPCCmdAddr @@
   drivers/platform/x86/socwatch/sw_telem.c:307:25: sparse:     expected void volatile [noderef] __iomem *addr
   drivers/platform/x86/socwatch/sw_telem.c:307:25: sparse:     got unsigned long long volatile [usertype] *static [assigned] [toplevel] s_pmcIPCCmdAddr
   drivers/platform/x86/socwatch/sw_telem.c:311:25: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void volatile [noderef] __iomem *addr @@     got unsigned long long volatile [usertype] *static [assigned] [toplevel] s_pmcIPCStsAddr @@
   drivers/platform/x86/socwatch/sw_telem.c:311:25: sparse:     expected void volatile [noderef] __iomem *addr
   drivers/platform/x86/socwatch/sw_telem.c:311:25: sparse:     got unsigned long long volatile [usertype] *static [assigned] [toplevel] s_pmcIPCStsAddr
   drivers/platform/x86/socwatch/sw_telem.c:315:25: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void volatile [noderef] __iomem *addr @@     got unsigned long long volatile [usertype] *static [assigned] [toplevel] s_pmcIPCWBufAddr @@
   drivers/platform/x86/socwatch/sw_telem.c:315:25: sparse:     expected void volatile [noderef] __iomem *addr
   drivers/platform/x86/socwatch/sw_telem.c:315:25: sparse:     got unsigned long long volatile [usertype] *static [assigned] [toplevel] s_pmcIPCWBufAddr
   drivers/platform/x86/socwatch/sw_telem.c:319:25: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void volatile [noderef] __iomem *addr @@     got unsigned long long volatile [usertype] *static [assigned] [toplevel] s_pmcIPCRBufAddr @@
   drivers/platform/x86/socwatch/sw_telem.c:319:25: sparse:     expected void volatile [noderef] __iomem *addr
   drivers/platform/x86/socwatch/sw_telem.c:319:25: sparse:     got unsigned long long volatile [usertype] *static [assigned] [toplevel] s_pmcIPCRBufAddr
   drivers/platform/x86/socwatch/sw_telem.c:323:52: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void volatile [noderef] __iomem *addr @@     got unsigned long long volatile [usertype] *ssram_virt_addr @@
   drivers/platform/x86/socwatch/sw_telem.c:323:52: sparse:     expected void volatile [noderef] __iomem *addr
   drivers/platform/x86/socwatch/sw_telem.c:323:52: sparse:     got unsigned long long volatile [usertype] *ssram_virt_addr
>> drivers/platform/x86/socwatch/sw_telem.c:671:5: sparse: sparse: symbol 'read_telem' was not declared. Should it be static?
--
>> drivers/platform/x86/socwatch/sw_trace_notifier_provider.c:1634:67: sparse: sparse: incorrect type in argument 2 (different base types) @@     expected unsigned int flags @@     got restricted gfp_t @@
   drivers/platform/x86/socwatch/sw_trace_notifier_provider.c:1634:67: sparse:     expected unsigned int flags
   drivers/platform/x86/socwatch/sw_trace_notifier_provider.c:1634:67: sparse:     got restricted gfp_t

vim +/__iomem +756 drivers/platform/x86/socperf/soc_uncore.c

   674	
   675	/* ------------------------------------------------------------------------- */
   676	/*!
   677	 * @fn uncore_Create_Mem()
   678	 *
   679	 * @param    None
   680	 *
   681	 * @return   None     No return needed
   682	 *
   683	 * @brief    Read the counters
   684	 *
   685	 */
   686	static VOID uncore_Create_Mem(U32 memory_size, U64 *trace_buffer)
   687	{
   688		ECB pecb;
   689		DRV_PCI_DEVICE_ENTRY dpden;
   690		U32 bar_name = 0;
   691		DRV_PCI_DEVICE_ENTRY curr_pci_entry = NULL;
   692		U64 mmio_offset = 0;
   693		U32 dev_index = 0;
   694		U32 data_val = 0;
   695		U32 reg_index = 0;
   696		U64 physical_high = 0;
   697		U64 odla_physical_address = 0;
   698	
   699		if (device_uncore == NULL) {
   700			SOCPERF_PRINT_ERROR("ERROR: NULL device_uncore!\n");
   701			return;
   702		}
   703		pecb = (ECB)LWPMU_DEVICE_PMU_register_data(device_uncore)[0];
   704		if (pecb == NULL) {
   705			SOCPERF_PRINT_ERROR("ERROR: null pecb!\n");
   706			return;
   707		}
   708	
   709		if (!trace_buffer) {
   710			return;
   711		}
   712	
   713		ECB_pcidev_entry_list(pecb) = (DRV_PCI_DEVICE_ENTRY)(
   714			(S8 *)pecb + ECB_pcidev_list_offset(pecb));
   715		dpden = ECB_pcidev_entry_list(pecb);
   716	
   717		for (dev_index = 0; dev_index < ECB_num_pci_devices(pecb);
   718		     dev_index++) {
   719			curr_pci_entry = &dpden[dev_index];
   720			bar_name = DRV_PCI_DEVICE_ENTRY_bar_name(curr_pci_entry);
   721			mmio_offset = DRV_PCI_DEVICE_ENTRY_base_offset_for_mmio(
   722				curr_pci_entry);
   723	
   724			if (DRV_PCI_DEVICE_ENTRY_prog_type(curr_pci_entry) ==
   725				    UNC_MEMORY &&
   726			    DRV_PCI_DEVICE_ENTRY_config_type(curr_pci_entry) ==
   727				    UNC_PCICFG &&
   728			    bar_name == UNC_SOCPCI &&
   729			    DRV_PCI_DEVICE_ENTRY_operation(curr_pci_entry) ==
   730				    UNC_OP_WRITE) {
   731				read_From_Register(
   732					DRV_PCI_DEVICE_ENTRY_bus_no(curr_pci_entry),
   733					DRV_PCI_DEVICE_ENTRY_dev_no(curr_pci_entry),
   734					DRV_PCI_DEVICE_ENTRY_func_no(curr_pci_entry),
   735					DRV_PCI_DEVICE_ENTRY_port_id(curr_pci_entry),
   736					SOC_COUNTER_READ_OP_CODE, mmio_offset,
   737					&data_val);
   738				if (reg_index == 1) {
   739					odla_physical_address = data_val;
   740				} else if (reg_index == 2) {
   741					physical_high = data_val;
   742					odla_physical_address = odla_physical_address |
   743								(physical_high << 32);
   744				}
   745				SOCPERF_PRINT_DEBUG(
   746					"op=%d port=%d offset=%x val=%x\n",
   747					DRV_PCI_DEVICE_ENTRY_op_code(curr_pci_entry),
   748					DRV_PCI_DEVICE_ENTRY_port_id(curr_pci_entry),
   749					mmio_offset, data_val);
   750				reg_index++;
   751			}
   752			continue;
   753		}
   754		SOCPERF_PRINT_DEBUG("Physical Address=%llx\n", odla_physical_address);
   755		if (odla_physical_address) {
 > 756			trace_virtual_address = (U64)(UIOP)ioremap_cache(
   757				odla_physical_address, SOC_UNCORE_PAGE_SIZE);
   758			SOCPERF_PRINT_DEBUG("PHY=%llx ODLA VIRTUAL ADDRESS=%llx\n",
   759					    odla_physical_address,
   760					    trace_virtual_address);
   761			if (trace_buffer) {
   762				*trace_buffer = odla_physical_address;
   763			}
   764		}
   765	}
   766	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

             reply	other threads:[~2022-07-26 14:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-26 14:55 kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-07-27 23:44 drivers/platform/x86/socperf/soc_uncore.c:756:47: sparse: sparse: cast removes address space '__iomem' of expression kernel test robot

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=202207262235.TSKOSTSL-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=faycal.benmlih@intel.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manisha.chinthapally@intel.com \
    /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.