Re: [PATCH v6 2/2] mmc: Add mmc driver for Sunplus SP7021

From: kernel test robot
Date: Wed Apr 06 2022 - 12:38:29 EST


Hi Tony,

I love your patch! Perhaps something to improve:

[auto build test WARNING on ulf-hansson-mmc-mirror/next]
[cannot apply to robh/for-next linus/master v5.18-rc1 next-20220406]
[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/intel-lab-lkp/linux/commits/Tony-Huang/Add-mmc-driver-for-Sunplus-SP7021-SOC/20220406-194106
base: https://git.linaro.org/people/ulf.hansson/mmc-mirror.git next
config: arc-allyesconfig (https://download.01.org/0day-ci/archive/20220406/202204062111.QhaaiQEq-lkp@xxxxxxxxx/config)
compiler: arceb-elf-gcc (GCC) 11.2.0
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/intel-lab-lkp/linux/commit/325a0d9ca9d65f5616f794e0dbb04256312f739d
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Tony-Huang/Add-mmc-driver-for-Sunplus-SP7021-SOC/20220406-194106
git checkout 325a0d9ca9d65f5616f794e0dbb04256312f739d
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arc SHELL=/bin/bash drivers/mmc/host/

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

All warnings (new ones prefixed by >>):

drivers/mmc/host/sunplus-mmc.c: In function 'spmmc_set_bus_timing':
>> drivers/mmc/host/sunplus-mmc.c:311:15: warning: variable 'timing_name' set but not used [-Wunused-but-set-variable]
311 | char *timing_name;
| ^~~~~~~~~~~
drivers/mmc/host/sunplus-mmc.c: At top level:
>> drivers/mmc/host/sunplus-mmc.c:798:13: warning: no previous prototype for 'spmmc_irq' [-Wmissing-prototypes]
798 | irqreturn_t spmmc_irq(int irq, void *dev_id)
| ^~~~~~~~~
>> drivers/mmc/host/sunplus-mmc.c:894:5: warning: no previous prototype for 'spmmc_get_cd' [-Wmissing-prototypes]
894 | int spmmc_get_cd(struct mmc_host *mmc)
| ^~~~~~~~~~~~
drivers/mmc/host/sunplus-mmc.c: In function 'spmmc_drv_probe':
>> drivers/mmc/host/sunplus-mmc.c:1021:22: warning: variable 'mode' set but not used [-Wunused-but-set-variable]
1021 | unsigned int mode;
| ^~~~
drivers/mmc/host/sunplus-mmc.c: At top level:
drivers/mmc/host/sunplus-mmc.c:1170:9: error: implicit declaration of function 'SYSTEM_SLEEP_PM_OPS'; did you mean 'SET_SYSTEM_SLEEP_PM_OPS'? [-Werror=implicit-function-declaration]
1170 | SYSTEM_SLEEP_PM_OPS(spmmc_pm_suspend, spmmc_pm_resume)
| ^~~~~~~~~~~~~~~~~~~
| SET_SYSTEM_SLEEP_PM_OPS
>> drivers/mmc/host/sunplus-mmc.c:1170:9: warning: initialization of 'int (*)(struct device *)' from 'int' makes pointer from integer without a cast [-Wint-conversion]
drivers/mmc/host/sunplus-mmc.c:1170:9: note: (near initialization for 'spmmc_pm_ops.prepare')
drivers/mmc/host/sunplus-mmc.c:1170:9: error: initializer element is not constant
drivers/mmc/host/sunplus-mmc.c:1170:9: note: (near initialization for 'spmmc_pm_ops.prepare')
drivers/mmc/host/sunplus-mmc.c:1171:9: error: expected '}' before 'RUNTIME_PM_OPS'
1171 | RUNTIME_PM_OPS(spmmc_pm_runtime_suspend, spmmc_pm_runtime_resume, NULL)
| ^~~~~~~~~~~~~~
drivers/mmc/host/sunplus-mmc.c:1169:47: note: to match this '{'
1169 | static const struct dev_pm_ops spmmc_pm_ops = {
| ^
drivers/mmc/host/sunplus-mmc.c:1160:12: warning: 'spmmc_pm_runtime_resume' defined but not used [-Wunused-function]
1160 | static int spmmc_pm_runtime_resume(struct device *dev)
| ^~~~~~~~~~~~~~~~~~~~~~~
drivers/mmc/host/sunplus-mmc.c:1150:12: warning: 'spmmc_pm_runtime_suspend' defined but not used [-Wunused-function]
1150 | static int spmmc_pm_runtime_suspend(struct device *dev)
| ^~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors


vim +/timing_name +311 drivers/mmc/host/sunplus-mmc.c

304
305 static void spmmc_set_bus_timing(struct spmmc_host *host, unsigned int timing)
306 {
307 u32 value = readl(host->base + SPMMC_SD_CONFIG1_REG);
308 int clkdiv = FIELD_GET(SPMMC_CLOCK_DIVISION, readl(host->base + SPMMC_SD_CONFIG0_REG));
309 int delay = clkdiv / 2 < 7 ? clkdiv / 2 : 7;
310 int hs_en = 1;
> 311 char *timing_name;
312
313 host->ddr_enabled = 0;
314 switch (timing) {
315 case MMC_TIMING_LEGACY:
316 hs_en = 0;
317 timing_name = "legacy";
318 break;
319 case MMC_TIMING_MMC_HS:
320 timing_name = "mmc high-speed";
321 break;
322 case MMC_TIMING_SD_HS:
323 timing_name = "sd high-speed";
324 break;
325 case MMC_TIMING_UHS_SDR50:
326 timing_name = "sd uhs SDR50";
327 break;
328 case MMC_TIMING_UHS_SDR104:
329 timing_name = "sd uhs SDR104";
330 break;
331 case MMC_TIMING_UHS_DDR50:
332 host->ddr_enabled = 1;
333 timing_name = "sd uhs DDR50";
334 break;
335 case MMC_TIMING_MMC_DDR52:
336 host->ddr_enabled = 1;
337 timing_name = "mmc DDR52";
338 break;
339 case MMC_TIMING_MMC_HS200:
340 timing_name = "mmc HS200";
341 break;
342 default:
343 timing_name = "invalid";
344 hs_en = 0;
345 break;
346 }
347
348 if (hs_en) {
349 value |= SPMMC_SD_HIGH_SPEED_EN; /* sd_high_speed_en */
350 writel(value, host->base + SPMMC_SD_CONFIG1_REG);
351 value = readl(host->base + SPMMC_SD_TIMING_CONFIG0_REG);
352 value |= FIELD_PREP(SPMMC_SD_WRITE_DATA_DELAY, delay); /* sd_wr_dat_dly_sel */
353 value |= FIELD_PREP(SPMMC_SD_WRITE_COMMAND_DELAY, delay); /* sd_wr_cmd_dly_sel */
354 writel(value, host->base + SPMMC_SD_TIMING_CONFIG0_REG);
355 } else {
356 value &= ~SPMMC_SD_HIGH_SPEED_EN;
357 writel(value, host->base + SPMMC_SD_CONFIG1_REG);
358 }
359 if (host->ddr_enabled) {
360 value = readl(host->base + SPMMC_SD_CONFIG0_REG);
361 value |= SPMMC_SD_DDR_MODE; /* sdddrmode */
362 writel(value, host->base + SPMMC_SD_CONFIG0_REG);
363 } else {
364 value = readl(host->base + SPMMC_SD_CONFIG0_REG);
365 value &= ~SPMMC_SD_DDR_MODE;
366 writel(value, host->base + SPMMC_SD_CONFIG0_REG);
367 }
368 }
369

--
0-DAY CI Kernel Test Service
https://01.org/lkp