All of lore.kernel.org
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: [chrome-os:chromeos-4.4 86/91] drivers/staging/gasket/gasket_core.c:1013:15: sparse: expected void *cpu_addr
Date: Fri, 08 May 2020 18:14:36 +0800	[thread overview]
Message-ID: <202005081833.3aHLSFBM%lkp@intel.com> (raw)

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

CC: kbuild-all(a)lists.01.org
TO: cros-kernel-buildreports(a)googlegroups.com
TO: Guenter Roeck <groeck@google.com>

tree:   https://chromium.googlesource.com/chromiumos/third_party/kernel chromeos-4.4
head:   1231e06d9791a1cb79112533c0405c40300fbd95
commit: f7b1f7e308f5663ca90b5f1d0c039cf7a3b97110 [86/91] CHROMIUM: staging: gasket: fix mmap of coherent buffer when IOMMU translation on
reproduce:
        # apt-get install sparse
        # sparse version: 
        git checkout f7b1f7e308f5663ca90b5f1d0c039cf7a3b97110
        make ARCH=x86_64 allmodconfig
        make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
:::::: branch date: 21 hours ago
:::::: commit date: 21 hours ago

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/staging/gasket/gasket_core.c:1013:15: sparse: warning: incorrect type in argument 3 (different address spaces)
>> drivers/staging/gasket/gasket_core.c:1013:15: sparse:    expected void *cpu_addr
>> drivers/staging/gasket/gasket_core.c:1013:15: sparse:    got unsigned char [noderef] [usertype] <asn:2> *virt_base

git remote add chrome-os https://chromium.googlesource.com/chromiumos/third_party/kernel
git remote update chrome-os
git checkout f7b1f7e308f5663ca90b5f1d0c039cf7a3b97110
vim +1013 drivers/staging/gasket/gasket_core.c

f3463fa3ff0459 Simon Que   2018-06-29   987  
2a498bf1f01090 Todd Poynor 2018-07-29   988  /* Map a region of coherent memory. */
fea755803823c5 Todd Poynor 2018-07-31   989  static int gasket_mmap_coherent(struct gasket_dev *gasket_dev,
fea755803823c5 Todd Poynor 2018-07-31   990  				struct vm_area_struct *vma)
f3463fa3ff0459 Simon Que   2018-06-29   991  {
f3463fa3ff0459 Simon Que   2018-06-29   992  	const struct gasket_driver_desc *driver_desc =
f3463fa3ff0459 Simon Que   2018-06-29   993  		gasket_dev->internal_desc->driver_desc;
f3463fa3ff0459 Simon Que   2018-06-29   994  	const ulong requested_length = vma->vm_end - vma->vm_start;
f3463fa3ff0459 Simon Que   2018-06-29   995  	int ret;
f3463fa3ff0459 Simon Que   2018-06-29   996  	ulong permissions;
f3463fa3ff0459 Simon Que   2018-06-29   997  
f3463fa3ff0459 Simon Que   2018-06-29   998  	if (requested_length == 0 || requested_length >
f3463fa3ff0459 Simon Que   2018-06-29   999  	    gasket_dev->coherent_buffer.length_bytes) {
f3463fa3ff0459 Simon Que   2018-06-29  1000  		trace_gasket_mmap_exit(-EINVAL);
f3463fa3ff0459 Simon Que   2018-06-29  1001  		return -EINVAL;
f3463fa3ff0459 Simon Que   2018-06-29  1002  	}
f3463fa3ff0459 Simon Que   2018-06-29  1003  
f3463fa3ff0459 Simon Que   2018-06-29  1004  	permissions = driver_desc->coherent_buffer_description.permissions;
f3463fa3ff0459 Simon Que   2018-06-29  1005  	if (!gasket_mmap_has_permissions(gasket_dev, vma, permissions)) {
0407a129da6e98 Todd Poynor 2018-07-26  1006  		dev_err(gasket_dev->dev, "Permission checking failed.\n");
f3463fa3ff0459 Simon Que   2018-06-29  1007  		trace_gasket_mmap_exit(-EPERM);
f3463fa3ff0459 Simon Que   2018-06-29  1008  		return -EPERM;
f3463fa3ff0459 Simon Que   2018-06-29  1009  	}
f3463fa3ff0459 Simon Que   2018-06-29  1010  
f3463fa3ff0459 Simon Que   2018-06-29  1011  	vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
f7b1f7e308f566 Todd Poynor 2019-08-27  1012  	vma->vm_pgoff = 0;
f7b1f7e308f566 Todd Poynor 2019-08-27 @1013  	ret = dma_mmap_coherent(gasket_dev->dma_dev, vma,
f7b1f7e308f566 Todd Poynor 2019-08-27  1014  				gasket_dev->coherent_buffer.virt_base,
f7b1f7e308f566 Todd Poynor 2019-08-27  1015  				gasket_dev->coherent_buffer.phys_base,
f7b1f7e308f566 Todd Poynor 2019-08-27  1016  				requested_length);
f3463fa3ff0459 Simon Que   2018-06-29  1017  	if (ret) {
f7b1f7e308f566 Todd Poynor 2019-08-27  1018  		dev_err(gasket_dev->dev,
f7b1f7e308f566 Todd Poynor 2019-08-27  1019  			"Error mmapping coherent buffer err=%d.\n", ret);
f3463fa3ff0459 Simon Que   2018-06-29  1020  		trace_gasket_mmap_exit(ret);
f3463fa3ff0459 Simon Que   2018-06-29  1021  		return ret;
f3463fa3ff0459 Simon Que   2018-06-29  1022  	}
f3463fa3ff0459 Simon Que   2018-06-29  1023  
f3463fa3ff0459 Simon Que   2018-06-29  1024  	/* Record the user virtual to dma_address mapping that was
f3463fa3ff0459 Simon Que   2018-06-29  1025  	 * created by the kernel.
f3463fa3ff0459 Simon Que   2018-06-29  1026  	 */
fea755803823c5 Todd Poynor 2018-07-31  1027  	gasket_set_user_virt(gasket_dev, requested_length,
fea755803823c5 Todd Poynor 2018-07-31  1028  			     gasket_dev->coherent_buffer.phys_base,
fea755803823c5 Todd Poynor 2018-07-31  1029  			     vma->vm_start);
f3463fa3ff0459 Simon Que   2018-06-29  1030  	return 0;
f3463fa3ff0459 Simon Que   2018-06-29  1031  }
f3463fa3ff0459 Simon Que   2018-06-29  1032  

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

                 reply	other threads:[~2020-05-08 10:14 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=202005081833.3aHLSFBM%lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild@lists.01.org \
    /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.