Any interests in Kernel 4.0 on My book live?

I have another error:

$ make uImage
  CHK     include/config/kernel.release
  CHK     include/generated/uapi/linux/version.h
  CHK     include/generated/utsrelease.h
  CHK     include/generated/bounds.h
  CHK     include/generated/timeconst.h
  CHK     include/generated/asm-offsets.h
  CALL    scripts/checksyscalls.sh
  CHK     include/generated/compile.h
  CALL    arch/powerpc/kernel/systbl_chk.sh
  CHK     kernel/config_data.h
  CC      drivers/ata/sata_dwc_pmp.o
drivers/ata/sata_dwc_pmp.c: In function 'clear_chan_interrupts':
drivers/ata/sata_dwc_pmp.c:538:36: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
  struct dmaIntrRegs* __iomem reg = &(sata_dma_regs->interrupt_clear);
                                    ^
drivers/ata/sata_dwc_pmp.c:539:15: error: dereferencing pointer to incomplete type 'struct dmaIntrRegs'
  out_le32(&reg->tfr.low, dma_chan);
               ^~
drivers/ata/sata_dwc_pmp.c: In function 'sata_dwc_hardreset':
drivers/ata/sata_dwc_pmp.c:1172:26: warning: unused variable 'hsdev' [-Wunused-variable]
  struct sata_dwc_device *hsdev = HSDEV_FROM_HSDEVP(hsdevp);
                          ^~~~~
drivers/ata/sata_dwc_pmp.c: In function 'sata_dwc_qc_issue':
drivers/ata/sata_dwc_pmp.c:1882:6: warning: unused variable 'status' [-Wunused-variable]
  u32 status, sactive;
      ^~~~~~
cc1: some warnings being treated as errors
scripts/Makefile.build:293: recipe for target 'drivers/ata/sata_dwc_pmp.o' failed
make[2]: *** [drivers/ata/sata_dwc_pmp.o] Error 1
scripts/Makefile.build:544: recipe for target 'drivers/ata' failed
make[1]: *** [drivers/ata] Error 2
Makefile:988: recipe for target 'drivers' failed
make: *** [drivers] Error 2

Any suggestions?

One more question, what is your full .config ?
I found config-4.9.txt, but it seems like diff from default config (ppc44x_defconfig?).

It’s a problem with the config file, I forgot to include them with the patches. I posted all config files used for 4.9.33 here.

All commands you use are perfectly fine, I envy your 8 core CPU :unamused:.
NCQ versions compile sata_dwc with Native Command Queueing, while PMP versions use no NCQ. The nc extension refers to NetConsole support, you can remove netconsole if you don’t use it. You definitely do not need the wndr4700.c file.
Also, as you say:
# CONFIG_PPC_4K_PAGES is not set
CONFIG_PPC_64K_PAGES=y

Please note that in 4.9.33 64K pages won’t work without 007_fix_64K_pages.patch.
Right now I am torture testing 4.9.53, you will find the patches and config file here. 4.9.44+ fixes a few cornerstone issues that I flagged upstream, but nothing to worry about in normal use, maybe just reboot once a year.

Once your kernel compiles, don’t forget to compile a new dtb file otherwise the new kernel won’t boot. I posted the dts source files here. Alternatively, you can save some time and just extract the compiled kernel posted here.

One more thing, I have not included the network patches which provide the 122MB read over samba mentioned above (at least on my drive). It’s another set of 12 patches, but the real challenge is that gcc compilers generates (proper) 464fp code that hits a defect on our APM821xx cpu’s. Took me a very long time to figure that out and found it accidentally when adding debug code magically made the problem go away. Working around it requires a manual process using -fdump-tree-all which generates hundreds of files, some of which have to be patched in assembler. So, as a workaround I provided pre-compiled kernels for those that want the faster network throughput and working jumbo packets.

Hope that solves it. Happy compiling…
Ewald

Hi Ewald,

Thanks for response.
It seems kernel 4.9.53 successfully compiled. Also compiled apollo3g_eco.dtb.
But when try to boot it hangs after Loading Device Tree, then reboot again.
Seems like something wrong with DTB.

