LoongArch architecture development
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: YingKun Meng <mengyingkun@loongson.cn>,
	lgirdwood@gmail.com, broonie@kernel.org
Cc: oe-kbuild-all@lists.linux.dev, alsa-devel@alsa-project.org,
	loongarch@lists.linux.dev, loongson-kernel@lists.loongnix.cn,
	Yingkun Meng <mengyingkun@loongson.cn>
Subject: Re: [PATCH 1/3] ASoC: Add support for Loongson I2S controller
Date: Tue, 6 Jun 2023 02:35:29 +0800	[thread overview]
Message-ID: <202306060223.9hdivLrx-lkp@intel.com> (raw)
In-Reply-To: <20230605120934.2306548-1-mengyingkun@loongson.cn>

Hi YingKun,

kernel test robot noticed the following build errors:

[auto build test ERROR on 1fbcc5ab1c7a172ef1159b154c296fe1e9ce209b]

url:    https://github.com/intel-lab-lkp/linux/commits/YingKun-Meng/ASoC-loongson-Add-Loongson-Generic-ASoC-Sound-Card-Support/20230605-215940
base:   1fbcc5ab1c7a172ef1159b154c296fe1e9ce209b
patch link:    https://lore.kernel.org/r/20230605120934.2306548-1-mengyingkun%40loongson.cn
patch subject: [PATCH 1/3] ASoC: Add support for Loongson I2S controller
config: powerpc-allmodconfig (https://download.01.org/0day-ci/archive/20230606/202306060223.9hdivLrx-lkp@intel.com/config)
compiler: powerpc-linux-gcc (GCC) 12.3.0
reproduce (this is a W=1 build):
        mkdir -p ~/bin
        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/cb79a1df70a849f772428740eb3c155da83de25b
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review YingKun-Meng/ASoC-loongson-Add-Loongson-Generic-ASoC-Sound-Card-Support/20230605-215940
        git checkout cb79a1df70a849f772428740eb3c155da83de25b
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.3.0 ~/bin/make.cross W=1 O=build_dir ARCH=powerpc olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.3.0 ~/bin/make.cross W=1 O=build_dir ARCH=powerpc SHELL=/bin/bash sound/soc/loongson/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202306060223.9hdivLrx-lkp@intel.com/

All error/warnings (new ones prefixed by >>):

   sound/soc/loongson/loongson_i2s_pci.c: In function 'dma_desc_save':
>> sound/soc/loongson/loongson_i2s_pci.c:82:17: error: implicit declaration of function 'readq'; did you mean 'readl'? [-Werror=implicit-function-declaration]
      82 |         val |= (readq(order_reg) & DMA_ORDER_CTRL_MASK);
         |                 ^~~~~
         |                 readl
>> sound/soc/loongson/loongson_i2s_pci.c:84:9: error: implicit declaration of function 'writeq'; did you mean 'writel'? [-Werror=implicit-function-declaration]
      84 |         writeq(val, order_reg);
         |         ^~~~~~
         |         writel
   sound/soc/loongson/loongson_i2s_pci.c: In function 'loongson_pcm_hw_params':
>> sound/soc/loongson/loongson_i2s_pci.c:171:45: warning: right shift count >= width of type [-Wshift-count-overflow]
     171 |                 desc->order_hi = order_addr >> 32;
         |                                             ^~
   sound/soc/loongson/loongson_i2s_pci.c:174:43: warning: right shift count >= width of type [-Wshift-count-overflow]
     174 |                 desc->saddr_hi = mem_addr >> 32;
         |                                           ^~
   sound/soc/loongson/loongson_i2s_pci.c:190:57: warning: right shift count >= width of type [-Wshift-count-overflow]
     190 |                 desc->order_hi = prtd->dma_desc_arr_phy >> 32;
         |                                                         ^~
   sound/soc/loongson/loongson_i2s_pci.c: In function 'loongson_i2s_pci_probe':
>> sound/soc/loongson/loongson_i2s_pci.c:397:29: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
     397 |         tx_data->dev_addr = (u64)i2s->reg_base + LS_I2S_TX_DATA;
         |                             ^
   sound/soc/loongson/loongson_i2s_pci.c:400:29: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
     400 |         rx_data->dev_addr = (u64)i2s->reg_base + LS_I2S_RX_DATA;
         |                             ^
   cc1: some warnings being treated as errors


vim +82 sound/soc/loongson/loongson_i2s_pci.c

    74	
    75	static struct
    76	loongson_dma_desc *dma_desc_save(struct loongson_runtime_data *prtd)
    77	{
    78		void __iomem *order_reg = prtd->dma_data->order_addr;
    79		u64 val;
    80	
    81		val = (u64)prtd->dma_pos_desc_phy & DMA_ORDER_ASK_MASK;
  > 82		val |= (readq(order_reg) & DMA_ORDER_CTRL_MASK);
    83		val |= DMA_ORDER_ASK_VALID;
  > 84		writeq(val, order_reg);
    85	
    86		while (readl(order_reg) & DMA_ORDER_ASK_VALID)
    87			udelay(2);
    88	
    89		return prtd->dma_pos_desc;
    90	}
    91	
    92	static int loongson_pcm_trigger(struct snd_soc_component *component,
    93					struct snd_pcm_substream *substream, int cmd)
    94	{
    95		struct loongson_runtime_data *prtd = substream->runtime->private_data;
    96		struct device *dev = substream->pcm->card->dev;
    97		void __iomem *order_reg = prtd->dma_data->order_addr;
    98		u64 val;
    99		int ret = 0;
   100	
   101		switch (cmd) {
   102		case SNDRV_PCM_TRIGGER_START:
   103		case SNDRV_PCM_TRIGGER_RESUME:
   104		case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
   105			val = prtd->dma_pos_desc_phy & DMA_ORDER_ASK_MASK;
   106			if (dev->coherent_dma_mask == DMA_BIT_MASK(64))
   107				val |= DMA_ORDER_ADDR_64;
   108			else
   109				val &= ~DMA_ORDER_ADDR_64;
   110			val |= (readq(order_reg) & DMA_ORDER_CTRL_MASK);
   111			val |= DMA_ORDER_START;
   112			writeq(val, order_reg);
   113	
   114			while ((readl(order_reg) & DMA_ORDER_START))
   115				udelay(2);
   116			break;
   117		case SNDRV_PCM_TRIGGER_STOP:
   118		case SNDRV_PCM_TRIGGER_SUSPEND:
   119		case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
   120			dma_desc_save(prtd);
   121	
   122			/* dma stop */
   123			val = readq(order_reg) | DMA_ORDER_STOP;
   124			writeq(val, order_reg);
   125			udelay(1000);
   126	
   127			break;
   128		default:
   129			ret = -EINVAL;
   130		}
   131	
   132		return ret;
   133	}
   134	
   135	static int loongson_pcm_hw_params(struct snd_soc_component *component,
   136					  struct snd_pcm_substream *substream,
   137					  struct snd_pcm_hw_params *params)
   138	{
   139		struct snd_pcm_runtime *runtime = substream->runtime;
   140		struct loongson_runtime_data *prtd = runtime->private_data;
   141		size_t buf_len = params_buffer_bytes(params);
   142		size_t period_len = params_period_bytes(params);
   143		dma_addr_t order_addr, mem_addr;
   144		struct loongson_dma_desc *desc;
   145		u32 num_periods;
   146		int i;
   147	
   148		if (buf_len % period_len) {
   149			pr_err("buf len not multiply of period len\n");
   150			return -EINVAL;
   151		}
   152	
   153		num_periods = buf_len / period_len;
   154		if (!num_periods) {
   155			pr_err("dma data too small\n");
   156			return -EINVAL;
   157		}
   158	
   159		snd_pcm_set_runtime_buffer(substream, &substream->dma_buffer);
   160		runtime->dma_bytes = buf_len;
   161	
   162		/* initialize dma descriptor array */
   163		mem_addr = runtime->dma_addr;
   164		order_addr = prtd->dma_desc_arr_phy;
   165		for (i = 0; i < num_periods; i++) {
   166			desc = &prtd->dma_desc_arr[i];
   167	
   168			/* next descriptor physical address */
   169			order_addr += sizeof(*desc);
   170			desc->order = order_addr | BIT(0);
 > 171			desc->order_hi = order_addr >> 32;
   172	
   173			desc->saddr = mem_addr;
   174			desc->saddr_hi = mem_addr >> 32;
   175			desc->daddr = prtd->dma_data->dev_addr;
   176	
   177			desc->cmd = BIT(0);
   178			if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
   179				desc->cmd |= BIT(12);
   180	
   181			desc->length = period_len >> 2;
   182			desc->step_length = 0;
   183			desc->step_times = 1;
   184	
   185			mem_addr += period_len;
   186		}
   187		if (num_periods > 0) {
   188			desc = &prtd->dma_desc_arr[num_periods - 1];
   189			desc->order = prtd->dma_desc_arr_phy | BIT(0);
   190			desc->order_hi = prtd->dma_desc_arr_phy >> 32;
   191		}
   192	
   193		/* init position descriptor */
   194		*prtd->dma_pos_desc = *prtd->dma_desc_arr;
   195	
   196		return 0;
   197	}
   198	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

  parent reply	other threads:[~2023-06-05 18:36 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-05 12:09 [PATCH 1/3] ASoC: Add support for Loongson I2S controller YingKun Meng
2023-06-05 12:09 ` [PATCH 2/3] ASoC: loongson: Add Loongson Generic ASoC Sound Card Support YingKun Meng
2023-06-05 12:47   ` Mark Brown
2023-06-09  3:57     ` YingKun Meng
2023-06-05 12:09 ` [PATCH 3/3] ASoC: dt-bindings: Add support for Loongson audio card YingKun Meng
2023-06-05 14:45   ` Krzysztof Kozlowski
2023-06-05 15:06     ` Mark Brown
2023-06-12  2:38       ` Yingkun Meng
2023-06-12  2:30     ` Yingkun Meng
2023-06-05 13:17 ` [PATCH 1/3] ASoC: Add support for Loongson I2S controller Mark Brown
2023-06-12  1:44   ` Yingkun Meng
2023-06-05 18:35 ` kernel test robot [this message]
2023-06-05 19:50 ` 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=202306060223.9hdivLrx-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=loongarch@lists.linux.dev \
    --cc=loongson-kernel@lists.loongnix.cn \
    --cc=mengyingkun@loongson.cn \
    --cc=oe-kbuild-all@lists.linux.dev \
    /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