mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
	Alex Deucher <alexander.deucher@amd.com>,
	Luben Tuikov <luben.tuikov@amd.com>
Subject: drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c:1884:21: sparse: sparse: incorrect type in argument 1 (different address spaces)
Date: Fri, 19 Jun 2020 03:15:42 +0800	[thread overview]
Message-ID: <202006190339.9NOG9bOQ%lkp@intel.com> (raw)

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   1b5044021070efa3259f3e9548dc35d1eb6aa844
commit: 57430471e2fa60a412e220fa3014567e792aaa6f drm/amdgpu: Add support for USBC PD FW download
date:   4 months ago
config: riscv-randconfig-s032-20200618 (attached as .config)
compiler: riscv64-linux-gcc (GCC) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.2-rc1-10-gc17b1b06-dirty
        git checkout 57430471e2fa60a412e220fa3014567e792aaa6f
        # save the attached .config to linux build tree
        make W=1 C=1 ARCH=riscv CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'

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


sparse warnings: (new ones prefixed by >>)

   drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c:160:9: sparse: sparse: incompatible types in conditional expression (different base types):
   drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c:160:9: sparse:    void
   drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c:160:9: sparse:    int
   drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c:525:5: sparse: sparse: symbol 'psp_ta_invoke' was not declared. Should it be static?
>> drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c:1884:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void volatile [noderef] <asn:2> *addr @@     got void *[assigned] cpu_addr @@
>> drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c:1884:21: sparse:     expected void volatile [noderef] <asn:2> *addr
   drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c:1884:21: sparse:     got void *[assigned] cpu_addr
   drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c:1887:9: sparse: sparse: undefined identifier 'clflush_cache_range'

vim +1884 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c

  1857	
  1858	static ssize_t psp_usbc_pd_fw_sysfs_write(struct device *dev,
  1859							       struct device_attribute *attr,
  1860							       const char *buf,
  1861							       size_t count)
  1862	{
  1863		struct drm_device *ddev = dev_get_drvdata(dev);
  1864		struct amdgpu_device *adev = ddev->dev_private;
  1865		void *cpu_addr;
  1866		dma_addr_t dma_addr;
  1867		int ret;
  1868		char fw_name[100];
  1869		const struct firmware *usbc_pd_fw;
  1870	
  1871	
  1872		snprintf(fw_name, sizeof(fw_name), "amdgpu/%s", buf);
  1873		ret = request_firmware(&usbc_pd_fw, fw_name, adev->dev);
  1874		if (ret)
  1875			goto fail;
  1876	
  1877		/* We need contiguous physical mem to place the FW  for psp to access */
  1878		cpu_addr = dma_alloc_coherent(adev->dev, usbc_pd_fw->size, &dma_addr, GFP_KERNEL);
  1879	
  1880		ret = dma_mapping_error(adev->dev, dma_addr);
  1881		if (ret)
  1882			goto rel_buf;
  1883	
> 1884		memcpy_toio(cpu_addr, usbc_pd_fw->data, usbc_pd_fw->size);
  1885	
  1886		/*TODO Remove once PSP starts snooping CPU cache */
  1887		clflush_cache_range(cpu_addr, (usbc_pd_fw->size & ~(L1_CACHE_BYTES - 1)));
  1888	
  1889		mutex_lock(&adev->psp.mutex);
  1890		ret = psp_load_usbc_pd_fw(&adev->psp, dma_addr);
  1891		mutex_unlock(&adev->psp.mutex);
  1892	
  1893	rel_buf:
  1894		dma_free_coherent(adev->dev, usbc_pd_fw->size, cpu_addr, dma_addr);
  1895		release_firmware(usbc_pd_fw);
  1896	
  1897	fail:
  1898		if (ret) {
  1899			DRM_ERROR("Failed to load USBC PD FW, err = %d", ret);
  1900			return ret;
  1901		}
  1902	
  1903		return count;
  1904	}
  1905	

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

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

                 reply	other threads:[~2020-06-18 19:15 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202006190339.9NOG9bOQ%lkp@intel.com \
    --to=lkp@intel.com \
    --cc=alexander.deucher@amd.com \
    --cc=andrey.grodzovsky@amd.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luben.tuikov@amd.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®