Welcome! Log In Create A New Profile

Advanced

Debian on Zyxel NAS326

Posted by Kirsch 
Re: Debian on Zyxel NAS326
September 28, 2017 04:22PM
musv,

Data point: I've tested a 1GB file xfer with NFS on 4.12.x, and it did not cause me any problem.

I've not yet tried 4.13.2, which I have planned to release.

-bodhi
===========================
Forum Wiki
bodhi's corner
musv
Re: Debian on Zyxel NAS326
October 18, 2017 02:00PM
I tried kernel 4.13.7 today. To get sure the problem is not related to my config, I took the config of 4.10.10 (the last fully working kernel) and used also the dts file from April.

The problem occurred again:
Okt 18 21:34:23 nas kernel: rpc-srv/tcp: nfsd: sent only 56968 when sending 65644 bytes - shutting down socket

Hence, I can eliminate every config changes. It must be the network driver in the kernel.

bodhi Wrote:
-------------------------------------------------------
> Data point: I've tested a 1GB file xfer with NFS on 4.12.x, and it did not cause me any problem.

It's not caused by a single file. For me the most likely way to reproduce it, is to send files not with full speed over a longer period of time - half an hour up to an hour. That's why I wrote explicitly: listen to music files, that are stored on the nfs device.

So far I downgraded to 4.10.10.
Re: Debian on Zyxel NAS326
October 19, 2017 08:43PM
musv Wrote:
-------------------------------------------------------
> I tried kernel 4.13.7 today. To get sure the
> problem is not related to my config, I took the
> config of 4.10.10 (the last fully working kernel)
> and used also the dts file from April.
>
> The problem occurred again:
>
Okt 18 21:34:23 nas kernel: rpc-srv/tcp:
> nfsd: sent only 56968 when sending 65644 bytes -
> shutting down socket
>
> Hence, I can eliminate every config changes. It
> must be the network driver in the kernel.
>
> bodhi Wrote:
> -------------------------------------------------------
> > Data point: I've tested a 1GB file xfer with NFS
> on 4.12.x, and it did not cause me any problem.
>
> It's not caused by a single file. For me the most
> likely way to reproduce it, is to send files not
> with full speed over a longer period of time -
> half an hour up to an hour. That's why I wrote
> explicitly: listen to music files, that are stored
> on the nfs device.
>
> So far I downgraded to 4.10.10.

Yes, it sounds like the ethernet driver TCP buffer xmit problem.

-bodhi
===========================
Forum Wiki
bodhi's corner
musv
Re: Debian on Zyxel NAS326
October 20, 2017 07:23AM
I'm currently in contact with the mvneta developer from free-electrons.com. With their help I'm testing around.

The first step was to take the mvneta driver directory (kernel/driver/net/ethernet/mvneta) from 4.10.10 and replace the driver from 4.13.7. I had to modify a few lines but I got the 4.10.10 driver running in 4.13.7 and it works perfectly without any issues.

In the whole driver update list, they have marked 3 patches as potentially suspicious. So I'll revert those patches and see, which one is the critical one.
Re: Debian on Zyxel NAS326
October 20, 2017 02:47PM
musv,

> In the whole driver update list, they have marked
> 3 patches as potentially suspicious. So I'll
> revert those patches and see, which one is the
> critical one.

There is one TCP buffer related patch I think the most suspicious.

-bodhi
===========================
Forum Wiki
bodhi's corner
kralan
Re: Debian on Zyxel NAS326
October 30, 2017 10:45AM
I am still at 4.9.5-tld-8 and am planning to upgrade to the latest available kernel soon.
Do I gather correctly from the recent posts that it's better to wait with the upgrade until the mvneta issue is sorted out?
Re: Debian on Zyxel NAS326
October 30, 2017 01:15PM
kralan Wrote:
-------------------------------------------------------
> I am still at 4.9.5-tld-8 and am planning to
> upgrade to the latest available kernel soon.
> Do I gather correctly from the recent posts that
> it's better to wait with the upgrade until the
> mvneta issue is sorted out?

It's really up to you. If your use case is similar to musv then I'd say don't upgrade. OTOH, I am not sure when this will be sorted out. If there is no activity upstream for a while, then I would have to repeat musv test and try patching the mvneta driver myself.

-bodhi
===========================
Forum Wiki
bodhi's corner
musv
Re: Debian on Zyxel NAS326
October 31, 2017 09:47AM
Here's the discussion about the issue:

https://www.spinics.net/lists/netdev/msg461420.html

kralan:
You can upgrade to at least to Kernel 4.10.x without issues. At least according to my tests to problematic patch is:

https://github.com/torvalds/linux/commit/2a90f7e1d5d04e4f1060268e0b55a2c702bbd67a#diff-851bfc43b3ca32355b4c07d29dbba7f0

If you just revert this patch before compiling the kernel, you won't suffer any nfs-server issues. If you don't use nfs or samba as a server on the Zyxel, you'll probably not notice any regressions.
Re: Debian on Zyxel NAS326
October 31, 2017 03:00PM
Thanks musv! I'll take a look and incorporate in the next release.

