[asahilinux:nvme/new 6/9] drivers/mailbox/apple-mailbox-compat-shim.c:68:20: warning: cast from pointer to integer of different size
by kernel test robot
tree: https://github.com/AsahiLinux/linux nvme/new
head: b97dea3822f87d95ed741680a55b0e6b13755194
commit: 2160c3a88f8ad962d0a5a57dae36ffa895fd8a0b [6/9] HACK compat mailbox shim
config: microblaze-randconfig-r005-20210822 (attached as .config)
compiler: microblaze-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/AsahiLinux/linux/commit/2160c3a88f8ad962d0a5a57dae36ff...
git remote add asahilinux https://github.com/AsahiLinux/linux
git fetch --no-tags asahilinux nvme/new
git checkout 2160c3a88f8ad962d0a5a57dae36ffa895fd8a0b
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=microblaze
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
drivers/mailbox/apple-mailbox-compat-shim.c: In function 'apple_compat_mbox_chan_send_data':
>> drivers/mailbox/apple-mailbox-compat-shim.c:68:20: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
68 | msg.msg0 = (u64)data;
| ^
drivers/mailbox/apple-mailbox-compat-shim.c: In function 'rtk_got_msg':
>> drivers/mailbox/apple-mailbox-compat-shim.c:112:56: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
112 | mbox_chan_received_data(&mbox->chan[endpoint], (void *)message);
| ^
vim +68 drivers/mailbox/apple-mailbox-compat-shim.c
61
62 static int apple_compat_mbox_chan_send_data(struct mbox_chan *chan, void *data)
63 {
64 struct apple_compat_mbox_priv *priv = chan->con_priv;
65 struct apple_compat_mbox *apple_mbox = priv->mbox;
66 struct apple_mbox_msg msg;
67
> 68 msg.msg0 = (u64)data;
69 msg.msg1 = priv->ep;
70
71 return mbox_send_message(apple_mbox->hw_chan, &msg);
72 }
73
74 static int apple_compat_mbox_chan_startup(struct mbox_chan *chan)
75 {
76 struct apple_compat_mbox_priv *priv = chan->con_priv;
77 priv->enabled = true;
78 apple_rtkit_start_ep(priv->mbox->rtk, priv->ep);
79 return 0;
80 }
81
82 static void apple_compat_mbox_chan_shutdown(struct mbox_chan *chan)
83 {
84 struct apple_compat_mbox_priv *priv = chan->con_priv;
85 priv->enabled = false;
86 }
87
88 static bool apple_compat_mbox_chan_last_txdone(struct mbox_chan *chan)
89 {
90 return true;
91 }
92
93 static const struct mbox_chan_ops apple_compat_mbox_ops = {
94 .send_data = &apple_compat_mbox_chan_send_data,
95 .last_tx_done = apple_compat_mbox_chan_last_txdone,
96 .startup = &apple_compat_mbox_chan_startup,
97 .shutdown = &apple_compat_mbox_chan_shutdown,
98 };
99
100 static int dummy_shmem_verify(void *cookie, dma_addr_t addr, size_t len)
101 {
102 return 0;
103 }
104
105 static void rtk_got_msg(void *cookie, u8 endpoint, u64 message)
106 {
107 struct apple_compat_mbox *mbox = cookie;
108
109 if (!mbox->chan_priv[endpoint].enabled)
110 return;
111
> 112 mbox_chan_received_data(&mbox->chan[endpoint], (void *)message);
113 }
114
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year
include/linux/compiler_types.h:319:45: error: call to '__compiletime_assert_224' declared with attribute error: BUILD_BUG_ON failed: FIX_KMAP_SLOTS > PTRS_PER_PTE
by kernel test robot
Hi Thomas,
FYI, the error/warning still remains.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 9ff50bf2f2ff5fab01cac26d8eed21a89308e6ef
commit: 39cac191ff37939544af80d5d2af6b870fd94c9b arc/mm/highmem: Use generic kmap atomic implementation
date: 10 months ago
config: arc-randconfig-r012-20210822 (attached as .config)
compiler: arc-elf-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 39cac191ff37939544af80d5d2af6b870fd94c9b
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arc SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
In file included from <command-line>:
arch/arc/mm/highmem.c: In function 'kmap_init':
>> include/linux/compiler_types.h:319:45: error: call to '__compiletime_assert_224' declared with attribute error: BUILD_BUG_ON failed: FIX_KMAP_SLOTS > PTRS_PER_PTE
319 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^
include/linux/compiler_types.h:300:25: note: in definition of macro '__compiletime_assert'
300 | prefix ## suffix(); \
| ^~~~~~
include/linux/compiler_types.h:319:9: note: in expansion of macro '_compiletime_assert'
319 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:50:9: note: in expansion of macro 'BUILD_BUG_ON_MSG'
50 | BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
| ^~~~~~~~~~~~~~~~
arch/arc/mm/highmem.c:69:9: note: in expansion of macro 'BUILD_BUG_ON'
69 | BUILD_BUG_ON(FIX_KMAP_SLOTS > PTRS_PER_PTE);
| ^~~~~~~~~~~~
vim +/__compiletime_assert_224 +319 include/linux/compiler_types.h
eb5c2d4b45e3d2 Will Deacon 2020-07-21 305
eb5c2d4b45e3d2 Will Deacon 2020-07-21 306 #define _compiletime_assert(condition, msg, prefix, suffix) \
eb5c2d4b45e3d2 Will Deacon 2020-07-21 307 __compiletime_assert(condition, msg, prefix, suffix)
eb5c2d4b45e3d2 Will Deacon 2020-07-21 308
eb5c2d4b45e3d2 Will Deacon 2020-07-21 309 /**
eb5c2d4b45e3d2 Will Deacon 2020-07-21 310 * compiletime_assert - break build and emit msg if condition is false
eb5c2d4b45e3d2 Will Deacon 2020-07-21 311 * @condition: a compile-time constant condition to check
eb5c2d4b45e3d2 Will Deacon 2020-07-21 312 * @msg: a message to emit if condition is false
eb5c2d4b45e3d2 Will Deacon 2020-07-21 313 *
eb5c2d4b45e3d2 Will Deacon 2020-07-21 314 * In tradition of POSIX assert, this macro will break the build if the
eb5c2d4b45e3d2 Will Deacon 2020-07-21 315 * supplied condition is *false*, emitting the supplied error message if the
eb5c2d4b45e3d2 Will Deacon 2020-07-21 316 * compiler has support to do so.
eb5c2d4b45e3d2 Will Deacon 2020-07-21 317 */
eb5c2d4b45e3d2 Will Deacon 2020-07-21 318 #define compiletime_assert(condition, msg) \
eb5c2d4b45e3d2 Will Deacon 2020-07-21 @319 _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
eb5c2d4b45e3d2 Will Deacon 2020-07-21 320
:::::: The code at line 319 was first introduced by commit
:::::: eb5c2d4b45e3d2d5d052ea6b8f1463976b1020d5 compiler.h: Move compiletime_assert() macros into compiler_types.h
:::::: TO: Will Deacon <will(a)kernel.org>
:::::: CC: Will Deacon <will(a)kernel.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year
[linux-next:master 9016/9522] fs/ntfs3/inode.c:1792:2: warning: unannotated fall-through between switch labels
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 86ed57fd8c93fdfaabb4f58e78455180fa7d8a84
commit: b4a4ba2f7c4dd1ea56cadd48fb231f8fd0816e75 [9016/9522] Merge remote-tracking branch 'ntfs3/master'
config: x86_64-randconfig-r011-20210822 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 9e9d70591e72fc6762b4b9a226b68ed1307419bf)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commi...
git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
git fetch --no-tags linux-next master
git checkout b4a4ba2f7c4dd1ea56cadd48fb231f8fd0816e75
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
>> fs/ntfs3/inode.c:1792:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
case -ENOTEMPTY:
^
fs/ntfs3/inode.c:1792:2: note: insert 'break;' to avoid fall-through
case -ENOTEMPTY:
^
break;
1 warning generated.
--
>> fs/ntfs3/index.c:178:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
default:
^
fs/ntfs3/index.c:178:2: note: insert 'break;' to avoid fall-through
default:
^
break;
1 warning generated.
vim +1792 fs/ntfs3/inode.c
82cae269cfa953 Konstantin Komarov 2021-08-13 1694
82cae269cfa953 Konstantin Komarov 2021-08-13 1695 /*
82cae269cfa953 Konstantin Komarov 2021-08-13 1696 * ntfs_unlink_inode
82cae269cfa953 Konstantin Komarov 2021-08-13 1697 *
82cae269cfa953 Konstantin Komarov 2021-08-13 1698 * inode_operations::unlink
82cae269cfa953 Konstantin Komarov 2021-08-13 1699 * inode_operations::rmdir
82cae269cfa953 Konstantin Komarov 2021-08-13 1700 */
82cae269cfa953 Konstantin Komarov 2021-08-13 1701 int ntfs_unlink_inode(struct inode *dir, const struct dentry *dentry)
82cae269cfa953 Konstantin Komarov 2021-08-13 1702 {
82cae269cfa953 Konstantin Komarov 2021-08-13 1703 int err;
82cae269cfa953 Konstantin Komarov 2021-08-13 1704 struct super_block *sb = dir->i_sb;
82cae269cfa953 Konstantin Komarov 2021-08-13 1705 struct ntfs_sb_info *sbi = sb->s_fs_info;
82cae269cfa953 Konstantin Komarov 2021-08-13 1706 struct inode *inode = d_inode(dentry);
82cae269cfa953 Konstantin Komarov 2021-08-13 1707 struct ntfs_inode *ni = ntfs_i(inode);
82cae269cfa953 Konstantin Komarov 2021-08-13 1708 const struct qstr *name = &dentry->d_name;
82cae269cfa953 Konstantin Komarov 2021-08-13 1709 struct ntfs_inode *dir_ni = ntfs_i(dir);
82cae269cfa953 Konstantin Komarov 2021-08-13 1710 struct ntfs_index *indx = &dir_ni->dir;
82cae269cfa953 Konstantin Komarov 2021-08-13 1711 struct cpu_str *uni = NULL;
82cae269cfa953 Konstantin Komarov 2021-08-13 1712 struct ATTR_FILE_NAME *fname;
82cae269cfa953 Konstantin Komarov 2021-08-13 1713 u8 name_type;
82cae269cfa953 Konstantin Komarov 2021-08-13 1714 struct ATTR_LIST_ENTRY *le;
82cae269cfa953 Konstantin Komarov 2021-08-13 1715 struct MFT_REF ref;
82cae269cfa953 Konstantin Komarov 2021-08-13 1716 bool is_dir = S_ISDIR(inode->i_mode);
82cae269cfa953 Konstantin Komarov 2021-08-13 1717 struct INDEX_ROOT *dir_root;
82cae269cfa953 Konstantin Komarov 2021-08-13 1718
82cae269cfa953 Konstantin Komarov 2021-08-13 1719 dir_root = indx_get_root(indx, dir_ni, NULL, NULL);
82cae269cfa953 Konstantin Komarov 2021-08-13 1720 if (!dir_root)
82cae269cfa953 Konstantin Komarov 2021-08-13 1721 return -EINVAL;
82cae269cfa953 Konstantin Komarov 2021-08-13 1722
82cae269cfa953 Konstantin Komarov 2021-08-13 1723 ni_lock(ni);
82cae269cfa953 Konstantin Komarov 2021-08-13 1724
82cae269cfa953 Konstantin Komarov 2021-08-13 1725 if (is_dir && !dir_is_empty(inode)) {
82cae269cfa953 Konstantin Komarov 2021-08-13 1726 err = -ENOTEMPTY;
82cae269cfa953 Konstantin Komarov 2021-08-13 1727 goto out1;
82cae269cfa953 Konstantin Komarov 2021-08-13 1728 }
82cae269cfa953 Konstantin Komarov 2021-08-13 1729
82cae269cfa953 Konstantin Komarov 2021-08-13 1730 if (ntfs_is_meta_file(sbi, inode->i_ino)) {
82cae269cfa953 Konstantin Komarov 2021-08-13 1731 err = -EINVAL;
82cae269cfa953 Konstantin Komarov 2021-08-13 1732 goto out1;
82cae269cfa953 Konstantin Komarov 2021-08-13 1733 }
82cae269cfa953 Konstantin Komarov 2021-08-13 1734
82cae269cfa953 Konstantin Komarov 2021-08-13 1735 /* allocate PATH_MAX bytes */
82cae269cfa953 Konstantin Komarov 2021-08-13 1736 uni = __getname();
82cae269cfa953 Konstantin Komarov 2021-08-13 1737 if (!uni) {
82cae269cfa953 Konstantin Komarov 2021-08-13 1738 err = -ENOMEM;
82cae269cfa953 Konstantin Komarov 2021-08-13 1739 goto out1;
82cae269cfa953 Konstantin Komarov 2021-08-13 1740 }
82cae269cfa953 Konstantin Komarov 2021-08-13 1741
82cae269cfa953 Konstantin Komarov 2021-08-13 1742 /* Convert input string to unicode */
82cae269cfa953 Konstantin Komarov 2021-08-13 1743 err = ntfs_nls_to_utf16(sbi, name->name, name->len, uni, NTFS_NAME_LEN,
82cae269cfa953 Konstantin Komarov 2021-08-13 1744 UTF16_HOST_ENDIAN);
82cae269cfa953 Konstantin Komarov 2021-08-13 1745 if (err < 0)
82cae269cfa953 Konstantin Komarov 2021-08-13 1746 goto out2;
82cae269cfa953 Konstantin Komarov 2021-08-13 1747
82cae269cfa953 Konstantin Komarov 2021-08-13 1748 /*mark rw ntfs as dirty. it will be cleared at umount*/
82cae269cfa953 Konstantin Komarov 2021-08-13 1749 ntfs_set_state(sbi, NTFS_DIRTY_DIRTY);
82cae269cfa953 Konstantin Komarov 2021-08-13 1750
82cae269cfa953 Konstantin Komarov 2021-08-13 1751 /* find name in record */
82cae269cfa953 Konstantin Komarov 2021-08-13 1752 mi_get_ref(&dir_ni->mi, &ref);
82cae269cfa953 Konstantin Komarov 2021-08-13 1753
82cae269cfa953 Konstantin Komarov 2021-08-13 1754 le = NULL;
82cae269cfa953 Konstantin Komarov 2021-08-13 1755 fname = ni_fname_name(ni, uni, &ref, &le);
82cae269cfa953 Konstantin Komarov 2021-08-13 1756 if (!fname) {
82cae269cfa953 Konstantin Komarov 2021-08-13 1757 err = -ENOENT;
82cae269cfa953 Konstantin Komarov 2021-08-13 1758 goto out3;
82cae269cfa953 Konstantin Komarov 2021-08-13 1759 }
82cae269cfa953 Konstantin Komarov 2021-08-13 1760
82cae269cfa953 Konstantin Komarov 2021-08-13 1761 name_type = paired_name(fname->type);
82cae269cfa953 Konstantin Komarov 2021-08-13 1762
82cae269cfa953 Konstantin Komarov 2021-08-13 1763 err = indx_delete_entry(indx, dir_ni, fname, fname_full_size(fname),
82cae269cfa953 Konstantin Komarov 2021-08-13 1764 sbi);
82cae269cfa953 Konstantin Komarov 2021-08-13 1765 if (err)
82cae269cfa953 Konstantin Komarov 2021-08-13 1766 goto out3;
82cae269cfa953 Konstantin Komarov 2021-08-13 1767
82cae269cfa953 Konstantin Komarov 2021-08-13 1768 /* Then remove name from mft */
82cae269cfa953 Konstantin Komarov 2021-08-13 1769 ni_remove_attr_le(ni, attr_from_name(fname), le);
82cae269cfa953 Konstantin Komarov 2021-08-13 1770
82cae269cfa953 Konstantin Komarov 2021-08-13 1771 le16_add_cpu(&ni->mi.mrec->hard_links, -1);
82cae269cfa953 Konstantin Komarov 2021-08-13 1772 ni->mi.dirty = true;
82cae269cfa953 Konstantin Komarov 2021-08-13 1773
82cae269cfa953 Konstantin Komarov 2021-08-13 1774 if (name_type != FILE_NAME_POSIX) {
82cae269cfa953 Konstantin Komarov 2021-08-13 1775 /* Now we should delete name by type */
82cae269cfa953 Konstantin Komarov 2021-08-13 1776 fname = ni_fname_type(ni, name_type, &le);
82cae269cfa953 Konstantin Komarov 2021-08-13 1777 if (fname) {
82cae269cfa953 Konstantin Komarov 2021-08-13 1778 err = indx_delete_entry(indx, dir_ni, fname,
82cae269cfa953 Konstantin Komarov 2021-08-13 1779 fname_full_size(fname), sbi);
82cae269cfa953 Konstantin Komarov 2021-08-13 1780 if (err)
82cae269cfa953 Konstantin Komarov 2021-08-13 1781 goto out3;
82cae269cfa953 Konstantin Komarov 2021-08-13 1782
82cae269cfa953 Konstantin Komarov 2021-08-13 1783 ni_remove_attr_le(ni, attr_from_name(fname), le);
82cae269cfa953 Konstantin Komarov 2021-08-13 1784
82cae269cfa953 Konstantin Komarov 2021-08-13 1785 le16_add_cpu(&ni->mi.mrec->hard_links, -1);
82cae269cfa953 Konstantin Komarov 2021-08-13 1786 }
82cae269cfa953 Konstantin Komarov 2021-08-13 1787 }
82cae269cfa953 Konstantin Komarov 2021-08-13 1788 out3:
82cae269cfa953 Konstantin Komarov 2021-08-13 1789 switch (err) {
82cae269cfa953 Konstantin Komarov 2021-08-13 1790 case 0:
82cae269cfa953 Konstantin Komarov 2021-08-13 1791 drop_nlink(inode);
82cae269cfa953 Konstantin Komarov 2021-08-13 @1792 case -ENOTEMPTY:
82cae269cfa953 Konstantin Komarov 2021-08-13 1793 case -ENOSPC:
82cae269cfa953 Konstantin Komarov 2021-08-13 1794 case -EROFS:
82cae269cfa953 Konstantin Komarov 2021-08-13 1795 break;
82cae269cfa953 Konstantin Komarov 2021-08-13 1796 default:
82cae269cfa953 Konstantin Komarov 2021-08-13 1797 make_bad_inode(inode);
82cae269cfa953 Konstantin Komarov 2021-08-13 1798 }
82cae269cfa953 Konstantin Komarov 2021-08-13 1799
82cae269cfa953 Konstantin Komarov 2021-08-13 1800 dir->i_mtime = dir->i_ctime = current_time(dir);
82cae269cfa953 Konstantin Komarov 2021-08-13 1801 mark_inode_dirty(dir);
82cae269cfa953 Konstantin Komarov 2021-08-13 1802 inode->i_ctime = dir->i_ctime;
82cae269cfa953 Konstantin Komarov 2021-08-13 1803 if (inode->i_nlink)
82cae269cfa953 Konstantin Komarov 2021-08-13 1804 mark_inode_dirty(inode);
82cae269cfa953 Konstantin Komarov 2021-08-13 1805
82cae269cfa953 Konstantin Komarov 2021-08-13 1806 out2:
82cae269cfa953 Konstantin Komarov 2021-08-13 1807 __putname(uni);
82cae269cfa953 Konstantin Komarov 2021-08-13 1808 out1:
82cae269cfa953 Konstantin Komarov 2021-08-13 1809 ni_unlock(ni);
82cae269cfa953 Konstantin Komarov 2021-08-13 1810 return err;
82cae269cfa953 Konstantin Komarov 2021-08-13 1811 }
82cae269cfa953 Konstantin Komarov 2021-08-13 1812
:::::: The code at line 1792 was first introduced by commit
:::::: 82cae269cfa953032fbb8980a7d554d60fb00b17 fs/ntfs3: Add initialization of super block
:::::: TO: Konstantin Komarov <almaz.alexandrovich(a)paragon-software.com>
:::::: CC: Konstantin Komarov <almaz.alexandrovich(a)paragon-software.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year
[asahilinux:nvme/new 4/9] drivers/mailbox/apple-asc-mailbox.c:79:9: error: implicit declaration of function 'writeq_relaxed'; did you mean 'writel_relaxed'?
by kernel test robot
tree: https://github.com/AsahiLinux/linux nvme/new
head: b97dea3822f87d95ed741680a55b0e6b13755194
commit: 306a1be5e6d8932858256eb9230b33155313abad [4/9] mailbox: add driver for Apple ASC mailboxes
config: microblaze-randconfig-r005-20210822 (attached as .config)
compiler: microblaze-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/AsahiLinux/linux/commit/306a1be5e6d8932858256eb9230b33...
git remote add asahilinux https://github.com/AsahiLinux/linux
git fetch --no-tags asahilinux nvme/new
git checkout 306a1be5e6d8932858256eb9230b33155313abad
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=microblaze
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
drivers/mailbox/apple-asc-mailbox.c: In function 'apple_mbox_hw_send':
>> drivers/mailbox/apple-asc-mailbox.c:79:9: error: implicit declaration of function 'writeq_relaxed'; did you mean 'writel_relaxed'? [-Werror=implicit-function-declaration]
79 | writeq_relaxed(msg->msg0, apple_mbox->regs + APPLE_ASC_MBOX_A2I_SEND0);
| ^~~~~~~~~~~~~~
| writel_relaxed
>> drivers/mailbox/apple-asc-mailbox.c:85:9: error: implicit declaration of function 'writeq'; did you mean 'writel'? [-Werror=implicit-function-declaration]
85 | writeq(FIELD_PREP(APPLE_ASC_MBOX_MSG1_MSG, msg->msg1),
| ^~~~~~
| writel
>> drivers/mailbox/apple-asc-mailbox.c:85:16: error: implicit declaration of function 'FIELD_PREP' [-Werror=implicit-function-declaration]
85 | writeq(FIELD_PREP(APPLE_ASC_MBOX_MSG1_MSG, msg->msg1),
| ^~~~~~~~~~
drivers/mailbox/apple-asc-mailbox.c: In function 'apple_mbox_hw_recv':
>> drivers/mailbox/apple-asc-mailbox.c:101:21: error: implicit declaration of function 'readq_relaxed'; did you mean 'readl_relaxed'? [-Werror=implicit-function-declaration]
101 | msg->msg0 = readq_relaxed(apple_mbox->regs + APPLE_ASC_MBOX_I2A_RECV0);
| ^~~~~~~~~~~~~
| readl_relaxed
>> drivers/mailbox/apple-asc-mailbox.c:108:17: error: implicit declaration of function 'FIELD_GET'; did you mean 'FOLL_GET'? [-Werror=implicit-function-declaration]
108 | FIELD_GET(APPLE_ASC_MBOX_MSG1_MSG,
| ^~~~~~~~~
| FOLL_GET
>> drivers/mailbox/apple-asc-mailbox.c:109:27: error: implicit declaration of function 'readq'; did you mean 'readl'? [-Werror=implicit-function-declaration]
109 | readq(apple_mbox->regs + APPLE_ASC_MBOX_I2A_RECV1));
| ^~~~~
| readl
cc1: some warnings being treated as errors
vim +79 drivers/mailbox/apple-asc-mailbox.c
74
75 static void apple_mbox_hw_send(struct apple_mbox *apple_mbox,
76 struct apple_mbox_msg *msg)
77 {
78 WARN_ON(!apple_mbox_hw_can_send(apple_mbox));
> 79 writeq_relaxed(msg->msg0, apple_mbox->regs + APPLE_ASC_MBOX_A2I_SEND0);
80
81 /*
82 * we need a DMA barrier here since this message might be related to
83 * data stored in a shared memory buffer.
84 */
> 85 writeq(FIELD_PREP(APPLE_ASC_MBOX_MSG1_MSG, msg->msg1),
86 apple_mbox->regs + APPLE_ASC_MBOX_A2I_SEND1);
87 }
88
89 static bool apple_mbox_hw_can_recv(struct apple_mbox *apple_mbox)
90 {
91 u32 mbox_ctrl =
92 readl_relaxed(apple_mbox->regs + APPLE_ASC_MBOX_I2A_CONTROL);
93
94 return !(mbox_ctrl & APPLE_ASC_MBOX_CONTROL_EMPTY);
95 }
96
97 static void apple_mbox_hw_recv(struct apple_mbox *apple_mbox,
98 struct apple_mbox_msg *msg)
99 {
100 WARN_ON(!apple_mbox_hw_can_recv(apple_mbox));
> 101 msg->msg0 = readq_relaxed(apple_mbox->regs + APPLE_ASC_MBOX_I2A_RECV0);
102
103 /*
104 * we need a DMA barrier here since this message might be related to
105 * data stored in a shared memory buffer.
106 */
107 msg->msg1 =
> 108 FIELD_GET(APPLE_ASC_MBOX_MSG1_MSG,
> 109 readq(apple_mbox->regs + APPLE_ASC_MBOX_I2A_RECV1));
110 }
111
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year
[android-common:android12-5.10 1/3] include/trace/hooks/pci.h:15:1: sparse: sparse: incorrect type in assignment (different address spaces)
by kernel test robot
tree: https://android.googlesource.com/kernel/common android12-5.10
head: 20c3903ad71d6c2f0e405635ec8a57e12690be15
commit: bce9e7942ad39b8ecbbe592e6cae351c34b6991f [1/3] ANDROID: PCI/PM: Use usleep_range for d3hot_delay
config: x86_64-randconfig-s021-20210821 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.3-348-gf0e6938b-dirty
git remote add android-common https://android.googlesource.com/kernel/common
git fetch --no-tags android-common android12-5.10
git checkout bce9e7942ad39b8ecbbe592e6cae351c34b6991f
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
drivers/pci/pci.c:1024:13: sparse: sparse: restricted pci_power_t degrades to integer
drivers/pci/pci.c:1024:21: sparse: sparse: restricted pci_power_t degrades to integer
drivers/pci/pci.c:1024:31: sparse: sparse: restricted pci_power_t degrades to integer
drivers/pci/pci.c:1024:39: sparse: sparse: restricted pci_power_t degrades to integer
drivers/pci/pci.c:1033:35: sparse: sparse: restricted pci_power_t degrades to integer
drivers/pci/pci.c:1033:54: sparse: sparse: restricted pci_power_t degrades to integer
drivers/pci/pci.c:1034:19: sparse: sparse: restricted pci_power_t degrades to integer
drivers/pci/pci.c:1034:37: sparse: sparse: restricted pci_power_t degrades to integer
drivers/pci/pci.c:1064:23: sparse: sparse: invalid assignment: |=
drivers/pci/pci.c:1064:23: sparse: left side has type unsigned short
drivers/pci/pci.c:1064:23: sparse: right side has type restricted pci_power_t
drivers/pci/pci.c:1069:57: sparse: sparse: restricted pci_power_t degrades to integer
drivers/pci/pci.c:1091:28: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted pci_power_t [usertype] current_state @@ got int @@
drivers/pci/pci.c:1091:28: sparse: expected restricted pci_power_t [usertype] current_state
drivers/pci/pci.c:1091:28: sparse: got int
drivers/pci/pci.c:1140:36: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted pci_power_t [usertype] current_state @@ got int @@
drivers/pci/pci.c:1140:36: sparse: expected restricted pci_power_t [usertype] current_state
drivers/pci/pci.c:1140:36: sparse: got int
drivers/pci/pci.c:1318:13: sparse: sparse: restricted pci_power_t degrades to integer
drivers/pci/pci.c:1318:21: sparse: sparse: restricted pci_power_t degrades to integer
drivers/pci/pci.c:1320:18: sparse: sparse: restricted pci_power_t degrades to integer
drivers/pci/pci.c:1320:26: sparse: sparse: restricted pci_power_t degrades to integer
drivers/pci/pci.c:1343:13: sparse: sparse: restricted pci_power_t degrades to integer
drivers/pci/pci.c:1343:22: sparse: sparse: restricted pci_power_t degrades to integer
drivers/pci/pci.c:1350:46: sparse: sparse: restricted pci_power_t degrades to integer
drivers/pci/pci.c:1350:54: sparse: sparse: restricted pci_power_t degrades to integer
drivers/pci/pci.c:1706:38: sparse: sparse: array of flexible structures
drivers/pci/pci.c:2279:44: sparse: sparse: restricted pci_power_t degrades to integer
drivers/pci/pci.c:2580:61: sparse: sparse: restricted pci_power_t degrades to integer
drivers/pci/pci.c:2581:45: sparse: sparse: restricted pci_power_t degrades to integer
drivers/pci/pci.c:2747:20: sparse: sparse: restricted pci_power_t degrades to integer
drivers/pci/pci.c:2747:38: sparse: sparse: restricted pci_power_t degrades to integer
drivers/pci/pci.c:2770:49: sparse: sparse: restricted pci_power_t degrades to integer
drivers/pci/pci.c:2770:67: sparse: sparse: restricted pci_power_t degrades to integer
drivers/pci/pci.c:4671:13: sparse: sparse: invalid assignment: |=
drivers/pci/pci.c:4671:13: sparse: left side has type unsigned short
drivers/pci/pci.c:4671:13: sparse: right side has type restricted pci_power_t
drivers/pci/pci.c:4676:13: sparse: sparse: invalid assignment: |=
drivers/pci/pci.c:4676:13: sparse: left side has type unsigned short
drivers/pci/pci.c:4676:13: sparse: right side has type restricted pci_power_t
drivers/pci/pci.c: note: in included file:
>> include/trace/hooks/pci.h:15:1: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct tracepoint_func *it_func_ptr @@ got struct tracepoint_func [noderef] __rcu *funcs @@
include/trace/hooks/pci.h:15:1: sparse: expected struct tracepoint_func *it_func_ptr
include/trace/hooks/pci.h:15:1: sparse: got struct tracepoint_func [noderef] __rcu *funcs
vim +15 include/trace/hooks/pci.h
5
6 #if !defined(_TRACE_HOOK_PCI_H) || defined(TRACE_HEADER_MULTI_READ)
7 #define _TRACE_HOOK_PCI_H
8 #include <linux/tracepoint.h>
9 #include <trace/hooks/vendor_hooks.h>
10 /*
11 * Following tracepoints are not exported in tracefs and provide a
12 * mechanism for vendor modules to hook and extend functionality
13 */
14
> 15 DECLARE_RESTRICTED_HOOK(android_rvh_pci_d3_sleep,
16 TP_PROTO(struct pci_dev *dev, unsigned int delay, int *err),
17 TP_ARGS(dev, delay, err), 1);
18
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c:721:12: warning: stack frame size (1056) exceeds limit (1024) in function 'hclge_dbg_dump_tm_pg'
by kernel test robot
Hi Guangbin,
FYI, the error/warning still remains.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 9ff50bf2f2ff5fab01cac26d8eed21a89308e6ef
commit: cad7c215a4b1bc67920ab0d2673ac08a2cc885f1 net: hns3: refactor dump tm of debugfs
date: 3 months ago
config: riscv-randconfig-r021-20210822 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 9e9d70591e72fc6762b4b9a226b68ed1307419bf)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install riscv cross compiling tool for clang build
# apt-get install binutils-riscv64-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout cad7c215a4b1bc67920ab0d2673ac08a2cc885f1
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=riscv
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
>> drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c:721:12: warning: stack frame size (1056) exceeds limit (1024) in function 'hclge_dbg_dump_tm_pg' [-Wframe-larger-than]
static int hclge_dbg_dump_tm_pg(struct hclge_dev *hdev, char *buf, int len)
^
1 warning generated.
vim +/hclge_dbg_dump_tm_pg +721 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c
720
> 721 static int hclge_dbg_dump_tm_pg(struct hclge_dev *hdev, char *buf, int len)
722 {
723 char data_str[ARRAY_SIZE(tm_pg_items)][HCLGE_DBG_DATA_STR_LEN];
724 struct hclge_tm_shaper_para c_shaper_para, p_shaper_para;
725 char *result[ARRAY_SIZE(tm_pg_items)], *sch_mode_str;
726 u8 pg_id, sch_mode, weight, pri_bit_map, i, j;
727 char content[HCLGE_DBG_TM_INFO_LEN];
728 int pos = 0;
729 int ret;
730
731 for (i = 0; i < ARRAY_SIZE(tm_pg_items); i++)
732 result[i] = &data_str[i][0];
733
734 hclge_dbg_fill_content(content, sizeof(content), tm_pg_items,
735 NULL, ARRAY_SIZE(tm_pg_items));
736 pos += scnprintf(buf + pos, len - pos, "%s", content);
737
738 for (pg_id = 0; pg_id < hdev->tm_info.num_pg; pg_id++) {
739 ret = hclge_tm_get_pg_to_pri_map(hdev, pg_id, &pri_bit_map);
740 if (ret)
741 return ret;
742
743 ret = hclge_tm_get_pg_sch_mode(hdev, pg_id, &sch_mode);
744 if (ret)
745 return ret;
746
747 ret = hclge_tm_get_pg_weight(hdev, pg_id, &weight);
748 if (ret)
749 return ret;
750
751 ret = hclge_tm_get_pg_shaper(hdev, pg_id,
752 HCLGE_OPC_TM_PG_C_SHAPPING,
753 &c_shaper_para);
754 if (ret)
755 return ret;
756
757 ret = hclge_tm_get_pg_shaper(hdev, pg_id,
758 HCLGE_OPC_TM_PG_P_SHAPPING,
759 &p_shaper_para);
760 if (ret)
761 return ret;
762
763 sch_mode_str = sch_mode & HCLGE_TM_TX_SCHD_DWRR_MSK ? "dwrr" :
764 "sp";
765
766 j = 0;
767 sprintf(result[j++], "%02u", pg_id);
768 sprintf(result[j++], "0x%02x", pri_bit_map);
769 sprintf(result[j++], "%4s", sch_mode_str);
770 sprintf(result[j++], "%3u", weight);
771 hclge_dbg_fill_shaper_content(&c_shaper_para, result, &j);
772 hclge_dbg_fill_shaper_content(&p_shaper_para, result, &j);
773
774 hclge_dbg_fill_content(content, sizeof(content), tm_pg_items,
775 (const char **)result,
776 ARRAY_SIZE(tm_pg_items));
777 pos += scnprintf(buf + pos, len - pos, "%s", content);
778 }
779
780 return 0;
781 }
782
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year
[frank-w-bpi-r2-4.14:5.14-rc 6/24] drivers/misc/mediatek/btif/common/mtk_btif.c:379:6: warning: variable 'i_ret' set but not used
by kernel test robot
tree: https://github.com/frank-w/BPI-R2-4.14 5.14-rc
head: 15ab19c94d88070dd93ad282b83ff856be6092fc
commit: 6c7a57f4d7a96ee09d6aacbdac04d2f3b3da24f6 [6/24] mt6625l: include wifi-code
config: arm-randconfig-c002-20210822 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 9e9d70591e72fc6762b4b9a226b68ed1307419bf)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install arm cross compiling tool for clang build
# apt-get install binutils-arm-linux-gnueabi
# https://github.com/frank-w/BPI-R2-4.14/commit/6c7a57f4d7a96ee09d6aacbdac0...
git remote add frank-w-bpi-r2-4.14 https://github.com/frank-w/BPI-R2-4.14
git fetch --no-tags frank-w-bpi-r2-4.14 5.14-rc
git checkout 6c7a57f4d7a96ee09d6aacbdac04d2f3b3da24f6
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
>> drivers/misc/mediatek/btif/common/mtk_btif.c:379:6: warning: variable 'i_ret' set but not used [-Wunused-but-set-variable]
int i_ret = 0;
^
>> drivers/misc/mediatek/btif/common/mtk_btif.c:773:6: warning: variable 'result' set but not used [-Wunused-but-set-variable]
int result = 0;
^
>> drivers/misc/mediatek/btif/common/mtk_btif.c:3029:17: warning: variable 'p_buf' set but not used [-Wunused-but-set-variable]
unsigned char *p_buf = NULL;
^
3 warnings generated.
--
>> drivers/misc/mediatek/btif/common/btif_dma_plat.c:1313:17: warning: variable 'flag' set but not used [-Wunused-but-set-variable]
unsigned int flag = 0;
^
1 warning generated.
--
>> drivers/misc/mediatek/btif/common/btif_plat.c:1343:17: warning: variable 'flag' set but not used [-Wunused-but-set-variable]
unsigned int flag = 0;
^
1 warning generated.
vim +/i_ret +379 drivers/misc/mediatek/btif/common/mtk_btif.c
eca6cb9d1200e7 Frank Wunderlich 2021-07-12 376
eca6cb9d1200e7 Frank Wunderlich 2021-07-12 377 static int mtk_btif_restore_noirq(struct device *dev)
eca6cb9d1200e7 Frank Wunderlich 2021-07-12 378 {
eca6cb9d1200e7 Frank Wunderlich 2021-07-12 @379 int i_ret = 0;
eca6cb9d1200e7 Frank Wunderlich 2021-07-12 380 struct platform_device *pdev = to_platform_device(dev);
eca6cb9d1200e7 Frank Wunderlich 2021-07-12 381 p_mtk_btif p_btif = platform_get_drvdata(pdev);
eca6cb9d1200e7 Frank Wunderlich 2021-07-12 382
eca6cb9d1200e7 Frank Wunderlich 2021-07-12 383 BTIF_INFO_FUNC("++\n");
eca6cb9d1200e7 Frank Wunderlich 2021-07-12 384 if (_btif_state_hold(p_btif))
eca6cb9d1200e7 Frank Wunderlich 2021-07-12 385 return E_BTIF_INTR;
eca6cb9d1200e7 Frank Wunderlich 2021-07-12 386 if (p_btif->enable)
eca6cb9d1200e7 Frank Wunderlich 2021-07-12 387 BTIF_ERR_FUNC("!!!-----------------!BTIF is not closed before IPOH shutdown!!!---------------!\n");
eca6cb9d1200e7 Frank Wunderlich 2021-07-12 388 WARN_ON(p_btif->enable);
eca6cb9d1200e7 Frank Wunderlich 2021-07-12 389
eca6cb9d1200e7 Frank Wunderlich 2021-07-12 390 i_ret = _btif_restore_noirq(p_btif);
eca6cb9d1200e7 Frank Wunderlich 2021-07-12 391 BTIF_STATE_RELEASE(p_btif);
eca6cb9d1200e7 Frank Wunderlich 2021-07-12 392 BTIF_INFO_FUNC("--\n");
eca6cb9d1200e7 Frank Wunderlich 2021-07-12 393 return 0;
eca6cb9d1200e7 Frank Wunderlich 2021-07-12 394 }
eca6cb9d1200e7 Frank Wunderlich 2021-07-12 395
:::::: The code at line 379 was first introduced by commit
:::::: eca6cb9d1200e774a42a7dd581e3ce064081bdec mt6625l: add driver folder from 5.13
:::::: TO: Frank Wunderlich <frank-w(a)public-files.de>
:::::: CC: Frank Wunderlich <frank-w(a)public-files.de>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year
Re: [PATCH V3 1/9] PCI/VGA: Move vgaarb to drivers/pci
by kernel test robot
Hi Huacai,
I love your patch! Perhaps something to improve:
[auto build test WARNING on pci/next]
[also build test WARNING on linus/master v5.14-rc6 next-20210820]
[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]
url: https://github.com/0day-ci/linux/commits/Huacai-Chen/PCI-VGA-Rework-defau...
base: https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git next
config: arm-randconfig-c002-20210820 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project d9c5613e856cf2addfbf892fc4c1ce9ef9feceaa)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install arm cross compiling tool for clang build
# apt-get install binutils-arm-linux-gnueabi
# https://github.com/0day-ci/linux/commit/5a499ac0123cbe13fba8e3216dc81cf09...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Huacai-Chen/PCI-VGA-Rework-default-VGA-device-selection/20210820-181519
git checkout 5a499ac0123cbe13fba8e3216dc81cf09f59b101
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm clang-analyzer
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
clang-analyzer warnings: (new ones prefixed by >>)
^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/block/pktcdvd.c:2214:6: note: Assuming 'flush' is 0
if (flush && pkt_flush_cache(pd))
^~~~~
drivers/block/pktcdvd.c:2214:12: note: Left side of '&&' is false
if (flush && pkt_flush_cache(pd))
^
drivers/block/pktcdvd.c:2219:2: note: Calling 'pkt_set_speed'
pkt_set_speed(pd, MAX_SPEED, MAX_SPEED);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/block/pktcdvd.c:801:8: note: Calling 'pkt_generic_packet'
ret = pkt_generic_packet(pd, &cgc);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/block/pktcdvd.c:706:27: note: Assuming field 'data_direction' is not equal to CGC_DATA_WRITE
rq = blk_get_request(q, (cgc->data_direction == CGC_DATA_WRITE) ?
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/block/pktcdvd.c:706:26: note: '?' condition is false
rq = blk_get_request(q, (cgc->data_direction == CGC_DATA_WRITE) ?
^
drivers/block/pktcdvd.c:708:2: note: Taking true branch
if (IS_ERR(rq))
^
drivers/block/pktcdvd.c:709:3: note: Returning without writing to 'cgc->sshdr', which participates in a condition later
return PTR_ERR(rq);
^
drivers/block/pktcdvd.c:801:8: note: Returning from 'pkt_generic_packet'
ret = pkt_generic_packet(pd, &cgc);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/block/pktcdvd.c:802:6: note: 'ret' is not equal to 0
if (ret)
^~~
drivers/block/pktcdvd.c:802:2: note: Taking true branch
if (ret)
^
drivers/block/pktcdvd.c:803:3: note: Calling 'pkt_dump_sense'
pkt_dump_sense(pd, &cgc);
^~~~~~~~~~~~~~~~~~~~~~~~
drivers/block/pktcdvd.c:753:6: note: 'sshdr' is non-null
if (sshdr)
^~~~~
drivers/block/pktcdvd.c:753:2: note: Taking true branch
if (sshdr)
^
drivers/block/pktcdvd.c:757:4: note: 1st function call argument is an uninitialized value
sense_key_string(sshdr->sense_key));
^
drivers/block/pktcdvd.c:76:33: note: expanded from macro 'pkt_err'
pr_err("%s: " fmt, pd->name, ##__VA_ARGS__)
^~~~~~~~~~~
include/linux/printk.h:390:33: note: expanded from macro 'pr_err'
printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
^~~~~~~~~~~
drivers/block/pktcdvd.c:2723:2: warning: Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119 [clang-analyzer-security.insecureAPI.strcpy]
strcpy(disk->disk_name, pd->name);
^~~~~~
drivers/block/pktcdvd.c:2723:2: note: Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119
strcpy(disk->disk_name, pd->name);
^~~~~~
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
Suppressed 3 warnings (3 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings generated.
drivers/pci/ecam.c:62:2: warning: Value stored to 'bsz' is never read [clang-analyzer-deadcode.DeadStores]
bsz = 1 << bus_shift;
^ ~~~~~~~~~~~~~~
drivers/pci/ecam.c:62:2: note: Value stored to 'bsz' is never read
bsz = 1 << bus_shift;
^ ~~~~~~~~~~~~~~
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
4 warnings generated.
>> drivers/pci/vgaarb.c:245:17: warning: Value stored to 'dev' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
struct device *dev = &vgadev->pdev->dev;
^~~ ~~~~~~~~~~~~~~~~~~
drivers/pci/vgaarb.c:245:17: note: Value stored to 'dev' during its initialization is never read
struct device *dev = &vgadev->pdev->dev;
^~~ ~~~~~~~~~~~~~~~~~~
drivers/pci/vgaarb.c:394:17: warning: Value stored to 'dev' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
struct device *dev = &vgadev->pdev->dev;
^~~ ~~~~~~~~~~~~~~~~~~
drivers/pci/vgaarb.c:394:17: note: Value stored to 'dev' during its initialization is never read
struct device *dev = &vgadev->pdev->dev;
^~~ ~~~~~~~~~~~~~~~~~~
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings generated.
Suppressed 2 warnings (2 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
4 warnings generated.
fs/fat/fatent.c:482:2: warning: Value stored to 'err' is never read [clang-analyzer-deadcode.DeadStores]
err = nr_bhs = idx_clus = 0;
^ ~~~~~~~~~~~~~~~~~~~~~
fs/fat/fatent.c:482:2: note: Value stored to 'err' is never read
err = nr_bhs = idx_clus = 0;
^ ~~~~~~~~~~~~~~~~~~~~~
fs/fat/fatent.c:684:18: warning: The left operand of '>=' is a garbage value [clang-analyzer-core.UndefinedBinaryOperatorResult]
if (ra->ra_next >= ra->ra_limit)
^
fs/fat/fatent.c:777:14: note: Assuming '__UNIQUE_ID___x254' is <= '__UNIQUE_ID___y255'
ent_start = max_t(u64, range->start>>sbi->cluster_bits, FAT_START_ENT);
^
include/linux/minmax.h:112:27: note: expanded from macro 'max_t'
#define max_t(type, x, y) __careful_cmp((type)(x), (type)(y), >)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/minmax.h:38:3: note: expanded from macro '__careful_cmp'
__cmp_once(x, y, __UNIQUE_ID(__x), __UNIQUE_ID(__y), op))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/minmax.h:33:3: note: expanded from macro '__cmp_once'
__cmp(unique_x, unique_y, op); })
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/minmax.h:28:26: note: expanded from macro '__cmp'
#define __cmp(x, y, op) ((x) op (y) ? (x) : (y))
^~~~~~~~~~
fs/fat/fatent.c:777:14: note: '?' condition is false
ent_start = max_t(u64, range->start>>sbi->cluster_bits, FAT_START_ENT);
^
include/linux/minmax.h:112:27: note: expanded from macro 'max_t'
#define max_t(type, x, y) __careful_cmp((type)(x), (type)(y), >)
^
include/linux/minmax.h:38:3: note: expanded from macro '__careful_cmp'
__cmp_once(x, y, __UNIQUE_ID(__x), __UNIQUE_ID(__y), op))
^
include/linux/minmax.h:33:3: note: expanded from macro '__cmp_once'
__cmp(unique_x, unique_y, op); })
^
include/linux/minmax.h:28:26: note: expanded from macro '__cmp'
#define __cmp(x, y, op) ((x) op (y) ? (x) : (y))
^
fs/fat/fatent.c:781:6: note: Assuming 'ent_start' is < field 'max_cluster'
if (ent_start >= sbi->max_cluster || range->len < sbi->cluster_size)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/fat/fatent.c:781:6: note: Left side of '||' is false
fs/fat/fatent.c:781:39: note: Assuming field 'len' is >= field 'cluster_size'
if (ent_start >= sbi->max_cluster || range->len < sbi->cluster_size)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/fat/fatent.c:781:2: note: Taking false branch
if (ent_start >= sbi->max_cluster || range->len < sbi->cluster_size)
^
fs/fat/fatent.c:783:6: note: Assuming 'ent_end' is < field 'max_cluster'
if (ent_end >= sbi->max_cluster)
^~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/fat/fatent.c:783:2: note: Taking false branch
if (ent_end >= sbi->max_cluster)
^
fs/fat/fatent.c:789:2: note: Calling 'fat_ra_init'
fat_ra_init(sb, &fatent_ra, &fatent, ent_end + 1);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/fat/fatent.c:660:6: note: Assuming 'ent_limit' is <= field 'entry'
if (fatent->entry >= ent_limit)
^~~~~~~~~~~~~~~~~~~~~~~~~~
fs/fat/fatent.c:660:2: note: Taking true branch
if (fatent->entry >= ent_limit)
^
fs/fat/fatent.c:661:3: note: Returning without writing to 'ra->ra_next'
return;
^
fs/fat/fatent.c:789:2: note: Returning from 'fat_ra_init'
fat_ra_init(sb, &fatent_ra, &fatent, ent_end + 1);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/fat/fatent.c:790:9: note: Assuming 'ent_end' is >= field 'entry'
while (fatent.entry <= ent_end) {
^~~~~~~~~~~~~~~~~~~~~~~
fs/fat/fatent.c:790:2: note: Loop condition is true. Entering loop body
while (fatent.entry <= ent_end) {
^
fs/fat/fatent.c:792:3: note: Calling 'fat_ent_reada'
fat_ent_reada(sb, &fatent_ra, &fatent);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/fat/fatent.c:684:18: note: The left operand of '>=' is a garbage value
if (ra->ra_next >= ra->ra_limit)
~~~~~~~~~~~ ^
Suppressed 2 warnings (2 in non-user code).
vim +/dev +245 drivers/pci/vgaarb.c
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 241
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 242 static struct vga_device *__vga_tryget(struct vga_device *vgadev,
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 243 unsigned int rsrc)
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 244 {
a75d68f62106fe6 drivers/gpu/vga/vgaarb.c Bjorn Helgaas 2016-11-17 @245 struct device *dev = &vgadev->pdev->dev;
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 246 unsigned int wants, legacy_wants, match;
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 247 struct vga_device *conflict;
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 248 unsigned int pci_bits;
3448a19da479b6b drivers/gpu/vga/vgaarb.c Dave Airlie 2010-06-01 249 u32 flags = 0;
3448a19da479b6b drivers/gpu/vga/vgaarb.c Dave Airlie 2010-06-01 250
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 251 /* Account for "normal" resources to lock. If we decode the legacy,
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 252 * counterpart, we need to request it as well
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 253 */
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 254 if ((rsrc & VGA_RSRC_NORMAL_IO) &&
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 255 (vgadev->decodes & VGA_RSRC_LEGACY_IO))
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 256 rsrc |= VGA_RSRC_LEGACY_IO;
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 257 if ((rsrc & VGA_RSRC_NORMAL_MEM) &&
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 258 (vgadev->decodes & VGA_RSRC_LEGACY_MEM))
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 259 rsrc |= VGA_RSRC_LEGACY_MEM;
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 260
a75d68f62106fe6 drivers/gpu/vga/vgaarb.c Bjorn Helgaas 2016-11-17 261 vgaarb_dbg(dev, "%s: %d\n", __func__, rsrc);
a75d68f62106fe6 drivers/gpu/vga/vgaarb.c Bjorn Helgaas 2016-11-17 262 vgaarb_dbg(dev, "%s: owns: %d\n", __func__, vgadev->owns);
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 263
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 264 /* Check what resources we need to acquire */
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 265 wants = rsrc & ~vgadev->owns;
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 266
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 267 /* We already own everything, just mark locked & bye bye */
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 268 if (wants == 0)
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 269 goto lock_them;
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 270
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 271 /* We don't need to request a legacy resource, we just enable
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 272 * appropriate decoding and go
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 273 */
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 274 legacy_wants = wants & VGA_RSRC_LEGACY_MASK;
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 275 if (legacy_wants == 0)
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 276 goto enable_them;
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 277
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 278 /* Ok, we don't, let's find out how we need to kick off */
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 279 list_for_each_entry(conflict, &vga_list, list) {
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 280 unsigned int lwants = legacy_wants;
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 281 unsigned int change_bridge = 0;
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 282
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 283 /* Don't conflict with myself */
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 284 if (vgadev == conflict)
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 285 continue;
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 286
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 287 /* Check if the architecture allows a conflict between those
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 288 * 2 devices or if they are on separate domains
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 289 */
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 290 if (!vga_conflicts(vgadev->pdev, conflict->pdev))
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 291 continue;
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 292
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 293 /* We have a possible conflict. before we go further, we must
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 294 * check if we sit on the same bus as the conflicting device.
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 295 * if we don't, then we must tie both IO and MEM resources
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 296 * together since there is only a single bit controlling
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 297 * VGA forwarding on P2P bridges
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 298 */
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 299 if (vgadev->pdev->bus != conflict->pdev->bus) {
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 300 change_bridge = 1;
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 301 lwants = VGA_RSRC_LEGACY_IO | VGA_RSRC_LEGACY_MEM;
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 302 }
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 303
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 304 /* Check if the guy has a lock on the resource. If he does,
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 305 * return the conflicting entry
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 306 */
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 307 if (conflict->locks & lwants)
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 308 return conflict;
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 309
4e4e7dc55af5aa6 drivers/gpu/vga/vgaarb.c Alex Williamson 2014-07-03 310 /* Ok, now check if it owns the resource we want. We can
4e4e7dc55af5aa6 drivers/gpu/vga/vgaarb.c Alex Williamson 2014-07-03 311 * lock resources that are not decoded, therefore a device
4e4e7dc55af5aa6 drivers/gpu/vga/vgaarb.c Alex Williamson 2014-07-03 312 * can own resources it doesn't decode.
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 313 */
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 314 match = lwants & conflict->owns;
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 315 if (!match)
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 316 continue;
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 317
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 318 /* looks like he doesn't have a lock, we can steal
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 319 * them from him
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 320 */
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 321
3448a19da479b6b drivers/gpu/vga/vgaarb.c Dave Airlie 2010-06-01 322 flags = 0;
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 323 pci_bits = 0;
3448a19da479b6b drivers/gpu/vga/vgaarb.c Dave Airlie 2010-06-01 324
4e4e7dc55af5aa6 drivers/gpu/vga/vgaarb.c Alex Williamson 2014-07-03 325 /* If we can't control legacy resources via the bridge, we
4e4e7dc55af5aa6 drivers/gpu/vga/vgaarb.c Alex Williamson 2014-07-03 326 * also need to disable normal decoding.
4e4e7dc55af5aa6 drivers/gpu/vga/vgaarb.c Alex Williamson 2014-07-03 327 */
3448a19da479b6b drivers/gpu/vga/vgaarb.c Dave Airlie 2010-06-01 328 if (!conflict->bridge_has_one_vga) {
4e4e7dc55af5aa6 drivers/gpu/vga/vgaarb.c Alex Williamson 2014-07-03 329 if ((match & conflict->decodes) & VGA_RSRC_LEGACY_MEM)
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 330 pci_bits |= PCI_COMMAND_MEMORY;
4e4e7dc55af5aa6 drivers/gpu/vga/vgaarb.c Alex Williamson 2014-07-03 331 if ((match & conflict->decodes) & VGA_RSRC_LEGACY_IO)
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 332 pci_bits |= PCI_COMMAND_IO;
4e4e7dc55af5aa6 drivers/gpu/vga/vgaarb.c Alex Williamson 2014-07-03 333
4e4e7dc55af5aa6 drivers/gpu/vga/vgaarb.c Alex Williamson 2014-07-03 334 if (pci_bits) {
4e4e7dc55af5aa6 drivers/gpu/vga/vgaarb.c Alex Williamson 2014-07-03 335 vga_irq_set_state(conflict, false);
4e4e7dc55af5aa6 drivers/gpu/vga/vgaarb.c Alex Williamson 2014-07-03 336 flags |= PCI_VGA_STATE_CHANGE_DECODES;
4e4e7dc55af5aa6 drivers/gpu/vga/vgaarb.c Alex Williamson 2014-07-03 337 }
3448a19da479b6b drivers/gpu/vga/vgaarb.c Dave Airlie 2010-06-01 338 }
3448a19da479b6b drivers/gpu/vga/vgaarb.c Dave Airlie 2010-06-01 339
3448a19da479b6b drivers/gpu/vga/vgaarb.c Dave Airlie 2010-06-01 340 if (change_bridge)
3448a19da479b6b drivers/gpu/vga/vgaarb.c Dave Airlie 2010-06-01 341 flags |= PCI_VGA_STATE_CHANGE_BRIDGE;
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 342
3448a19da479b6b drivers/gpu/vga/vgaarb.c Dave Airlie 2010-06-01 343 pci_set_vga_state(conflict->pdev, false, pci_bits, flags);
f22d776f3e280e6 drivers/gpu/vga/vgaarb.c Alex Williamson 2013-08-15 344 conflict->owns &= ~match;
4e4e7dc55af5aa6 drivers/gpu/vga/vgaarb.c Alex Williamson 2014-07-03 345
4e4e7dc55af5aa6 drivers/gpu/vga/vgaarb.c Alex Williamson 2014-07-03 346 /* If we disabled normal decoding, reflect it in owns */
4e4e7dc55af5aa6 drivers/gpu/vga/vgaarb.c Alex Williamson 2014-07-03 347 if (pci_bits & PCI_COMMAND_MEMORY)
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 348 conflict->owns &= ~VGA_RSRC_NORMAL_MEM;
4e4e7dc55af5aa6 drivers/gpu/vga/vgaarb.c Alex Williamson 2014-07-03 349 if (pci_bits & PCI_COMMAND_IO)
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 350 conflict->owns &= ~VGA_RSRC_NORMAL_IO;
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 351 }
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 352
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 353 enable_them:
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 354 /* ok dude, we got it, everybody conflicting has been disabled, let's
4e4e7dc55af5aa6 drivers/gpu/vga/vgaarb.c Alex Williamson 2014-07-03 355 * enable us. Mark any bits in "owns" regardless of whether we
4e4e7dc55af5aa6 drivers/gpu/vga/vgaarb.c Alex Williamson 2014-07-03 356 * decoded them. We can lock resources we don't decode, therefore
4e4e7dc55af5aa6 drivers/gpu/vga/vgaarb.c Alex Williamson 2014-07-03 357 * we must track them via "owns".
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 358 */
3448a19da479b6b drivers/gpu/vga/vgaarb.c Dave Airlie 2010-06-01 359 flags = 0;
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 360 pci_bits = 0;
3448a19da479b6b drivers/gpu/vga/vgaarb.c Dave Airlie 2010-06-01 361
3448a19da479b6b drivers/gpu/vga/vgaarb.c Dave Airlie 2010-06-01 362 if (!vgadev->bridge_has_one_vga) {
3448a19da479b6b drivers/gpu/vga/vgaarb.c Dave Airlie 2010-06-01 363 flags |= PCI_VGA_STATE_CHANGE_DECODES;
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 364 if (wants & (VGA_RSRC_LEGACY_MEM|VGA_RSRC_NORMAL_MEM))
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 365 pci_bits |= PCI_COMMAND_MEMORY;
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 366 if (wants & (VGA_RSRC_LEGACY_IO|VGA_RSRC_NORMAL_IO))
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 367 pci_bits |= PCI_COMMAND_IO;
3448a19da479b6b drivers/gpu/vga/vgaarb.c Dave Airlie 2010-06-01 368 }
4e4e7dc55af5aa6 drivers/gpu/vga/vgaarb.c Alex Williamson 2014-07-03 369 if (wants & VGA_RSRC_LEGACY_MASK)
3448a19da479b6b drivers/gpu/vga/vgaarb.c Dave Airlie 2010-06-01 370 flags |= PCI_VGA_STATE_CHANGE_BRIDGE;
3448a19da479b6b drivers/gpu/vga/vgaarb.c Dave Airlie 2010-06-01 371
3448a19da479b6b drivers/gpu/vga/vgaarb.c Dave Airlie 2010-06-01 372 pci_set_vga_state(vgadev->pdev, true, pci_bits, flags);
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 373
5d90ccf908bd806 drivers/gpu/vga/vgaarb.c Thierry Reding 2015-08-12 374 if (!vgadev->bridge_has_one_vga)
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 375 vga_irq_set_state(vgadev, true);
5d90ccf908bd806 drivers/gpu/vga/vgaarb.c Thierry Reding 2015-08-12 376
4e4e7dc55af5aa6 drivers/gpu/vga/vgaarb.c Alex Williamson 2014-07-03 377 vgadev->owns |= wants;
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 378 lock_them:
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 379 vgadev->locks |= (rsrc & VGA_RSRC_LEGACY_MASK);
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 380 if (rsrc & VGA_RSRC_LEGACY_IO)
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 381 vgadev->io_lock_cnt++;
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 382 if (rsrc & VGA_RSRC_LEGACY_MEM)
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 383 vgadev->mem_lock_cnt++;
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 384 if (rsrc & VGA_RSRC_NORMAL_IO)
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 385 vgadev->io_norm_cnt++;
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 386 if (rsrc & VGA_RSRC_NORMAL_MEM)
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 387 vgadev->mem_norm_cnt++;
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 388
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 389 return NULL;
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 390 }
deb2d2ecd43dfc5 drivers/gpu/vga/vgaarb.c Benjamin Herrenschmidt 2009-08-11 391
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year
Re: [Intel-gfx] [PATCH 24/27] drm/i915: Multi-BB execbuf
by kernel test robot
Hi Matthew,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on drm-intel/for-linux-next]
[also build test WARNING on drm-tip/drm-tip drm-exynos/exynos-drm-next next-20210820]
[cannot apply to tegra-drm/drm/tegra/for-next linus/master drm/drm-next v5.14-rc6]
[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]
url: https://github.com/0day-ci/linux/commits/Matthew-Brost/Parallel-submissio...
base: git://anongit.freedesktop.org/drm-intel for-linux-next
config: x86_64-buildonly-randconfig-r002-20210821 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 9e9d70591e72fc6762b4b9a226b68ed1307419bf)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/7e7ae2111b2855ac3d63aa5c806c6936d...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Matthew-Brost/Parallel-submission-aka-multi-bb-execbuf/20210821-065348
git checkout 7e7ae2111b2855ac3d63aa5c806c6936daaa6bbc
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
>> drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c:608:20: warning: comparison of array 'eb->batch_len' equal to a null pointer is always false [-Wtautological-pointer-compare]
if (unlikely(eb->batch_len == 0)) { /* impossible! */
~~~~^~~~~~~~~ ~
include/linux/compiler.h:78:42: note: expanded from macro 'unlikely'
# define unlikely(x) __builtin_expect(!!(x), 0)
^
1 warning generated.
vim +608 drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
548
549 static int
550 eb_add_vma(struct i915_execbuffer *eb,
551 unsigned int *current_batch,
552 unsigned int i,
553 struct i915_vma *vma)
554 {
555 struct drm_i915_private *i915 = eb->i915;
556 struct drm_i915_gem_exec_object2 *entry = &eb->exec[i];
557 struct eb_vma *ev = &eb->vma[i];
558
559 ev->vma = vma;
560 ev->exec = entry;
561 ev->flags = entry->flags;
562
563 if (eb->lut_size > 0) {
564 ev->handle = entry->handle;
565 hlist_add_head(&ev->node,
566 &eb->buckets[hash_32(entry->handle,
567 eb->lut_size)]);
568 }
569
570 if (entry->relocation_count)
571 list_add_tail(&ev->reloc_link, &eb->relocs);
572
573 /*
574 * SNA is doing fancy tricks with compressing batch buffers, which leads
575 * to negative relocation deltas. Usually that works out ok since the
576 * relocate address is still positive, except when the batch is placed
577 * very low in the GTT. Ensure this doesn't happen.
578 *
579 * Note that actual hangs have only been observed on gen7, but for
580 * paranoia do it everywhere.
581 */
582 if (is_batch_buffer(eb, i)) {
583 if (entry->relocation_count &&
584 !(ev->flags & EXEC_OBJECT_PINNED))
585 ev->flags |= __EXEC_OBJECT_NEEDS_BIAS;
586 if (eb->reloc_cache.has_fence)
587 ev->flags |= EXEC_OBJECT_NEEDS_FENCE;
588
589 eb->batches[*current_batch] = ev;
590
591 if (unlikely(ev->flags & EXEC_OBJECT_WRITE)) {
592 drm_dbg(&i915->drm,
593 "Attempting to use self-modifying batch buffer\n");
594 return -EINVAL;
595 }
596
597 if (range_overflows_t(u64,
598 eb->batch_start_offset,
599 eb->args->batch_len,
600 ev->vma->size)) {
601 drm_dbg(&i915->drm, "Attempting to use out-of-bounds batch\n");
602 return -EINVAL;
603 }
604
605 if (eb->args->batch_len == 0)
606 eb->batch_len[*current_batch] = ev->vma->size -
607 eb->batch_start_offset;
> 608 if (unlikely(eb->batch_len == 0)) { /* impossible! */
609 drm_dbg(&i915->drm, "Invalid batch length\n");
610 return -EINVAL;
611 }
612
613 ++*current_batch;
614 }
615
616 return 0;
617 }
618
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year