[linux-next:master 7237/10830] drivers/gpu/drm/xe/xe_mmio.c:109:23: error: result of comparison of constant 4294967296 with expression of type 'resource_size_t' (aka 'unsigned int') is always false

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   20af1ca418d2c0b11bc2a1fe8c0c88f67bcc2a7e
commit: 237412e45390805e14a6936fb998d756c4eac9d8 [7237/10830] drm/xe: Enable 32bits build
config: i386-randconfig-r051-20240227 (https://download.01.org/0day-ci/archive/20240228/202402282106.ou7DStPq-lkp@xxxxxxxxx/config)
compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240228/202402282106.ou7DStPq-lkp@xxxxxxxxx/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202402282106.ou7DStPq-lkp@xxxxxxxxx/

All errors (new ones prefixed by >>):

>> drivers/gpu/drm/xe/xe_mmio.c:109:23: error: result of comparison of constant 4294967296 with expression of type 'resource_size_t' (aka 'unsigned int') is always false [-Werror,-Wtautological-constant-out-of-range-compare]
     109 |                     root_res->start > 0x100000000ull)
         |                     ~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~
   1 error generated.


vim +109 drivers/gpu/drm/xe/xe_mmio.c

dd08ebf6c3525a Matthew Brost              2023-03-30   50  
7f075300a31829 Michael J. Ruhl            2023-05-25   51  /*
7f075300a31829 Michael J. Ruhl            2023-05-25   52   * if force_vram_bar_size is set, attempt to set to the requested size
7f075300a31829 Michael J. Ruhl            2023-05-25   53   * else set to maximum possible size
7f075300a31829 Michael J. Ruhl            2023-05-25   54   */
433002ca367076 Michael J. Ruhl            2023-06-05   55  static void xe_resize_vram_bar(struct xe_device *xe)
dd08ebf6c3525a Matthew Brost              2023-03-30   56  {
adce1b393f90c3 Bommithi Sakeena           2023-11-17   57  	u64 force_vram_bar_size = xe_modparam.force_vram_bar_size;
dd08ebf6c3525a Matthew Brost              2023-03-30   58  	struct pci_dev *pdev = to_pci_dev(xe->drm.dev);
dd08ebf6c3525a Matthew Brost              2023-03-30   59  	struct pci_bus *root = pdev->bus;
dd08ebf6c3525a Matthew Brost              2023-03-30   60  	resource_size_t current_size;
7f075300a31829 Michael J. Ruhl            2023-05-25   61  	resource_size_t rebar_size;
7f075300a31829 Michael J. Ruhl            2023-05-25   62  	struct resource *root_res;
7f075300a31829 Michael J. Ruhl            2023-05-25   63  	u32 bar_size_mask;
dd08ebf6c3525a Matthew Brost              2023-03-30   64  	u32 pci_cmd;
dd08ebf6c3525a Matthew Brost              2023-03-30   65  	int i;
dd08ebf6c3525a Matthew Brost              2023-03-30   66  
7f075300a31829 Michael J. Ruhl            2023-05-25   67  	/* gather some relevant info */
0bc519d20ffa7a Lucas De Marchi            2023-11-17   68  	current_size = pci_resource_len(pdev, LMEM_BAR);
0bc519d20ffa7a Lucas De Marchi            2023-11-17   69  	bar_size_mask = pci_rebar_get_possible_sizes(pdev, LMEM_BAR);
7f075300a31829 Michael J. Ruhl            2023-05-25   70  
7f075300a31829 Michael J. Ruhl            2023-05-25   71  	if (!bar_size_mask)
433002ca367076 Michael J. Ruhl            2023-06-05   72  		return;
dd08ebf6c3525a Matthew Brost              2023-03-30   73  
7f075300a31829 Michael J. Ruhl            2023-05-25   74  	/* set to a specific size? */
2a8477f7614a62 Matthew Auld               2023-03-08   75  	if (force_vram_bar_size) {
7f075300a31829 Michael J. Ruhl            2023-05-25   76  		u32 bar_size_bit;
dd08ebf6c3525a Matthew Brost              2023-03-30   77  
2a8477f7614a62 Matthew Auld               2023-03-08   78  		rebar_size = force_vram_bar_size * (resource_size_t)SZ_1M;
dd08ebf6c3525a Matthew Brost              2023-03-30   79  
7f075300a31829 Michael J. Ruhl            2023-05-25   80  		bar_size_bit = bar_size_mask & BIT(pci_rebar_bytes_to_size(rebar_size));
dd08ebf6c3525a Matthew Brost              2023-03-30   81  
7f075300a31829 Michael J. Ruhl            2023-05-25   82  		if (!bar_size_bit) {
dd08ebf6c3525a Matthew Brost              2023-03-30   83  			drm_info(&xe->drm,
7f075300a31829 Michael J. Ruhl            2023-05-25   84  				 "Requested size: %lluMiB is not supported by rebar sizes: 0x%x. Leaving default: %lluMiB\n",
7f075300a31829 Michael J. Ruhl            2023-05-25   85  				 (u64)rebar_size >> 20, bar_size_mask, (u64)current_size >> 20);
433002ca367076 Michael J. Ruhl            2023-06-05   86  			return;
dd08ebf6c3525a Matthew Brost              2023-03-30   87  		}
7f075300a31829 Michael J. Ruhl            2023-05-25   88  
7f075300a31829 Michael J. Ruhl            2023-05-25   89  		rebar_size = 1ULL << (__fls(bar_size_bit) + BAR_SIZE_SHIFT);
7f075300a31829 Michael J. Ruhl            2023-05-25   90  
7f075300a31829 Michael J. Ruhl            2023-05-25   91  		if (rebar_size == current_size)
433002ca367076 Michael J. Ruhl            2023-06-05   92  			return;
dd08ebf6c3525a Matthew Brost              2023-03-30   93  	} else {
7f075300a31829 Michael J. Ruhl            2023-05-25   94  		rebar_size = 1ULL << (__fls(bar_size_mask) + BAR_SIZE_SHIFT);
dd08ebf6c3525a Matthew Brost              2023-03-30   95  
7f075300a31829 Michael J. Ruhl            2023-05-25   96  		/* only resize if larger than current */
7f075300a31829 Michael J. Ruhl            2023-05-25   97  		if (rebar_size <= current_size)
433002ca367076 Michael J. Ruhl            2023-06-05   98  			return;
dd08ebf6c3525a Matthew Brost              2023-03-30   99  	}
dd08ebf6c3525a Matthew Brost              2023-03-30  100  
433002ca367076 Michael J. Ruhl            2023-06-05  101  	drm_info(&xe->drm, "Attempting to resize bar from %lluMiB -> %lluMiB\n",
96cb46df567e04 Balasubramani Vivekanandan 2023-04-25  102  		 (u64)current_size >> 20, (u64)rebar_size >> 20);
96cb46df567e04 Balasubramani Vivekanandan 2023-04-25  103  
dd08ebf6c3525a Matthew Brost              2023-03-30  104  	while (root->parent)
dd08ebf6c3525a Matthew Brost              2023-03-30  105  		root = root->parent;
dd08ebf6c3525a Matthew Brost              2023-03-30  106  
dd08ebf6c3525a Matthew Brost              2023-03-30  107  	pci_bus_for_each_resource(root, root_res, i) {
dd08ebf6c3525a Matthew Brost              2023-03-30  108  		if (root_res && root_res->flags & (IORESOURCE_MEM | IORESOURCE_MEM_64) &&
dd08ebf6c3525a Matthew Brost              2023-03-30 @109  		    root_res->start > 0x100000000ull)
dd08ebf6c3525a Matthew Brost              2023-03-30  110  			break;
dd08ebf6c3525a Matthew Brost              2023-03-30  111  	}
dd08ebf6c3525a Matthew Brost              2023-03-30  112  
dd08ebf6c3525a Matthew Brost              2023-03-30  113  	if (!root_res) {
96cb46df567e04 Balasubramani Vivekanandan 2023-04-25  114  		drm_info(&xe->drm, "Can't resize VRAM BAR - platform support is missing. Consider enabling 'Resizable BAR' support in your BIOS\n");
433002ca367076 Michael J. Ruhl            2023-06-05  115  		return;
dd08ebf6c3525a Matthew Brost              2023-03-30  116  	}
dd08ebf6c3525a Matthew Brost              2023-03-30  117  
dd08ebf6c3525a Matthew Brost              2023-03-30  118  	pci_read_config_dword(pdev, PCI_COMMAND, &pci_cmd);
dd08ebf6c3525a Matthew Brost              2023-03-30  119  	pci_write_config_dword(pdev, PCI_COMMAND, pci_cmd & ~PCI_COMMAND_MEMORY);
dd08ebf6c3525a Matthew Brost              2023-03-30  120  
0bc519d20ffa7a Lucas De Marchi            2023-11-17  121  	_resize_bar(xe, LMEM_BAR, rebar_size);
dd08ebf6c3525a Matthew Brost              2023-03-30  122  
dd08ebf6c3525a Matthew Brost              2023-03-30  123  	pci_assign_unassigned_bus_resources(pdev->bus);
dd08ebf6c3525a Matthew Brost              2023-03-30  124  	pci_write_config_dword(pdev, PCI_COMMAND, pci_cmd);
dd08ebf6c3525a Matthew Brost              2023-03-30  125  }
dd08ebf6c3525a Matthew Brost              2023-03-30  126  

:::::: The code at line 109 was first introduced by commit
:::::: dd08ebf6c3525a7ea2186e636df064ea47281987 drm/xe: Introduce a new DRM driver for Intel GPUs

:::::: TO: Matthew Brost <matthew.brost@xxxxxxxxx>
:::::: CC: Rodrigo Vivi <rodrigo.vivi@xxxxxxxxx>

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux