Re: AW: drivers/mtd/nand/ecc-realtek.c:443:undefined reference to `dma_free_pages'

From: Miquel Raynal

Date: Wed Nov 19 2025 - 14:27:39 EST


Hi Markus,

On 07/11/2025 at 11:31:18 +01, <markus.stockhausen@xxxxxx> wrote:

>> Von: kernel test robot <lkp@xxxxxxxxx>
>> Gesendet: Freitag, 7. November 2025 04:39
>> An: Markus Stockhausen <markus.stockhausen@xxxxxx>
>> Cc: oe-kbuild-all@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx; Miquel
> Raynal <miquel.raynal@xxxxxxxxxxx>
>> Betreff: drivers/mtd/nand/ecc-realtek.c:443:undefined reference to
> `dma_free_pages'
>>
>> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
> master
>> head: 4a0c9b3391999818e2c5b93719699b255be1f682
>> commit: 3148d0e5b1c5733d69ec51b70c8280e46488750a mtd: nand: realtek-ecc:
> Add Realtek external ECC engine support
>> date: 6 weeks ago
>> config: sh-randconfig-r121-20251107
> (https://download.01.org/0day-ci/archive/20251107/202511071114.8WeW2GZK-lkp@
> intel.com/config)
>> compiler: sh4-linux-gcc (GCC) 15.1.0
>> reproduce (this is a W=1 build):
> (https://download.01.org/0day-ci/archive/20251107/202511071114.8WeW2GZK-lkp@
> intel.com/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/202511071114.8WeW2GZK-lkp@intel.
>> | com/
>>
>> All errors (new ones prefixed by >>):
>>
>> sh4-linux-ld: drivers/mtd/nand/ecc-realtek.o: in function
> `rtl_ecc_remove':
>> >> drivers/mtd/nand/ecc-realtek.c:443:(.text+0x1f8): undefined reference
> to `dma_free_pages'
>> sh4-linux-ld: drivers/mtd/nand/ecc-realtek.o: in function
> `rtl_ecc_probe':
>> >> drivers/mtd/nand/ecc-realtek.c:434:(.text+0x2e8): undefined reference
> to `dma_alloc_pages'
>> sh4-linux-ld: drivers/media/i2c/tc358746.o: in function
> `tc358746_probe':
>> drivers/media/i2c/tc358746.c:1585:(.text+0x15cc): undefined reference
> to `devm_clk_hw_register'
>> sh4-linux-ld: drivers/media/i2c/tc358746.c:1610:(.text+0x163c):
> undefined reference to `devm_of_clk_add_hw_provider'
>> sh4-linux-ld: drivers/media/i2c/tc358746.c:1610:(.text+0x1640):
> undefined reference to `of_clk_hw_simple_get'
>
> Hi Miquel,
>
> help. What needs to be done here?
>
> Markus

Looks like the sh architecture has no DMA support whereas the driver
depends on it without properly advertising it in Kconfig. The driver may
be enabled on this architecture due to COMPILE_TEST being set in
Kconfig.

I'll send a small fix.

Cheers,
Miquèl