Re: [PATCH v2 3/8] partitions: Introduce NVIDIA Tegra Partition Table

From: kbuild test robot
Date: Sun Mar 08 2020 - 19:31:14 EST


Hi Dmitry,

I love your patch! Yet something to improve:

[auto build test ERROR on tegra/for-next]
[also build test ERROR on block/for-next linus/master v5.6-rc4 next-20200306]
[cannot apply to ulf.hansson-mmc/next]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url: https://github.com/0day-ci/linux/commits/Dmitry-Osipenko/Introduce-NVIDIA-Tegra-Partition-Tablex/20200306-124106
base: https://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux.git for-next
config: arm64-randconfig-a001-20200308 (attached as .config)
compiler: aarch64-linux-gcc (GCC) 7.5.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
GCC_VERSION=7.5.0 make.cross ARCH=arm64

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>):

block/partitions/tegra.o: In function `tegra_partition_table_emmc_boot_offset':
>> block/partitions/tegra.c:370: undefined reference to `mmc_bdev_to_card'
block/partitions/tegra.c:370:(.text+0x66c): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `mmc_bdev_to_card'
>> block/partitions/tegra.c:379: undefined reference to `mmc_card_is_blockaddr'
block/partitions/tegra.c:379:(.text+0x69c): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `mmc_card_is_blockaddr'

vim +370 block/partitions/tegra.c

366
367 static int
368 tegra_partition_table_emmc_boot_offset(struct tegra_partition_table_parser *ptp)
369 {
> 370 struct mmc_card *card = mmc_bdev_to_card(ptp->state->bdev);
371 const struct of_device_id *matched;
372 const u32 *sdhci_bases;
373 u32 sdhci_base;
374 unsigned int i;
375 int err;
376
377 /* filter out unexpected/untested boot sources */
378 if (!card || card->ext_csd.rev < 3 ||
> 379 !mmc_card_is_blockaddr(card) ||
380 mmc_card_is_removable(card->host))
381 return -1;
382
383 /* skip everything unrelated to Tegra eMMC */
384 matched = of_match_node(tegra_sdhci_match, card->host->parent->of_node);
385 if (!matched)
386 return -1;
387
388 sdhci_bases = matched->data;
389
390 /* figure out SDHCI instance ID by the base address */
391 err = of_property_read_u32_index(card->host->parent->of_node,
392 "reg", 0, &sdhci_base);
393 if (err)
394 return -1;
395
396 for (i = 0; i < TEGRA_PT_SDHCI_DEVICE_INSTANCES; i++) {
397 if (sdhci_base == sdhci_bases[i])
398 break;
399 }
400
401 if (i == TEGRA_PT_SDHCI_DEVICE_INSTANCES)
402 return -1;
403
404 ptp->dev_id = TEGRA_PT_SDHCI_DEVICE_ID;
405 ptp->dev_instance = i;
406
407 /*
408 * eMMC storage has two special boot partitions in addition to the
409 * main one. NVIDIA's bootloader linearizes eMMC boot0->boot1->main
410 * accesses, this means that the partition table addresses are shifted
411 * by the size of boot partitions. In accordance with the eMMC
412 * specification, the boot partition size is calculated as follows:
413 *
414 * boot partition size = 128K byte x BOOT_SIZE_MULT
415 *
416 * This function returns number of sectors occupied by the both boot
417 * partitions.
418 */
419 return card->ext_csd.raw_boot_mult * SZ_128K /
420 SECTOR_SIZE * MMC_NUM_BOOT_PARTITION;
421 }
422

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip