From: kernel test robot <lkp@intel.com>
To: Thomas Zimmermann <tzimmermann@suse.de>,
maarten.lankhorst@linux.intel.com, mripard@kernel.org,
airlied@gmail.com, daniel@ffwll.ch, javierm@redhat.com,
deller@gmx.de, geert@linux-m68k.org, sudipm.mukherjee@gmail.com,
teddy.wang@siliconmotion.com
Cc: oe-kbuild-all@lists.linux.dev, linux-fbdev@vger.kernel.org,
Thomas Zimmermann <tzimmermann@suse.de>,
dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 5/6] fbdev: Move CFB read and write code into helper functions
Date: Wed, 26 Apr 2023 14:07:03 +0800 [thread overview]
Message-ID: <202304261333.9giYEbEl-lkp@intel.com> (raw)
In-Reply-To: <20230425142846.730-6-tzimmermann@suse.de>
Hi Thomas,
kernel test robot noticed the following build warnings:
[auto build test WARNING on drm-misc/drm-misc-next]
[also build test WARNING on linus/master next-20230425]
[cannot apply to v6.3]
[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/Thomas-Zimmermann/fbdev-Return-number-of-bytes-read-or-written/20230425-223011
base: git://anongit.freedesktop.org/drm/drm-misc drm-misc-next
patch link: https://lore.kernel.org/r/20230425142846.730-6-tzimmermann%40suse.de
patch subject: [PATCH 5/6] fbdev: Move CFB read and write code into helper functions
config: nios2-randconfig-s031-20230423 (https://download.01.org/0day-ci/archive/20230426/202304261333.9giYEbEl-lkp@intel.com/config)
compiler: nios2-linux-gcc (GCC) 12.1.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.4-39-gce1a6720-dirty
# https://github.com/intel-lab-lkp/linux/commit/d4a150f3dfa8e73f2e92f1c7efc9271e17632cc2
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Thomas-Zimmermann/fbdev-Return-number-of-bytes-read-or-written/20230425-223011
git checkout d4a150f3dfa8e73f2e92f1c7efc9271e17632cc2
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=nios2 olddefconfig
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=nios2 SHELL=/bin/bash drivers/video/fbdev/core/
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202304261333.9giYEbEl-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
>> drivers/video/fbdev/core/fb_cfb_fops.c:44:39: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const *s @@ got unsigned char [noderef] [usertype] __iomem *[assigned] src @@
drivers/video/fbdev/core/fb_cfb_fops.c:44:39: sparse: expected void const *s
drivers/video/fbdev/core/fb_cfb_fops.c:44:39: sparse: got unsigned char [noderef] [usertype] __iomem *[assigned] src
>> drivers/video/fbdev/core/fb_cfb_fops.c:113:32: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *d @@ got unsigned char [noderef] [usertype] __iomem *[assigned] dst @@
drivers/video/fbdev/core/fb_cfb_fops.c:113:32: sparse: expected void *d
drivers/video/fbdev/core/fb_cfb_fops.c:113:32: sparse: got unsigned char [noderef] [usertype] __iomem *[assigned] dst
vim +44 drivers/video/fbdev/core/fb_cfb_fops.c
6
7 ssize_t fb_cfb_read(struct fb_info *info, char __user *buf, size_t count, loff_t *ppos)
8 {
9 unsigned long p = *ppos;
10 u8 *buffer, *dst;
11 u8 __iomem *src;
12 int c, cnt = 0, err = 0;
13 unsigned long total_size;
14
15 if (!info->screen_base)
16 return -ENODEV;
17
18 total_size = info->screen_size;
19
20 if (total_size == 0)
21 total_size = info->fix.smem_len;
22
23 if (p >= total_size)
24 return 0;
25
26 if (count >= total_size)
27 count = total_size;
28
29 if (count + p > total_size)
30 count = total_size - p;
31
32 buffer = kmalloc((count > PAGE_SIZE) ? PAGE_SIZE : count, GFP_KERNEL);
33 if (!buffer)
34 return -ENOMEM;
35
36 src = (u8 __iomem *)(info->screen_base + p);
37
38 if (info->fbops->fb_sync)
39 info->fbops->fb_sync(info);
40
41 while (count) {
42 c = (count > PAGE_SIZE) ? PAGE_SIZE : count;
43 dst = buffer;
> 44 fb_memcpy_fromfb(dst, src, c);
45 dst += c;
46 src += c;
47
48 if (copy_to_user(buf, buffer, c)) {
49 err = -EFAULT;
50 break;
51 }
52 *ppos += c;
53 buf += c;
54 cnt += c;
55 count -= c;
56 }
57
58 kfree(buffer);
59
60 return cnt ? cnt : err;
61 }
62 EXPORT_SYMBOL(fb_cfb_read);
63
64 ssize_t fb_cfb_write(struct fb_info *info, const char __user *buf, size_t count, loff_t *ppos)
65 {
66 unsigned long p = *ppos;
67 u8 *buffer, *src;
68 u8 __iomem *dst;
69 int c, cnt = 0, err = 0;
70 unsigned long total_size;
71
72 if (!info->screen_base)
73 return -ENODEV;
74
75 total_size = info->screen_size;
76
77 if (total_size == 0)
78 total_size = info->fix.smem_len;
79
80 if (p > total_size)
81 return -EFBIG;
82
83 if (count > total_size) {
84 err = -EFBIG;
85 count = total_size;
86 }
87
88 if (count + p > total_size) {
89 if (!err)
90 err = -ENOSPC;
91
92 count = total_size - p;
93 }
94
95 buffer = kmalloc((count > PAGE_SIZE) ? PAGE_SIZE : count, GFP_KERNEL);
96 if (!buffer)
97 return -ENOMEM;
98
99 dst = (u8 __iomem *)(info->screen_base + p);
100
101 if (info->fbops->fb_sync)
102 info->fbops->fb_sync(info);
103
104 while (count) {
105 c = (count > PAGE_SIZE) ? PAGE_SIZE : count;
106 src = buffer;
107
108 if (copy_from_user(src, buf, c)) {
109 err = -EFAULT;
110 break;
111 }
112
> 113 fb_memcpy_tofb(dst, src, c);
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests
WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: Thomas Zimmermann <tzimmermann@suse.de>,
maarten.lankhorst@linux.intel.com, mripard@kernel.org,
airlied@gmail.com, daniel@ffwll.ch, javierm@redhat.com,
deller@gmx.de, geert@linux-m68k.org, sudipm.mukherjee@gmail.com,
teddy.wang@siliconmotion.com
Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org,
Thomas Zimmermann <tzimmermann@suse.de>,
oe-kbuild-all@lists.linux.dev
Subject: Re: [PATCH 5/6] fbdev: Move CFB read and write code into helper functions
Date: Wed, 26 Apr 2023 14:07:03 +0800 [thread overview]
Message-ID: <202304261333.9giYEbEl-lkp@intel.com> (raw)
In-Reply-To: <20230425142846.730-6-tzimmermann@suse.de>
Hi Thomas,
kernel test robot noticed the following build warnings:
[auto build test WARNING on drm-misc/drm-misc-next]
[also build test WARNING on linus/master next-20230425]
[cannot apply to v6.3]
[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/Thomas-Zimmermann/fbdev-Return-number-of-bytes-read-or-written/20230425-223011
base: git://anongit.freedesktop.org/drm/drm-misc drm-misc-next
patch link: https://lore.kernel.org/r/20230425142846.730-6-tzimmermann%40suse.de
patch subject: [PATCH 5/6] fbdev: Move CFB read and write code into helper functions
config: nios2-randconfig-s031-20230423 (https://download.01.org/0day-ci/archive/20230426/202304261333.9giYEbEl-lkp@intel.com/config)
compiler: nios2-linux-gcc (GCC) 12.1.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.4-39-gce1a6720-dirty
# https://github.com/intel-lab-lkp/linux/commit/d4a150f3dfa8e73f2e92f1c7efc9271e17632cc2
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Thomas-Zimmermann/fbdev-Return-number-of-bytes-read-or-written/20230425-223011
git checkout d4a150f3dfa8e73f2e92f1c7efc9271e17632cc2
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=nios2 olddefconfig
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=nios2 SHELL=/bin/bash drivers/video/fbdev/core/
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202304261333.9giYEbEl-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
>> drivers/video/fbdev/core/fb_cfb_fops.c:44:39: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const *s @@ got unsigned char [noderef] [usertype] __iomem *[assigned] src @@
drivers/video/fbdev/core/fb_cfb_fops.c:44:39: sparse: expected void const *s
drivers/video/fbdev/core/fb_cfb_fops.c:44:39: sparse: got unsigned char [noderef] [usertype] __iomem *[assigned] src
>> drivers/video/fbdev/core/fb_cfb_fops.c:113:32: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *d @@ got unsigned char [noderef] [usertype] __iomem *[assigned] dst @@
drivers/video/fbdev/core/fb_cfb_fops.c:113:32: sparse: expected void *d
drivers/video/fbdev/core/fb_cfb_fops.c:113:32: sparse: got unsigned char [noderef] [usertype] __iomem *[assigned] dst
vim +44 drivers/video/fbdev/core/fb_cfb_fops.c
6
7 ssize_t fb_cfb_read(struct fb_info *info, char __user *buf, size_t count, loff_t *ppos)
8 {
9 unsigned long p = *ppos;
10 u8 *buffer, *dst;
11 u8 __iomem *src;
12 int c, cnt = 0, err = 0;
13 unsigned long total_size;
14
15 if (!info->screen_base)
16 return -ENODEV;
17
18 total_size = info->screen_size;
19
20 if (total_size == 0)
21 total_size = info->fix.smem_len;
22
23 if (p >= total_size)
24 return 0;
25
26 if (count >= total_size)
27 count = total_size;
28
29 if (count + p > total_size)
30 count = total_size - p;
31
32 buffer = kmalloc((count > PAGE_SIZE) ? PAGE_SIZE : count, GFP_KERNEL);
33 if (!buffer)
34 return -ENOMEM;
35
36 src = (u8 __iomem *)(info->screen_base + p);
37
38 if (info->fbops->fb_sync)
39 info->fbops->fb_sync(info);
40
41 while (count) {
42 c = (count > PAGE_SIZE) ? PAGE_SIZE : count;
43 dst = buffer;
> 44 fb_memcpy_fromfb(dst, src, c);
45 dst += c;
46 src += c;
47
48 if (copy_to_user(buf, buffer, c)) {
49 err = -EFAULT;
50 break;
51 }
52 *ppos += c;
53 buf += c;
54 cnt += c;
55 count -= c;
56 }
57
58 kfree(buffer);
59
60 return cnt ? cnt : err;
61 }
62 EXPORT_SYMBOL(fb_cfb_read);
63
64 ssize_t fb_cfb_write(struct fb_info *info, const char __user *buf, size_t count, loff_t *ppos)
65 {
66 unsigned long p = *ppos;
67 u8 *buffer, *src;
68 u8 __iomem *dst;
69 int c, cnt = 0, err = 0;
70 unsigned long total_size;
71
72 if (!info->screen_base)
73 return -ENODEV;
74
75 total_size = info->screen_size;
76
77 if (total_size == 0)
78 total_size = info->fix.smem_len;
79
80 if (p > total_size)
81 return -EFBIG;
82
83 if (count > total_size) {
84 err = -EFBIG;
85 count = total_size;
86 }
87
88 if (count + p > total_size) {
89 if (!err)
90 err = -ENOSPC;
91
92 count = total_size - p;
93 }
94
95 buffer = kmalloc((count > PAGE_SIZE) ? PAGE_SIZE : count, GFP_KERNEL);
96 if (!buffer)
97 return -ENOMEM;
98
99 dst = (u8 __iomem *)(info->screen_base + p);
100
101 if (info->fbops->fb_sync)
102 info->fbops->fb_sync(info);
103
104 while (count) {
105 c = (count > PAGE_SIZE) ? PAGE_SIZE : count;
106 src = buffer;
107
108 if (copy_from_user(src, buf, c)) {
109 err = -EFAULT;
110 break;
111 }
112
> 113 fb_memcpy_tofb(dst, src, c);
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests
next prev parent reply other threads:[~2023-04-26 6:08 UTC|newest]
Thread overview: 73+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-25 14:28 [PATCH 0/6] drm,fbdev: Use fbdev's I/O helpers Thomas Zimmermann
2023-04-25 14:28 ` Thomas Zimmermann
2023-04-25 14:28 ` [PATCH 1/6] fbdev: Return number of bytes read or written Thomas Zimmermann
2023-04-25 14:28 ` Thomas Zimmermann
2023-04-25 16:15 ` Javier Martinez Canillas
2023-04-25 16:15 ` Javier Martinez Canillas
2023-04-26 9:43 ` [1/6] " Sui Jingfeng
2023-04-26 14:41 ` [PATCH 1/6] " Geert Uytterhoeven
2023-04-26 14:41 ` Geert Uytterhoeven
2023-04-26 15:01 ` Thomas Zimmermann
2023-04-26 15:01 ` Thomas Zimmermann
2023-04-25 14:28 ` [PATCH 2/6] fbdev: Use screen_buffer in fb_sys_{read,write}() Thomas Zimmermann
2023-04-25 14:28 ` Thomas Zimmermann
2023-04-25 16:35 ` Javier Martinez Canillas
2023-04-25 16:35 ` Javier Martinez Canillas
2023-04-26 14:14 ` Thomas Zimmermann
2023-04-26 14:43 ` Geert Uytterhoeven
2023-04-26 14:43 ` Geert Uytterhoeven
2023-04-26 9:47 ` [2/6] " Sui Jingfeng
2023-04-25 14:28 ` [PATCH 3/6] fbdev: Don't re-validate info->state in fb_ops implementations Thomas Zimmermann
2023-04-25 14:28 ` Thomas Zimmermann
2023-04-25 16:38 ` Javier Martinez Canillas
2023-04-25 16:38 ` Javier Martinez Canillas
2023-04-26 9:49 ` [3/6] " Sui Jingfeng
2023-04-26 14:49 ` [PATCH 3/6] " Geert Uytterhoeven
2023-04-26 14:49 ` Geert Uytterhoeven
2023-04-26 15:07 ` Thomas Zimmermann
2023-04-26 15:07 ` Thomas Zimmermann
2023-04-25 14:28 ` [PATCH 4/6] fbdev: Validate info->screen_{base,buffer} " Thomas Zimmermann
2023-04-25 14:28 ` [PATCH 4/6] fbdev: Validate info->screen_{base, buffer} " Thomas Zimmermann
2023-04-25 16:39 ` [PATCH 4/6] fbdev: Validate info->screen_{base,buffer} " Javier Martinez Canillas
2023-04-25 16:39 ` Javier Martinez Canillas
2023-04-26 10:24 ` [4/6] fbdev: Validate info->screen_{base, buffer} " Sui Jingfeng
2023-04-26 14:56 ` [PATCH 4/6] fbdev: Validate info->screen_{base,buffer} " Geert Uytterhoeven
2023-04-26 14:56 ` [PATCH 4/6] fbdev: Validate info->screen_{base, buffer} " Geert Uytterhoeven
2023-04-27 13:54 ` [PATCH 4/6] fbdev: Validate info->screen_{base,buffer} " Thomas Zimmermann
2023-04-27 13:54 ` [PATCH 4/6] fbdev: Validate info->screen_{base, buffer} " Thomas Zimmermann
2023-04-25 14:28 ` [PATCH 5/6] fbdev: Move CFB read and write code into helper functions Thomas Zimmermann
2023-04-25 14:28 ` Thomas Zimmermann
2023-04-25 16:47 ` Javier Martinez Canillas
2023-04-25 16:47 ` Javier Martinez Canillas
2023-04-26 5:16 ` kernel test robot
2023-04-26 5:16 ` kernel test robot
2023-04-26 14:24 ` Thomas Zimmermann
2023-04-26 14:24 ` Thomas Zimmermann
2023-04-26 6:07 ` kernel test robot [this message]
2023-04-26 6:07 ` kernel test robot
2023-04-26 6:47 ` kernel test robot
2023-04-26 6:47 ` kernel test robot
2023-04-26 10:25 ` [5/6] " Sui Jingfeng
2023-04-26 15:01 ` [PATCH 5/6] " Geert Uytterhoeven
2023-04-26 15:01 ` Geert Uytterhoeven
2023-04-26 15:06 ` Thomas Zimmermann
2023-04-26 15:06 ` Thomas Zimmermann
2023-04-26 15:21 ` Geert Uytterhoeven
2023-04-26 15:21 ` Geert Uytterhoeven
2023-04-28 11:20 ` Thomas Zimmermann
2023-04-28 11:20 ` Thomas Zimmermann
2023-04-28 12:20 ` Geert Uytterhoeven
2023-04-28 12:20 ` Geert Uytterhoeven
2023-04-25 14:28 ` [PATCH 6/6] drm/fb-helper: Use fb_{cfb,sys}_{read, write}() Thomas Zimmermann
2023-04-25 14:28 ` Thomas Zimmermann
2023-04-25 16:50 ` Javier Martinez Canillas
2023-04-25 16:50 ` Javier Martinez Canillas
2023-04-26 10:26 ` [6/6] " Sui Jingfeng
2023-04-26 15:15 ` [PATCH 6/6] " Geert Uytterhoeven
2023-04-26 15:15 ` Geert Uytterhoeven
2023-04-28 11:25 ` Thomas Zimmermann
2023-04-28 11:25 ` Thomas Zimmermann
2023-04-25 19:17 ` [PATCH 0/6] drm,fbdev: Use fbdev's I/O helpers Helge Deller
2023-04-25 19:17 ` Helge Deller
2023-04-26 10:33 ` Sui Jingfeng
2023-04-26 11:22 ` Thomas Zimmermann
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=202304261333.9giYEbEl-lkp@intel.com \
--to=lkp@intel.com \
--cc=airlied@gmail.com \
--cc=daniel@ffwll.ch \
--cc=deller@gmx.de \
--cc=dri-devel@lists.freedesktop.org \
--cc=geert@linux-m68k.org \
--cc=javierm@redhat.com \
--cc=linux-fbdev@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=sudipm.mukherjee@gmail.com \
--cc=teddy.wang@siliconmotion.com \
--cc=tzimmermann@suse.de \
/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.