-bodhi
===========================
Forum Wiki
bodhi's corner
musv
Re: Debian on Zyxel NAS326
November 22, 2017 11:49AM
Just to give some feedback. The problem has been resolved.

If you build the next kernel image, just check if this patch has been applied:
https://www.spinics.net/lists/netdev/msg466892.html

diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
index 64a04975bcf8..bc93b69cfd1e 100644
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -816,11 +816,14 @@ static void mvneta_txq_pend_desc_add(struct mvneta_port *pp,
 {
 	u32 val;
 
-	/* Only 255 descriptors can be added at once ; Assume caller
-	 * process TX desriptors in quanta less than 256
-	 */
-	val = pend_desc + txq->pending;
-	mvreg_write(pp, MVNETA_TXQ_UPDATE_REG(txq->id), val);
+	pend_desc += txq->pending;
+
+	/* Only 255 Tx descriptors can be added at once */
+	do {
+		val = min(pend_desc, 255);
+		mvreg_write(pp, MVNETA_TXQ_UPDATE_REG(txq->id), val);
+		pend_desc -= val;
+	} while (pend_desc > 0);
 	txq->pending = 0;
 }
Re: Debian on Zyxel NAS326
November 22, 2017 03:27PM
Thanks musv!

-bodhi
===========================
Forum Wiki
bodhi's corner
musv
Re: Debian on Zyxel NAS326
June 04, 2018 07:56AM
I'm currently compiling kernel 4.16.3. There's a new setting:

CPU Power Management -> CPU frequency scaling -> Armada 37xx CPUFreq support

Quote

This adds the CPUFreq driver support for Marvell Armada 37xx SoCs.
The Armada 37xx PMU supports 4 frequency and VDD levels.

Depends on: CPU_FREQ [=y] && (ARM [=y] || ARM64) && ARCH_MVEBU [=y] && CPUFREQ_DT [=y]

Is this working for our Armada 380 too?

Btw. the patch from 4.14 doesn't apply on 4.16 anymore. I had to remove some printk messages from marvell.c file.
Re: Debian on Zyxel NAS326
June 04, 2018 04:17PM
musv,

We are on 4.16.7 already:

https://forum.doozan.com/read.php?2,32146

> CPU Power Management -> CPU frequency scaling ->
> Armada 37xx CPUFreq support
> Is this working for our Armada 380 too?

It is not applicable to A38x.

-bodhi
===========================
Forum Wiki
bodhi's corner
musv
Re: Debian on Zyxel NAS326
September 30, 2018 02:18AM
Hi Bodhi,

I need some help with kernel-4.18.x. I don't get the mtdparts running. I tried to follow your hints. But the kernel still crashes.

[    0.933092] WARNING: CPU: 0 PID: 1 at drivers/mtd/nand/raw/nand_base.c:2773 nand_subop_get_data_len+0x50/0x94
[    0.943051] Modules linked in:
[    0.946126] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.18.9-gentoo #2
[    0.952674] Hardware name: Marvell Armada 380/385 (Device Tree)
[    0.958625] [<c01115a0>] (unwind_backtrace) from [<c010cea4>] (show_stack+0x10/0x14)
[    0.966399] [<c010cea4>] (show_stack) from [<c07bbaf8>] (dump_stack+0x88/0x9c)
[    0.973651] [<c07bbaf8>] (dump_stack) from [<c01299e8>] (__warn.part.3+0xbc/0xd8)
[    0.981163] [<c01299e8>] (__warn.part.3) from [<c0129ad4>] (warn_slowpath_null+0x44/0x4c)
[    0.989371] [<c0129ad4>] (warn_slowpath_null) from [<c05b95e0>] (nand_subop_get_data_len+0x50/0x94)
[    0.998452] [<c05b95e0>] (nand_subop_get_data_len) from [<c05c0138>] (marvell_nfc_parse_instructions+0x58/0x238)
[    1.008664] [<c05c0138>] (marvell_nfc_parse_instructions) from [<c05c2774>] (marvell_nfc_naked_access_exec+0x28/0x1ac)
[    1.019397] [<c05c2774>] (marvell_nfc_naked_access_exec) from [<c05b93c4>] (nand_op_parser_exec_op+0x200/0x278)
[    1.029521] [<c05b93c4>] (nand_op_parser_exec_op) from [<c05b6d70>] (nand_reset_op+0x10c/0x15c)
[    1.038250] [<c05b6d70>] (nand_reset_op) from [<c05b9674>] (nand_reset+0x50/0xa8)
[    1.045760] [<c05b9674>] (nand_reset) from [<c05ba8c4>] (nand_scan_ident+0x228/0x1218)
[    1.053706] [<c05ba8c4>] (nand_scan_ident) from [<c05c0ce4>] (marvell_nand_chip_init+0x1a4/0x864)
[    1.062610] [<c05c0ce4>] (marvell_nand_chip_init) from [<c05c1680>] (marvell_nfc_probe+0x2dc/0x458)
[    1.071690] [<c05c1680>] (marvell_nfc_probe) from [<c05438ac>] (platform_drv_probe+0x48/0x98)
[    1.080246] [<c05438ac>] (platform_drv_probe) from [<c0542588>] (driver_probe_device+0x228/0x31c)
[    1.089149] [<c0542588>] (driver_probe_device) from [<c0542758>] (__driver_attach+0xdc/0xe0)
[    1.097617] [<c0542758>] (__driver_attach) from [<c054089c>] (bus_for_each_dev+0x74/0xb4)
[    1.105822] [<c054089c>] (bus_for_each_dev) from [<c05412a0>] (bus_add_driver+0x1c0/0x204)
[    1.114115] [<c05412a0>] (bus_add_driver) from [<c0542ebc>] (driver_register+0x74/0x108)
[    1.122234] [<c0542ebc>] (driver_register) from [<c0102cf8>] (do_one_initcall+0x54/0x208)
[    1.130443] [<c0102cf8>] (do_one_initcall) from [<c0a010cc>] (kernel_init_freeable+0x254/0x2e4)
[    1.139176] [<c0a010cc>] (kernel_init_freeable) from [<c07cfbbc>] (kernel_init+0x8/0x110)
[    1.147384] [<c07cfbbc>] (kernel_init) from [<c01010e8>] (ret_from_fork+0x14/0x2c)
[    1.154977] Exception stack(0xdf499fb0 to 0xdf499ff8)
[    1.160044] 9fa0:                                     00000000 00000000 00000000 00000000
[    1.168249] 9fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[    1.176455] 9fe0: 00000000 00000000 00000000 00000000 00000013 00000000
[    1.183111] ---[ end trace 21eeae4e2d71e798 ]---
[    1.187752] ------------[ cut here ]------------
[    1.192388] WARNING: CPU: 0 PID: 1 at drivers/mtd/nand/raw/nand_base.c:2773 nand_subop_get_data_len+0x50/0x94

I compared the my kernel config in the nand-section with your provided one. But there weren't any noticeable differences. I even activated CONFIG_MTD_AR7_PARTS (didn't find any documentation about this thing) and CONFIG_MTD_CMDLINE_PARTS.