TFTP from server 192.168.1.144; our IP address is 192.168.1.5
Filename '/linux-4.9.53/uImage'.
Load address: 0x1000000
Loading: *.#################################################################
. #################################################################
. ########################################################
done
Bytes transferred = 2715990 (297156 hex)
Using ppc_4xx_eth0 device
TFTP from server 192.168.1.144; our IP address is 192.168.1.5
Filename '/linux-4.9.53/apollo3g_eco.dtb'.
Load address: 0x1800000
Loading: *.#
done
Bytes transferred = 9518 (252e hex)
## Booting kernel from Legacy Image at 01000000 ...
   Image Name:   Linux-4.9.53-mbl+
   Image Type:   PowerPC Linux Kernel Image (gzip compressed)
   Data Size:    2715926 Bytes =  2.6 MB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 01800000
   Booting using the fdt blob at 0x1800000
   Uncompressing Kernel Image ... OK
   Loading Device Tree to 00ffa000, end 00fff52d ... OK
.
U-Boot 2009.08-svn64818 (Feb 27 2012 - 16:28:23), Build: 0.2.4
... restart boot ...

By the way, using apollo3g.dtb - the same result

Let’s check a few things, just to be 100% we are not overlooking something:

  1. Do you have an MBL duo? I created a DTD file for Duos, but have never been able to test.
  2. I assume you built and installed the modules (make modules; make modules_install → /lib/modules/4.9.53-mbl+
  3. Did you compile the dts files with the supplied kdts.sh script?
  4. What if you use the precompiled versions of dtb and kernel from here
  5. It seems you are booting from TFTP. Specifically netconsole could give issues with TFTP. Do you have the same issues when booting from disk using /boot/uImage & /boot/apollo3g.dtb (uImage being a copy of your new kernel, same for the dtb.)
  6. If you enabled netconsole (per the default .config in the patches) then your boot.scr should look like below (substitute your IP/MAC addresses). See my post on netconsole. Maybe you can disable netconsole in the kernel config…

setenv md0_args ‘setenv bootargs netconsole=6665@192.168.1.6/eth0,6666@192.168.1.20/3c:a8:2a:84:b6:37 root=/dev/sda1 rw rootfstype=ext3 rootflags=data=ordered’
setenv load_sata ‘sata init; ext2load sata 1:1 ${kernel_addr_r} /boot/uImage; ext2load sata 1:1 ${fdt_addr_r} /boot/apollo3g.dtb’
setenv boot_sata ‘run load_sata; run md0_args addtty; bootm ${kernel_addr_r} - ${fdt_addr_r}’
echo ==== Loading Linux kernel, Device tree, Root filesystem ====
run boot_sata

Other than that, it seems you have a slightly older uBoot than I have, but I would doubt that matters, unless it has issues with netconsole.
One final note: 4.9.53 did NOT pass the torture test. It failed 12 tests, including 3 hangs/watchdog timeout/reboots, memory leaks etc.
I have yet to find out why, since the patches are 100% the same. Hence, I recommend to go for 4.9.33.which ran for 7 weeks production with not one single issue.
I just started a compile on 4.9.40 to see where it started to go wrong. While these are supposedly minor releases, I noticed some significant kernel changes after 4.9.33. Several of the drivers have been upgraded to confirm to newer kernel standards, but the bar is continuously rising. Also, at every release I need to change more kernel code to match the performance of a good old 2.6.32.71. On that kernel I managed to get 120MB/s disk writes (even on Samba) and 185MB/s disk read (122 MB/s on Samba)… Now, I get only 80MB/s write on SAMBA and 115MB/s read. Of course still much better than stock FW.

PS: I also posted a Debian Jessie release that is newer than KL Yangs. It has 10’s of fixes for all kind of issues related to our older powerpc hardware, including Samba fixes, udevd, journald etc.

Hope this clears the final hurdle…
Ewald.

To test compiled kernel I use boot from TFTP (kernel and dtb) and rootfs from NFS.
Also I am not use netconsole. I connect console directly to UART (J8).

  1. I have MBL with one HDD (not duo).
  2. I build only kernel, and not build main rootfs yet (for test purpose I’ll use your image)
  3. Yes, I compiled dts using your script.
  4. Used precompiled versions of dtb and kernel from your link and have the same freeze:
=> run net_nfs
Using ppc_4xx_eth0 device
TFTP from server 192.168.1.144; our IP address is 192.168.1.5
Filename '/kernel_usb.4.9.33/uImage_4.9.33.nc.usb'.
Load address: 0x1000000
Loading: *.#################################################################
. #################################################################
. ##########################################################
done
Bytes transferred = 2753810 (2a0512 hex)
Using ppc_4xx_eth0 device
TFTP from server 192.168.1.144; our IP address is 192.168.1.5
Filename '/kernel_usb.4.9.33/apollo3g.dtb_4.9.33'.
Load address: 0x1800000
Loading: *.#
done
Bytes transferred = 9494 (2516 hex)
## Booting kernel from Legacy Image at 01000000 ...
   Image Name:   Linux-4.9.33-mbl+
   Image Type:   PowerPC Linux Kernel Image (gzip compressed)
   Data Size:    2753746 Bytes =  2.6 MB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 01800000
   Booting using the fdt blob at 0x1800000
   Uncompressing Kernel Image ... OK
   Loading Device Tree to 00ffa000, end 00fff515 ... OK

I not use netconsole, I connected directly to UART. By the way, I have precompiled linux-4.1.17 which have no such problem. Maybe platform probe is not getting called.
Tomorrow I will update U-boot and will look if it helps… If not, probably will look debug version of u-boot…
Anyway its halting at the point where u-boot is handing over to the Linux kernel image.
Regardng 4.9.33 I compiled it (using patches which you provided for .53 because build fails when used patches .33) but can not use because of u-boot freeze.
Those fixed you posted are great, but I hope to build system from sources using your pathches. This is a great challenge! :slight_smile:

Thanks for taking the timing to answer the questions.

With “using” netconsole, I also meant also that it’s compiled into the kernel. For sure it will conflict with booting from TFTP. as both uboot and the kernel program ETH0 which could give issues at handover from uboot to kernel. I know they can both work together, but you need to let uboot and DHCP know and it’s a whole process where every bit needs to be correct. Just take a look [here]. In addition, you need to make a custom boot.src which you have not done. In addition, my NETPOLL implementation is really the absolute minimum to get NETCONSOLE going but it’s not a fully functional NETPOLL. This could confuse TFTP.
So make sure you remove:
CONFIG_NETCONSOLE=y
CONFIG_NETCONSOLE_DYNAMIC=y
CONFIG_NETPOLL=y
CONFIG_NET_POLL_CONTROLLER=y
form kernel config.

I don’t recommend to update uboot. Lots of things could go wrong. If you decide to do it anyway, make sure you have a copy of the original uboot partition.

I will verify and if needed fix the patches for 4.9.33, but they should be the same as those for 4.9.53 I posted. It’s quite a challenge to keep it all clean as some files are getting patched 3 times in sequence as I did not want to mix my patches with those from the LEDE project and allow folks to take out a patch if you don’t like it e.g. no NETPOLL.

Since you have the same HW as I do, the dtb files should be OK. The only difference I can see is the use of TFTP and NFS based rootfs in combination with the NETCONSOLE kernel module.

Sorry for the troubles you are having…
If I have a few spare cycles, I will try to test TFTP, but my challenge is that I don’t have a serial console, nor can I solder one as my MBL is very early version (pre-production unit?) I picked up (for peanuts) second hand in the bay area. So I can’t type uboot commands but need to generate uboot images which is very time consuming…

On another note. Yesterday I compiled 4.9.40 and started the torture test. It still needs to run 72 more hours, but as I thought, results look promising and identical to 4.9.33. I think trouble starts post 4.9.44…

Ewald

Well, I rebuild kerkel 4.9.33 with disabled NETCONSOLE: uImage and apollo3g.dtb (pathces from your latest patches for 4.9.33 with .config).
It compiled successfully.
Result the same - boot freezes after Loading Device Tree:

console output with compiled 4.9.33 and disabled NETCONSOLE - freezes
ENET Speed is 1000 Mbps - FULL duplex connection (EMAC0)
Using ppc_4xx_eth0 device
TFTP from server 192.168.1.144; our IP address is 192.168.1.5
Filename '/linux-4.9.33-local/uImage'.
Load address: 0x1000000
Loading: *.#################################################################
. #################################################################
. #######################################################
done
Bytes transferred = 2705103 (2946cf hex)
Using ppc_4xx_eth0 device
TFTP from server 192.168.1.144; our IP address is 192.168.1.5
Filename '/linux-4.9.33-local/apollo3g.dtb'.
Load address: 0x1800000
Loading: *.#
done
Bytes transferred = 7509 (1d55 hex)
 ## Booting kernel from Legacy Image at 01000000 ...
   Image Name:   Linux-4.9.33-mbl+
   Image Type:   PowerPC Linux Kernel Image (gzip compressed)
   Data Size:    2705039 Bytes =  2.6 MB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
 ## Flattened Device Tree blob at 01800000
   Booting using the fdt blob at 0x1800000
   Uncompressing Kernel Image ... OK
   Loading Device Tree to 00ffb000, end 00fffd54 ... OK
.
console output with precompiled 4.9.33 from kernel_usb.4.9.33.tgz - freezes
ENET Speed is 1000 Mbps - FULL duplex connection (EMAC0)
Using ppc_4xx_eth0 device
TFTP from server 192.168.1.144; our IP address is 192.168.1.5
Filename '/kernel_usb.4.9.33/uImage_4.9.33.nc.usb'.
Load address: 0x1000000
Loading: *.#################################################################
. #################################################################
. ##########################################################
done
Bytes transferred = 2753810 (2a0512 hex)
Using ppc_4xx_eth0 device
TFTP from server 192.168.1.144; our IP address is 192.168.1.5
Filename '/kernel_usb.4.9.33/apollo3g.dtb_4.9.33'.
Load address: 0x1800000
Loading: *.#
done
Bytes transferred = 9494 (2516 hex)
## Booting kernel from Legacy Image at 01000000 ...
   Image Name:   Linux-4.9.33-mbl+
   Image Type:   PowerPC Linux Kernel Image (gzip compressed)
   Data Size:    2753746 Bytes =  2.6 MB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 01800000
   Booting using the fdt blob at 0x1800000
   Uncompressing Kernel Image ... OK
   Loading Device Tree to 00ffa000, end 00fff515 ... OK
console output with prebuilt 4.9.33 from MBLJessieClean-4.9.33.tgz - freezes
ENET Speed is 1000 Mbps - FULL duplex connection (EMAC0)
Using ppc_4xx_eth0 device
TFTP from server 192.168.1.144; our IP address is 192.168.1.5
Filename '/MBLJessieClean-4.9.33/uImage'.
Load address: 0x1000000
Loading: *.T T T T T T T T T T 
Retry count exceeded; starting again
Using ppc_4xx_eth0 device
TFTP from server 192.168.1.144; our IP address is 192.168.1.5
Filename '/MBLJessieClean-4.9.33/uImage'.
Load address: 0x1000000
Loading: *.#################################################################
. #################################################################
. ##########################################################
done
Bytes transferred = 2753810 (2a0512 hex)
Using ppc_4xx_eth0 device
TFTP from server 192.168.1.144; our IP address is 192.168.1.5
Filename '/MBLJessieClean-4.9.33/apollo3g.dtb'.
Load address: 0x1800000
Loading: *.#
done
Bytes transferred = 9494 (2516 hex)
## Booting kernel from Legacy Image at 01000000 ...
   Image Name:   Linux-4.9.33-mbl+
   Image Type:   PowerPC Linux Kernel Image (gzip compressed)
   Data Size:    2753746 Bytes =  2.6 MB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 01800000
   Booting using the fdt blob at 0x1800000
   Uncompressing Kernel Image ... OK
   Loading Device Tree to 00ffa000, end 00fff515 ... OK
console output with prebuilt 4.1.17 from jessie_sda1_rootfs_password_4.1.17.tar.gz - success
ENET Speed is 1000 Mbps - FULL duplex connection (EMAC0)
Using ppc_4xx_eth0 device
TFTP from server 192.168.1.144; our IP address is 192.168.1.5
Filename '/linux-4.1.17/uImage'.
Load address: 0x1000000
Loading: *.#################################################################
. #################################################################
. ##############################################################
done
Bytes transferred = 2813816 (2aef78 hex)
Using ppc_4xx_eth0 device
TFTP from server 192.168.1.144; our IP address is 192.168.1.5
Filename '/linux-4.1.17/apollo3g.dtb'.
Load address: 0x1800000
Loading: *.#
done
Bytes transferred = 8533 (2155 hex)
 ## Booting kernel from Legacy Image at 01000000 ...
   Image Name:   Linux-4.1.17-mbl
   Image Type:   PowerPC Linux Kernel Image (gzip compressed)
   Data Size:    2813752 Bytes =  2.7 MB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
 ## Flattened Device Tree blob at 01800000
   Booting using the fdt blob at 0x1800000
   Uncompressing Kernel Image ... OK
   Loading Device Tree to 00ffa000, end 00fff154 ... OK
Using PowerPC 44x Platform machine description
Initializing cgroup subsys cpu
Linux version 4.1.17-mbl (root@mbl-dev) (gcc version 4.9.2 (Debian 4.9.2-10) ) #1 Sat Feb 13 10:46:06 UTC 2016
Zone ranges:
  DMA      [mem 0x0000000000000000-0x000000000fffffff]
  Normal   empty
Movable zone start for each node
Early memory node ranges
  node   0: [mem 0x0000000000000000-0x000000000fffffff]
Initmem setup node 0 [mem 0x0000000000000000-0x000000000fffffff]
MMU: Allocated 1088 bytes of context maps for 255 contexts
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 16352
Kernel command line: root=/dev/nfs rw nfsroot=192.168.1.144:/srv/nfs/jessie_sda1_rootfs_password_4.1.17 ip=dhcp console=ttyS0,115200
PID hash table entries: 1024 (order: -2, 4096 bytes)
Dentry cache hash table entries: 32768 (order: 3, 131072 bytes)
Inode-cache hash table entries: 16384 (order: 2, 65536 bytes)
Sorting __ex_table...
Memory: 255216K/262144K available (4384K kernel code, 192K rwdata, 984K rodata, 224K init, 259K bss, 6928K reserved, 0K cma-reserved)
 ...  continue normal boot... 

Unfortunately I can not build 4.1.17 by myself due to errors related to compiler-gcc7.h. But that’s another story and I think there is no sense to fix this because you have stable 4.9.33…

Build 4.1.17 error
build@build2:~/src/linux-4.1.17$ make -j 6
  CHK     include/config/kernel.release
  CHK     include/generated/uapi/linux/version.h
  CHK     include/generated/utsrelease.h
  CC      scripts/mod/devicetable-offsets.s
  CC      kernel/bounds.s
In file included from include/linux/compiler.h:54:0,
                 from include/uapi/linux/stddef.h:1,
                 from include/linux/stddef.h:4,
                 from ./include/uapi/linux/posix_types.h:4,
                 from include/uapi/linux/types.h:13,
                 from include/linux/types.h:5,
                 from include/linux/mod_devicetable.h:11,
                 from scripts/mod/devicetable-offsets.c:2:
include/linux/compiler-gcc.h:121:1: fatal error: linux/compiler-gcc7.h: No such file or directory
 #include gcc_header(__GNUC__)
 ^~~~
compilation terminated.
scripts/Makefile.build:153: recipe for target 'scripts/mod/devicetable-offsets.s' failed
make[2]: *** [scripts/mod/devicetable-offsets.s] Error 1
scripts/Makefile.build:403: recipe for target 'scripts/mod' failed
make[1]: *** [scripts/mod] Error 2
Makefile:555: recipe for target 'scripts' failed
make: *** [scripts] Error 2
make: *** Waiting for unfinished jobs....
In file included from include/linux/compiler.h:54:0,
                 from include/uapi/linux/stddef.h:1,
                 from include/linux/stddef.h:4,
                 from ./include/uapi/linux/posix_types.h:4,
                 from include/uapi/linux/types.h:13,
                 from include/linux/types.h:5,
                 from include/linux/page-flags.h:8,
                 from kernel/bounds.c:9:
include/linux/compiler-gcc.h:121:1: fatal error: linux/compiler-gcc7.h: No such file or directory
 #include gcc_header(__GNUC__)
 ^~~~
compilation terminated.
Kbuild:43: recipe for target 'kernel/bounds.s' failed
make[1]: *** [kernel/bounds.s] Error 1
Makefile:990: recipe for target 'prepare0' failed
make: *** [prepare0] Error 2

I will try to place image from MBLJessieClean-4.9.33.tgz to HDD instead of TFTP, build *.scr and let yoy know the result.
One more thing. I recompile apollo3g.dtb and successfully started with prebuilt 4.1.17. Also I found that apollo3g.dts the same for 4.1.17 and 4.9.33. So, I think problem not with Device Tree. Something with kernel…

UPDATE. Just try to load system manually step-by-step using uboot commands:

Summary
=> sata init
SATA DWC initialization 1
init: Waiting for device...
sata_dwc: Device found
scan: Waiting for device...1
=> setenv bootargs root=/dev/md0 rw rootfstype=ext3 rootflags=data=ordered
=> tftp ${fdt_addr_r} /linux-4.9.33/apollo3g.dtb
ENET Speed is 1000 Mbps - FULL duplex connection (EMAC0)
Using ppc_4xx_eth0 device
TFTP from server 192.168.1.144; our IP address is 192.168.1.5
Filename '/linux-4.9.33/apollo3g.dtb'.
Load address: 0x1800000
Loading: *.#
done
Bytes transferred = 7509 (1d55 hex)
=> tftp ${kernel_addr_r} /linux-4.9.33/uImage
Using ppc_4xx_eth0 device
TFTP from server 192.168.1.144; our IP address is 192.168.1.5
Filename '/linux-4.9.33/uImage'.
Load address: 0x1000000
Loading: *.#################################################################
. #################################################################
. #######################################################
done
Bytes transferred = 2715437 (296f2d hex)
=> print addtty
addtty=setenv bootargs ${bootargs} console=ttyS0,${baudrate}
=> run addtty
=> print bootargs
bootargs=root=/dev/md0 rw rootfstype=ext3 rootflags=data=ordered console=ttyS0,115200
=> bootm ${kernel_addr_r} - ${fdt_addr_r}
## Booting kernel from Legacy Image at 01000000 ...
   Image Name:   Linux-4.9.33-mbl+
   Image Type:   PowerPC Linux Kernel Image (gzip compressed)
   Data Size:    2715373 Bytes =  2.6 MB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 01800000
   Booting using the fdt blob at 0x1800000
   Uncompressing Kernel Image ... OK
   Loading Device Tree to 00ffb000, end 00fffd54 ... OK

At this point I found no more output to console, but rootfs loaded (from HDD - /dev/md0)!
I can connect using ssh! Great.
I rebuild 4.9.33 with your patches and set CONFIG_SERIAL_8250_CONSOLE=y - now i can see what kernel talks.
Thanks for help.

One more question: there is empty /sys/class/leds/* (kernel 4.9.33). I missing something in configuration?
During boot stock kernel (and precompiled 4.1.17) there is output:
Registered led device: a3g_led
but for 4.9.33 there is no such message.

Also I found kernel 4.1.17 build with CONFIG_SATA_DWC_PMP=y
but for 4.9.33 I have error when try to set CONFIG_SATA_DWC_PMP=y:

[details=Summary] drivers/ata/sata_dwc_pmp.c: In function ‘clear_chan_interrupts’:
drivers/ata/sata_dwc_pmp.c:538:36: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
struct dmaIntrRegs* __iomem reg = &(sata_dma_regs->interrupt_clear);
^
drivers/ata/sata_dwc_pmp.c:539:15: error: dereferencing pointer to incomplete type ‘struct dmaIntrRegs’
out_le32(&reg->tfr.low, dma_chan);
^~
drivers/ata/sata_dwc_pmp.c: In function ‘sata_dwc_qc_issue’:
drivers/ata/sata_dwc_pmp.c:1882:6: warning: unused variable ‘status’ [-Wunused-variable]
u32 status, sactive;
^~~~~~
drivers/ata/sata_dwc_pmp.c: In function ‘sata_dwc_error_handler’:
drivers/ata/sata_dwc_pmp.c:1978:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
struct sata_dwc_device_port *hsdevp = HSDEVP_FROM_AP(ap);
^~~~~~
At top level:
drivers/ata/sata_dwc_pmp.c:506:13: warning: ‘print_dma_configuration’ defined but not used [-Wunused-function]
static void print_dma_configuration (struct ata_port *ap, struct lli *lli, int idx) {
^~~~~~~~~~~~~~~~~~~~~~~
drivers/ata/sata_dwc_pmp.c:491:13: warning: ‘print_dma_registers’ defined but not used [-Wunused-function]
static void print_dma_registers( int dma_chan ) {
^~~~~~~~~~~~~~~~~~~
drivers/ata/sata_dwc_pmp.c:481:13: warning: ‘sata_dwc_tf_dump’ defined but not used [-Wunused-function]
static void sata_dwc_tf_dump(struct device *dwc_dev, struct ata_taskfile *tf) {
^~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
scripts/Makefile.build:293: recipe for target ‘drivers/ata/sata_dwc_pmp.o’ failed[/details]

people thank you for taking your time and answering those questions. i found lots of useful info. i am new here and i registered as i wanted to learn (i’m also a member of weight loss forums, but i hope this is not a problem)… already found lots of useful info but i might be having some questions for you later… would you mind answering them for me? please? i just see that you’re good at finding solutions unlike me…

Still no success of enable led (/sys/class/leds/*) with 4.9.33 :unamused:

Hi Ewald,

It seems there are some patches which are not included within your 4.9.33 patches archive.
I tested your precompiled 4.9.33 and LEDS working.
Then I get /proc/config.gz and rebuild 4.9.33 using it (and applied your patches).
As result, I always have difference with .config:

CONFIG_FREEZER=y
CONFIG_PPC4xx_PCI_EXPRESS=y

CONFIG_PPC4xx_HSTA_MSI is not set

-# CONFIG_PPC4xx_MSI is not set
+CONFIG_PPC4xx_MSI=y
+CONFIG_PPC_MSI_BITMAP=y

CONFIG_PPC_XICS is not set

CONFIG_PPC_ICP_NATIVE is not set

CONFIG_PPC_ICP_HV is not set

@@ -337,6 +338,7 @@
CONFIG_PPC44x_SIMPLE=y
CONFIG_PPC4xx_GPIO=y
CONFIG_PPC4xx_OCM=y
+CONFIG_460EX=y
CONFIG_APM821xx=y

CONFIG_KVM_GUEST is not set

CONFIG_EPAPR_PARAVIRT is not set

@@ -1191,6 +1193,13 @@
CONFIG_IBM_EMAC_POLL_WEIGHT=32
CONFIG_IBM_EMAC_RX_COPY_THRESHOLD=256
CONFIG_IBM_EMAC_RX_SKB_HEADROOM=4
+CONFIG_IBM_EMAC_INTR_COALESCE=y
+CONFIG_IBM_EMAC_TX_COAL_COUNT=32
+CONFIG_IBM_EMAC_TX_COAL_TIMER=50000
+CONFIG_IBM_EMAC_RX_COAL_COUNT=32
+CONFIG_IBM_EMAC_RX_COAL_TIMER=50000
+CONFIG_IBM_EMAC_MASK_CEXT=y
+CONFIG_IBM_EMAC_SYSFS=y

CONFIG_IBM_EMAC_DEBUG is not set

CONFIG_IBM_EMAC_ZMII is not set

CONFIG_IBM_EMAC_RGMII=y

It means I have no options related to CONFIG_PPC4xx_MSI, CONFIG_460EX, IBM_EMAC.
Ewald, could you please to check if there are all patches included in archive? Looks like something missing (also related to LEDS bacause I have no /sys/class/leds after compile).

ls -la /sys/class/leds/
total 0
drwxr-xr-x  2 root root 0 Oct 12 16:20 .
drwxr-xr-x 29 root root 0 Oct 12 16:20 ..

I will try compiling again tonight. I have been busy with work for a few months now, but will try this after work.

Thanks for working on this. My MBL’s didn’t crash or fail, but I knew they had more potential. I installed a 3.5mm Stereo Mini Jack and hooked it up to the serial port in all my MBL’s and my MBWE. When the warranty expires on the MyClouds, I am going to do it to them as well.

I use the 1TB as a Gentoo/FreeBSD Distfiles repository. It works great and I have a cronjob that keeps it updated every week. When I get the MBWE setup with Gentoo (darn oxnas810), I will shift it over.

Any updates to this? I would be pleased to run a 4.14 kernel in the future. :slight_smile:

@Wherfuld,
I hear you: time to close this threat and open a fresh one.
But at this time there are a few open ends which have to fixed first.
Happy to help you going on Kernel 4.x and Debian Jessie.
Ewald

@F0rester,
Sorry for late reply, way too busy…
Great to see your progress…

I will include CONFIG_SERIAL_8250_CONSOLE=y in my configs from now on.
Tx for figuring that out because, as you already may know, I can’t run a console on my MBL…

I recall leds working fine, so in carrying over things from one kernel version to other (even with Github), I must have forgotten to bring something over. Drivers/led/led-apollo3g.c is in the patch (so that part I did not screw up) but it looks I did not include the patch part for the makefile.
For /sys/class/leds to work, LEDS_CLASS must also be enabled (implemented in led-class-3g), which is not the case also.

I’ll make a proper fix and introduce CONFIG_LEDS_APOLLO3G versus the previous approach of just patching the makefile. Give me a day to test it…

I’ll take a look at the CONFIG_SATA_DWC_PMP=y. Can’t figure this out right away since that is how I compile it today…

With respect to the configuration parameters:
CONFIG_PPC4xx_MSI: not actively used at this point in time. I tried to leverage MSI (Message Signaled Interrupt) to accelerate a number of functions but it’s not stable yet. But it’s complex as it involves moving from shared interrupts to dedicated interrupts which allows to pass data to the interrupt handler. For example, on the network it would allow to support 4 concurrent network streams to reach 125MB/s (aggregated).
CONFIG_460EX: being used for cryptographic accelerator and a few tunings (e.g. enabling high bandwidth access on memory queues), I have not posted all cryptographic patches yet due to lack of time to write test code.
IBM_EMAC_xxx: these are related to the re-write of the IBM EMAC network driver that I am working on (e.g. implementation of Interrupt Coalescence, sysfs) etc. The challenge here is that with every kernel version, there is a lot of integration to be done and I yet have to find a way to even get it to work in 4.10 or later. Newer kernels also favor 64-bit PPC optimized constructs, so even when we get it to work in a stable fashion, we are losing performance on the way. For example, on 4.9.52 and 4.10.20, I am seeing 20% performance decrease.
In the meantime I understand how to fix it, but at the expense of rolling back parts of 4.10 to 4.9.
For example: network driver rewrite to achieve 125MB/s read/write over NAS:

  • on 4.9.40: 12 patches to roll back core kernel code to mix of 3.x/4.1 implementation
  • on 4.10.20: ~30 patches to roll back core kernel code to mix of 3.x/4.1 implementation

As I mentioned before, I am only publishing a compiled kernel with modified network drivers as they will only work on one specific version anyhow.

Ewald

@Simba7,
I think we are having a stable and highly performing 4.9.x now, which is a fairly new kernel (4.9.40 is July 2017) and most importantly: an LTS release.
The challenge with newer kernels is that more and more code is being optimized for the capabilities of newer SoC’s and architectures such as PPC64. So while it might be possible to get 4.14 up and running, it might come at a rather severe performance penalty (20%+). That again can be fixed by rolling back parts of the kernel code, but its time consuming and it defeats the purpose of moving to newer kernel. So newer is not always better, specifically for older HW. Recently I fixed a few kernel bugs on Android for Oreo: they are still on 3.x! Next LTS is 4.14. Will see…
Ewald

OK here we go:

  • pre-compiled kernel 4.9.44 with netconsole, usb, led support, 8250 console and improved networking stack: link

    • /sys/class/leds is in the kernel now via led-class-3g and leds_apollo3g (dmesg: Registered led device: a3g_led), but I don’t think it’s working perfectly (e.g. cat y >/sys/devices/virtual/leds/a3g_led/color yields red)
      UPDATE: this could be due to my early MBL version (proto?). I noticed that the green led is very dim. So maybe a HW issue and not a kernel one.
    • passed 24 hours torture test
    • Samba read @MTU 4080: 114MB/s (slightly less than 4.9.40)
    • Samba write @MTU 4080: 75MB/s (slightly less than 4.9.40)
    • sequential disk read/write: 175MB/s/105MB/s (equal to 4.9.40)
  • updated patches and kernel config file: link. These can be applied from 4.9.31 to 4.9.53, validated for quality & good performance until 4.9.44 (whereas 4.9.53 failed)

I took a fresh copy of 4.9.44, applied the patches and compiled on the MBL itself.
With respect to sata_dwc_pmp.c compile errors: don;t use it for now. I merged both pmp and ncq code into sata_dwc_ncq.c as it was too difficult to maintain 2 versions and synchronize every change.

If you want to test with NCQ, uncomment the following one (or two for debugging) lines in drivers/ata/sata_dwc_nqc.c:
//#define SATA_DWC_NCQ
//#define CONFIG_SATA_DWC_VDEBUG
Please note that under 4.9.x NCQ actually degrades disk performance slightly, whereas in 2.6.32.70 or even 4.1.x it increases the performance (as it should be). I have yet to find out why…

How does one apply the kernel file (kernel_4.9.44.tgz) to the disk?
(I used your MBLJessieClean-4.9.33.tgz image for my install)
Thanks

@thegooddoctor,
Assuming you have copied kernel_4.9.44.tgz to /tmp, execute following commands as root:

cd /
tar xvzf /tmp/kernel_4.9.44.tgz (unpack the tar archive)
cp /boot/uImage /boot/uImage_4.9.33.save (save the 4.9.33 kernel just in case…)
cp /boot/uImage_4.9.44 /boot/uImage (put the 4.9.44 kernel in place)
systemctl reboot (reboot)

If all is well, you should will be running 4.9.44 afterwards.
To quickly validate the performance, run:
time dd if=/dev/zero of=/shares/tst.dd bs=1M count=1K (/shares or any other location on the data volume → this tests large sequential write speed)
time dd if=/shares/tst.dd of=/dev/null bs=1M count=1K (–> test sequential disk read speed)

On your PC, copy the tst.dd file which is 1GB in size to a PC drive of choice (SSD is best of course) and note down Samba read speed.
Then write back tst.dd to the NAS to validate write speed.

Play with different MTU sizes, since your network switch may not support Jumbo packets (mine does).
On the MBL:
ifconfig eth0 mtu (4080 will give the best result, due the way the MAL works)

On windows I am seeing no difference between MTU 4088 or 9000 on my Intel I218_LM. Don’t turn on adaptive Inter-Frame Spacing, the MBLdriver does not support it.

Once you found the best MTU, you can add it to the startup files on the NAS (/etc/network/ifup.d)

Let me know how well it works :wink:
Ewald