Skip to content

Commit 607f44c

Browse files
psi-suedasty
authored andcommitted
HACK: drivers: mtd: nand: remove WARN caused by quirky amlogic vendor nand driver
The following WARN was printed during boot: WARNING: CPU: 2 PID: 1 at drivers/mtd/nand/raw/nand_base.c:5168 nand_scan_with_ids+0x880/0x1738 Modules linked in: CPU: 2 PID: 1 Comm: swapper/0 Not tainted 6.6.60+ torvalds#25 Hardware name: Amlogic (DT) pstate: 20000005 (nzCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : nand_scan_with_ids+0x880/0x1738 lr : nand_scan_with_ids+0x298/0x1738 sp : ffff80008142b9f0 x29: ffff80008142ba50 x28: 0000000000000000 x27: ffff000001bf1090 x26: ffff8000813f2c90 x25: ffff000001b8dc10 x24: ffff000001bf1230 x23: ffff000001bf15d0 x22: ffff000001bf1230 x21: ffff8000813f2c90 x20: 0000000000000001 x19: ffff800081351c38 x18: ffffffffffffffff x17: 30303032203a6574 x16: 61725f6b6c63202c x15: 35203a7265646976 x14: 69645f316c657665 x13: 00000000000000c4 x12: 00000000ffffffea x11: 00000000ffffefff x10: 00000000ffffefff x9 : ffff8000812e4350 x8 : ffff80008142b988 x7 : 0000000000003fff x6 : 000000005b19d11d x5 : 00ffffffffffffff x4 : 0000000000000000 x3 : ffff800080763b78 x2 : 0000000000000000 x1 : 0000000000000001 x0 : ffff0000022e5080 Call trace: nand_scan_with_ids+0x880/0x1738 meson_nfc_probe+0x70c/0xab4 platform_probe+0x68/0xdc really_probe+0x148/0x2ac __driver_probe_device+0x78/0x12c driver_probe_device+0xd8/0x15c __driver_attach+0x94/0x19c bus_for_each_dev+0x78/0xdc driver_attach+0x24/0x30 bus_add_driver+0xe4/0x208 driver_register+0x60/0x128 __platform_driver_register+0x28/0x34 meson_nfc_driver_init+0x1c/0x2c do_one_initcall+0x70/0x200 kernel_init_freeable+0x174/0x23c kernel_init+0x24/0x1dc ret_from_fork+0x10/0x20 ---[ end trace 0000000000000000 ]--- This is the result of the vendor amlogic nand driver handling u-boot and linux partitions as two separate chips but the chips are reused. So when the code gets there the second time, the flag is set which causes the WARN to trigger. Just removing the WARN seems to be enough as all is working fine as before. Signed-off-by: Peter Suti <peter.suti@streamunlimited.com>
1 parent cef0e7b commit 607f44c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/mtd/nand/raw/nand_base.c

+5-1
Original file line numberDiff line numberDiff line change
@@ -5165,7 +5165,11 @@ static void rawnand_check_data_only_read_support(struct nand_chip *chip)
51655165
static void rawnand_early_check_supported_ops(struct nand_chip *chip)
51665166
{
51675167
/* The supported_op fields should not be set by individual drivers */
5168-
WARN_ON_ONCE(chip->controller->supported_op.data_only_read);
5168+
/* The vendor meson_nand driver reuses the chip->controller structure because
5169+
* it needs to create two nand chips, one for u-boot and one for the partitions in linux
5170+
* So when the code gets here the second time the WARN would be printed.
5171+
* Just remove the WARN for now as things seem to work fine as before.
5172+
*/
51695173

51705174
if (!nand_has_exec_op(chip))
51715175
return;

0 commit comments

Comments
 (0)