My Uboot-Config:
mtdparts=mtdparts=pxa3xx_nand-0:2m(u-boot),2m(env),2m(config),15m(kernel1),110m(rootfs1),15m(kernel2),-(rootfs2)

What did I miss? 4.16.13 (last update) works fine.
Re: Debian on Zyxel NAS326
September 30, 2018 02:53AM
Hi musv,

> I need some help with kernel-4.18.x. I don't get
> the mtdparts running.

> What did I miss? 4.16.13 (last update) works fine.

The kernel config did not change. It always has CONFIG_MTD_CMDLINE_PARTS.

The crash happened because you have the DTB appended to uImage. You are not booting with the separate DTB (also not with separate uInitrd, but uInitrd is not the problem). So the bootargs does not have the cmdline mtdparts.

Marvell>> boot

NAND read: device 0 whole chip
Attempt to read outside the flash area
 0 bytes read: ERROR
Booting Gentoo from sda1
AHCI init for unit0
Target spinup took 0 ms.
Target spinup took 0 ms.

Error: SCSI Controller(s) 1B4B:9215 1B4B:9235 not found
scanning bus for devices...
...
  Device 1: (1:0) Vendor: ATA Prod.: ST9500325AS Rev: 0001
            Type: Hard Disk
            Capacity: 476940.0 MB = 465.7 GB (976773168 x 512)
Found 2 device(s).

4787801 bytes read in 125 ms (36.5 MiB/s)
*  kernel: cmdline image address = 0x02000000

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.18.9-gentoo (root@nas) (gcc version 8.2.0 (Gentoo 8.2.0-r2 p1.2)) #2 SMP Wed Sep 26 14:01:03 CEST 2018
[    0.000000] CPU: ARMv7 Processor [414fc091] revision 1 (ARMv7), cr=10c5387d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] OF: fdt: Machine model: Zyxel NAS326
[    0.000000] Memory policy: Data cache writealloc
[    0.000000] random: get_random_bytes called from start_kernel+0x8c/0x464 with crng_init=0
[    0.000000] percpu: Embedded 16 pages/cpu @(ptrval) s36812 r8192 d20532 u65536
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 129920
[    0.000000] Kernel command line: console=ttyS0,115200 root=/dev/sda2 init=/lib/systemd/systemd

I understood you want to make it simple. But I would recommend setting up booting with separate DTB and with uInitrd. The logistics is too cumbersome when you always need to remember to append the DTB. And the ability to boot with appended DTB will be removed from the mainline kernel eventually.

Please let me know if that was indeed the problem or if it was something else (systemd has some problem lately).

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Debian on Zyxel NAS326
September 30, 2018 03:46AM
Ah, I see. You are running gentoo.

-bodhi
===========================
Forum Wiki
bodhi's corner
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: