Re: [PATCH 2/2] spi: omap2-mcspi: Add support for MULTI-mode

From: kernel test robot
Date: Tue Feb 06 2024 - 20:55:39 EST


Hi Louis,

kernel test robot noticed the following build errors:

[auto build test ERROR on 41bccc98fb7931d63d03f326a746ac4d429c1dd3]

url: https://github.com/intel-lab-lkp/linux/commits/Louis-Chauvet/Revert-spi-spi-omap2-mcspi-c-Toggle-CS-after-each-word/20240206-180243
base: 41bccc98fb7931d63d03f326a746ac4d429c1dd3
patch link: https://lore.kernel.org/r/20240126-spi-omap2-mcspi-multi-mode-v1-2-d143d33f0fe0%40bootlin.com
patch subject: [PATCH 2/2] spi: omap2-mcspi: Add support for MULTI-mode
config: i386-buildonly-randconfig-003-20240207 (https://download.01.org/0day-ci/archive/20240207/202402070919.C08LpTkR-lkp@xxxxxxxxx/config)
compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240207/202402070919.C08LpTkR-lkp@xxxxxxxxx/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202402070919.C08LpTkR-lkp@xxxxxxxxx/

All errors (new ones prefixed by >>):

>> drivers/spi/spi-omap2-mcspi.c:1415:23: error: use of undeclared identifier 'master'
1415 | omap2_mcspi_set_mode(master);
| ^
1 error generated.


vim +/master +1415 drivers/spi/spi-omap2-mcspi.c

1379
1380 static int omap2_mcspi_prepare_message(struct spi_controller *ctlr,
1381 struct spi_message *msg)
1382 {
1383 struct omap2_mcspi *mcspi = spi_controller_get_devdata(ctlr);
1384 struct omap2_mcspi_regs *ctx = &mcspi->ctx;
1385 struct omap2_mcspi_cs *cs;
1386 struct spi_transfer *tr;
1387 u8 bits_per_word;
1388 u32 speed_hz;
1389
1390 /*
1391 * The conditions are strict, it is mandatory to check each transfer of the list to see if
1392 * multi-mode is applicable.
1393 */
1394 mcspi->use_multi_mode = true;
1395 list_for_each_entry(tr, &msg->transfers, transfer_list) {
1396 if (!tr->bits_per_word)
1397 bits_per_word = msg->spi->bits_per_word;
1398 else
1399 bits_per_word = tr->bits_per_word;
1400
1401 /* Check if the transfer content is only one word */
1402 if ((bits_per_word < 8 && tr->len > 1) ||
1403 (bits_per_word >= 8 && tr->len > bits_per_word / 8))
1404 mcspi->use_multi_mode = false;
1405
1406 /* Check if transfer asks to change the CS status after the transfer */
1407 if (!tr->cs_change)
1408 mcspi->use_multi_mode = false;
1409
1410 /* If at least one message is not compatible, switch back to single mode */
1411 if (!mcspi->use_multi_mode)
1412 break;
1413 }
1414
> 1415 omap2_mcspi_set_mode(master);
1416
1417 /* In single mode only a single channel can have the FORCE bit enabled
1418 * in its chconf0 register.
1419 * Scan all channels and disable them except the current one.
1420 * A FORCE can remain from a last transfer having cs_change enabled
1421 *
1422 * In multi mode all FORCE bits must be disabled.
1423 */
1424 list_for_each_entry(cs, &ctx->cs, node) {
1425 if (msg->spi->controller_state == cs && !mcspi->use_multi_mode) {
1426 continue;
1427 }
1428
1429 if ((cs->chconf0 & OMAP2_MCSPI_CHCONF_FORCE)) {
1430 cs->chconf0 &= ~OMAP2_MCSPI_CHCONF_FORCE;
1431 writel_relaxed(cs->chconf0,
1432 cs->base + OMAP2_MCSPI_CHCONF0);
1433 readl_relaxed(cs->base + OMAP2_MCSPI_CHCONF0);
1434 }
1435 }
1436
1437 return 0;
1438 }
1439

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