From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: [chrome-os:chromeos-5.10 18970/18992] drivers/gpu/arm/midgard/mali_kbase_mmu.c:218:6: warning: variable 'ret' set but not used
Date: Tue, 17 Aug 2021 20:46:31 +0800 [thread overview]
Message-ID: <202108172023.YA2Pj1iG-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 10611 bytes --]
tree: https://chromium.googlesource.com/chromiumos/third_party/kernel chromeos-5.10
head: aa781ee2afbcc219c70046dc804b319565e18372
commit: 38d69e2e44ad116b6859968ea996a2701e006cd1 [18970/18992] CHROMIUM: MALI: fixup midgard compilation for kernel 5.10
config: arm-randconfig-r024-20210817 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 2c6448cdc2f68f8c28fd0bd9404182b81306e6e6)
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
git remote add chrome-os https://chromium.googlesource.com/chromiumos/third_party/kernel
git fetch --no-tags chrome-os chromeos-5.10
git checkout 38d69e2e44ad116b6859968ea996a2701e006cd1
# 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@intel.com>
All warnings (new ones prefixed by >>):
>> drivers/gpu/arm/midgard/mali_kbase_mmu.c:218:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
int ret;
^
1 warning generated.
--
>> drivers/gpu/arm/midgard/ipa/mali_kbase_ipa.c:88:13: warning: no previous prototype for function 'kbase_ipa_model_name_from_id' [-Wmissing-prototypes]
const char *kbase_ipa_model_name_from_id(u32 gpu_id)
^
drivers/gpu/arm/midgard/ipa/mali_kbase_ipa.c:88:7: note: declare 'static' if the function is not intended to be used outside of this translation unit
const char *kbase_ipa_model_name_from_id(u32 gpu_id)
^
static
>> drivers/gpu/arm/midgard/ipa/mali_kbase_ipa.c:422:5: warning: no previous prototype for function 'kbase_scale_static_power' [-Wmissing-prototypes]
u32 kbase_scale_static_power(const u32 c, const u32 voltage)
^
drivers/gpu/arm/midgard/ipa/mali_kbase_ipa.c:422:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
u32 kbase_scale_static_power(const u32 c, const u32 voltage)
^
static
>> drivers/gpu/arm/midgard/ipa/mali_kbase_ipa.c:577:5: warning: no previous prototype for function 'kbase_get_real_power_locked' [-Wmissing-prototypes]
int kbase_get_real_power_locked(struct kbase_device *kbdev, u32 *power,
^
drivers/gpu/arm/midgard/ipa/mali_kbase_ipa.c:577:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int kbase_get_real_power_locked(struct kbase_device *kbdev, u32 *power,
^
static
3 warnings generated.
--
>> drivers/gpu/arm/midgard/backend/gpu/mali_kbase_irq_linux.c:181:5: warning: no previous prototype for function 'kbase_set_custom_irq_handler' [-Wmissing-prototypes]
int kbase_set_custom_irq_handler(struct kbase_device *kbdev,
^
drivers/gpu/arm/midgard/backend/gpu/mali_kbase_irq_linux.c:181:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int kbase_set_custom_irq_handler(struct kbase_device *kbdev,
^
static
1 warning generated.
--
>> drivers/gpu/arm/midgard/backend/gpu/mali_kbase_devfreq.c:424:5: warning: no previous prototype for function 'kbase_devfreq_init' [-Wmissing-prototypes]
int kbase_devfreq_init(struct kbase_device *kbdev)
^
drivers/gpu/arm/midgard/backend/gpu/mali_kbase_devfreq.c:424:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int kbase_devfreq_init(struct kbase_device *kbdev)
^
static
>> drivers/gpu/arm/midgard/backend/gpu/mali_kbase_devfreq.c:518:6: warning: no previous prototype for function 'kbase_devfreq_term' [-Wmissing-prototypes]
void kbase_devfreq_term(struct kbase_device *kbdev)
^
drivers/gpu/arm/midgard/backend/gpu/mali_kbase_devfreq.c:518:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void kbase_devfreq_term(struct kbase_device *kbdev)
^
static
2 warnings generated.
vim +/ret +218 drivers/gpu/arm/midgard/mali_kbase_mmu.c
091c39ecb4a279 Brian Norris 2021-07-16 209
091c39ecb4a279 Brian Norris 2021-07-16 210 static void kbase_gpu_mmu_handle_write_fault(struct kbase_context *kctx,
091c39ecb4a279 Brian Norris 2021-07-16 211 struct kbase_as *faulting_as)
091c39ecb4a279 Brian Norris 2021-07-16 212 {
091c39ecb4a279 Brian Norris 2021-07-16 213 struct kbasep_gwt_list_element *pos;
091c39ecb4a279 Brian Norris 2021-07-16 214 struct kbase_va_region *region;
091c39ecb4a279 Brian Norris 2021-07-16 215 struct kbase_device *kbdev;
091c39ecb4a279 Brian Norris 2021-07-16 216 u64 fault_pfn, pfn_offset;
091c39ecb4a279 Brian Norris 2021-07-16 217 u32 op;
091c39ecb4a279 Brian Norris 2021-07-16 @218 int ret;
091c39ecb4a279 Brian Norris 2021-07-16 219 int as_no;
091c39ecb4a279 Brian Norris 2021-07-16 220
091c39ecb4a279 Brian Norris 2021-07-16 221 as_no = faulting_as->number;
091c39ecb4a279 Brian Norris 2021-07-16 222 kbdev = container_of(faulting_as, struct kbase_device, as[as_no]);
091c39ecb4a279 Brian Norris 2021-07-16 223 fault_pfn = faulting_as->fault_addr >> PAGE_SHIFT;
091c39ecb4a279 Brian Norris 2021-07-16 224
091c39ecb4a279 Brian Norris 2021-07-16 225 kbase_gpu_vm_lock(kctx);
091c39ecb4a279 Brian Norris 2021-07-16 226
091c39ecb4a279 Brian Norris 2021-07-16 227 /* Find region and check if it should be writable. */
091c39ecb4a279 Brian Norris 2021-07-16 228 region = kbase_region_tracker_find_region_enclosing_address(kctx,
091c39ecb4a279 Brian Norris 2021-07-16 229 faulting_as->fault_addr);
091c39ecb4a279 Brian Norris 2021-07-16 230 if (kbase_is_region_invalid_or_free(region)) {
091c39ecb4a279 Brian Norris 2021-07-16 231 kbase_gpu_vm_unlock(kctx);
091c39ecb4a279 Brian Norris 2021-07-16 232 kbase_mmu_report_fault_and_kill(kctx, faulting_as,
091c39ecb4a279 Brian Norris 2021-07-16 233 "Memory is not mapped on the GPU");
091c39ecb4a279 Brian Norris 2021-07-16 234 return;
091c39ecb4a279 Brian Norris 2021-07-16 235 }
091c39ecb4a279 Brian Norris 2021-07-16 236
091c39ecb4a279 Brian Norris 2021-07-16 237 if (!(region->flags & KBASE_REG_GPU_WR)) {
091c39ecb4a279 Brian Norris 2021-07-16 238 kbase_gpu_vm_unlock(kctx);
091c39ecb4a279 Brian Norris 2021-07-16 239 kbase_mmu_report_fault_and_kill(kctx, faulting_as,
091c39ecb4a279 Brian Norris 2021-07-16 240 "Region does not have write permissions");
091c39ecb4a279 Brian Norris 2021-07-16 241 return;
091c39ecb4a279 Brian Norris 2021-07-16 242 }
091c39ecb4a279 Brian Norris 2021-07-16 243
091c39ecb4a279 Brian Norris 2021-07-16 244 /* Capture addresses of faulting write location
091c39ecb4a279 Brian Norris 2021-07-16 245 * for job dumping if write tracking is enabled.
091c39ecb4a279 Brian Norris 2021-07-16 246 */
091c39ecb4a279 Brian Norris 2021-07-16 247 if (kctx->gwt_enabled) {
091c39ecb4a279 Brian Norris 2021-07-16 248 u64 page_addr = faulting_as->fault_addr & PAGE_MASK;
091c39ecb4a279 Brian Norris 2021-07-16 249 bool found = false;
091c39ecb4a279 Brian Norris 2021-07-16 250 /* Check if this write was already handled. */
091c39ecb4a279 Brian Norris 2021-07-16 251 list_for_each_entry(pos, &kctx->gwt_current_list, link) {
091c39ecb4a279 Brian Norris 2021-07-16 252 if (page_addr == pos->page_addr) {
091c39ecb4a279 Brian Norris 2021-07-16 253 found = true;
091c39ecb4a279 Brian Norris 2021-07-16 254 break;
091c39ecb4a279 Brian Norris 2021-07-16 255 }
091c39ecb4a279 Brian Norris 2021-07-16 256 }
091c39ecb4a279 Brian Norris 2021-07-16 257
091c39ecb4a279 Brian Norris 2021-07-16 258 if (!found) {
091c39ecb4a279 Brian Norris 2021-07-16 259 pos = kmalloc(sizeof(*pos), GFP_KERNEL);
091c39ecb4a279 Brian Norris 2021-07-16 260 if (pos) {
091c39ecb4a279 Brian Norris 2021-07-16 261 pos->region = region;
091c39ecb4a279 Brian Norris 2021-07-16 262 pos->page_addr = page_addr;
091c39ecb4a279 Brian Norris 2021-07-16 263 pos->num_pages = 1;
091c39ecb4a279 Brian Norris 2021-07-16 264 list_add(&pos->link, &kctx->gwt_current_list);
091c39ecb4a279 Brian Norris 2021-07-16 265 } else {
091c39ecb4a279 Brian Norris 2021-07-16 266 dev_warn(kbdev->dev, "kmalloc failure");
091c39ecb4a279 Brian Norris 2021-07-16 267 }
091c39ecb4a279 Brian Norris 2021-07-16 268 }
091c39ecb4a279 Brian Norris 2021-07-16 269 }
091c39ecb4a279 Brian Norris 2021-07-16 270
091c39ecb4a279 Brian Norris 2021-07-16 271 pfn_offset = fault_pfn - region->start_pfn;
091c39ecb4a279 Brian Norris 2021-07-16 272 /* Now make this faulting page writable to GPU. */
091c39ecb4a279 Brian Norris 2021-07-16 273 ret = kbase_mmu_update_pages_no_flush(kctx, fault_pfn,
091c39ecb4a279 Brian Norris 2021-07-16 274 &kbase_get_gpu_phy_pages(region)[pfn_offset],
091c39ecb4a279 Brian Norris 2021-07-16 275 1, region->flags);
091c39ecb4a279 Brian Norris 2021-07-16 276
091c39ecb4a279 Brian Norris 2021-07-16 277 /* flush L2 and unlock the VA (resumes the MMU) */
091c39ecb4a279 Brian Norris 2021-07-16 278 if (kbase_hw_has_issue(kbdev, BASE_HW_ISSUE_6367))
091c39ecb4a279 Brian Norris 2021-07-16 279 op = AS_COMMAND_FLUSH;
091c39ecb4a279 Brian Norris 2021-07-16 280 else
091c39ecb4a279 Brian Norris 2021-07-16 281 op = AS_COMMAND_FLUSH_PT;
091c39ecb4a279 Brian Norris 2021-07-16 282
091c39ecb4a279 Brian Norris 2021-07-16 283 kbase_gpu_mmu_handle_write_faulting_as(kbdev, faulting_as,
091c39ecb4a279 Brian Norris 2021-07-16 284 fault_pfn, 1, op);
091c39ecb4a279 Brian Norris 2021-07-16 285
091c39ecb4a279 Brian Norris 2021-07-16 286 kbase_gpu_vm_unlock(kctx);
091c39ecb4a279 Brian Norris 2021-07-16 287 }
091c39ecb4a279 Brian Norris 2021-07-16 288
:::::: The code at line 218 was first introduced by commit
:::::: 091c39ecb4a279d5ecdcfc2442d2a9306fcb0344 CHROMIUM: MALI: import midgard gpu driver from v4.19
:::::: TO: Brian Norris <briannorris@chromium.org>
:::::: CC: Commit Bot <commit-bot@chromium.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 35173 bytes --]
reply other threads:[~2021-08-17 12:46 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=202108172023.YA2Pj1iG-lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild-all@lists.01.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.