From: kernel test robot <lkp@intel.com>
To: Oded Gabbay <ogabbay@kernel.org>
Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org
Subject: Re: [PATCH 03/11] habanalabs: change mmu_get_real_page_size to be ASIC-specific
Date: Thu, 17 Mar 2022 06:33:11 +0800 [thread overview]
Message-ID: <202203170651.S8azQIor-lkp@intel.com> (raw)
In-Reply-To: <20220316114129.2520107-3-ogabbay@kernel.org>
Hi Oded,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on char-misc/char-misc-testing]
[also build test WARNING on next-20220316]
[cannot apply to linux/master linus/master v5.17-rc8]
[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/Oded-Gabbay/habanalabs-set-non-0-value-in-dram-default-page-size/20220316-194323
base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git d6cd2f85931f87dbd07c664c9c6e806db1dd7c75
config: x86_64-randconfig-a013-20220314 (https://download.01.org/0day-ci/archive/20220317/202203170651.S8azQIor-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project a6ec1e3d798f8eab43fb3a91028c6ab04e115fcb)
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/0day-ci/linux/commit/9535025e314bc12dbdeebee7c71634699759bcfa
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Oded-Gabbay/habanalabs-set-non-0-value-in-dram-default-page-size/20220316-194323
git checkout 9535025e314bc12dbdeebee7c71634699759bcfa
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/misc/
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/misc/habanalabs/common/mmu/mmu.c:209:32: warning: variable 'prop' set but not used [-Wunused-but-set-variable]
struct asic_fixed_properties *prop;
^
drivers/misc/habanalabs/common/mmu/mmu.c:276:32: warning: variable 'prop' set but not used [-Wunused-but-set-variable]
struct asic_fixed_properties *prop;
^
2 warnings generated.
vim +/prop +209 drivers/misc/habanalabs/common/mmu/mmu.c
184
185 /*
186 * hl_mmu_unmap_page - unmaps a virtual addr
187 *
188 * @ctx: pointer to the context structure
189 * @virt_addr: virt addr to map from
190 * @page_size: size of the page to unmap
191 * @flush_pte: whether to do a PCI flush
192 *
193 * This function does the following:
194 * - Check that the virt addr is mapped
195 * - Unmap the virt addr and frees pgts if possible
196 * - Returns 0 on success, -EINVAL if the given addr is not mapped
197 *
198 * Because this function changes the page tables in the device and because it
199 * changes the MMU hash, it must be protected by a lock.
200 * However, because it maps only a single page, the lock should be implemented
201 * in a higher level in order to protect the entire mapping of the memory area
202 *
203 * For optimization reasons PCI flush may be requested once after unmapping of
204 * large area.
205 */
206 int hl_mmu_unmap_page(struct hl_ctx *ctx, u64 virt_addr, u32 page_size, bool flush_pte)
207 {
208 struct hl_device *hdev = ctx->hdev;
> 209 struct asic_fixed_properties *prop;
210 struct hl_mmu_properties *mmu_prop;
211 struct hl_mmu_funcs *mmu_funcs;
212 int i, pgt_residency, rc = 0;
213 u32 real_page_size, npages;
214 u64 real_virt_addr;
215 bool is_dram_addr;
216
217 if (!hdev->mmu_enable)
218 return 0;
219
220 prop = &hdev->asic_prop;
221 is_dram_addr = hl_is_dram_va(hdev, virt_addr);
222 mmu_prop = hl_mmu_get_prop(hdev, page_size, is_dram_addr);
223
224 pgt_residency = mmu_prop->host_resident ? MMU_HR_PGT : MMU_DR_PGT;
225 mmu_funcs = hl_mmu_get_funcs(hdev, pgt_residency, is_dram_addr);
226
227 rc = hdev->asic_funcs->mmu_get_real_page_size(hdev, mmu_prop, page_size, &real_page_size,
228 is_dram_addr);
229 if (rc)
230 return rc;
231
232 npages = page_size / real_page_size;
233 real_virt_addr = virt_addr;
234
235 for (i = 0 ; i < npages ; i++) {
236 rc = mmu_funcs->unmap(ctx, real_virt_addr, is_dram_addr);
237 if (rc)
238 break;
239
240 real_virt_addr += real_page_size;
241 }
242
243 if (flush_pte)
244 mmu_funcs->flush(ctx);
245
246 return rc;
247 }
248
---
0-DAY CI Kernel Test Service
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
next prev parent reply other threads:[~2022-03-16 22:34 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-16 11:41 [PATCH 01/11] habanalabs: set non-0 value in dram default page size Oded Gabbay
2022-03-16 11:41 ` [PATCH 02/11] habanalabs: add DRAM default page size to HW info Oded Gabbay
2022-03-16 11:41 ` [PATCH 03/11] habanalabs: change mmu_get_real_page_size to be ASIC-specific Oded Gabbay
2022-03-16 22:33 ` kernel test robot [this message]
2022-03-16 11:41 ` [PATCH 04/11] habanalabs: convert all MMU masks/shifts to arrays Oded Gabbay
2022-03-16 11:41 ` [PATCH 05/11] habanalabs: add user API to get valid DRAM page sizes Oded Gabbay
2022-03-16 19:37 ` kernel test robot
2022-03-16 11:41 ` [PATCH 06/11] habanalabs: add new return code to device fd open Oded Gabbay
2022-03-16 11:41 ` [PATCH 07/11] habanalabs: expose compute ctx status through info ioctl Oded Gabbay
2022-03-16 11:41 ` [PATCH 08/11] habanalabs/gaudi: increase submission resources Oded Gabbay
2022-03-16 11:41 ` [PATCH 09/11] habanalabs/gaudi: avoid resetting max power in hard reset Oded Gabbay
2022-03-16 11:41 ` [PATCH 10/11] habanalabs: parse full firmware versions Oded Gabbay
2022-03-16 11:41 ` [PATCH 11/11] habanalabs: modify dma_mask to be ASIC specific property Oded Gabbay
-- strict thread matches above, loose matches on Subject: below --
2022-03-17 7:00 [PATCH 03/11] habanalabs: change mmu_get_real_page_size to be ASIC-specific kernel test robot
2022-03-20 15:31 ` kernel test robot
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=202203170651.S8azQIor-lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild-all@lists.01.org \
--cc=llvm@lists.linux.dev \
--cc=ogabbay@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 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.