[PATCH] ALSA: memalloc: Revive x86-specific WC page allocations again

kernel test robot lkp at intel.com
Sun Aug 21 16:31:25 CEST 2022


Hi Takashi,

I love your patch! Perhaps something to improve:

[auto build test WARNING on tiwai-sound/for-next]
[also build test WARNING on linus/master v6.0-rc1 next-20220819]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Takashi-Iwai/ALSA-memalloc-Revive-x86-specific-WC-page-allocations-again/20220821-162443
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git for-next
config: i386-randconfig-s001 (https://download.01.org/0day-ci/archive/20220821/202208212226.7Ji4ZW8k-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.3.0-5) 11.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.4-39-gce1a6720-dirty
        # https://github.com/intel-lab-lkp/linux/commit/86072b28544f52618e4ce8336ba80be1d67f38d9
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Takashi-Iwai/ALSA-memalloc-Revive-x86-specific-WC-page-allocations-again/20220821-162443
        git checkout 86072b28544f52618e4ce8336ba80be1d67f38d9
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=i386 SHELL=/bin/bash sound/core/

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp at intel.com>

sparse warnings: (new ones prefixed by >>)
>> sound/core/memalloc.c:705:41: sparse: sparse: incorrect type in initializer (different base types) @@     expected unsigned long gfp @@     got restricted gfp_t @@
   sound/core/memalloc.c:705:41: sparse:     expected unsigned long gfp
   sound/core/memalloc.c:705:41: sparse:     got restricted gfp_t
>> sound/core/memalloc.c:710:62: sparse: sparse: restricted gfp_t degrades to integer
>> sound/core/memalloc.c:711:29: sparse: sparse: invalid assignment: |=
>> sound/core/memalloc.c:711:29: sparse:    left side has type unsigned long
>> sound/core/memalloc.c:711:29: sparse:    right side has type restricted gfp_t
   sound/core/memalloc.c:714:60: sparse: sparse: restricted gfp_t degrades to integer
   sound/core/memalloc.c:715:38: sparse: sparse: restricted gfp_t degrades to integer
   sound/core/memalloc.c:715:52: sparse: sparse: restricted gfp_t degrades to integer
   sound/core/memalloc.c:289:43: sparse: sparse: incorrect type in argument 2 (different base types) @@     expected restricted gfp_t [usertype] gfp_mask @@     got unsigned long gfp @@
   sound/core/memalloc.c:289:43: sparse:     expected restricted gfp_t [usertype] gfp_mask
   sound/core/memalloc.c:289:43: sparse:     got unsigned long gfp
   sound/core/memalloc.c:299:52: sparse: sparse: incorrect type in argument 3 (different base types) @@     expected unsigned long gfp @@     got restricted gfp_t @@
   sound/core/memalloc.c:299:52: sparse:     expected unsigned long gfp
   sound/core/memalloc.c:299:52: sparse:     got restricted gfp_t

vim +705 sound/core/memalloc.c

   699	
   700	/* manual page allocations with wc setup */
   701	static void *do_alloc_fallback_pages(struct device *dev, size_t size,
   702					     dma_addr_t *addr, bool wc)
   703	{
   704		void *p;
 > 705		unsigned long gfp = DEFAULT_GFP & ~__GFP_COMP;
   706	
   707	 again:
   708		p = do_alloc_pages(size, addr, gfp);
   709		if (!p || (*addr + size - 1) & ~dev->coherent_dma_mask) {
 > 710			if (IS_ENABLED(CONFIG_ZONE_DMA32) && !(gfp & GFP_DMA32)) {
 > 711				gfp |= GFP_DMA32;
   712				goto again;
   713			}
   714			if (IS_ENABLED(CONFIG_ZONE_DMA) && !(gfp & GFP_DMA)) {
   715				gfp = (gfp & ~GFP_DMA32) | GFP_DMA;
   716				goto again;
   717			}
   718		}
   719		if (p && wc)
   720			set_memory_wc((unsigned long)(p), size >> PAGE_SHIFT);
   721		return p;
   722	}
   723	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp


More information about the Alsa-devel mailing list