[chrome-os:chromeos-5.4 60/67] drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:318:2: error: initialization of 'uint32_t * (*)(uint32_t *, uint32_t)' {aka 'unsigned int * (*)(unsigned int *, unsigned int)'} from incompatible pointer type 'uint32_t (*)(void)' {aka 'unsigned int (*)(v...
by kernel test robot
tree: https://chromium.googlesource.com/chromiumos/third_party/kernel chromeos-5.4
head: 5d3c2d08737677b0c9fbceb8deb4affc2203d757
commit: e22d97f8d4f8fae5de0ce382aeeea450bda8c08f [60/67] CHROMIUM: camx: Re-enable COMPILE_TEST
config: arm64-allyesconfig (attached as .config)
compiler: aarch64-linux-gcc (GCC) 9.3.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
git remote add chrome-os https://chromium.googlesource.com/chromiumos/third_party/kernel
git fetch --no-tags chrome-os chromeos-5.4
git checkout e22d97f8d4f8fae5de0ce382aeeea450bda8c08f
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm64
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/media/platform/camx/cam_cdm/cam_cdm_util.c:312:2: error: positional initialization of field in 'struct' declared with 'designated_init' attribute [-Werror=designated-init]
312 | cdm_get_cmd_header_size,
| ^~~~~~~~~~~~~~~~~~~~~~~
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:312:2: note: (near initialization for 'CDM170_ops')
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:312:2: error: invalid initializer
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:312:2: note: (near initialization for 'CDM170_ops.<anonymous>')
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:313:2: error: positional initialization of field in 'struct' declared with 'designated_init' attribute [-Werror=designated-init]
313 | cdm_required_size_reg_continuous,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:313:2: note: (near initialization for 'CDM170_ops')
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:313:2: error: initialization of 'uint32_t (*)(void)' {aka 'unsigned int (*)(void)'} from incompatible pointer type 'uint32_t (*)(uint32_t)' {aka 'unsigned int (*)(unsigned int)'} [-Werror=incompatible-pointer-types]
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:313:2: note: (near initialization for 'CDM170_ops.cdm_offsetof_dmi_addr')
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:314:2: error: positional initialization of field in 'struct' declared with 'designated_init' attribute [-Werror=designated-init]
314 | cdm_required_size_reg_random,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:314:2: note: (near initialization for 'CDM170_ops')
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:314:2: error: initialization of 'void (*)(uint32_t *, uint32_t)' {aka 'void (*)(unsigned int *, unsigned int)'} from incompatible pointer type 'uint32_t (*)(uint32_t)' {aka 'unsigned int (*)(unsigned int)'} [-Werror=incompatible-pointer-types]
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:314:2: note: (near initialization for 'CDM170_ops.cdm_write_genirq')
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:315:2: error: positional initialization of field in 'struct' declared with 'designated_init' attribute [-Werror=designated-init]
315 | cdm_required_size_dmi,
| ^~~~~~~~~~~~~~~~~~~~~
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:315:2: note: (near initialization for 'CDM170_ops')
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:316:2: error: positional initialization of field in 'struct' declared with 'designated_init' attribute [-Werror=designated-init]
316 | cdm_required_size_genirq,
| ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:316:2: note: (near initialization for 'CDM170_ops')
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:316:2: error: initialization of 'uint32_t (*)(uint32_t)' {aka 'unsigned int (*)(unsigned int)'} from incompatible pointer type 'uint32_t (*)(void)' {aka 'unsigned int (*)(void)'} [-Werror=incompatible-pointer-types]
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:316:2: note: (near initialization for 'CDM170_ops.cdm_required_size_reg_random')
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:317:2: error: positional initialization of field in 'struct' declared with 'designated_init' attribute [-Werror=designated-init]
317 | cdm_required_size_indirect,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:317:2: note: (near initialization for 'CDM170_ops')
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:318:2: error: positional initialization of field in 'struct' declared with 'designated_init' attribute [-Werror=designated-init]
318 | cdm_required_size_changebase,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:318:2: note: (near initialization for 'CDM170_ops')
>> drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:318:2: error: initialization of 'uint32_t * (*)(uint32_t *, uint32_t)' {aka 'unsigned int * (*)(unsigned int *, unsigned int)'} from incompatible pointer type 'uint32_t (*)(void)' {aka 'unsigned int (*)(void)'} [-Werror=incompatible-pointer-types]
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:318:2: note: (near initialization for 'CDM170_ops.cdm_write_changebase')
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:319:2: error: positional initialization of field in 'struct' declared with 'designated_init' attribute [-Werror=designated-init]
319 | cdm_offsetof_dmi_addr,
| ^~~~~~~~~~~~~~~~~~~~~
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:319:2: note: (near initialization for 'CDM170_ops')
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:319:2: error: initialization of 'uint32_t * (*)(uint32_t *, uint32_t, uint32_t *)' {aka 'unsigned int * (*)(unsigned int *, unsigned int, unsigned int *)'} from incompatible pointer type 'uint32_t (*)(void)' {aka 'unsigned int (*)(void)'} [-Werror=incompatible-pointer-types]
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:319:2: note: (near initialization for 'CDM170_ops.cdm_write_regrandom')
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:320:2: error: positional initialization of field in 'struct' declared with 'designated_init' attribute [-Werror=designated-init]
320 | cdm_offsetof_indirect_addr,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:320:2: note: (near initialization for 'CDM170_ops')
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:321:2: error: positional initialization of field in 'struct' declared with 'designated_init' attribute [-Werror=designated-init]
321 | cdm_write_regcontinuous,
| ^~~~~~~~~~~~~~~~~~~~~~~
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:321:2: note: (near initialization for 'CDM170_ops')
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:321:2: error: initialization of 'uint32_t (*)(unsigned int)' {aka 'unsigned int (*)(unsigned int)'} from incompatible pointer type 'uint32_t * (*)(uint32_t *, uint32_t, uint32_t, uint32_t *)' {aka 'unsigned int * (*)(unsigned int *, unsigned int, unsigned int, unsigned int *)'} [-Werror=incompatible-pointer-types]
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:321:2: note: (near initialization for 'CDM170_ops.cdm_get_cmd_header_size')
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:322:2: error: positional initialization of field in 'struct' declared with 'designated_init' attribute [-Werror=designated-init]
322 | cdm_write_regrandom,
| ^~~~~~~~~~~~~~~~~~~
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:322:2: note: (near initialization for 'CDM170_ops')
>> drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:322:2: error: initialization of 'uint32_t (*)(uint32_t)' {aka 'unsigned int (*)(unsigned int)'} from incompatible pointer type 'uint32_t * (*)(uint32_t *, uint32_t, uint32_t *)' {aka 'unsigned int * (*)(unsigned int *, unsigned int, unsigned int *)'} [-Werror=incompatible-pointer-types]
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:322:2: note: (near initialization for 'CDM170_ops.cdm_required_size_reg_continuous')
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:323:2: error: positional initialization of field in 'struct' declared with 'designated_init' attribute [-Werror=designated-init]
323 | cdm_write_dmi,
| ^~~~~~~~~~~~~
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:323:2: note: (near initialization for 'CDM170_ops')
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:323:2: error: initialization of 'uint32_t * (*)(uint32_t *, uint32_t, uint32_t, uint32_t *)' {aka 'unsigned int * (*)(unsigned int *, unsigned int, unsigned int, unsigned int *)'} from incompatible pointer type 'uint32_t * (*)(uint32_t *, uint8_t, uint32_t, uint8_t, uint32_t, uint32_t)' {aka 'unsigned int * (*)(unsigned int *, unsigned char, unsigned int, unsigned char, unsigned int, unsigned int)'} [-Werror=incompatible-pointer-types]
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:323:2: note: (near initialization for 'CDM170_ops.cdm_write_regcontinuous')
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:324:2: error: positional initialization of field in 'struct' declared with 'designated_init' attribute [-Werror=designated-init]
324 | cdm_write_indirect,
| ^~~~~~~~~~~~~~~~~~
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:324:2: note: (near initialization for 'CDM170_ops')
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:325:2: error: positional initialization of field in 'struct' declared with 'designated_init' attribute [-Werror=designated-init]
325 | cdm_write_changebase,
| ^~~~~~~~~~~~~~~~~~~~
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:325:2: note: (near initialization for 'CDM170_ops')
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:325:2: error: initialization of 'uint32_t (*)(void)' {aka 'unsigned int (*)(void)'} from incompatible pointer type 'uint32_t * (*)(uint32_t *, uint32_t)' {aka 'unsigned int * (*)(unsigned int *, unsigned int)'} [-Werror=incompatible-pointer-types]
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:325:2: note: (near initialization for 'CDM170_ops.cdm_required_size_indirect')
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:326:2: error: positional initialization of field in 'struct' declared with 'designated_init' attribute [-Werror=designated-init]
326 | cdm_write_genirq,
| ^~~~~~~~~~~~~~~~
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:326:2: note: (near initialization for 'CDM170_ops')
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:326:2: error: initialization of 'uint32_t * (*)(uint32_t *, uint8_t, uint32_t, uint8_t, uint32_t, uint32_t)' {aka 'unsigned int * (*)(unsigned int *, unsigned char, unsigned int, unsigned char, unsigned int, unsigned int)'} from incompatible pointer type 'void (*)(uint32_t *, uint32_t)' {aka 'void (*)(unsigned int *, unsigned int)'} [-Werror=incompatible-pointer-types]
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:326:2: note: (near initialization for 'CDM170_ops.cdm_write_dmi')
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c: In function 'cam_cdm_util_reg_cont_write':
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:368:45: warning: comparison is always false due to limited range of data type [-Wtype-limits]
368 | if ((!reg_cont->count) || (reg_cont->count > 0x10000) ||
| ^
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c: In function 'cam_cdm_util_reg_random_write':
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:399:49: warning: comparison is always false due to limited range of data type [-Wtype-limits]
399 | if ((!reg_random->count) || (reg_random->count > 0x10000) ||
| ^
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c: In function 'cam_cdm_util_cmd_buf_write':
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:466:29: warning: variable 'total_cmd_buf_size' set but not used [-Wunused-but-set-variable]
466 | uint32_t cdm_cmd_type = 0, total_cmd_buf_size = 0;
| ^~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +318 drivers/media/platform/camx/cam_cdm/cam_cdm_util.c
46ba272ec14153 Atanas Filipov 2020-06-11 310
46ba272ec14153 Atanas Filipov 2020-06-11 311 struct cam_cdm_utils_ops CDM170_ops = {
46ba272ec14153 Atanas Filipov 2020-06-11 312 cdm_get_cmd_header_size,
46ba272ec14153 Atanas Filipov 2020-06-11 313 cdm_required_size_reg_continuous,
46ba272ec14153 Atanas Filipov 2020-06-11 314 cdm_required_size_reg_random,
46ba272ec14153 Atanas Filipov 2020-06-11 315 cdm_required_size_dmi,
46ba272ec14153 Atanas Filipov 2020-06-11 316 cdm_required_size_genirq,
46ba272ec14153 Atanas Filipov 2020-06-11 317 cdm_required_size_indirect,
46ba272ec14153 Atanas Filipov 2020-06-11 @318 cdm_required_size_changebase,
46ba272ec14153 Atanas Filipov 2020-06-11 319 cdm_offsetof_dmi_addr,
46ba272ec14153 Atanas Filipov 2020-06-11 320 cdm_offsetof_indirect_addr,
46ba272ec14153 Atanas Filipov 2020-06-11 321 cdm_write_regcontinuous,
46ba272ec14153 Atanas Filipov 2020-06-11 @322 cdm_write_regrandom,
46ba272ec14153 Atanas Filipov 2020-06-11 323 cdm_write_dmi,
46ba272ec14153 Atanas Filipov 2020-06-11 324 cdm_write_indirect,
46ba272ec14153 Atanas Filipov 2020-06-11 325 cdm_write_changebase,
46ba272ec14153 Atanas Filipov 2020-06-11 326 cdm_write_genirq,
46ba272ec14153 Atanas Filipov 2020-06-11 327 };
46ba272ec14153 Atanas Filipov 2020-06-11 328
:::::: The code at line 318 was first introduced by commit
:::::: 46ba272ec141535d56c5a9117d7b3775c84cd466 CHROMIUM: media: camx: soc: Add initial drivers
:::::: TO: Atanas Filipov <afilipov(a)mm-sol.com>
:::::: CC: Commit Bot <commit-bot(a)chromium.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 3 months
[chrome-os:chromeos-5.4 33/67] drivers/net/wireless/mediatek/mt76/mt7921/pci.c:151:6: warning: no previous prototype for function 'mt7921_pci_enable_aspm'
by kernel test robot
tree: https://chromium.googlesource.com/chromiumos/third_party/kernel chromeos-5.4
head: 5d3c2d08737677b0c9fbceb8deb4affc2203d757
commit: 5f94a0c31e951c4196789d4b377d3806ff5bd4d0 [33/67] FROMLIST: mt76: mt7921: introduce PCIe ASPM support (L0s/L1/L1ss)
config: powerpc-randconfig-r001-20210618 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project d1baf2895467735ab14f4b3415fce204c0cc8e7f)
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 powerpc cross compiling tool for clang build
# apt-get install binutils-powerpc-linux-gnu
git remote add chrome-os https://chromium.googlesource.com/chromiumos/third_party/kernel
git fetch --no-tags chrome-os chromeos-5.4
git checkout 5f94a0c31e951c4196789d4b377d3806ff5bd4d0
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc
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 >>):
In file included from drivers/net/wireless/mediatek/mt76/mt7921/pci.c:6:
In file included from include/linux/kernel.h:11:
In file included from include/linux/compiler.h:323:
arch/powerpc/include/asm/barrier.h:47:9: warning: '__lwsync' macro redefined [-Wmacro-redefined]
#define __lwsync() __asm__ __volatile__ (stringify_in_c(LWSYNC) : : :"memory")
^
<built-in>:308:9: note: previous definition is here
#define __lwsync __builtin_ppc_lwsync
^
>> drivers/net/wireless/mediatek/mt76/mt7921/pci.c:151:6: warning: no previous prototype for function 'mt7921_pci_enable_aspm' [-Wmissing-prototypes]
void mt7921_pci_enable_aspm(struct pci_dev *pdev)
^
drivers/net/wireless/mediatek/mt76/mt7921/pci.c:151:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void mt7921_pci_enable_aspm(struct pci_dev *pdev)
^
static
2 warnings generated.
vim +/mt7921_pci_enable_aspm +151 drivers/net/wireless/mediatek/mt76/mt7921/pci.c
150
> 151 void mt7921_pci_enable_aspm(struct pci_dev *pdev)
152 {
153 mt7921_pci_config_L1ss(pdev, true);
154 mt7921_pci_config_L1(pdev, true);
155 }
156
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 3 months
Re: [PATCH RFC 4/4] ufs: Make host controller state change handling more systematic
by kernel test robot
Hi Bart,
[FYI, it's a private test report for your RFC patch.]
[auto build test ERROR on mkp-scsi/for-next]
[also build test ERROR on next-20210618]
[cannot apply to scsi/for-next bvanassche/for-next v5.13-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/Bart-Van-Assche/UFS-patches-for-...
base: https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next
config: powerpc-randconfig-r035-20210618 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project d1baf2895467735ab14f4b3415fce204c0cc8e7f)
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 powerpc cross compiling tool for clang build
# apt-get install binutils-powerpc-linux-gnu
# https://github.com/0day-ci/linux/commit/fcc87d783f58d9f9ee2c0ccd19c61a57c...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Bart-Van-Assche/UFS-patches-for-Linux-kernel-v5-14/20210619-085409
git checkout fcc87d783f58d9f9ee2c0ccd19c61a57c5941bfb
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All error/warnings (new ones prefixed by >>):
In file included from drivers/scsi/ufs/ufshcd.c:12:
In file included from include/linux/async.h:12:
In file included from include/linux/list.h:9:
In file included from include/linux/kernel.h:12:
In file included from include/linux/bitops.h:32:
In file included from arch/powerpc/include/asm/bitops.h:62:
arch/powerpc/include/asm/barrier.h:49:9: warning: '__lwsync' macro redefined [-Wmacro-redefined]
#define __lwsync() __asm__ __volatile__ (stringify_in_c(LWSYNC) : : :"memory")
^
<built-in>:309:9: note: previous definition is here
#define __lwsync __builtin_ppc_lwsync
^
>> drivers/scsi/ufs/ufshcd.c:4077:6: error: use of undeclared identifier 'old_state'
if (old_state != UFSHCD_STATE_ERROR || new_state == UFSHCD_STATE_ERROR)
^
>> drivers/scsi/ufs/ufshcd.c:4079:3: warning: misleading indentation; statement is not part of the previous 'if' [-Wmisleading-indentation]
return true;
^
drivers/scsi/ufs/ufshcd.c:4077:2: note: previous statement is here
if (old_state != UFSHCD_STATE_ERROR || new_state == UFSHCD_STATE_ERROR)
^
>> drivers/scsi/ufs/ufshcd.c:4081:2: error: expected identifier or '('
return false;
^
>> drivers/scsi/ufs/ufshcd.c:4082:1: error: extraneous closing brace ('}')
}
^
drivers/scsi/ufs/ufshcd.c:9361:44: warning: shift count >= width of type [-Wshift-count-overflow]
if (!dma_set_mask_and_coherent(hba->dev, DMA_BIT_MASK(64)))
^~~~~~~~~~~~~~~~
include/linux/dma-mapping.h:76:54: note: expanded from macro 'DMA_BIT_MASK'
#define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
^ ~~~
3 warnings and 3 errors generated.
vim +/old_state +4077 drivers/scsi/ufs/ufshcd.c
4072
4073 static bool ufshcd_set_state(struct ufs_hba *hba, enum ufshcd_state new_state)
4074 {
4075 lockdep_assert_held(hba->host->host_lock);
4076
> 4077 if (old_state != UFSHCD_STATE_ERROR || new_state == UFSHCD_STATE_ERROR)
4078 hba->ufshcd_state = new_state;
> 4079 return true;
4080 }
> 4081 return false;
> 4082 }
4083
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 3 months
Re: [PATCH v2] block: genhd: don't call probe function with major_names_lock held
by kernel test robot
Hi Tetsuo,
I love your patch! Perhaps something to improve:
[auto build test WARNING on linux/master]
[also build test WARNING on linus/master v5.13-rc6]
[cannot apply to block/for-next next-20210618]
[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/Tetsuo-Handa/block-genhd-don-t-c...
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git dd860052c99b1e088352bdd4fb7aef46f8d2ef47
config: x86_64-randconfig-a004-20210618 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project d1baf2895467735ab14f4b3415fce204c0cc8e7f)
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 x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# https://github.com/0day-ci/linux/commit/1de14b707f1a3e49fa4412b1eb8391f09...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Tetsuo-Handa/block-genhd-don-t-call-probe-function-with-major_names_lock-held/20210619-090731
git checkout 1de14b707f1a3e49fa4412b1eb8391f09747a005
# 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 >>):
>> block/genhd.c:223: warning: expecting prototype for __register_blkdev(). Prototype was for ____register_blkdev() instead
vim +223 block/genhd.c
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 196
9e8c0bccdc944b block/genhd.c Márton Németh 2009-02-20 197 /**
e2b6b301871719 block/genhd.c Christoph Hellwig 2020-11-14 198 * __register_blkdev - register a new block device
9e8c0bccdc944b block/genhd.c Márton Németh 2009-02-20 199 *
f33ff110ef31bd block/genhd.c Srivatsa S. Bhat 2018-02-05 200 * @major: the requested major device number [1..BLKDEV_MAJOR_MAX-1]. If
f33ff110ef31bd block/genhd.c Srivatsa S. Bhat 2018-02-05 201 * @major = 0, try to allocate any unused major number.
9e8c0bccdc944b block/genhd.c Márton Németh 2009-02-20 202 * @name: the name of the new block device as a zero terminated string
1de14b707f1a3e block/genhd.c Tetsuo Handa 2021-06-19 203 * @probe: callback that is called on access to any minor number of @major
1de14b707f1a3e block/genhd.c Tetsuo Handa 2021-06-19 204 * @owner: the owner of @probe function (i.e. THIS_MODULE or NULL).
9e8c0bccdc944b block/genhd.c Márton Németh 2009-02-20 205 *
9e8c0bccdc944b block/genhd.c Márton Németh 2009-02-20 206 * The @name must be unique within the system.
9e8c0bccdc944b block/genhd.c Márton Németh 2009-02-20 207 *
0e056eb5530da8 block/genhd.c Mauro Carvalho Chehab 2017-03-30 208 * The return value depends on the @major input parameter:
0e056eb5530da8 block/genhd.c Mauro Carvalho Chehab 2017-03-30 209 *
f33ff110ef31bd block/genhd.c Srivatsa S. Bhat 2018-02-05 210 * - if a major device number was requested in range [1..BLKDEV_MAJOR_MAX-1]
f33ff110ef31bd block/genhd.c Srivatsa S. Bhat 2018-02-05 211 * then the function returns zero on success, or a negative error code
9e8c0bccdc944b block/genhd.c Márton Németh 2009-02-20 212 * - if any unused major number was requested with @major = 0 parameter
9e8c0bccdc944b block/genhd.c Márton Németh 2009-02-20 213 * then the return value is the allocated major number in range
f33ff110ef31bd block/genhd.c Srivatsa S. Bhat 2018-02-05 214 * [1..BLKDEV_MAJOR_MAX-1] or a negative error code otherwise
f33ff110ef31bd block/genhd.c Srivatsa S. Bhat 2018-02-05 215 *
f33ff110ef31bd block/genhd.c Srivatsa S. Bhat 2018-02-05 216 * See Documentation/admin-guide/devices.txt for the list of allocated
f33ff110ef31bd block/genhd.c Srivatsa S. Bhat 2018-02-05 217 * major numbers.
e2b6b301871719 block/genhd.c Christoph Hellwig 2020-11-14 218 *
e2b6b301871719 block/genhd.c Christoph Hellwig 2020-11-14 219 * Use register_blkdev instead for any new code.
9e8c0bccdc944b block/genhd.c Márton Németh 2009-02-20 220 */
1de14b707f1a3e block/genhd.c Tetsuo Handa 2021-06-19 221 int ____register_blkdev(unsigned int major, const char *name,
1de14b707f1a3e block/genhd.c Tetsuo Handa 2021-06-19 222 void (*probe)(dev_t devt), struct module *owner)
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 @223 {
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 224 struct blk_major_name **n, *p;
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 225 int index, ret = 0;
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 226
e49fbbbf0aa14f block/genhd.c Christoph Hellwig 2020-10-29 227 mutex_lock(&major_names_lock);
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 228
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 229 /* temporary */
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 230 if (major == 0) {
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 231 for (index = ARRAY_SIZE(major_names)-1; index > 0; index--) {
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 232 if (major_names[index] == NULL)
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 233 break;
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 234 }
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 235
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 236 if (index == 0) {
dfc76d11dd455a block/genhd.c Keyur Patel 2019-02-17 237 printk("%s: failed to get major for %s\n",
dfc76d11dd455a block/genhd.c Keyur Patel 2019-02-17 238 __func__, name);
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 239 ret = -EBUSY;
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 240 goto out;
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 241 }
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 242 major = index;
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 243 ret = major;
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 244 }
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 245
133d55cdb2f1f9 block/genhd.c Logan Gunthorpe 2017-06-16 246 if (major >= BLKDEV_MAJOR_MAX) {
dfc76d11dd455a block/genhd.c Keyur Patel 2019-02-17 247 pr_err("%s: major requested (%u) is greater than the maximum (%u) for %s\n",
dfc76d11dd455a block/genhd.c Keyur Patel 2019-02-17 248 __func__, major, BLKDEV_MAJOR_MAX-1, name);
133d55cdb2f1f9 block/genhd.c Logan Gunthorpe 2017-06-16 249
133d55cdb2f1f9 block/genhd.c Logan Gunthorpe 2017-06-16 250 ret = -EINVAL;
133d55cdb2f1f9 block/genhd.c Logan Gunthorpe 2017-06-16 251 goto out;
133d55cdb2f1f9 block/genhd.c Logan Gunthorpe 2017-06-16 252 }
133d55cdb2f1f9 block/genhd.c Logan Gunthorpe 2017-06-16 253
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 254 p = kmalloc(sizeof(struct blk_major_name), GFP_KERNEL);
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 255 if (p == NULL) {
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 256 ret = -ENOMEM;
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 257 goto out;
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 258 }
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 259
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 260 p->major = major;
a160c6159d4a0c block/genhd.c Christoph Hellwig 2020-10-29 261 p->probe = probe;
1de14b707f1a3e block/genhd.c Tetsuo Handa 2021-06-19 262 p->owner = owner;
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 263 strlcpy(p->name, name, sizeof(p->name));
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 264 p->next = NULL;
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 265 index = major_to_index(major);
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 266
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 267 for (n = &major_names[index]; *n; n = &(*n)->next) {
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 268 if ((*n)->major == major)
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 269 break;
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 270 }
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 271 if (!*n)
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 272 *n = p;
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 273 else
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 274 ret = -EBUSY;
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 275
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 276 if (ret < 0) {
f33ff110ef31bd block/genhd.c Srivatsa S. Bhat 2018-02-05 277 printk("register_blkdev: cannot get major %u for %s\n",
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 278 major, name);
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 279 kfree(p);
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 280 }
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 281 out:
e49fbbbf0aa14f block/genhd.c Christoph Hellwig 2020-10-29 282 mutex_unlock(&major_names_lock);
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 283 return ret;
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 284 }
1de14b707f1a3e block/genhd.c Tetsuo Handa 2021-06-19 285 EXPORT_SYMBOL(____register_blkdev);
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 286
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 3 months
[atishp04:dma_non_coherent_v1 8/42] drivers/gpio/gpio-starfive-jh7100.c:504:8: error: implicit declaration of function 'devm_request_irq'; did you mean 'can_request_irq'?
by kernel test robot
tree: https://github.com/atishp04/linux dma_non_coherent_v1
head: 37cdb4f054939f097f3297ec76c1c6738312c577
commit: ad78ee06db98750082ab52e23e4608a3787a3db4 [8/42] gpio: starfive-jh7100: Add StarFive JH7100 GPIO driver
config: m68k-allmodconfig (attached as .config)
compiler: m68k-linux-gcc (GCC) 9.3.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/atishp04/linux/commit/ad78ee06db98750082ab52e23e4608a3...
git remote add atishp04 https://github.com/atishp04/linux
git fetch --no-tags atishp04 dma_non_coherent_v1
git checkout ad78ee06db98750082ab52e23e4608a3787a3db4
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=m68k
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/gpio/gpio-starfive-jh7100.c:332:6: warning: no previous prototype for 'sf_vic_gpio_dout_reverse' [-Wmissing-prototypes]
332 | void sf_vic_gpio_dout_reverse(int gpio, int en)
| ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpio/gpio-starfive-jh7100.c:351:6: warning: no previous prototype for 'sf_vic_gpio_dout_value' [-Wmissing-prototypes]
351 | void sf_vic_gpio_dout_value(int gpio, int v)
| ^~~~~~~~~~~~~~~~~~~~~~
drivers/gpio/gpio-starfive-jh7100.c:369:6: warning: no previous prototype for 'sf_vic_gpio_dout_low' [-Wmissing-prototypes]
369 | void sf_vic_gpio_dout_low(int gpio)
| ^~~~~~~~~~~~~~~~~~~~
drivers/gpio/gpio-starfive-jh7100.c:375:6: warning: no previous prototype for 'sf_vic_gpio_dout_high' [-Wmissing-prototypes]
375 | void sf_vic_gpio_dout_high(int gpio)
| ^~~~~~~~~~~~~~~~~~~~~
drivers/gpio/gpio-starfive-jh7100.c:381:6: warning: no previous prototype for 'sf_vic_gpio_doen_reverse' [-Wmissing-prototypes]
381 | void sf_vic_gpio_doen_reverse(int gpio, int en)
| ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpio/gpio-starfive-jh7100.c:400:6: warning: no previous prototype for 'sf_vic_gpio_doen_value' [-Wmissing-prototypes]
400 | void sf_vic_gpio_doen_value(int gpio, int v)
| ^~~~~~~~~~~~~~~~~~~~~~
drivers/gpio/gpio-starfive-jh7100.c:419:6: warning: no previous prototype for 'sf_vic_gpio_doen_low' [-Wmissing-prototypes]
419 | void sf_vic_gpio_doen_low(int gpio)
| ^~~~~~~~~~~~~~~~~~~~
drivers/gpio/gpio-starfive-jh7100.c:425:6: warning: no previous prototype for 'sf_vic_gpio_doen_high' [-Wmissing-prototypes]
425 | void sf_vic_gpio_doen_high(int gpio)
| ^~~~~~~~~~~~~~~~~~~~~
drivers/gpio/gpio-starfive-jh7100.c:431:6: warning: no previous prototype for 'sf_vic_gpio_manual' [-Wmissing-prototypes]
431 | void sf_vic_gpio_manual(int offset, int v)
| ^~~~~~~~~~~~~~~~~~
drivers/gpio/gpio-starfive-jh7100.c: In function 'starfive_gpio_probe':
>> drivers/gpio/gpio-starfive-jh7100.c:504:8: error: implicit declaration of function 'devm_request_irq'; did you mean 'can_request_irq'? [-Werror=implicit-function-declaration]
504 | ret = devm_request_irq(dev, irq, starfive_irq_handler, IRQF_SHARED,
| ^~~~~~~~~~~~~~~~
| can_request_irq
>> drivers/gpio/gpio-starfive-jh7100.c:504:57: error: 'IRQF_SHARED' undeclared (first use in this function)
504 | ret = devm_request_irq(dev, irq, starfive_irq_handler, IRQF_SHARED,
| ^~~~~~~~~~~
drivers/gpio/gpio-starfive-jh7100.c:504:57: note: each undeclared identifier is reported only once for each function it appears in
cc1: some warnings being treated as errors
vim +504 drivers/gpio/gpio-starfive-jh7100.c
446
447 static int starfive_gpio_probe(struct platform_device *pdev)
448 {
449 struct device *dev = &pdev->dev;
450 struct starfive_gpio *chip;
451 struct gpio_irq_chip *girq;
452 struct resource *res;
453 int irq, ret, ngpio;
454
455 chip = devm_kzalloc(dev, sizeof(*chip), GFP_KERNEL);
456 if (!chip)
457 return -ENOMEM;
458
459 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
460 chip->base = devm_ioremap_resource(dev, res);
461 if (IS_ERR(chip->base)) {
462 dev_err(dev, "failed to allocate device memory\n");
463 return PTR_ERR(chip->base);
464 }
465 gpio_base = chip->base;
466
467 irq = platform_get_irq(pdev, 0);
468 if (irq < 0) {
469 dev_err(dev, "Cannot get IRQ resource\n");
470 return irq;
471 }
472
473 raw_spin_lock_init(&chip->lock);
474 chip->gc.direction_input = starfive_direction_input;
475 chip->gc.direction_output = starfive_direction_output;
476 chip->gc.get_direction = starfive_get_direction;
477 chip->gc.get = starfive_get_value;
478 chip->gc.set = starfive_set_value;
479 chip->gc.base = 0;
480 chip->gc.ngpio = 64;
481 chip->gc.label = dev_name(dev);
482 chip->gc.parent = dev;
483 chip->gc.owner = THIS_MODULE;
484
485 girq = &chip->gc.irq;
486 girq->chip = &starfive_irqchip;
487 girq->parent_handler = NULL;
488 girq->num_parents = 0;
489 girq->parents = NULL;
490 girq->default_type = IRQ_TYPE_NONE;
491 girq->handler = handle_simple_irq;
492
493 ret = gpiochip_add_data(&chip->gc, chip);
494 if (ret) {
495 dev_err(dev, "gpiochip_add_data ret=%d!\n", ret);
496 return ret;
497 }
498
499 /* Disable all GPIO interrupts before enabling parent interrupts */
500 iowrite32(0, chip->base + GPIO_IE_HIGH);
501 iowrite32(0, chip->base + GPIO_IE_LOW);
502 chip->enabled = 0;
503
> 504 ret = devm_request_irq(dev, irq, starfive_irq_handler, IRQF_SHARED,
505 dev_name(dev), chip);
506 if (ret) {
507 dev_err(dev, "IRQ handler registering failed (%d)\n", ret);
508 return ret;
509 }
510
511 writel_relaxed(1, chip->base + GPIO_EN);
512
513 dev_info(dev, "StarFive GPIO chip registered %d GPIOs\n", ngpio);
514
515 return 0;
516 }
517
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 3 months
Re: [PATCH v2] block: genhd: don't call probe function with major_names_lock held
by kernel test robot
Hi Tetsuo,
I love your patch! Perhaps something to improve:
[auto build test WARNING on linux/master]
[also build test WARNING on linus/master v5.13-rc6]
[cannot apply to block/for-next next-20210618]
[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/Tetsuo-Handa/block-genhd-don-t-c...
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git dd860052c99b1e088352bdd4fb7aef46f8d2ef47
config: um-x86_64_defconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://github.com/0day-ci/linux/commit/1de14b707f1a3e49fa4412b1eb8391f09...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Tetsuo-Handa/block-genhd-don-t-call-probe-function-with-major_names_lock-held/20210619-090731
git checkout 1de14b707f1a3e49fa4412b1eb8391f09747a005
# save the attached .config to linux build tree
make W=1 ARCH=um SUBARCH=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 >>):
>> block/genhd.c:223: warning: expecting prototype for __register_blkdev(). Prototype was for ____register_blkdev() instead
vim +223 block/genhd.c
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 196
9e8c0bccdc944b block/genhd.c Márton Németh 2009-02-20 197 /**
e2b6b301871719 block/genhd.c Christoph Hellwig 2020-11-14 198 * __register_blkdev - register a new block device
9e8c0bccdc944b block/genhd.c Márton Németh 2009-02-20 199 *
f33ff110ef31bd block/genhd.c Srivatsa S. Bhat 2018-02-05 200 * @major: the requested major device number [1..BLKDEV_MAJOR_MAX-1]. If
f33ff110ef31bd block/genhd.c Srivatsa S. Bhat 2018-02-05 201 * @major = 0, try to allocate any unused major number.
9e8c0bccdc944b block/genhd.c Márton Németh 2009-02-20 202 * @name: the name of the new block device as a zero terminated string
1de14b707f1a3e block/genhd.c Tetsuo Handa 2021-06-19 203 * @probe: callback that is called on access to any minor number of @major
1de14b707f1a3e block/genhd.c Tetsuo Handa 2021-06-19 204 * @owner: the owner of @probe function (i.e. THIS_MODULE or NULL).
9e8c0bccdc944b block/genhd.c Márton Németh 2009-02-20 205 *
9e8c0bccdc944b block/genhd.c Márton Németh 2009-02-20 206 * The @name must be unique within the system.
9e8c0bccdc944b block/genhd.c Márton Németh 2009-02-20 207 *
0e056eb5530da8 block/genhd.c Mauro Carvalho Chehab 2017-03-30 208 * The return value depends on the @major input parameter:
0e056eb5530da8 block/genhd.c Mauro Carvalho Chehab 2017-03-30 209 *
f33ff110ef31bd block/genhd.c Srivatsa S. Bhat 2018-02-05 210 * - if a major device number was requested in range [1..BLKDEV_MAJOR_MAX-1]
f33ff110ef31bd block/genhd.c Srivatsa S. Bhat 2018-02-05 211 * then the function returns zero on success, or a negative error code
9e8c0bccdc944b block/genhd.c Márton Németh 2009-02-20 212 * - if any unused major number was requested with @major = 0 parameter
9e8c0bccdc944b block/genhd.c Márton Németh 2009-02-20 213 * then the return value is the allocated major number in range
f33ff110ef31bd block/genhd.c Srivatsa S. Bhat 2018-02-05 214 * [1..BLKDEV_MAJOR_MAX-1] or a negative error code otherwise
f33ff110ef31bd block/genhd.c Srivatsa S. Bhat 2018-02-05 215 *
f33ff110ef31bd block/genhd.c Srivatsa S. Bhat 2018-02-05 216 * See Documentation/admin-guide/devices.txt for the list of allocated
f33ff110ef31bd block/genhd.c Srivatsa S. Bhat 2018-02-05 217 * major numbers.
e2b6b301871719 block/genhd.c Christoph Hellwig 2020-11-14 218 *
e2b6b301871719 block/genhd.c Christoph Hellwig 2020-11-14 219 * Use register_blkdev instead for any new code.
9e8c0bccdc944b block/genhd.c Márton Németh 2009-02-20 220 */
1de14b707f1a3e block/genhd.c Tetsuo Handa 2021-06-19 221 int ____register_blkdev(unsigned int major, const char *name,
1de14b707f1a3e block/genhd.c Tetsuo Handa 2021-06-19 222 void (*probe)(dev_t devt), struct module *owner)
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 @223 {
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 224 struct blk_major_name **n, *p;
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 225 int index, ret = 0;
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 226
e49fbbbf0aa14f block/genhd.c Christoph Hellwig 2020-10-29 227 mutex_lock(&major_names_lock);
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 228
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 229 /* temporary */
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 230 if (major == 0) {
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 231 for (index = ARRAY_SIZE(major_names)-1; index > 0; index--) {
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 232 if (major_names[index] == NULL)
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 233 break;
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 234 }
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 235
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 236 if (index == 0) {
dfc76d11dd455a block/genhd.c Keyur Patel 2019-02-17 237 printk("%s: failed to get major for %s\n",
dfc76d11dd455a block/genhd.c Keyur Patel 2019-02-17 238 __func__, name);
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 239 ret = -EBUSY;
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 240 goto out;
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 241 }
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 242 major = index;
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 243 ret = major;
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 244 }
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 245
133d55cdb2f1f9 block/genhd.c Logan Gunthorpe 2017-06-16 246 if (major >= BLKDEV_MAJOR_MAX) {
dfc76d11dd455a block/genhd.c Keyur Patel 2019-02-17 247 pr_err("%s: major requested (%u) is greater than the maximum (%u) for %s\n",
dfc76d11dd455a block/genhd.c Keyur Patel 2019-02-17 248 __func__, major, BLKDEV_MAJOR_MAX-1, name);
133d55cdb2f1f9 block/genhd.c Logan Gunthorpe 2017-06-16 249
133d55cdb2f1f9 block/genhd.c Logan Gunthorpe 2017-06-16 250 ret = -EINVAL;
133d55cdb2f1f9 block/genhd.c Logan Gunthorpe 2017-06-16 251 goto out;
133d55cdb2f1f9 block/genhd.c Logan Gunthorpe 2017-06-16 252 }
133d55cdb2f1f9 block/genhd.c Logan Gunthorpe 2017-06-16 253
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 254 p = kmalloc(sizeof(struct blk_major_name), GFP_KERNEL);
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 255 if (p == NULL) {
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 256 ret = -ENOMEM;
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 257 goto out;
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 258 }
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 259
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 260 p->major = major;
a160c6159d4a0c block/genhd.c Christoph Hellwig 2020-10-29 261 p->probe = probe;
1de14b707f1a3e block/genhd.c Tetsuo Handa 2021-06-19 262 p->owner = owner;
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 263 strlcpy(p->name, name, sizeof(p->name));
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 264 p->next = NULL;
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 265 index = major_to_index(major);
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 266
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 267 for (n = &major_names[index]; *n; n = &(*n)->next) {
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 268 if ((*n)->major == major)
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 269 break;
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 270 }
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 271 if (!*n)
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 272 *n = p;
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 273 else
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 274 ret = -EBUSY;
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 275
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 276 if (ret < 0) {
f33ff110ef31bd block/genhd.c Srivatsa S. Bhat 2018-02-05 277 printk("register_blkdev: cannot get major %u for %s\n",
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 278 major, name);
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 279 kfree(p);
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 280 }
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 281 out:
e49fbbbf0aa14f block/genhd.c Christoph Hellwig 2020-10-29 282 mutex_unlock(&major_names_lock);
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 283 return ret;
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 284 }
1de14b707f1a3e block/genhd.c Tetsuo Handa 2021-06-19 285 EXPORT_SYMBOL(____register_blkdev);
^1da177e4c3f41 drivers/block/genhd.c Linus Torvalds 2005-04-16 286
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 3 months
[android-common:android-4.19 12/13] drivers/nvdimm/nd_virtio.c:56:28: sparse: sparse: incorrect type in assignment (different base types)
by kernel test robot
tree: https://android.googlesource.com/kernel/common android-4.19
head: 89a7be58e85a4a5248d134aa58cfade92644bd3a
commit: 748a437c5c0179283ae1814b612f9e1a744f3839 [12/13] UPSTREAM: virtio-pmem: Add virtio pmem driver
config: x86_64-randconfig-s022-20210618 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.3-341-g8af24329-dirty
git remote add android-common https://android.googlesource.com/kernel/common
git fetch --no-tags android-common android-4.19
git checkout 748a437c5c0179283ae1814b612f9e1a744f3839
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' W=1 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/nvdimm/nd_virtio.c:56:28: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] type @@ got restricted __virtio32 @@
drivers/nvdimm/nd_virtio.c:56:28: sparse: expected unsigned int [usertype] type
drivers/nvdimm/nd_virtio.c:56:28: sparse: got restricted __virtio32
>> drivers/nvdimm/nd_virtio.c:93:59: sparse: sparse: incorrect type in argument 2 (different base types) @@ expected restricted __virtio32 [usertype] val @@ got unsigned int [usertype] ret @@
drivers/nvdimm/nd_virtio.c:93:59: sparse: expected restricted __virtio32 [usertype] val
drivers/nvdimm/nd_virtio.c:93:59: sparse: got unsigned int [usertype] ret
vim +56 drivers/nvdimm/nd_virtio.c
36
37 /* The request submission function */
38 static int virtio_pmem_flush(struct nd_region *nd_region)
39 {
40 struct virtio_device *vdev = nd_region->provider_data;
41 struct virtio_pmem *vpmem = vdev->priv;
42 struct virtio_pmem_request *req_data;
43 struct scatterlist *sgs[2], sg, ret;
44 unsigned long flags;
45 int err, err1;
46
47 might_sleep();
48 req_data = kmalloc(sizeof(*req_data), GFP_KERNEL);
49 if (!req_data)
50 return -ENOMEM;
51
52 req_data->done = false;
53 init_waitqueue_head(&req_data->host_acked);
54 init_waitqueue_head(&req_data->wq_buf);
55 INIT_LIST_HEAD(&req_data->list);
> 56 req_data->req.type = cpu_to_virtio32(vdev, VIRTIO_PMEM_REQ_TYPE_FLUSH);
57 sg_init_one(&sg, &req_data->req, sizeof(req_data->req));
58 sgs[0] = &sg;
59 sg_init_one(&ret, &req_data->resp.ret, sizeof(req_data->resp));
60 sgs[1] = &ret;
61
62 spin_lock_irqsave(&vpmem->pmem_lock, flags);
63 /*
64 * If virtqueue_add_sgs returns -ENOSPC then req_vq virtual
65 * queue does not have free descriptor. We add the request
66 * to req_list and wait for host_ack to wake us up when free
67 * slots are available.
68 */
69 while ((err = virtqueue_add_sgs(vpmem->req_vq, sgs, 1, 1, req_data,
70 GFP_ATOMIC)) == -ENOSPC) {
71
72 dev_info(&vdev->dev, "failed to send command to virtio pmem device, no free slots in the virtqueue\n");
73 req_data->wq_buf_avail = false;
74 list_add_tail(&req_data->list, &vpmem->req_list);
75 spin_unlock_irqrestore(&vpmem->pmem_lock, flags);
76
77 /* A host response results in "host_ack" getting called */
78 wait_event(req_data->wq_buf, req_data->wq_buf_avail);
79 spin_lock_irqsave(&vpmem->pmem_lock, flags);
80 }
81 err1 = virtqueue_kick(vpmem->req_vq);
82 spin_unlock_irqrestore(&vpmem->pmem_lock, flags);
83 /*
84 * virtqueue_add_sgs failed with error different than -ENOSPC, we can't
85 * do anything about that.
86 */
87 if (err || !err1) {
88 dev_info(&vdev->dev, "failed to send command to virtio pmem device\n");
89 err = -EIO;
90 } else {
91 /* A host repsonse results in "host_ack" getting called */
92 wait_event(req_data->host_acked, req_data->done);
> 93 err = virtio32_to_cpu(vdev, req_data->resp.ret);
94 }
95
96 kfree(req_data);
97 return err;
98 };
99
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 3 months
[android-common:android-4.19 4/5] drivers/usb/host/xhci-mem.c:1880:56: sparse: sparse: restricted __le32 degrades to integer
by kernel test robot
tree: https://android.googlesource.com/kernel/common android-4.19
head: 7e9cfddda463ca301b5546efeebc3127d98c6ee0
commit: 5dfdaa15caebc782d1c90ff6513d4cc9f6ac3663 [4/5] ANDROID: GKI: usb: xhci: Add support for secondary interrupters
config: i386-randconfig-s002-20210618 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.3-341-g8af24329-dirty
git remote add android-common https://android.googlesource.com/kernel/common
git fetch --no-tags android-common android-4.19
git checkout 5dfdaa15caebc782d1c90ff6513d4cc9f6ac3663
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' W=1 ARCH=i386
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/usb/host/xhci-mem.c:936:6: sparse: sparse: symbol 'xhci_free_virt_devices_depth_first' was not declared. Should it be static?
>> drivers/usb/host/xhci-mem.c:1880:56: sparse: sparse: restricted __le32 degrades to integer
>> drivers/usb/host/xhci-mem.c:1840:6: sparse: sparse: symbol 'xhci_handle_sec_intr_events' was not declared. Should it be static?
>> drivers/usb/host/xhci-mem.c:1947:6: sparse: sparse: symbol 'xhci_event_ring_cleanup' was not declared. Should it be static?
>> drivers/usb/host/xhci-mem.c:2486:5: sparse: sparse: symbol 'xhci_event_ring_setup' was not declared. Should it be static?
>> drivers/usb/host/xhci-mem.c:2590:5: sparse: sparse: symbol 'xhci_event_ring_init' was not declared. Should it be static?
drivers/usb/host/xhci-mem.c:936:6: warning: no previous prototype for 'xhci_free_virt_devices_depth_first' [-Wmissing-prototypes]
936 | void xhci_free_virt_devices_depth_first(struct xhci_hcd *xhci, int slot_id)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/usb/host/xhci-mem.c:1840:6: warning: no previous prototype for 'xhci_handle_sec_intr_events' [-Wmissing-prototypes]
1840 | void xhci_handle_sec_intr_events(struct xhci_hcd *xhci, int intr_num)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/usb/host/xhci-mem.c:1947:6: warning: no previous prototype for 'xhci_event_ring_cleanup' [-Wmissing-prototypes]
1947 | void xhci_event_ring_cleanup(struct xhci_hcd *xhci)
| ^~~~~~~~~~~~~~~~~~~~~~~
drivers/usb/host/xhci-mem.c:2486:5: warning: no previous prototype for 'xhci_event_ring_setup' [-Wmissing-prototypes]
2486 | int xhci_event_ring_setup(struct xhci_hcd *xhci, struct xhci_ring **er,
| ^~~~~~~~~~~~~~~~~~~~~
drivers/usb/host/xhci-mem.c:2590:5: warning: no previous prototype for 'xhci_event_ring_init' [-Wmissing-prototypes]
2590 | int xhci_event_ring_init(struct xhci_hcd *xhci, gfp_t flags)
| ^~~~~~~~~~~~~~~~~~~~
drivers/usb/host/xhci-mem.c:365: warning: Function parameter or member 'xhci' not described in 'xhci_ring_alloc'
drivers/usb/host/xhci-mem.c:365: warning: Function parameter or member 'num_segs' not described in 'xhci_ring_alloc'
drivers/usb/host/xhci-mem.c:365: warning: Function parameter or member 'cycle_state' not described in 'xhci_ring_alloc'
drivers/usb/host/xhci-mem.c:365: warning: Function parameter or member 'type' not described in 'xhci_ring_alloc'
drivers/usb/host/xhci-mem.c:365: warning: Function parameter or member 'max_packet' not described in 'xhci_ring_alloc'
drivers/usb/host/xhci-mem.c:365: warning: Function parameter or member 'flags' not described in 'xhci_ring_alloc'
vim +1880 drivers/usb/host/xhci-mem.c
1839
> 1840 void xhci_handle_sec_intr_events(struct xhci_hcd *xhci, int intr_num)
1841 {
1842 union xhci_trb *erdp_trb, *current_trb;
1843 struct xhci_segment *seg;
1844 u64 erdp_reg;
1845 u32 iman_reg;
1846 dma_addr_t deq;
1847 unsigned long segment_offset;
1848
1849 /* disable irq, ack pending interrupt and ack all pending events */
1850
1851 iman_reg =
1852 readl_relaxed(&xhci->sec_ir_set[intr_num]->irq_pending);
1853 iman_reg &= ~IMAN_IE;
1854 writel_relaxed(iman_reg,
1855 &xhci->sec_ir_set[intr_num]->irq_pending);
1856 iman_reg =
1857 readl_relaxed(&xhci->sec_ir_set[intr_num]->irq_pending);
1858 if (iman_reg & IMAN_IP)
1859 writel_relaxed(iman_reg,
1860 &xhci->sec_ir_set[intr_num]->irq_pending);
1861
1862 /* last acked event trb is in erdp reg */
1863 erdp_reg =
1864 xhci_read_64(xhci, &xhci->sec_ir_set[intr_num]->erst_dequeue);
1865 deq = (dma_addr_t)(erdp_reg & ~ERST_PTR_MASK);
1866 if (!deq) {
1867 pr_debug("%s: event ring handling not required\n", __func__);
1868 return;
1869 }
1870
1871 seg = xhci->sec_event_ring[intr_num]->first_seg;
1872 segment_offset = deq - seg->dma;
1873
1874 /* find out virtual address of the last acked event trb */
1875 erdp_trb = current_trb = &seg->trbs[0] +
1876 (segment_offset/sizeof(*current_trb));
1877
1878 /* read cycle state of the last acked trb to find out CCS */
1879 xhci->sec_event_ring[intr_num]->cycle_state =
> 1880 (current_trb->event_cmd.flags & TRB_CYCLE);
1881
1882 while (1) {
1883 /* last trb of the event ring: toggle cycle state */
1884 if (current_trb == &seg->trbs[TRBS_PER_SEGMENT - 1]) {
1885 xhci->sec_event_ring[intr_num]->cycle_state ^= 1;
1886 current_trb = &seg->trbs[0];
1887 } else {
1888 current_trb++;
1889 }
1890
1891 /* cycle state transition */
1892 if ((le32_to_cpu(current_trb->event_cmd.flags) & TRB_CYCLE) !=
1893 xhci->sec_event_ring[intr_num]->cycle_state)
1894 break;
1895 }
1896
1897 if (erdp_trb != current_trb) {
1898 deq =
1899 xhci_trb_virt_to_dma(xhci->sec_event_ring[intr_num]->deq_seg,
1900 current_trb);
1901 if (deq == 0)
1902 xhci_warn(xhci,
1903 "WARN invalid SW event ring dequeue ptr.\n");
1904 /* Update HC event ring dequeue pointer */
1905 erdp_reg &= ERST_PTR_MASK;
1906 erdp_reg |= ((u64) deq & (u64) ~ERST_PTR_MASK);
1907 }
1908
1909 /* Clear the event handler busy flag (RW1C); event ring is empty. */
1910 erdp_reg |= ERST_EHB;
1911 xhci_write_64(xhci, erdp_reg,
1912 &xhci->sec_ir_set[intr_num]->erst_dequeue);
1913 }
1914
1915 int xhci_sec_event_ring_cleanup(struct usb_hcd *hcd, unsigned int intr_num)
1916 {
1917 int size;
1918 struct xhci_hcd *xhci = hcd_to_xhci(hcd);
1919 struct device *dev = xhci_to_hcd(xhci)->self.sysdev;
1920
1921 if (intr_num >= xhci->max_interrupters) {
1922 xhci_err(xhci, "invalid secondary interrupter num %d\n",
1923 intr_num);
1924 return -EINVAL;
1925 }
1926
1927 size =
1928 sizeof(struct xhci_erst_entry)*(xhci->sec_erst[intr_num].num_entries);
1929 if (xhci->sec_erst[intr_num].entries) {
1930 xhci_handle_sec_intr_events(xhci, intr_num);
1931 dma_free_coherent(dev, size, xhci->sec_erst[intr_num].entries,
1932 xhci->sec_erst[intr_num].erst_dma_addr);
1933 xhci->sec_erst[intr_num].entries = NULL;
1934 }
1935 xhci_dbg_trace(xhci, trace_xhci_dbg_init, "Freed SEC ERST#%d",
1936 intr_num);
1937 if (xhci->sec_event_ring[intr_num])
1938 xhci_ring_free(xhci, xhci->sec_event_ring[intr_num]);
1939
1940 xhci->sec_event_ring[intr_num] = NULL;
1941 xhci_dbg_trace(xhci, trace_xhci_dbg_init,
1942 "Freed sec event ring");
1943
1944 return 0;
1945 }
1946
> 1947 void xhci_event_ring_cleanup(struct xhci_hcd *xhci)
1948 {
1949 unsigned int i;
1950
1951 /* sec event ring clean up */
1952 for (i = 1; i < xhci->max_interrupters; i++)
1953 xhci_sec_event_ring_cleanup(xhci_to_hcd(xhci), i);
1954
1955 kfree(xhci->sec_ir_set);
1956 xhci->sec_ir_set = NULL;
1957 kfree(xhci->sec_erst);
1958 xhci->sec_erst = NULL;
1959 kfree(xhci->sec_event_ring);
1960 xhci->sec_event_ring = NULL;
1961
1962 /* primary event ring clean up */
1963 xhci_free_erst(xhci, &xhci->erst);
1964 xhci_dbg_trace(xhci, trace_xhci_dbg_init, "Freed primary ERST");
1965 if (xhci->event_ring)
1966 xhci_ring_free(xhci, xhci->event_ring);
1967 xhci->event_ring = NULL;
1968 xhci_dbg_trace(xhci, trace_xhci_dbg_init, "Freed priamry event ring");
1969 }
1970
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 3 months