* [linux-next:master 3006/13554] sound/soc/fsl/fsl_easrc.c:1204:17: warning: variable 'dev' set but not used
@ 2020-05-29 6:11 kbuild test robot
0 siblings, 0 replies; only message in thread
From: kbuild test robot @ 2020-05-29 6:11 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 13932 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: ff387fc20c697cdc887b2abf7ef494e853795a2f
commit: 955ac624058f91172b3b8820280556e699e1e0ff [3006/13554] ASoC: fsl_easrc: Add EASRC ASoC CPU DAI drivers
config: nds32-allmodconfig (attached as .config)
compiler: nds32le-linux-gcc (GCC) 9.3.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
git checkout 955ac624058f91172b3b8820280556e699e1e0ff
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=nds32
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>
All warnings (new ones prefixed by >>, old ones prefixed by <<):
In file included from ./arch/nds32/include/generated/asm/bug.h:1,
from include/linux/bug.h:5,
from include/linux/debug_locks.h:7,
from include/linux/mutex.h:21,
from include/linux/notifier.h:14,
from include/linux/clk.h:14,
from sound/soc/fsl/fsl_easrc.c:5:
include/linux/dma-mapping.h: In function 'dma_map_resource':
arch/nds32/include/asm/memory.h:82:32: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
82 | #define pfn_valid(pfn) ((pfn) >= PHYS_PFN_OFFSET && (pfn) < (PHYS_PFN_OFFSET + max_mapnr))
| ^~
include/asm-generic/bug.h:139:27: note: in definition of macro 'WARN_ON_ONCE'
139 | int __ret_warn_once = !!(condition); | ^~~~~~~~~
include/linux/dma-mapping.h:352:19: note: in expansion of macro 'pfn_valid'
352 | if (WARN_ON_ONCE(pfn_valid(PHYS_PFN(phys_addr))))
| ^~~~~~~~~
sound/soc/fsl/fsl_easrc.c: In function 'fsl_easrc_set_rs_ratio':
sound/soc/fsl/fsl_easrc.c:182:15: warning: variable 'int_bits' set but not used [-Wunused-but-set-variable]
182 | unsigned int int_bits;
| ^~~~~~~~
sound/soc/fsl/fsl_easrc.c: At top level:
sound/soc/fsl/fsl_easrc.c:967:5: warning: no previous prototype for 'fsl_easrc_config_context' [-Wmissing-prototypes]
967 | int fsl_easrc_config_context(struct fsl_asrc *easrc, unsigned int ctx_id)
| ^~~~~~~~~~~~~~~~~~~~~~~~
sound/soc/fsl/fsl_easrc.c:1128:5: warning: no previous prototype for 'fsl_easrc_set_ctx_format' [-Wmissing-prototypes]
1128 | int fsl_easrc_set_ctx_format(struct fsl_asrc_pair *ctx,
| ^~~~~~~~~~~~~~~~~~~~~~~~
sound/soc/fsl/fsl_easrc.c:1201:5: warning: no previous prototype for 'fsl_easrc_set_ctx_organziation' [-Wmissing-prototypes]
1201 | int fsl_easrc_set_ctx_organziation(struct fsl_asrc_pair *ctx)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sound/soc/fsl/fsl_easrc.c: In function 'fsl_easrc_set_ctx_organziation':
>> sound/soc/fsl/fsl_easrc.c:1204:17: warning: variable 'dev' set but not used [-Wunused-but-set-variable]
1204 | struct device *dev;
| ^~~
sound/soc/fsl/fsl_easrc.c: At top level:
sound/soc/fsl/fsl_easrc.c:1245:5: warning: no previous prototype for 'fsl_easrc_request_context' [-Wmissing-prototypes]
1245 | int fsl_easrc_request_context(int channels, struct fsl_asrc_pair *ctx)
| ^~~~~~~~~~~~~~~~~~~~~~~~~
sound/soc/fsl/fsl_easrc.c:1290:6: warning: no previous prototype for 'fsl_easrc_release_context' [-Wmissing-prototypes]
1290 | void fsl_easrc_release_context(struct fsl_asrc_pair *ctx)
| ^~~~~~~~~~~~~~~~~~~~~~~~~
sound/soc/fsl/fsl_easrc.c: In function 'fsl_easrc_release_context':
sound/soc/fsl/fsl_easrc.c:1294:17: warning: variable 'dev' set but not used [-Wunused-but-set-variable]
1294 | struct device *dev;
| ^~~
sound/soc/fsl/fsl_easrc.c: At top level:
sound/soc/fsl/fsl_easrc.c:1317:5: warning: no previous prototype for 'fsl_easrc_start_context' [-Wmissing-prototypes]
1317 | int fsl_easrc_start_context(struct fsl_asrc_pair *ctx)
| ^~~~~~~~~~~~~~~~~~~~~~~
>> sound/soc/fsl/fsl_easrc.c:1335:5: warning: no previous prototype for 'fsl_easrc_stop_context' [-Wmissing-prototypes]
1335 | int fsl_easrc_stop_context(struct fsl_asrc_pair *ctx)
| ^~~~~~~~~~~~~~~~~~~~~~
sound/soc/fsl/fsl_easrc.c:1382:18: warning: no previous prototype for 'fsl_easrc_get_dma_channel' [-Wmissing-prototypes]
1382 | struct dma_chan *fsl_easrc_get_dma_channel(struct fsl_asrc_pair *ctx,
| ^~~~~~~~~~~~~~~~~~~~~~~~~
vim +/dev +1204 sound/soc/fsl/fsl_easrc.c
1127
> 1128 int fsl_easrc_set_ctx_format(struct fsl_asrc_pair *ctx,
1129 snd_pcm_format_t *in_raw_format,
1130 snd_pcm_format_t *out_raw_format)
1131 {
1132 struct fsl_asrc *easrc = ctx->asrc;
1133 struct fsl_easrc_ctx_priv *ctx_priv = ctx->private;
1134 struct fsl_easrc_data_fmt *in_fmt = &ctx_priv->in_params.fmt;
1135 struct fsl_easrc_data_fmt *out_fmt = &ctx_priv->out_params.fmt;
1136 int ret;
1137
1138 /* Get the bitfield values for input data format */
1139 if (in_raw_format && out_raw_format) {
1140 ret = fsl_easrc_process_format(ctx, in_fmt, *in_raw_format);
1141 if (ret)
1142 return ret;
1143 }
1144
1145 regmap_update_bits(easrc->regmap, REG_EASRC_CC(ctx->index),
1146 EASRC_CC_BPS_MASK,
1147 EASRC_CC_BPS(in_fmt->width));
1148 regmap_update_bits(easrc->regmap, REG_EASRC_CC(ctx->index),
1149 EASRC_CC_ENDIANNESS_MASK,
1150 in_fmt->endianness << EASRC_CC_ENDIANNESS_SHIFT);
1151 regmap_update_bits(easrc->regmap, REG_EASRC_CC(ctx->index),
1152 EASRC_CC_FMT_MASK,
1153 in_fmt->floating_point << EASRC_CC_FMT_SHIFT);
1154 regmap_update_bits(easrc->regmap, REG_EASRC_CC(ctx->index),
1155 EASRC_CC_INSIGN_MASK,
1156 in_fmt->unsign << EASRC_CC_INSIGN_SHIFT);
1157
1158 /* In Sample Position */
1159 regmap_update_bits(easrc->regmap, REG_EASRC_CC(ctx->index),
1160 EASRC_CC_SAMPLE_POS_MASK,
1161 EASRC_CC_SAMPLE_POS(in_fmt->sample_pos));
1162
1163 /* Get the bitfield values for input data format */
1164 if (in_raw_format && out_raw_format) {
1165 ret = fsl_easrc_process_format(ctx, out_fmt, *out_raw_format);
1166 if (ret)
1167 return ret;
1168 }
1169
1170 regmap_update_bits(easrc->regmap, REG_EASRC_COC(ctx->index),
1171 EASRC_COC_BPS_MASK,
1172 EASRC_COC_BPS(out_fmt->width));
1173 regmap_update_bits(easrc->regmap, REG_EASRC_COC(ctx->index),
1174 EASRC_COC_ENDIANNESS_MASK,
1175 out_fmt->endianness << EASRC_COC_ENDIANNESS_SHIFT);
1176 regmap_update_bits(easrc->regmap, REG_EASRC_COC(ctx->index),
1177 EASRC_COC_FMT_MASK,
1178 out_fmt->floating_point << EASRC_COC_FMT_SHIFT);
1179 regmap_update_bits(easrc->regmap, REG_EASRC_COC(ctx->index),
1180 EASRC_COC_OUTSIGN_MASK,
1181 out_fmt->unsign << EASRC_COC_OUTSIGN_SHIFT);
1182
1183 /* Out Sample Position */
1184 regmap_update_bits(easrc->regmap, REG_EASRC_COC(ctx->index),
1185 EASRC_COC_SAMPLE_POS_MASK,
1186 EASRC_COC_SAMPLE_POS(out_fmt->sample_pos));
1187
1188 regmap_update_bits(easrc->regmap, REG_EASRC_COC(ctx->index),
1189 EASRC_COC_IEC_EN_MASK,
1190 out_fmt->iec958 << EASRC_COC_IEC_EN_SHIFT);
1191
1192 return ret;
1193 }
1194
1195 /*
1196 * The ASRC provides interleaving support in hardware to ensure that a
1197 * variety of sample sources can be internally combined
1198 * to conform with this format. Interleaving parameters are accessed
1199 * through the ASRC_CTRL_IN_ACCESSa and ASRC_CTRL_OUT_ACCESSa registers
1200 */
1201 int fsl_easrc_set_ctx_organziation(struct fsl_asrc_pair *ctx)
1202 {
1203 struct fsl_easrc_ctx_priv *ctx_priv;
> 1204 struct device *dev;
1205 struct fsl_asrc *easrc;
1206
1207 if (!ctx)
1208 return -ENODEV;
1209
1210 easrc = ctx->asrc;
1211 ctx_priv = ctx->private;
1212 dev = &easrc->pdev->dev;
1213
1214 /* input interleaving parameters */
1215 regmap_update_bits(easrc->regmap, REG_EASRC_CIA(ctx->index),
1216 EASRC_CIA_ITER_MASK,
1217 EASRC_CIA_ITER(ctx_priv->in_params.iterations));
1218 regmap_update_bits(easrc->regmap, REG_EASRC_CIA(ctx->index),
1219 EASRC_CIA_GRLEN_MASK,
1220 EASRC_CIA_GRLEN(ctx_priv->in_params.group_len));
1221 regmap_update_bits(easrc->regmap, REG_EASRC_CIA(ctx->index),
1222 EASRC_CIA_ACCLEN_MASK,
1223 EASRC_CIA_ACCLEN(ctx_priv->in_params.access_len));
1224
1225 /* output interleaving parameters */
1226 regmap_update_bits(easrc->regmap, REG_EASRC_COA(ctx->index),
1227 EASRC_COA_ITER_MASK,
1228 EASRC_COA_ITER(ctx_priv->out_params.iterations));
1229 regmap_update_bits(easrc->regmap, REG_EASRC_COA(ctx->index),
1230 EASRC_COA_GRLEN_MASK,
1231 EASRC_COA_GRLEN(ctx_priv->out_params.group_len));
1232 regmap_update_bits(easrc->regmap, REG_EASRC_COA(ctx->index),
1233 EASRC_COA_ACCLEN_MASK,
1234 EASRC_COA_ACCLEN(ctx_priv->out_params.access_len));
1235
1236 return 0;
1237 }
1238
1239 /*
1240 * Request one of the available contexts
1241 *
1242 * Returns a negative number on error and >=0 as context id
1243 * on success
1244 */
1245 int fsl_easrc_request_context(int channels, struct fsl_asrc_pair *ctx)
1246 {
1247 enum asrc_pair_index index = ASRC_INVALID_PAIR;
1248 struct fsl_asrc *easrc = ctx->asrc;
1249 struct device *dev;
1250 unsigned long lock_flags;
1251 int ret = 0;
1252 int i;
1253
1254 dev = &easrc->pdev->dev;
1255
1256 spin_lock_irqsave(&easrc->lock, lock_flags);
1257
1258 for (i = ASRC_PAIR_A; i < EASRC_CTX_MAX_NUM; i++) {
1259 if (easrc->pair[i])
1260 continue;
1261
1262 index = i;
1263 break;
1264 }
1265
1266 if (index == ASRC_INVALID_PAIR) {
1267 dev_err(dev, "all contexts are busy\n");
1268 ret = -EBUSY;
1269 } else if (channels > easrc->channel_avail) {
1270 dev_err(dev, "can't give the required channels: %d\n",
1271 channels);
1272 ret = -EINVAL;
1273 } else {
1274 ctx->index = index;
1275 ctx->channels = channels;
1276 easrc->pair[index] = ctx;
1277 easrc->channel_avail -= channels;
1278 }
1279
1280 spin_unlock_irqrestore(&easrc->lock, lock_flags);
1281
1282 return ret;
1283 }
1284
1285 /*
1286 * Release the context
1287 *
1288 * This funciton is mainly doing the revert thing in request context
1289 */
1290 void fsl_easrc_release_context(struct fsl_asrc_pair *ctx)
1291 {
1292 unsigned long lock_flags;
1293 struct fsl_asrc *easrc;
> 1294 struct device *dev;
1295
1296 if (!ctx)
1297 return;
1298
1299 easrc = ctx->asrc;
1300 dev = &easrc->pdev->dev;
1301
1302 spin_lock_irqsave(&easrc->lock, lock_flags);
1303
1304 fsl_easrc_release_slot(easrc, ctx->index);
1305
1306 easrc->channel_avail += ctx->channels;
1307 easrc->pair[ctx->index] = NULL;
1308
1309 spin_unlock_irqrestore(&easrc->lock, lock_flags);
1310 }
1311
1312 /*
1313 * Start the context
1314 *
1315 * Enable the DMA request and context
1316 */
1317 int fsl_easrc_start_context(struct fsl_asrc_pair *ctx)
1318 {
1319 struct fsl_asrc *easrc = ctx->asrc;
1320
1321 regmap_update_bits(easrc->regmap, REG_EASRC_CC(ctx->index),
1322 EASRC_CC_FWMDE_MASK, EASRC_CC_FWMDE);
1323 regmap_update_bits(easrc->regmap, REG_EASRC_COC(ctx->index),
1324 EASRC_COC_FWMDE_MASK, EASRC_COC_FWMDE);
1325 regmap_update_bits(easrc->regmap, REG_EASRC_CC(ctx->index),
1326 EASRC_CC_EN_MASK, EASRC_CC_EN);
1327 return 0;
1328 }
1329
1330 /*
1331 * Stop the context
1332 *
1333 * Disable the DMA request and context
1334 */
> 1335 int fsl_easrc_stop_context(struct fsl_asrc_pair *ctx)
1336 {
1337 struct fsl_asrc *easrc = ctx->asrc;
1338 int val, i;
1339 int size = 0;
1340 int retry = 200;
1341
1342 regmap_read(easrc->regmap, REG_EASRC_CC(ctx->index), &val);
1343
1344 if (val & EASRC_CC_EN_MASK) {
1345 regmap_update_bits(easrc->regmap,
1346 REG_EASRC_CC(ctx->index),
1347 EASRC_CC_STOP_MASK, EASRC_CC_STOP);
1348 do {
1349 regmap_read(easrc->regmap, REG_EASRC_SFS(ctx->index), &val);
1350 val &= EASRC_SFS_NSGO_MASK;
1351 size = val >> EASRC_SFS_NSGO_SHIFT;
1352
1353 /* Read FIFO, drop the data */
1354 for (i = 0; i < size * ctx->channels; i++)
1355 regmap_read(easrc->regmap, REG_EASRC_RDFIFO(ctx->index), &val);
1356 /* Check RUN_STOP_DONE */
1357 regmap_read(easrc->regmap, REG_EASRC_IRQF, &val);
1358 if (val & EASRC_IRQF_RSD(1 << ctx->index)) {
1359 /*Clear RUN_STOP_DONE*/
1360 regmap_write_bits(easrc->regmap,
1361 REG_EASRC_IRQF,
1362 EASRC_IRQF_RSD(1 << ctx->index),
1363 EASRC_IRQF_RSD(1 << ctx->index));
1364 break;
1365 }
1366 udelay(100);
1367 } while (--retry);
1368
1369 if (retry == 0)
1370 dev_warn(&easrc->pdev->dev, "RUN STOP fail\n");
1371 }
1372
1373 regmap_update_bits(easrc->regmap, REG_EASRC_CC(ctx->index),
1374 EASRC_CC_EN_MASK | EASRC_CC_STOP_MASK, 0);
1375 regmap_update_bits(easrc->regmap, REG_EASRC_CC(ctx->index),
1376 EASRC_CC_FWMDE_MASK, 0);
1377 regmap_update_bits(easrc->regmap, REG_EASRC_COC(ctx->index),
1378 EASRC_COC_FWMDE_MASK, 0);
1379 return 0;
1380 }
1381
---
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: 55934 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-05-29 6:11 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-29 6:11 [linux-next:master 3006/13554] sound/soc/fsl/fsl_easrc.c:1204:17: warning: variable 'dev' set but not used kbuild test robot
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.