Kernel – 4.10 Released – OK with Patched NVIDIA and VMware..

Kernel 4.10 is out, and brief details of changes from -rc8 are here:  http://lkml.iu.edu/hypermail/linux/kernel/1702.2/02069.html

I have installed this, and the patched versions of VMware 12.5.2 and NVIDIA 378.13 compile and load/run OK.   See previous articles for patch details..    It is worth repeating here, that the NVIDIA patches do not currently include hotplug support..

$ uname -a
Linux rglinux-i7 4.10.0 #1 SMP Sun Feb 19 20:45:44 PST 2017 x86_64 x86_64 x86_64 GNU/Linux

Robert Gadsdon.   February 19, 2017.

NVIDIA – New Drivers, Still Broken with 4.10 – And a Patch for 378.13..

NVIDIA have released new drivers 375.39 (‘long term’) and 378.13 (‘short term’) and details are here:  http://www.nvidia.com/download/driverResults.aspx/114708/en-us and http://www.nvidia.com/download/driverResults.aspx/115031/en-us.

Both still fail to compile with Kernel 4.10 (tested with 4.10-rc8) and I tried the previous 378.09 patch against 379.13, but it failed to apply cleanly, as more code has changed..

$ cat nv-37809-410-patch.patch |patch -p0
patching file a/kernel/common/inc/nv-linux.h
patching file a/kernel/nvidia/nv-p2p.c
patching file a/kernel/nvidia-drm/nvidia-drm-fence.c
Hunk #7 succeeded at 136 (offset 4 lines).
Hunk #8 succeeded at 146 (offset 4 lines).
Hunk #9 succeeded at 155 (offset 4 lines).
Hunk #10 succeeded at 170 (offset 4 lines).
Hunk #11 succeeded at 285 (offset 4 lines).
Hunk #12 succeeded at 301 (offset 4 lines).
Hunk #13 succeeded at 320 (offset 4 lines).
Hunk #14 succeeded at 513 (offset 4 lines).
Hunk #15 FAILED at 666.
1 out of 15 hunks FAILED -- saving rejects to file a/kernel/nvidia-drm/nvidia-drm-fence.c.rej
patching file a/kernel/nvidia-drm/nvidia-drm-gem.c
Hunk #1 FAILED at 510.
1 out of 1 hunk FAILED -- saving rejects to file a/kernel/nvidia-drm/nvidia-drm-gem.c.rej
patching file a/kernel/nvidia-drm/nvidia-drm-gem.h
patching file a/kernel/nvidia-drm/nvidia-drm-modeset.c
patching file a/kernel/nvidia-drm/nvidia-drm-priv.h
patching file a/kernel/nvidia-uvm/uvm8_test.c
...................

The code changes appear to be relatively trivial, and in one case include an added ‘comment’, and I am trying to apply the necessary changes manually, and will then test the results..

Soon after I posted the original article, Tomas Pruzina posted an updated patch, for 378.13, and details are here:  https://devtalk.nvidia.com/default/topic/994087/linux/387-13-patch-for-4-10-0-rc8-linus-master-/

I have applied this to 378.13 on the test system, and it now compiles OK, on Kernel 4.10-rc8.

Robert Gadsdon.    February 14, 2017.

VMware – Updated vmnet Patch for Kernel 4.9/4.10..

Thanks to Mikkel Kroman, there is a more complete patch for VMware 12.5.2  vmnet on Kernel 4.9.x and 4.10-rc’s:

The change is to the get_user_pages parameter list, to now include the FOLL_WRITE parameter, and is as follows:

In vmnet-only/userif.c, around line 113, change

#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)
    retval = get_user_pages(addr, 1, 1, 0, &page, NULL);
#else
    retval = get_user_pages(current, current->mm, addr,
                1, 1, 0, &page, NULL);
#endif

to

#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
     retval = get_user_pages(addr, 1, FOLL_WRITE, &page, NULL);
#else
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)
     retval = get_user_pages(addr, 1, 1, 0, &page, NULL);
#else
     retval = get_user_pages(current, current->mm, addr,
                 1, 1, 0, &page, NULL);
#endif
#endif

VMware had been working OK on my system with the original version of the patch, and I have applied this new version of the patch, and it all works correctly..

Robert Gadsdon.   January 31, 2017.

 

 

NVIDIA – Kernel 4.10 Patch for 378.09..

Thanks – again – to Tomas Pruzina, there is a Kernel 4.10 patch for new beta driver 378.09, and details are here: https://devtalk.nvidia.com/default/topic/988958/linux/-patch-378-09-4-10-0-rc4-patches/

I have applied this to 378.09 on Kernel 4.10-rc4, and can confirm that it now compiles OK..

.............................
/home/rgadsdon/kernel/NVIDIA-Linux-x86_64-378.09-patched/kernel/nvidia/svnp01_linux.o
ld -r -o /home/rgadsdon/kernel/NVIDIA-Linux-x86_64-378.09-patched/kernel/nvidia-modeset/nv-modeset-interface.o /home/rgadsdon/kernel/NVIDIA-Linux-x86_64-378.09-patched/kernel/nvidia-modeset/nvidia-modeset-linux.o
 Building modules, stage 2.
 MODPOST 4 modules
 CC /home/rgadsdon/kernel/NVIDIA-Linux-x86_64-378.09-patched/kernel/nvidia-drm.mod.o
 LD [M] /home/rgadsdon/kernel/NVIDIA-Linux-x86_64-378.09-patched/kernel/nvidia-drm.ko
 CC /home/rgadsdon/kernel/NVIDIA-Linux-x86_64-378.09-patched/kernel/nvidia-modeset.mod.o
 LD [M] /home/rgadsdon/kernel/NVIDIA-Linux-x86_64-378.09-patched/kernel/nvidia-modeset.ko
 CC /home/rgadsdon/kernel/NVIDIA-Linux-x86_64-378.09-patched/kernel/nvidia-uvm.mod.o
 LD [M] /home/rgadsdon/kernel/NVIDIA-Linux-x86_64-378.09-patched/kernel/nvidia-uvm.ko
 CC /home/rgadsdon/kernel/NVIDIA-Linux-x86_64-378.09-patched/kernel/nvidia.mod.o
 LD [M] /home/rgadsdon/kernel/NVIDIA-Linux-x86_64-378.09-patched/kernel/nvidia.ko
make[2]: Leaving directory '/usr/src/linux-4.10-rc4'
make[1]: Leaving directory '/usr/src/linux-4.10-rc4'

As with the 375.26 patch, the hotplug functionality is simply ‘bypassed’ in the patch..

Robert Gadsdon.   January 19, 2017.

NVIDIA – Beta Driver 378.09 – Still Broken with Kernel 4.10

New beta driver 378.09 has been released, and details are here:  http://www.nvidia.com/download/driverResults.aspx/114232/en-us

The driver compiles OK with Kernel 4.9.4, but fails to compile with 4.10-rc4, with different errors from 375.26, as some of the code base has changed..

......................
CC [M] /home/rgadsdon/kernel/NVIDIA-Linux-x86_64-378.09/kernel/nvidia/nv-p2p.o
 CC [M] /home/rgadsdon/kernel/NVIDIA-Linux-x86_64-378.09/kernel/nvidia/nv-pat.o
/home/rgadsdon/kernel/NVIDIA-Linux-x86_64-378.09/kernel/nvidia/nv-pat.c: In function ‘nvidia_cpu_callback’:
/home/rgadsdon/kernel/NVIDIA-Linux-x86_64-378.09/kernel/nvidia/nv-pat.c:213:14: error: ‘CPU_DOWN_FAILED’ undeclared (first use in this function)
 case CPU_DOWN_FAILED:
 ^~~~~~~~~~~~~~~
/home/rgadsdon/kernel/NVIDIA-Linux-x86_64-378.09/kernel/nvidia/nv-pat.c:213:14: note: each undeclared identifier is reported only once for each function it appears in
/home/rgadsdon/kernel/NVIDIA-Linux-x86_64-378.09/kernel/nvidia/nv-pat.c:220:14: error: ‘CPU_DOWN_PREPARE’ undeclared (first use in this function)
 case CPU_DOWN_PREPARE:
 ^~~~~~~~~~~~~~~~
In file included from /home/rgadsdon/kernel/NVIDIA-Linux-x86_64-378.09/kernel/nvidia/nv-pat.c:15:0:
/home/rgadsdon/kernel/NVIDIA-Linux-x86_64-378.09/kernel/nvidia/nv-pat.c: In function ‘nv_init_pat_support’:
/home/rgadsdon/kernel/NVIDIA-Linux-x86_64-378.09/kernel/common/inc/nv-linux.h:391:34: error: implicit declaration of function ‘register_cpu_notifier’ [-Werror=implicit-function-declaration]
 #define register_hotcpu_notifier register_cpu_notifier
 ^
/home/rgadsdon/kernel/NVIDIA-Linux-x86_64-378.09/kernel/nvidia/nv-pat.c:258:17: note: in expansion of macro ‘register_hotcpu_notifier’
 if (register_hotcpu_notifier(&nv_hotcpu_nfb) != 0)
 ^~~~~~~~~~~~~~~~~~~~~~~~
/home/rgadsdon/kernel/NVIDIA-Linux-x86_64-378.09/kernel/nvidia/nv-pat.c: In function ‘nv_teardown_pat_support’:
/home/rgadsdon/kernel/NVIDIA-Linux-x86_64-378.09/kernel/common/inc/nv-linux.h:388:36: error: implicit declaration of function ‘unregister_cpu_notifier’ [-Werror=implicit-function-declaration]
 #define unregister_hotcpu_notifier unregister_cpu_notifier
 ^
/home/rgadsdon/kernel/NVIDIA-Linux-x86_64-378.09/kernel/nvidia/nv-pat.c:283:9: note: in expansion of macro ‘unregister_hotcpu_notifier’
 unregister_hotcpu_notifier(&nv_hotcpu_nfb);
 ^~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
/usr/src/linux-4.10-rc4/scripts/Makefile.build:293: recipe for target '/home/rgadsdon/kernel/NVIDIA-Linux-x86_64-378.09/kernel/nvidia/nv-pat.o' failed
make[3]: *** [/home/rgadsdon/kernel/NVIDIA-Linux-x86_64-378.09/kernel/nvidia/nv-pat.o] Error 1
/usr/src/linux-4.10-rc4/Makefile:1490: recipe for target '_module_/home/rgadsdon/kernel/NVIDIA-Linux-x86_64-378.09/kernel' failed
make[2]: *** [_module_/home/rgadsdon/kernel/NVIDIA-Linux-x86_64-378.09/kernel] Error 2
make[2]: Leaving directory '/usr/src/linux-4.10-rc4'
Makefile:150: recipe for target 'sub-make' failed
make[1]: *** [sub-make] Error 2
make[1]: Leaving directory '/usr/src/linux-4.10-rc4'
Makefile:81: recipe for target 'modules' failed
make: *** [modules] Error 2

And.. as expected, the patch for 375.26 does not work, as some of the code, headers, etc. are different, or files no longer exist:

.................
patching file a/kernel/common/inc/nv-mm.h
Hunk #1 FAILED at 83.
1 out of 1 hunk FAILED -- saving rejects to file a/kernel/common/inc/nv-mm.h.rej
..................
patching file a/kernel/nvidia-drm/nvidia-drm-modeset.c
Hunk #1 succeeded at 78 (offset 9 lines).
Hunk #2 FAILED at 644.
Hunk #3 FAILED at 982.
2 out of 3 hunks FAILED -- saving rejects to file a/kernel/nvidia-drm/nvidia-drm-modeset.c.rej
..........................
patching file a/kernel/nvidia-uvm/uvm8.c
Hunk #1 FAILED at 101.
Hunk #2 FAILED at 315.
2 out of 2 hunks FAILED -- saving rejects to file a/kernel/nvidia-uvm/uvm8.c.rej
patching file a/kernel/nvidia-uvm/uvm8_test.c
can't find file to patch at input line 342
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff -ur a/kernel/nvidia-uvm/uvm_lite.c b/kernel/nvidia-uvm/uvm_lite.c
...........................

So, for the time being, stay with 375.26 (patched) on 4.10-rc…

Robert Gadsdon.    January 18, 2017.

ARM64 – Odroid C2 – Patches for USB..

Thanks to Heiner Kallweit for info on two USB patches for the Odroid C2, and thanks to John Youn for the patches themselves..  They can be found at http://www.spinics.net/lists/linux-usb/msg151687.html and http://www.spinics.net/lists/linux-usb/msg151688.html .

I have applied these to Kernel 4.10-rc4 (including the Ethernet TX patch) and now USB is working, and detects/connects devices – sort of..

Plug in USB device, does not show up (same behaviour as before patch):

]# lsusb
Bus 001 Device 002: ID 05e3:0610 Genesys Logic, Inc. 4-port hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

But, do (as root)

# lsusb -v

then

# lsusb
Bus 001 Device 006: ID 0d8c:000c C-Media Electronics, Inc. Audio Adapter
Bus 001 Device 002: ID 05e3:0610 Genesys Logic, Inc. 4-port hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Remove:

# usb 1-1.1: USB disconnect, device number 6

More than one device:

# lsusb
Bus 001 Device 008: ID 0d8c:000c C-Media Electronics, Inc. Audio Adapter
Bus 001 Device 007: ID 248a:8566 Maxxter
Bus 001 Device 002: ID 05e3:0610 Genesys Logic, Inc. 4-port hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

USB ‘disk’:

usb 1-1.3: new high-speed USB device number 6 using dwc2
usb 1-1.3: New USB device found, idVendor=1b1c, idProduct=1a06
usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-1.3: Product: Slider 3.0
usb 1-1.3: Manufacturer: Corsair
usb 1-1.3: SerialNumber: 2310309051250017
usb-storage 1-1.3:1.0: USB Mass Storage device detected
scsi host0: usb-storage 1-1.3:1.0
scsi 0:0:0:0: Direct-Access Corsair Slider 3.0 1.00 PQ: 0 ANSI: 5
sd 0:0:0:0: Attached scsi generic sg0 type 0
sd 0:0:0:0: [sda] 62746624 512-byte logical blocks: (32.1 GB/29.9 GiB)
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Write cache: disabled, read cache: disabled, doesn't support DPO or FUA
 sda: sda1
sd 0:0:0:0: [sda] Attached SCSI removable disk

So..  There is more testing to be done, but at least some more core functionality is available..    I also need to check the kernel config, to see if there is another option to be included, to make ‘detection’ work correctly..

As usual, it remains to be seen whether these particular USB patches make it into the mainline kernel tree..

Robert Gadsdon.   January 18, 2017.

ARM64 – Kernel 4.10-rc4 on Odroid C2 – Ethernet Still Needs DTS Patch..

Just updated the Odroid C2 to Kernel 4.10-rc4, but the Ethernet hang problem still persists..   Applied the dts Ethernet TX patch (see http://rglinuxtech.com/?p=1872 ) , and it works OK now..

There seems to be a bit of a backlog of Meson/GXBB patches, and I read that the Ethernet TX fix was supposed to be merged with -rc4, but there were objections to other patches in the bundle, and it has been pushed back – yet again!

It seems we may possibly have to wait for 4.11, to get full functionality on the C2?

Robert Gadsdon.   January 16, 2017.

ARM64 – Odroid C2 – Kernel 4.10-rc Config Example..

As Odroid C2 support by the ‘mainline’ kernel is – hopefully – nearing completion, I have put a sample of my Kernel config at http://pastebin.com/XWfMEWHx .

The C2 is used for ‘headless’ operation, at present, and USB still does not work..    The kernel is 4.10-rc3, with the ‘Ethernet-TX’ dts patch applied.. (see http://rglinuxtech.com/?p=1872 ).

Robert Gadsdon.   January 14, 2017.

ARM64 – Odroid C2 – Working U-Boot..

Thanks to Heiner Kallweit, there is now a functional version of U-Boot for the Odroid C2, at https://github.com/hkallweit/u-boot ..

I have installed it on my C2 (eMMC) and it works fine..    Nice to have a functioning > saveenv command, at last..

U-Boot 2017.01-rc3 (Jan 14 2017 - 02:22:15 -0800) odroid-c2

DRAM: 2 GiB
MMC: meson_mmc: 0, meson_mmc: 1
In: serial@4c0
Out: serial@4c0
Err: serial@4c0
Net: eth0: ethernet@c9410000
Hit any key to stop autoboot: 0
=> setenv bootdelay 10
=> saveenv
Saving Environment to MMC...
Writing to MMC(0)... done

The u-boot parameters I use are:

setenv loadaddr "0x20000000"
setenv dtb_loadaddr "0x01000000"
setenv initrd_high "0xffffffff"
setenv fdt_high "0xffffffff"
setenv kernel_filename boot/uboot/Image
setenv fdt_filename boot/uboot/meson-gxbb-odroidc2.dtb
setenv bootargs "root=/dev/mmcblk0p1 rootwait rw"
setenv bootcmd "ext4load mmc 0:1 '${loadaddr}' '${kernel_filename}'; ext4load mmc 0:1 '${dtb_loadaddr}' '${fdt_filename}'; booti '${loadaddr}' - '${dtb_loadaddr}'"

Robert Gadsdon.   January 14,2017.

Kernel – 4.10-rc3 Released..

Kernel 4.10-rc3 is out, and brief details of changes since -rc2 are here:  http://lkml.iu.edu/hypermail/linux/kernel/1701.1/00183.html

Tested patched VMware (12.5.2) and patched NVIDIA (375.26) and both compile OK..   Same results as with -rc2..

Robert Gadsdon.    January 8, 2017.