tree:
git://git.ti.com/ti-linux-kernel/ti-linux-kernel.git ti-rt-linux-5.4.y
head: 6bb5d2a07d482b75243678d310524b4939113e4b
commit: 93fac9fa368d4c49b62745b6f324d019fb42ecc4 [10032/13999] HACK: scripts:
headers_install: fix allmodconfig builds
config: m68k-randconfig-p002-20210216 (attached as .config)
compiler: m68k-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 remote add ti
git://git.ti.com/ti-linux-kernel/ti-linux-kernel.git
git fetch --no-tags ti ti-rt-linux-5.4.y
git checkout 93fac9fa368d4c49b62745b6f324d019fb42ecc4
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=m68k
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
In file included from arch/m68k/include/asm/page.h:49,
from arch/m68k/include/asm/thread_info.h:6,
from include/linux/thread_info.h:38,
from include/asm-generic/preempt.h:5,
from ./arch/m68k/include/generated/asm/preempt.h:1,
from include/linux/preempt.h:78,
from include/linux/spinlock.h:51,
from include/linux/seqlock.h:36,
from include/linux/time.h:6,
from include/linux/stat.h:19,
from include/linux/module.h:10,
from drivers/mtd/spi-nor/spi-nor.c:13:
drivers/mtd/spi-nor/spi-nor.c: In function 'spi_nor_spimem_xfer_data':
arch/m68k/include/asm/page_no.h:33:50: warning: ordered comparison of pointer with null
pointer [-Wextra]
33 | #define virt_addr_valid(kaddr) (((void *)(kaddr) >= (void *)PAGE_OFFSET)
&& \
| ^~
drivers/mtd/spi-nor/spi-nor.c:389:34: note: in expansion of macro
'virt_addr_valid'
389 | if (object_is_on_stack(buf) || !virt_addr_valid(buf))
| ^~~~~~~~~~~~~~~
drivers/mtd/spi-nor/spi-nor.c: In function 'spi_nor_scan':
> drivers/mtd/spi-nor/spi-nor.c:5721:18: error: implicit
declaration of function 'of_read_number' [-Werror=implicit-function-declaration]
5721 | op.addr.val = of_read_number(reg, a_cells);
| ^~~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +/of_read_number +5721 drivers/mtd/spi-nor/spi-nor.c
620df2497415a9 Tudor Ambarus 2019-08-24 5556
cfc5604c488ccd Cyrille Pitchen 2017-04-25 5557 int spi_nor_scan(struct spi_nor
*nor, const char *name,
cfc5604c488ccd Cyrille Pitchen 2017-04-25 5558 const struct spi_nor_hwcaps
*hwcaps)
b199489d37b21c Huang Shijie 2014-02-24 5559 {
620df2497415a9 Tudor Ambarus 2019-08-24 5560 const struct flash_info *info;
b199489d37b21c Huang Shijie 2014-02-24 5561 struct device *dev =
nor->dev;
1976367173a47f Brian Norris 2015-08-13 5562 struct mtd_info *mtd =
&nor->mtd;
9c7d787508be6d Brian Norris 2015-10-30 5563 struct device_node *np =
spi_nor_get_flash_node(nor);
6f9db649f76819 Pratyush Yadav 2020-08-14 5564 struct device_node *child;
1e35a56781b4b5 Tudor Ambarus 2019-08-23 5565 struct spi_nor_flash_parameter
*params = &nor->params;
e24656fe97a4ac Pratyush Yadav 2020-08-05 5566 struct spi_mem_op op;
b199489d37b21c Huang Shijie 2014-02-24 5567 int ret;
b199489d37b21c Huang Shijie 2014-02-24 5568 int i;
b199489d37b21c Huang Shijie 2014-02-24 5569
b199489d37b21c Huang Shijie 2014-02-24 5570 ret = spi_nor_check(nor);
b199489d37b21c Huang Shijie 2014-02-24 5571 if (ret)
b199489d37b21c Huang Shijie 2014-02-24 5572 return ret;
b199489d37b21c Huang Shijie 2014-02-24 5573
cfc5604c488ccd Cyrille Pitchen 2017-04-25 5574 /* Reset SPI protocol for all
commands. */
cfc5604c488ccd Cyrille Pitchen 2017-04-25 5575 nor->reg_proto =
SNOR_PROTO_1_1_1;
cfc5604c488ccd Cyrille Pitchen 2017-04-25 5576 nor->read_proto =
SNOR_PROTO_1_1_1;
cfc5604c488ccd Cyrille Pitchen 2017-04-25 5577 nor->write_proto =
SNOR_PROTO_1_1_1;
cfc5604c488ccd Cyrille Pitchen 2017-04-25 5578
f173f26a4d543f Vignesh Raghavendra 2019-08-06 5579 /*
f173f26a4d543f Vignesh Raghavendra 2019-08-06 5580 * We need the bounce buffer
early to read/write registers when going
f173f26a4d543f Vignesh Raghavendra 2019-08-06 5581 * through the spi-mem layer
(buffers have to be DMA-able).
b35b9a10362d20 Boris Brezillon 2019-08-06 5582 * For spi-mem drivers,
we'll reallocate a new buffer if
b35b9a10362d20 Boris Brezillon 2019-08-06 5583 * nor->page_size turns out
to be greater than PAGE_SIZE (which
b35b9a10362d20 Boris Brezillon 2019-08-06 5584 * shouldn't happen before
long since NOR pages are usually less
b35b9a10362d20 Boris Brezillon 2019-08-06 5585 * than 1KB) after
spi_nor_scan() returns.
f173f26a4d543f Vignesh Raghavendra 2019-08-06 5586 */
f173f26a4d543f Vignesh Raghavendra 2019-08-06 5587 nor->bouncebuf_size =
PAGE_SIZE;
f173f26a4d543f Vignesh Raghavendra 2019-08-06 5588 nor->bouncebuf =
devm_kmalloc(dev, nor->bouncebuf_size,
f173f26a4d543f Vignesh Raghavendra 2019-08-06 5589 GFP_KERNEL);
f173f26a4d543f Vignesh Raghavendra 2019-08-06 5590 if (!nor->bouncebuf)
f173f26a4d543f Vignesh Raghavendra 2019-08-06 5591 return -ENOMEM;
f173f26a4d543f Vignesh Raghavendra 2019-08-06 5592
620df2497415a9 Tudor Ambarus 2019-08-24 5593 info =
spi_nor_get_flash_info(nor, name);
620df2497415a9 Tudor Ambarus 2019-08-24 5594 if (IS_ERR(info))
620df2497415a9 Tudor Ambarus 2019-08-24 5595 return PTR_ERR(info);
b199489d37b21c Huang Shijie 2014-02-24 5596
b296379fef7ce9 Boris Brezillon 2018-12-06 5597 nor->info = info;
b296379fef7ce9 Boris Brezillon 2018-12-06 5598
dcc935b06f1f29 Zhuohao Lee 2019-08-28 5599 spi_nor_debugfs_init(nor,
info);
dcc935b06f1f29 Zhuohao Lee 2019-08-28 5600
b199489d37b21c Huang Shijie 2014-02-24 5601 mutex_init(&nor->lock);
b199489d37b21c Huang Shijie 2014-02-24 5602
e99ca98f1d7190 Ricardo Ribalda Delgado 2016-12-02 5603 /*
e99ca98f1d7190 Ricardo Ribalda Delgado 2016-12-02 5604 * Make sure the XSR_RDY flag is
set before calling
e99ca98f1d7190 Ricardo Ribalda Delgado 2016-12-02 5605 * spi_nor_wait_till_ready().
Xilinx S3AN share MFR
e99ca98f1d7190 Ricardo Ribalda Delgado 2016-12-02 5606 * with Atmel spi-nor
e99ca98f1d7190 Ricardo Ribalda Delgado 2016-12-02 5607 */
ad3bba06b63697 Boris Brezillon 2019-07-30 5608 if (info->flags &
SPI_NOR_XSR_RDY)
e99ca98f1d7190 Ricardo Ribalda Delgado 2016-12-02 5609 nor->flags |=
SNOR_F_READY_XSR_RDY;
e99ca98f1d7190 Ricardo Ribalda Delgado 2016-12-02 5610
dff972458acb05 Boris Brezillon 2019-08-24 5611 if (info->flags &
SPI_NOR_HAS_LOCK)
dff972458acb05 Boris Brezillon 2019-08-24 5612 nor->flags |=
SNOR_F_HAS_LOCK;
dff972458acb05 Boris Brezillon 2019-08-24 5613
191f5c2ed4b6fa Tudor Ambarus 2019-06-10 5614 /*
191f5c2ed4b6fa Tudor Ambarus 2019-06-10 5615 * Atmel, SST, Intel/Numonyx,
and others serial NOR tend to power up
191f5c2ed4b6fa Tudor Ambarus 2019-06-10 5616 * with the software protection
bits set.
191f5c2ed4b6fa Tudor Ambarus 2019-06-10 5617 */
191f5c2ed4b6fa Tudor Ambarus 2019-06-10 5618 if (JEDEC_MFR(nor->info) ==
SNOR_MFR_ATMEL ||
191f5c2ed4b6fa Tudor Ambarus 2019-06-10 5619 JEDEC_MFR(nor->info) ==
SNOR_MFR_INTEL ||
191f5c2ed4b6fa Tudor Ambarus 2019-06-10 5620 JEDEC_MFR(nor->info) ==
SNOR_MFR_SST ||
191f5c2ed4b6fa Tudor Ambarus 2019-06-10 5621 nor->info->flags &
SPI_NOR_HAS_LOCK)
191f5c2ed4b6fa Tudor Ambarus 2019-06-10 5622 nor->clear_sr_bp =
spi_nor_clear_sr_bp;
191f5c2ed4b6fa Tudor Ambarus 2019-06-10 5623
1c1d8d98e1c706 Tudor Ambarus 2019-08-24 5624 /* Init flash parameters based
on flash_info struct and SFDP */
1c1d8d98e1c706 Tudor Ambarus 2019-08-24 5625 spi_nor_init_params(nor);
cfc5604c488ccd Cyrille Pitchen 2017-04-25 5626
32f1b7c8352fd3 Rafał Miłecki 2014-09-28 5627 if (!mtd->name)
b199489d37b21c Huang Shijie 2014-02-24 5628 mtd->name = dev_name(dev);
c9ec3900abf279 Brian Norris 2015-08-13 5629 mtd->priv = nor;
b199489d37b21c Huang Shijie 2014-02-24 5630 mtd->type = MTD_NORFLASH;
b199489d37b21c Huang Shijie 2014-02-24 5631 mtd->writesize = 1;
b199489d37b21c Huang Shijie 2014-02-24 5632 mtd->flags =
MTD_CAP_NORFLASH;
1e35a56781b4b5 Tudor Ambarus 2019-08-23 5633 mtd->size = params->size;
b199489d37b21c Huang Shijie 2014-02-24 5634 mtd->_erase = spi_nor_erase;
b199489d37b21c Huang Shijie 2014-02-24 5635 mtd->_read = spi_nor_read;
b23b0848f1a03e Pratyush Yadav 2020-06-16 5636 mtd->_suspend =
spi_nor_suspend;
d6084fc83c8249 Kamal Dasu 2017-08-22 5637 mtd->_resume =
spi_nor_resume;
b199489d37b21c Huang Shijie 2014-02-24 5638
dff972458acb05 Boris Brezillon 2019-08-24 5639 if (nor->params.locking_ops)
{
b199489d37b21c Huang Shijie 2014-02-24 5640 mtd->_lock = spi_nor_lock;
b199489d37b21c Huang Shijie 2014-02-24 5641 mtd->_unlock =
spi_nor_unlock;
5bf0e69b67a560 Brian Norris 2015-09-01 5642 mtd->_is_locked =
spi_nor_is_locked;
b199489d37b21c Huang Shijie 2014-02-24 5643 }
b199489d37b21c Huang Shijie 2014-02-24 5644
b199489d37b21c Huang Shijie 2014-02-24 5645 /* sst nor chips use AAI word
program */
b199489d37b21c Huang Shijie 2014-02-24 5646 if (info->flags &
SST_WRITE)
b199489d37b21c Huang Shijie 2014-02-24 5647 mtd->_write = sst_write;
b199489d37b21c Huang Shijie 2014-02-24 5648 else
b199489d37b21c Huang Shijie 2014-02-24 5649 mtd->_write =
spi_nor_write;
b199489d37b21c Huang Shijie 2014-02-24 5650
51983b7dcf3a50 Brian Norris 2014-09-10 5651 if (info->flags &
USE_FSR)
51983b7dcf3a50 Brian Norris 2014-09-10 5652 nor->flags |=
SNOR_F_USE_FSR;
3dd8012a8eeb37 Brian Norris 2016-01-29 5653 if (info->flags &
SPI_NOR_HAS_TB)
3dd8012a8eeb37 Brian Norris 2016-01-29 5654 nor->flags |=
SNOR_F_HAS_SR_TB;
2f5ad7f0f3e167 mar.krzeminski 2017-01-06 5655 if (info->flags &
NO_CHIP_ERASE)
2f5ad7f0f3e167 mar.krzeminski 2017-01-06 5656 nor->flags |=
SNOR_F_NO_OP_CHIP_ERASE;
c4b3eacc1dfef5 Alexander Sverdlin 2017-07-17 5657 if (info->flags &
USE_CLSR)
c4b3eacc1dfef5 Alexander Sverdlin 2017-07-17 5658 nor->flags |=
SNOR_F_USE_CLSR;
c14deddec1fbd8 grmoore(a)altera.com 2014-04-29 5659
b199489d37b21c Huang Shijie 2014-02-24 5660 if (info->flags &
SPI_NOR_NO_ERASE)
b199489d37b21c Huang Shijie 2014-02-24 5661 mtd->flags |= MTD_NO_ERASE;
b199489d37b21c Huang Shijie 2014-02-24 5662
b199489d37b21c Huang Shijie 2014-02-24 5663 mtd->dev.parent = dev;
1e35a56781b4b5 Tudor Ambarus 2019-08-23 5664 nor->page_size =
params->page_size;
b199489d37b21c Huang Shijie 2014-02-24 5665 mtd->writebufsize =
nor->page_size;
b199489d37b21c Huang Shijie 2014-02-24 5666
bb276262e88dae Brian Norris 2018-07-27 5667 if (of_property_read_bool(np,
"broken-flash-reset"))
bb276262e88dae Brian Norris 2018-07-27 5668 nor->flags |=
SNOR_F_BROKEN_RESET;
bb276262e88dae Brian Norris 2018-07-27 5669
cfc5604c488ccd Cyrille Pitchen 2017-04-25 5670 /*
cfc5604c488ccd Cyrille Pitchen 2017-04-25 5671 * Configure the SPI memory:
cfc5604c488ccd Cyrille Pitchen 2017-04-25 5672 * - select op codes for (Fast)
Read, Page Program and Sector Erase.
cfc5604c488ccd Cyrille Pitchen 2017-04-25 5673 * - set the number of dummy
cycles (mode cycles + wait states).
cfc5604c488ccd Cyrille Pitchen 2017-04-25 5674 * - set the SPI protocols for
register and memory accesses.
cfc5604c488ccd Cyrille Pitchen 2017-04-25 5675 */
1e35a56781b4b5 Tudor Ambarus 2019-08-23 5676 ret = spi_nor_setup(nor,
hwcaps);
cfc5604c488ccd Cyrille Pitchen 2017-04-25 5677 if (ret)
b199489d37b21c Huang Shijie 2014-02-24 5678 return ret;
b199489d37b21c Huang Shijie 2014-02-24 5679
92094ebc385ef5 Boris Brezillon 2019-08-24 5680 if (info->flags &
SPI_NOR_4B_OPCODES)
548ed6847f5303 Boris Brezillon 2018-12-06 5681 nor->flags |=
SNOR_F_4B_OPCODES;
548ed6847f5303 Boris Brezillon 2018-12-06 5682
696ce50f4e9377 Tudor Ambarus 2019-08-24 5683 ret =
spi_nor_set_addr_width(nor);
696ce50f4e9377 Tudor Ambarus 2019-08-24 5684 if (ret)
696ce50f4e9377 Tudor Ambarus 2019-08-24 5685 return ret;
c67cbb839da9cc Brian Norris 2015-11-10 5686
46dde01f6bab35 Kamal Dasu 2017-08-22 5687 /* Send all the required SPI
flash commands to initialize device */
46dde01f6bab35 Kamal Dasu 2017-08-22 5688 ret = spi_nor_init(nor);
46dde01f6bab35 Kamal Dasu 2017-08-22 5689 if (ret)
46dde01f6bab35 Kamal Dasu 2017-08-22 5690 return ret;
46dde01f6bab35 Kamal Dasu 2017-08-22 5691
6f9db649f76819 Pratyush Yadav 2020-08-14 5692 /*
6f9db649f76819 Pratyush Yadav 2020-08-14 5693 * Find out if a PHY pattern
partition is present.
6f9db649f76819 Pratyush Yadav 2020-08-14 5694 *
6f9db649f76819 Pratyush Yadav 2020-08-14 5695 * TODO: Teach the mtd core to
find the partition for us so we don't
6f9db649f76819 Pratyush Yadav 2020-08-14 5696 * have to repeat the parsing
logic here that mtd already has.
6f9db649f76819 Pratyush Yadav 2020-08-14 5697 */
6f9db649f76819 Pratyush Yadav 2020-08-14 5698 child = NULL;
6f9db649f76819 Pratyush Yadav 2020-08-14 5699 do {
6f9db649f76819 Pratyush Yadav 2020-08-14 5700 int len;
6f9db649f76819 Pratyush Yadav 2020-08-14 5701 char *label = NULL;
6f9db649f76819 Pratyush Yadav 2020-08-14 5702
6f9db649f76819 Pratyush Yadav 2020-08-14 5703 child = of_get_next_child(np,
child);
6f9db649f76819 Pratyush Yadav 2020-08-14 5704 if (child)
6f9db649f76819 Pratyush Yadav 2020-08-14 5705 label = (char
*)of_get_property(child, "label", &len);
6f9db649f76819 Pratyush Yadav 2020-08-14 5706
6f9db649f76819 Pratyush Yadav 2020-08-14 5707 if (label &&
!strcmp(label, "ospi.phypattern")) {
6f9db649f76819 Pratyush Yadav 2020-08-14 5708 const __be32 *reg;
6f9db649f76819 Pratyush Yadav 2020-08-14 5709 int a_cells, s_cells;
6f9db649f76819 Pratyush Yadav 2020-08-14 5710
6f9db649f76819 Pratyush Yadav 2020-08-14 5711 reg = of_get_property(child,
"reg", &len);
6f9db649f76819 Pratyush Yadav 2020-08-14 5712 if (!reg)
6f9db649f76819 Pratyush Yadav 2020-08-14 5713 continue;
6f9db649f76819 Pratyush Yadav 2020-08-14 5714
6f9db649f76819 Pratyush Yadav 2020-08-14 5715 a_cells =
of_n_addr_cells(child);
6f9db649f76819 Pratyush Yadav 2020-08-14 5716 s_cells =
of_n_size_cells(child);
6f9db649f76819 Pratyush Yadav 2020-08-14 5717 if (len / 4 != a_cells +
s_cells)
6f9db649f76819 Pratyush Yadav 2020-08-14 5718 continue;
6f9db649f76819 Pratyush Yadav 2020-08-14 5719
e24656fe97a4ac Pratyush Yadav 2020-08-05 5720 op =
spi_nor_spimem_read_op(nor);
6f9db649f76819 Pratyush Yadav 2020-08-14 @5721 op.addr.val =
of_read_number(reg, a_cells);
e24656fe97a4ac Pratyush Yadav 2020-08-05 5722
spi_mem_set_calibration_read_op(nor->spimem, &op);
6f9db649f76819 Pratyush Yadav 2020-08-14 5723 break;
6f9db649f76819 Pratyush Yadav 2020-08-14 5724 }
6f9db649f76819 Pratyush Yadav 2020-08-14 5725 } while (child);
e24656fe97a4ac Pratyush Yadav 2020-08-05 5726
06bb6f5a69dfc5 Rafał Miłecki 2015-08-10 5727 dev_info(dev, "%s (%lld
Kbytes)\n", info->name,
b199489d37b21c Huang Shijie 2014-02-24 5728 (long long)mtd->size
>> 10);
b199489d37b21c Huang Shijie 2014-02-24 5729
b199489d37b21c Huang Shijie 2014-02-24 5730 dev_dbg(dev,
b199489d37b21c Huang Shijie 2014-02-24 5731 "mtd .name = %s, .size =
0x%llx (%lldMiB), "
b199489d37b21c Huang Shijie 2014-02-24 5732 ".erasesize = 0x%.8x
(%uKiB) .numeraseregions = %d\n",
b199489d37b21c Huang Shijie 2014-02-24 5733 mtd->name, (long
long)mtd->size, (long long)(mtd->size >> 20),
b199489d37b21c Huang Shijie 2014-02-24 5734 mtd->erasesize,
mtd->erasesize / 1024, mtd->numeraseregions);
b199489d37b21c Huang Shijie 2014-02-24 5735
b199489d37b21c Huang Shijie 2014-02-24 5736 if (mtd->numeraseregions)
b199489d37b21c Huang Shijie 2014-02-24 5737 for (i = 0; i <
mtd->numeraseregions; i++)
b199489d37b21c Huang Shijie 2014-02-24 5738 dev_dbg(dev,
b199489d37b21c Huang Shijie 2014-02-24 5739 "mtd.eraseregions[%d] =
{ .offset = 0x%llx, "
b199489d37b21c Huang Shijie 2014-02-24 5740 ".erasesize = 0x%.8x
(%uKiB), "
b199489d37b21c Huang Shijie 2014-02-24 5741 ".numblocks = %d
}\n",
b199489d37b21c Huang Shijie 2014-02-24 5742 i, (long
long)mtd->eraseregions[i].offset,
b199489d37b21c Huang Shijie 2014-02-24 5743
mtd->eraseregions[i].erasesize,
b199489d37b21c Huang Shijie 2014-02-24 5744
mtd->eraseregions[i].erasesize / 1024,
b199489d37b21c Huang Shijie 2014-02-24 5745
mtd->eraseregions[i].numblocks);
b199489d37b21c Huang Shijie 2014-02-24 5746 return 0;
b199489d37b21c Huang Shijie 2014-02-24 5747 }
b61834b0d0ed50 Brian Norris 2014-04-08 5748 EXPORT_SYMBOL_GPL(spi_nor_scan);
b199489d37b21c Huang Shijie 2014-02-24 5749
:::::: The code at line 5721 was first introduced by commit
:::::: 6f9db649f76819bbe6b9ee1a7758717d0f2e01ee HACK: mtd: spi-nor: Look for PHY pattern
partition
:::::: TO: Pratyush Yadav <p.yadav(a)ti.com>
:::::: CC: Pratyush Yadav <p.yadav(a)ti.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org