bcm63xx kernel 5.10

Florian Fainelli f.fainelli at gmail.com
Fri Feb 4 10:54:14 PST 2022



On 2/4/2022 10:47 AM, Hauke Mehrtens wrote:
> On 2/4/22 19:23, Florian Fainelli wrote:
>>
>>
>> On 2/4/2022 9:28 AM, Daniel González Cabanelas wrote:
>>> Hi Hauke:
>>>
>>> El vie, 4 feb 2022 a las 0:48, Hauke Mehrtens (<hauke at hauke-m.de>) 
>>> escribió:
>>>>
>>>> Hi,
>>>>
>>>> We would like to switch the bcm63xx target to kernel 5.10. Paul created
>>>> a pull request for that:
>>>> https://github.com/openwrt/openwrt/pull/4616
>>>>
>>>> There is still a problem with Macronix NAND flash chips, see the
>>>> comments from the pull request.
>>>>
>>>> Could someone please have a look into this problem.
>>>>
>>>> Does this change in the upstream kernel help?
>>>> https://github.com/torvalds/linux/commit/22ca05b82d3e3abc2b116a11ee41b6b692b95530 
>>>>
>>>>
>>> The patch together with:
>>> https://github.com/torvalds/linux/commit/a071912636cc3420f54e2a6312c1625ac763cf03 
>>>
>>>
>>> They both apply cleanly without changes in current Openwrt, kernel
>>> testing 5.10, But the kernel still fails to load, caused by
>>> macronix_nand_block_protection_support .
>>
>> Is there a log available somewhere that shows the boot failure with 
>> 5.10? Have you been able to run a bisection somehow?
>>
>> None of those patches should be relevant as the DSL SoCs do not use 
>> EDU, they use PIO. Now about this one:
>>
>> lists.infradead.org/pipermail/linux-mtd/2022-January/091107.html
> 
> Hi Florian,
> 
> The details are in this pull request:
> https://github.com/openwrt/openwrt/pull/4616
> 
> We see this error:
> -------------------------------
> [    0.789569] printk: bootconsole [early0] disabled
> [    0.789569] printk: bootconsole [early0] disabled
> [    0.812291] bcm6368_nand 10000200.nand: there is not valid maps for 
> state default
> [    0.823019] nand: device found, Manufacturer ID: 0xc2, Chip ID: 0xf1
> [    0.829592] nand: Macronix MX30LF1G18AC
> [    0.833525] nand: 128 MiB, SLC, erase size: 128 KiB, page size: 2048, 
> OOB size: 64
> [    0.841306] bcm6368_nand 10000200.nand: detected 128MiB total, 128KiB 
> blocks, 2KiB pages, 16B OOB, 8-bit, BCH-4
> [    0.857758] Bad block table not found for chip 0
> [    0.867999] Bad block table not found for chip 0
> [    0.872690] Scanning device for bad blocks
> [    0.909739] CPU 0 Unable to handle kernel paging request at virtual 
> address 0040000c, epc == 80064e4c, ra == 80066e30
> [    0.920631] Oops[#1]:
> [    0.922965] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.10.87 #0
> [    0.929136] $ 0   : 00000000 00000001 00400000 00000002
> [    0.934511] $ 4   : 81438080 8140be2c 00000000 81408300
> [    0.939887] $ 8   : 8140a000 00001ff0 00000001 8114af80
> [    0.945263] $12   : 00000400 8143bc80 8143bc80 00000000
> [    0.950638] $16   : 80ee1f40 00000003 81438080 807b460c
> [    0.956014] $20   : 00000002 807a9880 806e9670 806e9648
> [    0.961392] $24   : 00000002 806549f8
> [    0.966767] $28   : 807a2000 8140bde0 80820000 80066e30
> [    0.972143] Hi    : 00000008
> [    0.975101] Lo    : cccccccf
> [    0.978082] epc   : 80064e4c __task_rq_lock+0x38/0xc0
> [    0.983266] ra    : 80066e30 try_to_wake_up+0xb4/0x5a4
> [    0.988541] Status: 10008f02 KERNEL EXL
> [    0.992574] Cause : 00800008 (ExcCode 02)
> [    0.996695] BadVA : 0040000c
> [    0.999652] PrId  : 0002a080 (Broadcom BMIPS4350)
> [    1.004488] Modules linked in:
> [    1.007633] Process swapper/0 (pid: 0, threadinfo=(ptrval), 
> task=(ptrval), tls=00000000)
> [    1.015957] Stack : 81438000 00000003 00000000 81438000 81438080 
> 00000003 00000000 10008f00
> [    1.024567]         8143852c 80066e30 00000400 0000002e 00000329 
> 00000000 00000000 00000001
> [    1.033178]         00000001 00000000 00000000 00000000 81422180 
> 82368cc4 10008f00 8140bf0c
> [    1.041789]         0000003a 807a9880 806e9670 806e9648 80820000 
> 80080920 80ee1f40 00000000
> [    1.050400]         80ee1f40 82368cc0 82368cc0 80080d90 81421a00 
> 00000000 00000000 00000000
> [    1.059010]         ...
> [    1.061520] Call Trace:
> [    1.064038] [<80064e4c>] __task_rq_lock+0x38/0xc0
> [    1.068881] [<80066e30>] try_to_wake_up+0xb4/0x5a4
> [    1.073831] [<80080920>] swake_up_locked+0x28/0x58
> [    1.078734] [<80080d90>] complete+0x44/0x64
> [    1.083065] [<8043b450>] brcmnand_irq+0xa4/0xac
> [    1.087719] [<80090a3c>] __handle_irq_event_percpu+0x70/0x1b8
> [    1.093607] [<80090c4c>] handle_irq_event+0x50/0xe8
> [    1.098624] [<80094fbc>] handle_level_irq+0xf0/0x1fc
> [    1.103732] [<80090118>] generic_handle_irq+0x44/0x5c
> [    1.108946] [<80396b10>] bcm6345_periph_irq_handle+0x110/0x1c0
> [    1.114932] [<80090118>] generic_handle_irq+0x44/0x5c
> [    1.120152] [<8065521c>] do_IRQ+0x1c/0x2c
> [    1.124254] [<80396fc4>] plat_irq_dispatch+0x60/0xd0
> [    1.129371] [<80015bf0>] handle_int+0x150/0x15c
> [    1.134015] [<80015a60>] __r4k_wait+0x20/0x40
> [    1.138492]
> [    1.140008] Code: 24140002  26101f40  8e420004 <8c42000c> 00021080 
> 02621021  8c510000  02118821  0c19540e
> [    1.150070]
> [    1.151660] ---[ end trace 625caeee62f8fa21 ]---
> [    1.156366] Kernel panic - not syncing: Fatal exception in interrupt
> [    1.162890] ------------[ cut here ]------------
> [    1.167651] WARNING: CPU: 0 PID: 0 at kernel/smp.c:633 
> smp_call_function_many_cond+0x438/0x454
> [    1.176503] Modules linked in:
> [    1.179651] CPU: 0 PID: 0 Comm: swapper/0 Tainted: G      D  5.10.87 #0
> [    1.187256] Stack : 10008f00 00000000 80820000 8008d84c 80830000 
> 80725d5c 00000000 00000000
> [    1.195864]         8140bb24 80ff0000 806f4060 807b74f8 807b6fe7 
> 10008f00 8140bac8 5f0039dd
> [    1.204474]         00000000 00000000 806f4060 8140b960 00000000 
> 00000000 ffffefff ffffffea
> [    1.213086]         0000008a 8140b96c 0000008a 807c0818 00000000 
> 10008f00 00000000 806f0000
> [    1.221696]         00000009 807b7100 00000000 00000000 00000678 
> 00000000 00000000 80ff0000
> [    1.230306]         ...
> [    1.232817] Call Trace:
> [    1.235353] [<8001a210>] show_stack+0x30/0x100
> [    1.239907] [<803794b8>] dump_stack+0xa8/0xd8
> [    1.244407] [<8003aaa4>] __warn+0xc0/0x12c
> [    1.248599] [<8003ab6c>] warn_slowpath_fmt+0x5c/0xac
> [    1.253704] [<800c3edc>] smp_call_function_many_cond+0x438/0x454
> [    1.259885] [<800c3f3c>] smp_call_function+0x24/0x30
> [    1.264996] [<8003a510>] panic+0x114/0x31c
> [    1.269206] [<8001a4cc>] die+0x124/0x130
> [    1.273257] [<800257a0>] do_page_fault+0x534/0x544
> [    1.278172] [<8002a674>] tlb_do_page_fault_0+0x124/0x12c
> [    1.283638] [<80066e30>] try_to_wake_up+0xb4/0x5a4
> [    1.288549]
> [    1.290076] ---[ end trace 625caeee62f8fa22 ]---
> [    1.294823] ------------[ cut here ]------------
> [    1.299582] WARNING: CPU: 0 PID: 0 at kernel/smp.c:498 
> smp_call_function_single+0x1f4/0x1fc
> [    1.308170] Modules linked in:
> [    1.311315] CPU: 0 PID: 0 Comm: swapper/0 Tainted: G      D W 
>   5.10.87 #0
> [    1.318921] Stack : 10008f00 00000001 80820000 8008d84c 80830000 
> 80725d5c 00000000 00000000
> [    1.327532]         8140bb34 80ff0000 806f4060 807b74f8 807b6fe7 
> 10008f00 8140bad8 5f0039dd
> [    1.336142]         00000000 00000000 806f4060 8140b970 00000000 
> 00000000 ffffefff ffffffea
> [    1.344753]         000000a2 8140b97c 000000a2 807c0818 00000000 
> 10008f00 00000000 806f0000
> [    1.353363]         00000009 807b7100 00000000 00000001 00000798 
> 00000000 00000000 80ff0000
> [    1.361974]         ...
> [    1.364482] Call Trace:
> [    1.367003] [<8001a210>] show_stack+0x30/0x100
> [    1.371573] [<803794b8>] dump_stack+0xa8/0xd8
> [    1.376056] [<8003aaa4>] __warn+0xc0/0x12c
> [    1.380265] [<8003ab6c>] warn_slowpath_fmt+0x5c/0xac
> [    1.385373] [<800c3924>] smp_call_function_single+0x1f4/0x1fc
> [    1.391284] [<800c3f3c>] smp_call_function+0x24/0x30
> [    1.396394] [<8003a510>] panic+0x114/0x31c
> [    1.400604] [<8001a4cc>] die+0x124/0x130
> [    1.404637] [<800257a0>] do_page_fault+0x534/0x544
> [    1.409566] [<8002a674>] tlb_do_page_fault_0+0x124/0x12c
> [    1.415029] [<80066e30>] try_to_wake_up+0xb4/0x5a4
> [    1.419948]
> [    1.421472] ---[ end trace 625caeee62f8fa23 ]---
> [    1.426235] Rebooting in 1 seconds..
> �HELO2.425330] triggering watchdog soft-reset...
> CPUI
> L1CI
> -------------------------------
> 
> 
> When we apply this change it starts to work again. This was added 
> between 5.4 and 5.10.

How about this, does it help:

diff --git a/drivers/mtd/nand/raw/brcmnand/brcmnand.c 
b/drivers/mtd/nand/raw/brcmnand/brcmnand.c
index f75929783b94..4ac0f90df9c8 100644
--- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c
+++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c
@@ -1563,6 +1563,10 @@ static void brcmnand_send_cmd(struct 
brcmnand_host *host, int cmd)

         dev_dbg(ctrl->dev, "send native cmd %d addr 0x%llx\n", cmd, 
cmd_addr);

+       reinit_completion(&ctrl->done);
+       reinit_completion(&ctrl->dma_done);
+       reinit_completion(&ctrl->edu_done);
+
         BUG_ON(ctrl->cmd_pending != 0);
         ctrl->cmd_pending = cmd;


-- 
Florian



More information about the openwrt-devel mailing list