From: Niklas Cassel <cassel@kernel.org>
To: kernel test robot <lkp@intel.com>
Cc: "Jingoo Han" <jingoohan1@gmail.com>,
"Manivannan Sadhasivam" <manivannan.sadhasivam@linaro.org>,
"Lorenzo Pieralisi" <lpieralisi@kernel.org>,
"Krzysztof Wilczyński" <kw@linux.com>,
"Rob Herring" <robh@kernel.org>,
"Bjorn Helgaas" <helgaas@kernel.org>,
llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
"Damien Le Moal" <dlemoal@kernel.org>,
linux-pci@vger.kernel.org
Subject: Re: [PATCH 3/6] PCI: dwc: endpoint: Add support for BAR type BAR_RESIZABLE
Date: Thu, 9 Jan 2025 09:07:43 +0100 [thread overview]
Message-ID: <Z3-Dz42s7uYoNCuV@ryzen> (raw)
In-Reply-To: <202501090927.zMSzHORM-lkp@intel.com>
On Thu, Jan 09, 2025 at 10:22:07AM +0800, kernel test robot wrote:
> Hi Niklas,
>
> kernel test robot noticed the following build warnings:
>
> [auto build test WARNING on pci/next]
> [also build test WARNING on next-20250108]
> [cannot apply to pci/for-linus linus/master v6.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#_base_tree_information]
>
> url: https://github.com/intel-lab-lkp/linux/commits/Niklas-Cassel/PCI-endpoint-Add-BAR-type-BAR_RESIZABLE/20250108-021844
> base: https://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git next
> patch link: https://lore.kernel.org/r/20250107181450.3182430-11-cassel%40kernel.org
> patch subject: [PATCH 3/6] PCI: dwc: endpoint: Add support for BAR type BAR_RESIZABLE
> config: arm-randconfig-003-20250109 (https://download.01.org/0day-ci/archive/20250109/202501090927.zMSzHORM-lkp@intel.com/config)
> compiler: clang version 20.0.0git (https://github.com/llvm/llvm-project 096551537b2a747a3387726ca618ceeb3950e9bc)
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250109/202501090927.zMSzHORM-lkp@intel.com/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@intel.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202501090927.zMSzHORM-lkp@intel.com/
>
> All warnings (new ones prefixed by >>):
>
> In file included from drivers/pci/controller/dwc/pcie-designware-ep.c:14:
> In file included from drivers/pci/controller/dwc/pcie-designware.h:17:
> In file included from include/linux/dma-mapping.h:8:
> In file included from include/linux/scatterlist.h:8:
> In file included from include/linux/mm.h:2223:
> include/linux/vmstat.h:518:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
> 518 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
> | ~~~~~~~~~~~ ^ ~~~
> >> drivers/pci/controller/dwc/pcie-designware-ep.c:259:27: warning: result of comparison of constant 140737488355328 with expression of type 'size_t' (aka 'unsigned int') is always false [-Wtautological-constant-out-of-range-compare]
> 259 | if (size < SZ_1M || size > (SZ_128G * 1024))
> | ~~~~ ^ ~~~~~~~~~~~~~~~~
> 2 warnings generated.
>
The compiler is correct that this condition can never happen on 32-bit,
but the code is correct, and the compiler will be able to optimize the
check away on 32-bit, so I will simply add a cast to shut up the warning.
Kind regards,
Niklas
>
> vim +259 drivers/pci/controller/dwc/pcie-designware-ep.c
>
> 249
> 250 static u32 dw_pcie_ep_bar_size_to_rebar_cap(size_t size)
> 251 {
> 252 u32 val;
> 253
> 254 /*
> 255 * According to PCIe base spec, min size for a resizable BAR is 1 MB,
> 256 * thus disallow a requested BAR size smaller than 1 MB.
> 257 * Disallow a requested BAR size larger than 128 TB.
> 258 */
> > 259 if (size < SZ_1M || size > (SZ_128G * 1024))
> 260 return 0;
> 261
> 262 val = ilog2(size);
> 263 val -= 20;
> 264
> 265 /* Sizes in REBAR_CAP start at BIT(4). */
> 266 return BIT(val + 4);
> 267 }
> 268
>
> --
> 0-DAY CI Kernel Test Service
> https://github.com/intel/lkp-tests/wiki
next prev parent reply other threads:[~2025-01-09 8:07 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-07 18:14 [PATCH 0/6] PCI: endpoint: Add support for resizable BARs Niklas Cassel
2025-01-07 18:14 ` [PATCH 1/6] PCI: endpoint: Add BAR type BAR_RESIZABLE Niklas Cassel
2025-01-07 18:14 ` [PATCH 2/6] PCI: dwc: ep: Move dw_pcie_ep_find_ext_capability() Niklas Cassel
2025-01-07 18:14 ` [PATCH 3/6] PCI: dwc: endpoint: Add support for BAR type BAR_RESIZABLE Niklas Cassel
2025-01-09 2:22 ` kernel test robot
2025-01-09 8:07 ` Niklas Cassel [this message]
2025-01-07 18:14 ` [PATCH 4/6] PCI: keystone: Describe resizable BARs as resizable BARs Niklas Cassel
2025-01-07 18:14 ` [PATCH 5/6] PCI: keystone: Specify correct alignment requirement Niklas Cassel
2025-01-07 18:14 ` [PATCH 6/6] PCI: dw-rockchip: Describe resizable BARs as resizable BARs Niklas Cassel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Z3-Dz42s7uYoNCuV@ryzen \
--to=cassel@kernel.org \
--cc=dlemoal@kernel.org \
--cc=helgaas@kernel.org \
--cc=jingoohan1@gmail.com \
--cc=kw@linux.com \
--cc=linux-pci@vger.kernel.org \
--cc=lkp@intel.com \
--cc=llvm@lists.linux.dev \
--cc=lpieralisi@kernel.org \
--cc=manivannan.sadhasivam@linaro.org \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=robh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox